Skip to content

Commit

Permalink
Mis spelling corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Mar 14, 2024
1 parent daf54d2 commit b88af23
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/dist
/how-to-make-a-release.txt
/nose-*.egg
/pycharm-venv
/tmp
/uncompyle6.egg-info
/unpyc
Expand Down
4 changes: 2 additions & 2 deletions uncompyle6/parsers/parse38.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def p_38_stmt(self, args):
JUMP_BACK COME_FROM_FINALLY
END_ASYNC_FOR
# FIXME: come froms after the else_suite or END_ASYNC_FOR distinguish which of
# for / forelse is used. Add come froms and check of add up control-flow detection phase.
# FIXME: "come_froms" after the "else_suite" or END_ASYNC_FOR distinguish which of
# for / forelse is used. Add "come_froms" and check of add up control-flow detection phase.
async_forelse_stmt38 ::= expr
GET_AITER
SETUP_FINALLY
Expand Down
5 changes: 2 additions & 3 deletions uncompyle6/parsers/reducecheck/for_block_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def for_block_invalid(self, lhs, n, rule, tree, tokens, first: int, last: int) -> bool:

# print("XXX", first, last)
# for t in range(first, last):
# print(tokens[t])
Expand Down Expand Up @@ -51,8 +50,8 @@ def for_block_invalid(self, lhs, n, rule, tree, tokens, first: int, last: int) -
pop_jump_index -= 1

# FIXME: something is fishy when and EXTENDED ARG is needed before the
# pop_jump_index instruction to get the argment. In this case, the
# _ifsmtst_jump can jump to a spot beyond the come_froms.
# pop_jump_index instruction to get the argument. In this case, the
# _ifsmtst_jump can jump to a spot beyond the ``come_froms``.
# That is going on in the non-EXTENDED_ARG case is that the POP_JUMP_IF
# jumps to a JUMP_(FORWARD) which is changed into an EXTENDED_ARG POP_JUMP_IF
# to the jumped forwarded address
Expand Down
3 changes: 1 addition & 2 deletions uncompyle6/parsers/reducecheck/ifelsestmt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@


def ifelsestmt2(self, lhs, n, rule, tree, tokens, first, last):

if (last + 1) < n and tokens[last + 1] == "COME_FROM_LOOP" and lhs != "ifelsestmtc":
# ifelsestmt jumped outside of loop. No good.
return True
Expand All @@ -66,7 +65,7 @@ def ifelsestmt2(self, lhs, n, rule, tree, tokens, first, last):
if raise_stmt1 == "raise_stmt1" and raise_stmt1[0] in ("LOAD_ASSERT",):
return True

# Make sure all of the "come froms" offset at the
# Make sure all of the "come_froms" offset at the
# end of the "if" come from somewhere inside the "if".
# Since the come_froms are ordered so that lowest
# offset COME_FROM is last, it is sufficient to test
Expand Down
12 changes: 3 additions & 9 deletions uncompyle6/parsers/reducecheck/ifstmts_jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def ifstmts_jump(self, lhs, n, rule, ast, tokens, first, last):

if len(rule[1]) <= 1 or not ast:
return False

Expand All @@ -24,7 +23,7 @@ def ifstmts_jump(self, lhs, n, rule, ast, tokens, first, last):
pop_jump_index -= 1

# FIXME: something is fishy when and EXTENDED ARG is needed before the
# pop_jump_index instruction to get the argment. In this case, the
# pop_jump_index instruction to get the argument. In this case, the
# _ifsmtst_jump can jump to a spot beyond the come_froms.
# That is going on in the non-EXTENDED_ARG case is that the POP_JUMP_IF
# jumps to a JUMP_(FORWARD) which is changed into an EXTENDED_ARG POP_JUMP_IF
Expand All @@ -34,16 +33,11 @@ def ifstmts_jump(self, lhs, n, rule, ast, tokens, first, last):

pop_jump_offset = tokens[pop_jump_index].off2int(prefer_last=False)
if isinstance(come_froms, Token):
if (
tokens[pop_jump_index].attr < pop_jump_offset and ast[0] != "pass"
):
if tokens[pop_jump_index].attr < pop_jump_offset and ast[0] != "pass":
# This is a jump backwards to a loop. All bets are off here when there the
# unless statement is "pass" which has no instructions associated with it.
return False
return (
come_froms.attr is not None
and pop_jump_offset > come_froms.attr
)
return come_froms.attr is not None and pop_jump_offset > come_froms.attr

elif len(come_froms) == 0:
return False
Expand Down
5 changes: 5 additions & 0 deletions uncompyle6/scanners/scanner37base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ def __init__(
super(Scanner37Base, self).__init__(version, show_asm, is_pypy)
self.offset2tok_index = None
self.debug = debug

# True is code is from PyPy
self.is_pypy = is_pypy

# Bytecode converted into instruction
self.insts = []

# Create opcode classification sets
# Note: super initialization above initializes self.opc

Expand Down
2 changes: 1 addition & 1 deletion uncompyle6/semantics/gencomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def comprehension_walk_newer(
assert store, "Couldn't find store in list/set comprehension"

# A problem created with later Python code generation is that there
# is a lamda set up with a dummy argument name that is then called
# is a lambda set up with a dummy argument name that is then called
# So we can't just translate that as is but need to replace the
# dummy name. Below we are picking out the variable name as seen
# in the code. And trying to generate code for the other parts
Expand Down
2 changes: 1 addition & 1 deletion uncompyle6/semantics/make_function2.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def build_param(ast, name, default):
- handle defaults
- handle format tuple parameters
"""
# if formal parameter is a tuple, the paramater name
# if formal parameter is a tuple, the parameter name
# starts with a dot (eg. '.1', '.2')
if name.startswith("."):
# replace the name with the tuple-string
Expand Down

0 comments on commit b88af23

Please sign in to comment.