Skip to content

Commit

Permalink
grass.temporal.ply: Fix enumerate-for-loop (SIM113)
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix committed Oct 7, 2024
1 parent e59bf34 commit d915d53
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python/grass/temporal/ply/yacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1502,10 +1502,8 @@ def lr0_goto(self, I, x):
# Compute the LR(0) sets of item function
def lr0_items(self):
C = [self.lr0_closure([self.grammar.Productions[0].lr_next])]
i = 0
for I in C:
for i, I in enumerate(C):
self.lr0_cidhash[id(I)] = i
i += 1

# Loop over the items in C and each grammar symbols
i = 0
Expand Down Expand Up @@ -1854,8 +1852,7 @@ def lr_parse_table(self):
self.add_lalr_lookaheads(C)

# Build the parser table, state by state
st = 0
for I in C:
for st, I in enumerate(C):
# Loop over each production in I
actlist = [] # List of actions
st_action = {}
Expand Down Expand Up @@ -2041,7 +2038,6 @@ def lr_parse_table(self):
action[st] = st_action
actionp[st] = st_actionp
goto[st] = st_goto
st += 1


# -----------------------------------------------------------------------------
Expand Down

0 comments on commit d915d53

Please sign in to comment.