Skip to content

Commit

Permalink
Fix the rule_id property of the artificial alternatives of alternatio…
Browse files Browse the repository at this point in the history
…ns with recurring labels (#226)
  • Loading branch information
renatahodovan authored Jun 3, 2024
1 parent e6be3dc commit 4867bd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grammarinator/tool/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ def build_expr(node, parent_id):
graph.add_edge(frm=recurring_rule_id, to=labeled_alt_id)
recurring_idx = 0
for i in range(len(children)):
labeled_alternative_id = graph.add_node(AlternativeNode(rule_id=f'{rule.id}_{label}', alt_idx=0, idx=i))
labeled_alternative_id = graph.add_node(AlternativeNode(rule_id=recurring_rule_id, alt_idx=0, idx=i))
graph.add_edge(frm=labeled_alt_id, to=labeled_alternative_id)
if labels[i] == label:
graph.add_edge(frm=labeled_alternative_id, to=(rule.name, label, recurring_idx))
Expand Down

0 comments on commit 4867bd9

Please sign in to comment.