lark icon indicating copy to clipboard operation
lark copied to clipboard

Why does tree_matcher return self rules that do not exist in the grammar?

Open brando90 opened this issue 4 years ago • 0 comments
trafficstars

Describe the bug

I expect tree_matcher to match a rule and a tree->children without introducing redundant self rules. In particular see this line:

            # Sometimes, tree_matcher returns weird self rules Tree('expansion', [Tree('expansion', [...])])

from: https://github.com/MegaIng/lark_ast_generator/blob/7f97fd3fba4a0e67faf4ff6c922b99df42eac843/rules_generator.py#L62 To Reproduce

To reproduce check this repo & file:

https://github.com/MegaIng/lark_ast_generator/blob/master/test.py

will work on how to exactly reproduce this and update.

brando90 avatar Jun 30 '21 17:06 brando90