Revise Python version comparisions

And set scanner.show_asm for 3.6
This commit is contained in:
rocky
2021-10-19 05:54:54 -04:00
parent ceb7c659bd
commit 0645738775
2 changed files with 3 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2016-2017, 2019 Rocky Bernstein # Copyright (c) 2016-2017, 2019, 2021 Rocky Bernstein
""" """
spark grammar differences over Python 3.4 for Python 3.5. spark grammar differences over Python 3.4 for Python 3.5.
""" """
@@ -168,7 +168,7 @@ class Python35Parser(Python34Parser):
call_token = tokens[i+1] call_token = tokens[i+1]
rule = 'call ::= expr unmapexpr ' + call_token.kind rule = 'call ::= expr unmapexpr ' + call_token.kind
self.addRule(rule, nop_func) self.addRule(rule, nop_func)
elif opname == 'BEFORE_ASYNC_WITH' and self.version < 3.8: elif opname == 'BEFORE_ASYNC_WITH' and self.version < (3, 8):
# Some Python 3.5+ async additions # Some Python 3.5+ async additions
rules_str = """ rules_str = """
stmt ::= async_with_stmt stmt ::= async_with_stmt

View File

@@ -20,6 +20,7 @@ JUMP_OPS = opc.JUMP_OPS
class Scanner36(Scanner3): class Scanner36(Scanner3):
def __init__(self, show_asm=None, is_pypy=False): def __init__(self, show_asm=None, is_pypy=False):
Scanner3.__init__(self, (3, 6), show_asm, is_pypy)
return return
def ingest(self, co, classname=None, code_objects={}, show_asm=None): def ingest(self, co, classname=None, code_objects={}, show_asm=None):