New submission from Isaac Elliott <isaace71...@gmail.com>:

echo 'print("a");print("b")' > test.py

This program is grammatically incorrect according to the specification 
(https://docs.python.org/3.8/reference/grammar.html). But Python 3 runs it 
without issue.


It's this production here

simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE

which says 'simple_stmt's must be terminated by a newline. However, the program 
I wrote doesn't contain any newlines.

I think the grammar spec is missing some information, but I'm not quite sure 
what. Does anyone have an idea?

----------
components: Interpreter Core
messages: 318617
nosy: Isaac Elliott
priority: normal
severity: normal
status: open
title: Grammar Incongruence
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33766>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to