Skip to content

Commit 39c33df

Browse files
pablogsalDinoV
authored andcommitted
Simplify grammar
1 parent f67310c commit 39c33df

File tree

2 files changed

+228
-265
lines changed

2 files changed

+228
-265
lines changed

Grammar/python.gram

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ import_stmt[stmt_ty](memo):
225225
# -----------------
226226

227227
import_name[stmt_ty]:
228-
| 'import' a=dotted_as_names { _PyAST_Import(a, 0, EXTRA) }
229-
| "lazy" 'import' a=dotted_as_names { _PyAST_Import(a, 1, EXTRA) }
228+
| lazy="lazy"? 'import' a=dotted_as_names { _PyAST_Import(a, lazy ? 1 : 0, EXTRA) }
230229

231230
# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS
232231
import_from[stmt_ty]:

0 commit comments

Comments
 (0)