Sorry if this is the incorrect place to post questions. If so, is there a slack or discord or should I use github issues?
I'm building a prefix DSL with pegjs and it's going pretty well. The idea is that users can define expressions according to the DSL and those expressions can be evaluated dynamically later with varying context.
I've run into a snag separating the parsing from the evaluation. Some expressions in my grammar require runtime context. Specifically, variable resolution from an object passed in options. I would like to be able to validate that the input syntax is valid according to my DSL separately without actually running the runtime actions. Later, the generated parser can emit runtime issues if the provided context is invalid.
In pegjs, is the parsing separate from the evaluation of the input? I've thought about trying to create an interface and injecting mock implementations of my actions, but I'm worried I'm over-complicating this or that I will affect downstream parsing. Are the return values from the action actually used in any downstream parsing or just to evaluate the final response.
Hope this is clear. Any thoughts on this?
Thanks,
Justin
P.S. Thanks for pegjs. It's awesome and I'm loving using it.