Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Grammar/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,12 @@ invalid_arguments:
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, _PyPegen_get_last_comprehension_item(PyPegen_last_item(b, comprehension_ty)), "Generator expression must be parenthesized") }
| a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }
invalid_kwarg:
| a[Token*]=('True'|'False'|'None') b='=' {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to %s", PyBytes_AS_STRING(a->bytes)) }
| a='True' b='=' {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to True") }
| a='False' b='=' {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to False") }
| a='None' b='=' {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "cannot assign to None") }
| a=NAME b='=' expression for_if_clauses {
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?")}
| !(NAME '=') a=expression b='=' {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce temporary allocations while parsing Python source.
Loading
Loading