mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-15 08:57:11 +08:00
Don't use a function that doesn't work
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
from parso.python import tree
|
from parso.python import tree
|
||||||
from parso.python.token import PythonTokenTypes
|
from parso.python.token import PythonTokenTypes
|
||||||
from parso.parser import BaseParser
|
from parso.parser import BaseParser
|
||||||
from parso.pgen2.parse import token_to_ilabel
|
|
||||||
|
|
||||||
|
|
||||||
NAME = PythonTokenTypes.NAME
|
NAME = PythonTokenTypes.NAME
|
||||||
@@ -163,9 +162,8 @@ class Parser(BaseParser):
|
|||||||
# end of a file, we have to recover even if the user doesn't want
|
# end of a file, we have to recover even if the user doesn't want
|
||||||
# error recovery.
|
# error recovery.
|
||||||
if stack[-1].dfa.from_rule == 'simple_stmt':
|
if stack[-1].dfa.from_rule == 'simple_stmt':
|
||||||
ilabel = token_to_ilabel(pgen_grammar, PythonTokenTypes.NEWLINE, value)
|
|
||||||
try:
|
try:
|
||||||
plan = stack[-1].dfa.ilabel_to_plan[ilabel]
|
plan = stack[-1].dfa.ilabel_to_plan[PythonTokenTypes.NEWLINE]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user