Skip to content

Commit 9d150e0

Browse files
committed
Update copyright
1 parent f030b33 commit 9d150e0

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

uncompyle6/parsers/parse27.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016-2020, 2023 Rocky Bernstein
1+
# Copyright (c) 2016-2020, 2023-2024 Rocky Bernstein
22
# Copyright (c) 2005 by Dan Pascu <[email protected]>
33
# Copyright (c) 2000-2002 by hartmut Goebel <[email protected]>
44

uncompyle6/parsers/parse31.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016-2017, 2022 Rocky Bernstein
1+
# Copyright (c) 2016-2017, 2022, 2024 Rocky Bernstein
22
"""
33
spark grammar differences over Python 3.2 for Python 3.1.
44
"""

uncompyle6/parsers/parse32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016-2017, 2022 Rocky Bernstein
1+
# Copyright (c) 2016-2017, 2022-2024 Rocky Bernstein
22
"""
33
spark grammar differences over Python 3 for Python 3.2.
44
"""
@@ -84,7 +84,7 @@ def customize_grammar_rules(self, tokens, customize):
8484
for i, token in enumerate(tokens):
8585
opname = token.kind
8686
if opname.startswith("MAKE_FUNCTION_A"):
87-
args_pos, args_kw, annotate_args = token.attr
87+
args_pos, _, annotate_args = token.attr
8888
# Check that there are 2 annotated params?
8989
rule = (
9090
"mkfunc_annotate ::= %s%sannotate_tuple "

uncompyle6/parsers/parse34.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017-2018 Rocky Bernstein
1+
# Copyright (c) 2017-2018, 2022-2024 Rocky Bernstein
22

33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@
2121

2222

2323
class Python34Parser(Python33Parser):
24-
2524
def p_misc34(self, args):
2625
"""
2726
expr ::= LOAD_ASSERT
@@ -57,36 +56,45 @@ def p_misc34(self, args):
5756
"""
5857

5958
def customize_grammar_rules(self, tokens, customize):
60-
self.remove_rules("""
59+
self.remove_rules(
60+
"""
6161
yield_from ::= expr expr YIELD_FROM
6262
# 3.4.2 has this. 3.4.4 may now
6363
# while1stmt ::= SETUP_LOOP l_stmts COME_FROM JUMP_BACK COME_FROM_LOOP
64-
""")
64+
"""
65+
)
6566
super(Python34Parser, self).customize_grammar_rules(tokens, customize)
6667
return
6768

69+
6870
class Python34ParserSingle(Python34Parser, PythonParserSingle):
6971
pass
7072

7173

72-
if __name__ == '__main__':
74+
if __name__ == "__main__":
7375
# Check grammar
7476
p = Python34Parser()
7577
p.check_grammar()
7678
from xdis.version_info import IS_PYPY, PYTHON_VERSION_TRIPLE
79+
7780
if PYTHON_VERSION_TRIPLE[:2] == (3, 4):
7881
lhs, rhs, tokens, right_recursive, dup_rhs = p.check_sets()
7982
from uncompyle6.scanner import get_scanner
83+
8084
s = get_scanner(PYTHON_VERSION_TRIPLE, IS_PYPY)
81-
opcode_set = set(s.opc.opname).union(set(
82-
"""JUMP_BACK CONTINUE RETURN_END_IF COME_FROM
85+
opcode_set = set(s.opc.opname).union(
86+
set(
87+
"""JUMP_BACK CONTINUE RETURN_END_IF COME_FROM
8388
LOAD_GENEXPR LOAD_ASSERT LOAD_SETCOMP LOAD_DICTCOMP LOAD_CLASSNAME
8489
LAMBDA_MARKER RETURN_LAST
85-
""".split()))
90+
""".split()
91+
)
92+
)
8693
remain_tokens = set(tokens) - opcode_set
8794
import re
88-
remain_tokens = set([re.sub(r'_\d+$', '', t) for t in remain_tokens])
89-
remain_tokens = set([re.sub('_CONT$', '', t) for t in remain_tokens])
95+
96+
remain_tokens = set([re.sub(r"_\d+$", "", t) for t in remain_tokens])
97+
remain_tokens = set([re.sub("_CONT$", "", t) for t in remain_tokens])
9098
remain_tokens = set(remain_tokens) - opcode_set
9199
print(remain_tokens)
92100
# print(sorted(p.rule2name.items()))

0 commit comments

Comments
 (0)