Skip to content

Commit 52f190f

Browse files
committed
Fix ambiguity in FROM x IMPORT y
1 parent 8dc6b03 commit 52f190f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parser/grammar.y

+4-4
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ yield_stmt: yield_expr
192192
raise_stmt: RAISE | RAISE test | RAISE test FROM test
193193
import_stmt: import_name | import_from
194194
import_name: IMPORT dotted_as_names
195-
// note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS
196-
import_dots: | import_dots '.' | import_dots ELIPSIS
197-
import_dots_plus: '.' | ELIPSIS | import_dots
198-
from_arg: import_dots dotted_name | import_dots_plus
195+
// note below: the '.' | ELIPSIS is necessary because '...' is tokenized as ELIPSIS
196+
dot: '.' | ELIPSIS
197+
dots: dot | dots dot
198+
from_arg: dotted_name | dots dotted_name | dots
199199
import_from_arg: '*' | '(' import_as_names ')' | import_as_names
200200
import_from: FROM from_arg IMPORT import_from_arg
201201
import_as_name: NAME | NAME AS NAME

0 commit comments

Comments
 (0)