Automatic parser generation
Adds the following functions:
-
mpca_lang_auto -
mpca_lang_auto_files -
mpc_auto_find_parser -
mpc_auto_delete
Allows to use mpca grammar without having to spam mpc_new.
Thanks a lot @Shdorsh. This looks like a nice feature. I left some comments on the changes. Please would you also be able to add some tests for this before I merge it?
This seems a bit unfinished. I'll try adding onto it, especially the auto parsers, to be able to construct one from multiple parsers so that auto functions can actually make use of what was predefined in raw C.
Edit: Also, mpca_lang_auto_files tests are not in yet. Will work on it some more.
Had to dig in a bit deeper to adapt things and make it work, hope you don't mind.
Thanks, I will try to get around to looking at this at some point...
Okay, I had some pretty dumb moment when I forgot to remove the escape sign in my mpca_lang_auto_files tests, then was a bit busy. It works now, all the tests are passing, even the new ones. Also, I have noticed you got a bunch of header files that aren't used (anymore?), like maths.h. I got another branch coming up for another PR where I will clean the namespace.
@orangeduck I also just saw that mpca_or is a 1-to-1 copy of mpc_or. Want me to do some treeshaking later on?