Fix invalid test issues.

This commit is contained in:
Dave Halter
2014-11-29 01:35:26 +01:00
parent 2b912cb75a
commit 3fb1934462
2 changed files with 3 additions and 4 deletions

View File

@@ -214,12 +214,11 @@ class Parser(object):
symbol = grammar.number2symbol[_type] symbol = grammar.number2symbol[_type]
if symbol in ('file_input', 'suite'): if symbol in ('file_input', 'suite'):
break break
# No success finding a transition
#print('err', tokenize.tok_name[typ], repr(value), start_pos, len(stack), index) #print('err', tokenize.tok_name[typ], repr(value), start_pos, len(stack), index)
self._stack_removal(grammar, stack, index + 1, value, start_pos) self._stack_removal(grammar, stack, index + 1, value, start_pos)
# Those can always be new statements.
if value in ('import', 'from', 'class', 'def', 'try', 'while', 'return'): if value in ('import', 'from', 'class', 'def', 'try', 'while', 'return'):
pass # Those can always be new statements.
add_token_callback(typ, value, prefix, start_pos)
elif typ == tokenize.DEDENT: elif typ == tokenize.DEDENT:
if symbol == 'suite': if symbol == 'suite':
if len(nodes) > 2: if len(nodes) > 2:

View File

@@ -147,7 +147,7 @@ a[0]
a = [a for a in [1,2] a = [a for a in [1,2]
def break(): pass def break(): pass
#? int() #?
a[0] a[0]
#? [] #? []