-
The left recursion handling in Ohm is marvellous. It helps handling PEG-problematic tasks like RPN or left-associativity with ease. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @evilguest — I'm not sure what you mean by "most of the PExpr instances seem to be just PExprs, with no hints on their actual types". If you are using a recent version of Ohm, the pexprs will be instances of the appropriate subclass of PExpr. Take this example:
This produces
Unfortunately I don't think we have a generic way to recursively walk PExprs, but's it's not too bad to implement yourself. Does that help? |
Beta Was this translation helpful? Give feedback.
-
Thanks, this helps a lot. I've misinterpreted the debugger output. The root cause is Jest screwing the imports, so any attempt to perform (body instanceof Apply) fails. |
Beta Was this translation helpful? Give feedback.
Hi @evilguest —
I'm not sure what you mean by "most of the PExpr instances seem to be just PExprs, with no hints on their actual types". If you are using a recent version of Ohm, the pexprs will be instances of the appropriate subclass of PExpr. Take this example:
This produces
Unfortunately I don't think we have a generic w…