-
Notifications
You must be signed in to change notification settings - Fork 292
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
Code crash in mpc_parse #27
Comments
Hey, I can't see the problem immediately but it seems likely that your grammar is going into an infinite loop during parsing. This can happen in a couple of cases but most likely is due to Left Recursion: https://github.com/orangeduck/mpc#the-parser-is-going-into-an-infinite-loop I can't spot the left recursion in your grammar but I suspect it might be in the
|
Yeah I thought you might say that... Even if I remove that rule the problem still occurs though... |
You were right. The problem was with left recursion! |
Good to hear it is working now 👍 |
Hello! I am trying to write a parser for a simple scripting language. So I completed my grammar and I tried to run it but I mpc_parse runs for about 25 seconds and then crashes without reason.
The error I am getting is:
The biggest problem is that the error is not always on the same spot. Some times it is on mpc_error or on mpc_delete. I don't know. It's kind of random.
I will give you part of my code and I hope you can tell me if it is my code's problem or if I should start debuggin mpc!!
My code:
The grammar I used in a less obfuscated version (it's hard to read on code):
I am really sorry for the long post. I just thought it would be better if I post my error before spending hours over hours to fix it. Maybe you have seen it again and you can pinpoint the problem immediately.
Thanks for your hard work. Mpc is a great piece of code and very helpful.
The text was updated successfully, but these errors were encountered: