New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of single quote instead of back quote in C11 parser is intentional ? #3
Comments
|
It seems to be a mistake because parsing this example: Gives this AST: But changing it by |
|
Also I just made a Lua-5.4.4 , lpeglabel and lpegrex online playground here https://github.com/mingodad/lua-wasm-playground |
|
That was indeed a mistake. I've update the C11 parser fixing that, along with some other issues I've found last months when putting the C11 AST to real use. Thanks for reporting.
Nice! Very useful to quickly prototype grammars! Can I add a link for it in the LPegRex readme? |
|
Thank you ! |
|
How do you debug |
|
Also like this https://lua-users.org/lists/lua-l/2009-10/msg00774.html |
Well usually I don't need to, because I usually prototype grammars incrementally, by creating small tests to cover each grammar rule change or addition. As seen in https://github.com/edubart/nelua-lang/blob/master/spec/syntaxdefs_spec.lua . When some change does not workout I can usually reason about why.
Something like that is probably doable with some patches in |
|
Could you help me with a grammar I'm trying to use with The grammar seems to be compiled fine and the input text I'm not ready to publish the grammar yet but if you could give a hand on it I could email it to you. |
|
Instead of debugging for you, I've added experimental support for a simple debug mode, inspired by the link you have shared. Also added in the README how to use it. Let me know if that helps you debugging. When you see |
|
Thank you ! |
|
Thank you again ! Changing it to: And now it parses fine and I can start changing/figuring out how to create a desired |
|
I also just updated the https://mingodad.github.io/lua-wasm-playground/ to use the latest |
|
I was trying to improve a bit the debug info with this: But I'm getting this error: I understand the consequence of |
|
With the suggestion of @roberto-ieru I extended a bit the debug output and it can be seen on https://mingodad.github.io/lua-wasm-playground/ with the |
|
And here is the output replacing |
While trying to create a parser using
lpegrexand looking atC11parser for usage patterns I found the one shown bellow, where most of the binary operands are captured with{`op`}but theANDoperator is captured with{'&&'}is this intentional or a mistake ?The text was updated successfully, but these errors were encountered: