Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b6098d

Browse files
committed
Add lookahead to grammar
1 parent d5b86c5 commit 3b6098d

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

Grammar/python.gram

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ simple_stmts[asdl_stmt_seq*]:
112112
# will throw a SyntaxError.
113113
simple_stmt[stmt_ty] (memo):
114114
| assignment
115-
| type_alias
115+
| &"type" type_alias
116116
| e=star_expressions { _PyAST_Expr(e, EXTRA) }
117117
| &'return' return_stmt
118118
| &('import' | 'from') import_stmt

Parser/parser.c

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)