Better visitor #1411
Daniel63656
started this conversation in
Ideas
Better visitor
#1411
Replies: 1 comment
-
Can you give some example situation in which you would want to use this pattern? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, coming from antlr parsing, I found the Visitor class(es) provided by lark a bit lacking. There is no way to get callbacks when exiting a rule and when terminals are encountered. Based on that, I wrote a very simple recursive top-down base visitor that has these features. I also made it so that the user can prevent further visiting a rule by returning False in an enter rule. Feel free to use this if you want:
Beta Was this translation helpful? Give feedback.
All reactions