NT break_stmt, continue_stmt -> break, continue...

to match AST
This commit is contained in:
rocky
2017-12-06 01:48:44 -05:00
parent f8d6998b22
commit 7daf95fcb4
6 changed files with 9 additions and 9 deletions

View File

@@ -62,8 +62,8 @@ class Python2Parser(PythonParser):
return_stmt_lambda ::= ret_expr RETURN_VALUE_LAMBDA
stmt ::= break_stmt
break_stmt ::= BREAK_LOOP
stmt ::= break
break ::= BREAK_LOOP
stmt ::= continue
continue ::= CONTINUE

View File

@@ -107,7 +107,7 @@ class Python26Parser(Python2Parser):
assert ::= assert_expr jmp_true LOAD_ASSERT RAISE_VARARGS_1 come_froms_pop
assert2 ::= assert_expr jmp_true LOAD_ASSERT expr RAISE_VARARGS_2 come_froms_pop
break_stmt ::= BREAK_LOOP JUMP_BACK
break ::= BREAK_LOOP JUMP_BACK
# Semantic actions want else_suitel to be at index 3
ifelsestmtl ::= testexpr c_stmts_opt cf_jb_cf_pop else_suitel

View File

@@ -88,8 +88,8 @@ class Python3Parser(PythonParser):
return_if_stmts ::= _stmts return_if_stmt
return_if_stmt ::= ret_expr RETURN_END_IF
stmt ::= break_stmt
break_stmt ::= BREAK_LOOP
stmt ::= break
break ::= BREAK_LOOP
stmt ::= continue
continue ::= CONTINUE

View File

@@ -20,7 +20,7 @@ def checker(ast, in_loop, errors):
errors.append(error_text)
for node in ast:
if not in_loop and node.kind in ('continue', 'break_stmt'):
if not in_loop and node.kind in ('continue', 'break'):
text = str(node)
error_text = '\n# not in loop:\n#\t' + '\n# '.join(text.split("\n"))
errors.append(error_text)

View File

@@ -224,7 +224,7 @@ TABLE_DIRECT = {
'print_to_items': ( '%C', (0, 2, ', ') ),
'call_stmt': ( '%|%p\n', (0, 200)),
'break_stmt': ( '%|break\n', ),
'break': ( '%|break\n', ),
'continue': ( '%|continue\n', ),
'raise_stmt0': ( '%|raise\n', ),

View File

@@ -28,7 +28,7 @@ node 2 range information, it in %c, is copied to nodes 0 and 1.
%r associates recursively location information for the string that follows
For example in:
'break_stmt': ( '%|%rbreak\n', ),
'break': ( '%|%rbreak\n', ),
The node will be associated with the text break, excluding the trailing newline.
@@ -84,7 +84,7 @@ ExtractInfo = namedtuple("ExtractInfo",
"lineNo lineStartOffset markerLine selectedLine selectedText nonterminal")
TABLE_DIRECT_FRAGMENT = {
'break_stmt': ( '%|%rbreak\n', ),
'break': ( '%|%rbreak\n', ),
'continue ': ( '%|%rcontinue\n', ),
'passstmt': ( '%|%rpass\n', ),
'raise_stmt0': ( '%|%rraise\n', ),