Misc fixups/cleanups

* parse3.py Had botched if-for-else test by grammar addition
* semantics/*.py: Show errorstack in failed parse when -g (requires sparck 1.2.0)
* some optimization in scanner3
This commit is contained in:
rocky
2016-05-12 09:27:25 -04:00
parent 8d51456f59
commit 6f6f1db576
6 changed files with 41 additions and 9 deletions

View File

@@ -76,6 +76,7 @@ class Python3Parser(PythonParser):
_stmts ::= _stmts stmt
_stmts ::= stmt
# statements with continue
c_stmts ::= _stmts
c_stmts ::= _stmts lastc_stmt
c_stmts ::= lastc_stmt
@@ -144,7 +145,7 @@ class Python3Parser(PythonParser):
return_if_stmts ::= return_if_stmt
return_if_stmts ::= _stmts return_if_stmt
return_if_stmt ::= ret_expr RETURN_END_IF
return_if_stmt ::= ret_expr RETURN_VALUE
stmt ::= break_stmt
break_stmt ::= BREAK_LOOP
@@ -241,7 +242,7 @@ class Python3Parser(PythonParser):
testtrue ::= expr jmp_true
_ifstmts_jump ::= return_if_stmts
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD _come_from _come_from
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM
_ifstmts_jump ::= c_stmts_opt
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE