-
I want to parse a string that is generated inside a class instance by calling a peggy generated parser. One of the parsing actions needs to invoke a function defined inside the class instance, so that I have access to the environment of that instance, including |
Beta Was this translation helpful? Give feedback.
Answered by
Mingun
Dec 3, 2021
Replies: 1 comment
-
Pass a class instance via options: let parser = peggy.generate(...);
parser.parse(input, { myClass });
// in the code block in the grammar:
options.myClass.<...> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hildjj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pass a class instance via options: