Skip to content

Commit

Permalink
Fixed IndentedBlock internal parse action to use correct value of cur
Browse files Browse the repository at this point in the history
  • Loading branch information
ptmcg committed Jan 20, 2022
1 parent 236cb8b commit 938f59d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyparsing/core.py
Expand Up @@ -3826,7 +3826,7 @@ def streamline(self) -> ParserElement:
seen.add(id(cur))
if isinstance(cur, IndentedBlock):
prev.add_parse_action(
lambda s, l, t: setattr(cur, "parent_anchor", col(l, s))
lambda s, l, t, cur_=cur: setattr(cur_, "parent_anchor", col(l, s))
)
break
subs = cur.recurse()
Expand Down

0 comments on commit 938f59d

Please sign in to comment.