diff options
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/peg_generator/scripts/grammar_grapher.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/peg_generator/scripts/grammar_grapher.py b/Tools/peg_generator/scripts/grammar_grapher.py index 4d77123..4a41dfa 100755 --- a/Tools/peg_generator/scripts/grammar_grapher.py +++ b/Tools/peg_generator/scripts/grammar_grapher.py @@ -29,6 +29,7 @@ from pegen.build import build_parser from pegen.grammar import ( Alt, Cut, + Forced, Grammar, Group, Leaf, @@ -60,6 +61,8 @@ def references_for_item(item: Any) -> List[Any]: return [_ref for _item in item.items for _ref in references_for_item(_item)] elif isinstance(item, Cut): return [] + elif isinstance(item, Forced): + return references_for_item(item.node) elif isinstance(item, Group): return references_for_item(item.rhs) elif isinstance(item, Lookahead): |