mirror of https://github.com/python/cpython
Don't allow '==' at top level yet, to catch conversion errors.
This commit is contained in:
parent
6a468bf71c
commit
09cea47433
|
@ -1,8 +1,7 @@
|
||||||
# Grammar for Python, version 10
|
# Grammar for Python, version 10
|
||||||
|
|
||||||
# Changes since version 9:
|
# Changes since version 9:
|
||||||
# Equality is now only tested with '=='; consequently
|
# Equality is now only tested with '=='
|
||||||
# Exprlist replaced by testlist everywhere except after 'for'
|
|
||||||
|
|
||||||
# Changes since version 8:
|
# Changes since version 8:
|
||||||
# Trailing commas in formal parameter lists are allowed
|
# Trailing commas in formal parameter lists are allowed
|
||||||
|
@ -64,7 +63,7 @@ fpdef: NAME | '(' fplist ')'
|
||||||
stmt: simple_stmt | compound_stmt
|
stmt: simple_stmt | compound_stmt
|
||||||
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
|
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
|
||||||
small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt
|
small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt
|
||||||
expr_stmt: (testlist '=')* testlist
|
expr_stmt: (exprlist '=')* exprlist
|
||||||
# For assignments, additional restrictions enforced by the interpreter
|
# For assignments, additional restrictions enforced by the interpreter
|
||||||
print_stmt: 'print' (test ',')* [test]
|
print_stmt: 'print' (test ',')* [test]
|
||||||
del_stmt: 'del' exprlist
|
del_stmt: 'del' exprlist
|
||||||
|
|
Loading…
Reference in New Issue