Skip to content

Commit

Permalink
Update codegen template for imaginary rules to correctly use current …
Browse files Browse the repository at this point in the history
…node (#244)
  • Loading branch information
akosthekiss authored Oct 28, 2024
1 parent d11a224 commit 9364362
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ class {{ graph.name }}({{ graph.superclass }}):

{% for rule in graph.imag_rules %}
def {{ rule.id | join('_') }}(self, parent=None):
with UnlexerRuleContext(self, '{{ rule.id | join('_') }}', parent) as current:
return current
with UnlexerRuleContext(self, '{{ rule.id | join('_') }}', parent) as rule:
current = rule.current
return current
{% endfor %}

{%- if graph.members %}
Expand Down

0 comments on commit 9364362

Please sign in to comment.