-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
convert from adhoc exception #5237
base: main
Are you sure you want to change the base?
Conversation
Add sample showing that throwing the exception is the problem 'use 4' is processed correctly, but use 5 dies on the exception
so we can safely throw the exception
Same problem as I explained on IRC, perhaps. CORE setting isn't loaded yet. You'd need to load it first. Guess, just CORE.c is OK for the purpose. |
I just've noticed that @niner has similar approach to mine: when an error exception is about to be thrown matters of inefficiency are not that important. |
Ok, tried harder to load the v6.c language before throwing the exception. |
If it works this way, I'd like to see a less hacky implementation. |
Sorry, wasn't clear: it's still failing. |
vrurg++
ok, current version now does something reasonable with -e 'use v6' and -e 'use v5' but fails when running files. |
Hmm... I'm wondering: why don't we load v6.c (or whatever is the basic supported version) unconditionally? And have any |
Considering that loaded core settings are cached anyway, it makes even more sense. |
The sample here copies a chunk of the lang_setup method from the main grammar.
"use v4" prints out the error message and dies.
"use v5" couldn't create the exception. I've tried to setup the core.c resolver here but am just cargo culting, this also dies.