mpc icon indicating copy to clipboard operation
mpc copied to clipboard

Automatic parser generation

Open Shdorsh opened this issue 8 months ago • 6 comments

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.

Shdorsh avatar Apr 25 '25 07:04 Shdorsh

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?

orangeduck avatar Apr 26 '25 14:04 orangeduck

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.

Shdorsh avatar Apr 28 '25 01:04 Shdorsh

Had to dig in a bit deeper to adapt things and make it work, hope you don't mind.

Shdorsh avatar Apr 29 '25 08:04 Shdorsh

Thanks, I will try to get around to looking at this at some point...

orangeduck avatar May 04 '25 14:05 orangeduck

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.

Shdorsh avatar May 06 '25 23:05 Shdorsh

@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?

Shdorsh avatar May 08 '25 04:05 Shdorsh