Handle PyPy JUMP_IF_NOT_DEBUG

Update README.rst to note PyPY and reorganize a little
This commit is contained in:
rocky
2016-07-25 09:06:13 -04:00
parent 285444e19a
commit 476eb50868
9 changed files with 50 additions and 20 deletions

View File

@@ -275,6 +275,14 @@ class Python2Parser(PythonParser):
self.add_unique_rule("call_function ::= expr CALL_METHOD",
op, v, customize)
continue
elif k == 'JUMP_IF_NOT_DEBUG':
self.add_unique_rule(
"stmt ::= assert_pypy", op, v, customize)
self.add_unique_rule(
"assert_pypy ::= JUMP_IF_NOT_DEBUG assert_expr jmp_true "
"LOAD_ASSERT RAISE_VARARGS_1 COME_FROM",
op, v, customize)
continue
elif op == 'BUILD_MAP':
kvlist_n = "kvlist_%s" % v
rule = kvlist_n + ' ::= ' + ' kv3' * v