Skip to content

Commit

Permalink
Fix some spelling mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jul 22, 2024
1 parent e76d9eb commit 5048653
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 21 deletions.
6 changes: 3 additions & 3 deletions decompyle3/parsers/p37/full.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023 Rocky Bernstein
# Copyright (c) 2020-2024 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
Expand Down Expand Up @@ -790,7 +790,7 @@ def p_grammar(self, args):
def p_come_from3(self, args):
"""
# In 3.7+ a SETUP_LOOP to a JUMP_FORWARD can
# get replaced by the JUMP_FORWARD addressed. Therefore come froms may
# get replaced by the JUMP_FORWARD addressed. Therefore COME_FROMs may
# appear out of nesting order. For example:
# if x
# for ... jump forward endif (1)
Expand Down Expand Up @@ -935,7 +935,7 @@ def p_36misc(self, args):
return_closure ::= LOAD_CLOSURE DUP_TOP STORE_NAME RETURN_VALUE RETURN_LAST
# 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
Expand Down
2 changes: 1 addition & 1 deletion decompyle3/parsers/p37/lambda_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def customize_grammar_rules_lambda37(self, tokens, customize):
generator_exp_async ::= load_genexpr LOAD_STR MAKE_FUNCTION_0
get_aiter CALL_FUNCTION_1
# 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
Expand Down
4 changes: 2 additions & 2 deletions decompyle3/parsers/p37/lambda_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def p_jump(self, args):

def p_37chained(self, args):
"""
# A compare_chained is two comparisions like x <= y <= z
# A compare_chained is two comparisons like x <= y <= z
compare_chained ::= expr compare_chained_middle ROT_TWO POP_TOP _come_froms
compare_chained ::= compare_chained37
compare_chained ::= compare_chained37_false
Expand Down Expand Up @@ -545,7 +545,7 @@ def p_comprehension(self, args):
comp_if ::= or_jump_if_false_loop_cf comp_iter
# We need to have a reduction rule to disambiguate
# these "comp_if_not" and "comp_if". The difference is burried in the
# these "comp_if_not" and "comp_if". The difference is buried in the
# sense of the jump in
# comp_iter -> comp_if_or -> or_parts_false_loop
# vs.:
Expand Down
4 changes: 2 additions & 2 deletions decompyle3/parsers/p38/full_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ def customize_grammar_rules_full38(self, tokens, customize):
COME_FROM_FINALLY
END_ASYNC_FOR
# FIXME: come froms after the else_suite or
# 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
# is used. Add COME_FROMs and check of add up
# control-flow detection phase.
# async_forelse_stmt38 ::= expr async_for store
# for_block COME_FROM_FINALLY END_ASYNC_FOR
Expand Down
4 changes: 2 additions & 2 deletions decompyle3/parsers/p38pypy/full_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ def customize_grammar_rules_full38(self, tokens, customize):
COME_FROM_FINALLY
END_ASYNC_FOR
# FIXME: come froms after the else_suite or
# 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
# is used. Add COME_FROMs and check of add up
# control-flow detection phase.
# async_forelse_stmt38 ::= expr async_for store
# for_block COME_FROM_FINALLY END_ASYNC_FOR
Expand Down
6 changes: 3 additions & 3 deletions decompyle3/parsers/parse_heads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2023 Rocky Bernstein
# Copyright (c) 2022-2024 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
Expand Down Expand Up @@ -99,7 +99,7 @@ def __init__(self, debug_parser, start_symbol, is_lambda=False):
self.insts = []

# True if we are parsing inside a lambda expression.
# because a lambda expression are wrtten on a single line, certain line-oriented
# because a lambda expression are written on a single line, certain line-oriented
# statements behave differently
self.is_lambda = is_lambda

Expand Down Expand Up @@ -422,6 +422,6 @@ def __init__(self, compile_mode, debug_parser):
self.insts = []

# true if we are parsing inside a lambda expression.
# because a lambda expression are wrtten on a single line, certain line-oriented
# because a lambda expression are written on a single line, certain line-oriented
# statements behave differently
self.is_lambda = False
2 changes: 1 addition & 1 deletion decompyle3/parsers/reduce_check/ifelsestmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def ifelsestmt(
if come_from_target < first_offset:
return True

# Make sure all the offsets from the "come froms" at the
# Make sure all the offsets from the "COME_FROMs" 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
4 changes: 2 additions & 2 deletions decompyle3/parsers/reduce_check/iflaststmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def iflaststmt(
("testexprc", "c_stmts"),
):

# "stmts" (end of then) should not end in a fallthough instruction
# "stmts" (end of then) should not end in a fallthrough instruction
# other wise this is just a plain ol' stmt.
ltm1 = tokens[last - 1]
if ltm1 == "COME_FROM":
Expand Down Expand Up @@ -121,7 +121,7 @@ def iflaststmt(
if last_inst.is_jump():
return target_offset == last_offset
else:
# A fallthough can't jump *beyond* the end in the nested
# A fallthrough can't jump *beyond* the end in the nested
# "if" around and outer "else"
return True
pass
Expand Down
2 changes: 0 additions & 2 deletions decompyle3/parsers/reduce_check/ifstmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ def ifstmt(
return True
pass

print("XXX", self)
print("XXX1", dir(self))
endif_inst_index = self.offset2inst_index[ltm1.off2int(prefer_last=False)]

# FIXME: RAISE_VARARGS is an instance of a no-follow instruction.
Expand Down
2 changes: 1 addition & 1 deletion decompyle3/semantics/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
# function_def_async
"mkfuncdeco0": ("%|def %c\n", (0, "mkfunc")),

# In cases where we desire an explict new line.
# In cases where we desire an explicit new line.
# After docstrings which are followed by a "def" is
# one situations where Python formatting desires two newlines,
# and this is added, as a transformation rule.
Expand Down
5 changes: 3 additions & 2 deletions decompyle3/semantics/helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys

from xdis import iscode

from decompyle3.parsers.treenode import SyntaxTree

minint = -sys.maxsize - 1
Expand Down Expand Up @@ -29,8 +30,8 @@ def escape_string(s: str, quotes=('"', "'", '"""', "'''")):
return "%s%s%s" % (quote, s, quote)


# FIXME: this and find_globals could be paramaterized with one of the
# above global ops
# FIXME: This and find_globals could be parameterized with one of the
# above global ops.
def find_all_globals(node, globs):
"""Search Syntax Tree node to find variable names that are global."""
for n in node:
Expand Down

0 comments on commit 5048653

Please sign in to comment.