Pypy 3.5 tolerance

This commit is contained in:
rocky
2019-11-09 21:56:36 -05:00
parent 1c0c54991e
commit 373916f57c
5 changed files with 8 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -144,9 +144,15 @@ class Python35Parser(Python34Parser):
super(Python35Parser, self).customize_grammar_rules(tokens, customize) super(Python35Parser, self).customize_grammar_rules(tokens, customize)
for i, token in enumerate(tokens): for i, token in enumerate(tokens):
opname = token.kind opname = token.kind
if opname == 'LOAD_ASSERT':
if 'PyPy' in customize:
rules_str = """
stmt ::= JUMP_IF_NOT_DEBUG stmts COME_FROM
"""
self.add_unique_doc_rules(rules_str, customize)
# FIXME: I suspect this is wrong for 3.6 and 3.5, but # FIXME: I suspect this is wrong for 3.6 and 3.5, but
# I haven't verified what the 3.7ish fix is # I haven't verified what the 3.7ish fix is
if opname == 'BUILD_MAP_UNPACK_WITH_CALL': elif opname == 'BUILD_MAP_UNPACK_WITH_CALL':
if self.version < 3.7: if self.version < 3.7:
self.addRule("expr ::= unmapexpr", nop_func) self.addRule("expr ::= unmapexpr", nop_func)
nargs = token.attr % 256 nargs = token.attr % 256

View File

@@ -188,13 +188,7 @@ class Python36Parser(Python35Parser):
for i, token in enumerate(tokens): for i, token in enumerate(tokens):
opname = token.kind opname = token.kind
if opname == 'LOAD_ASSERT': if opname == 'FORMAT_VALUE':
if 'PyPy' in customize:
rules_str = """
stmt ::= JUMP_IF_NOT_DEBUG stmts COME_FROM
"""
self.add_unique_doc_rules(rules_str, customize)
elif opname == 'FORMAT_VALUE':
rules_str = """ rules_str = """
expr ::= formatted_value1 expr ::= formatted_value1
formatted_value1 ::= expr FORMAT_VALUE formatted_value1 ::= expr FORMAT_VALUE