You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Fix spelling via "codespell"
This commit is contained in:
@@ -307,7 +307,7 @@ class Python26Parser(Python2Parser):
|
||||
|
||||
and ::= expr JUMP_IF_FALSE POP_TOP expr JUMP_IF_FALSE POP_TOP
|
||||
|
||||
# A "compare_chained" is two comparisions like x <= y <= z
|
||||
# A "compare_chained" is two comparisons like x <= y <= z
|
||||
compare_chained ::= expr compared_chained_middle ROT_TWO
|
||||
COME_FROM POP_TOP _come_froms
|
||||
compared_chained_middle ::= expr DUP_TOP ROT_THREE COMPARE_OP
|
||||
@@ -466,7 +466,7 @@ class Python26Parser(Python2Parser):
|
||||
ja_attr = ast[4].attr
|
||||
return tokens[last].offset != ja_attr
|
||||
elif lhs == "try_except":
|
||||
# We need to distingush "try_except" from "tryelsestmt"; we do that
|
||||
# We need to distinguish "try_except" from "tryelsestmt"; we do that
|
||||
# by checking the jump before the END_FINALLY
|
||||
# If we have:
|
||||
# insn
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2015-2022 Rocky Bernstein
|
||||
# Copyright (c) 2015-2023 Rocky Bernstein
|
||||
# Copyright (c) 2005 by Dan Pascu <dan@windowmaker.org>
|
||||
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
|
||||
# Copyright (c) 1999 John Aycock
|
||||
@@ -634,7 +634,7 @@ class Python3Parser(PythonParser):
|
||||
self.add_unique_rule(rule, token.kind, uniq_param, customize)
|
||||
|
||||
def add_make_function_rule(self, rule, opname, attr, customize):
|
||||
"""Python 3.3 added a an addtional LOAD_STR before MAKE_FUNCTION and
|
||||
"""Python 3.3 added a an additional LOAD_STR before MAKE_FUNCTION and
|
||||
this has an effect on many rules.
|
||||
"""
|
||||
if self.version >= (3, 3):
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2016-2017, 2022 Rocky Bernstein
|
||||
# Copyright (c) 2016-2017, 2022-2023 Rocky Bernstein
|
||||
"""
|
||||
spark grammar differences over Python 3.1 for Python 3.0.
|
||||
"""
|
||||
@@ -31,8 +31,8 @@ class Python30Parser(Python31Parser):
|
||||
|
||||
# In many ways Python 3.0 code generation is more like Python 2.6 than
|
||||
# it is 2.7 or 3.1. So we have a number of 2.6ish (and before) rules below
|
||||
# Specifically POP_TOP is more prevelant since there is no POP_JUMP_IF_...
|
||||
# instructions
|
||||
# Specifically POP_TOP is more prevalant since there is no POP_JUMP_IF_...
|
||||
# instructions.
|
||||
|
||||
_ifstmts_jump ::= c_stmts JUMP_FORWARD _come_froms POP_TOP COME_FROM
|
||||
_ifstmts_jump ::= c_stmts COME_FROM POP_TOP
|
||||
@@ -208,7 +208,7 @@ class Python30Parser(Python31Parser):
|
||||
come_froms POP_TOP POP_BLOCK COME_FROM_LOOP
|
||||
|
||||
|
||||
# A "compare_chained" is two comparisions like x <= y <= z
|
||||
# A "compare_chained" is two comparisons like x <= y <= z
|
||||
compared_chained_middle ::= expr DUP_TOP ROT_THREE COMPARE_OP
|
||||
jmp_false compared_chained_middle _come_froms
|
||||
compared_chained_middle ::= expr DUP_TOP ROT_THREE COMPARE_OP
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2016-2017, 2019, 2021 Rocky Bernstein
|
||||
# Copyright (c) 2016-2017, 2019, 2021, 2023 Rocky Bernstein
|
||||
"""
|
||||
spark grammar differences over Python 3.4 for Python 3.5.
|
||||
"""
|
||||
@@ -258,7 +258,7 @@ class Python35Parser(Python34Parser):
|
||||
('pos_arg ' * args_pos) +
|
||||
('kwarg ' * args_kw) + kw + token.kind)
|
||||
|
||||
# Note: semantic actions make use of the fact of wheter "args_pos"
|
||||
# Note: semantic actions make use of the fact of whether "args_pos"
|
||||
# zero or not in creating a template rule.
|
||||
self.add_unique_rule(rule, token.kind, args_pos, customize)
|
||||
else:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2016-2020, 2022 Rocky Bernstein
|
||||
# Copyright (c) 2016-2020, 2022-2023 Rocky Bernstein
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -58,7 +58,7 @@ class Python36Parser(Python35Parser):
|
||||
come_froms JUMP_BACK come_froms POP_BLOCK COME_FROM_LOOP
|
||||
|
||||
# 3.6 due to jump optimization, we sometimes add RETURN_END_IF where
|
||||
# RETURN_VALUE is meant. Specifcally this can happen in
|
||||
# RETURN_VALUE is meant. Specifically, this can happen in
|
||||
# ifelsestmt -> ...else_suite _. suite_stmts... (last) stmt
|
||||
return ::= return_expr RETURN_END_IF
|
||||
return ::= return_expr RETURN_VALUE COME_FROM
|
||||
@@ -404,7 +404,7 @@ class Python36Parser(Python35Parser):
|
||||
JUMP_LOOP COME_FROM
|
||||
POP_TOP POP_TOP POP_TOP POP_EXCEPT POP_TOP
|
||||
|
||||
# FIXME this is a workaround for probalby some bug in the Earley parser
|
||||
# FIXME this is a workaround for probably some bug in the Earley parser
|
||||
# if we use get_aiter, then list_comp_async doesn't match, and I don't
|
||||
# understand why.
|
||||
expr_get_aiter ::= expr GET_AITER
|
||||
|
@@ -224,11 +224,11 @@ class Python37Parser(Python37BaseParser):
|
||||
compare ::= compare_single
|
||||
compare_single ::= expr expr COMPARE_OP
|
||||
|
||||
# A compare_chained is two comparisions like x <= y <= z
|
||||
# A compare_chained is two comparisons like x <= y <= z
|
||||
compare_chained ::= expr compared_chained_middle ROT_TWO POP_TOP _come_froms
|
||||
compare_chained_right ::= expr COMPARE_OP JUMP_FORWARD
|
||||
|
||||
# Non-null kvlist items are broken out in the indiviual grammars
|
||||
# Non-null kvlist items are broken out in the individual grammars
|
||||
kvlist ::=
|
||||
|
||||
# Positional arguments in make_function
|
||||
@@ -1144,7 +1144,7 @@ class Python37Parser(Python37BaseParser):
|
||||
come_froms JUMP_BACK come_froms POP_BLOCK COME_FROM_LOOP
|
||||
|
||||
# 3.6 due to jump optimization, we sometimes add RETURN_END_IF where
|
||||
# RETURN_VALUE is meant. Specifcally this can happen in
|
||||
# RETURN_VALUE is meant. Specifically this can happen in
|
||||
# ifelsestmt -> ...else_suite _. suite_stmts... (last) stmt
|
||||
return ::= return_expr RETURN_END_IF
|
||||
return ::= return_expr RETURN_VALUE COME_FROM
|
||||
@@ -1377,7 +1377,7 @@ class Python37Parser(Python37BaseParser):
|
||||
JUMP_BACK COME_FROM
|
||||
POP_TOP POP_TOP POP_TOP POP_EXCEPT POP_TOP
|
||||
|
||||
# FIXME this is a workaround for probalby some bug in the Earley parser
|
||||
# FIXME this is a workaround for probably some bug in the Earley parser
|
||||
# if we use get_aiter, then list_comp_async doesn't match, and I don't
|
||||
# understand why.
|
||||
expr_get_aiter ::= expr GET_AITER
|
||||
|
@@ -38,7 +38,7 @@ class Python37BaseParser(PythonParser):
|
||||
return "%s_0" % (token.kind)
|
||||
|
||||
def add_make_function_rule(self, rule, opname, attr, customize):
|
||||
"""Python 3.3 added a an addtional LOAD_STR before MAKE_FUNCTION and
|
||||
"""Python 3.3 added a an additional LOAD_STR before MAKE_FUNCTION and
|
||||
this has an effect on many rules.
|
||||
"""
|
||||
new_rule = rule % "LOAD_STR "
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2017-2020, 2022 Rocky Bernstein
|
||||
# Copyright (c) 2017-2020, 2022-2023 Rocky Bernstein
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
Reference in New Issue
Block a user