Skip to content

Conversation

@Shdorsh
Copy link

@Shdorsh Shdorsh commented Apr 25, 2025

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 added 4 commits April 25, 2025 09:25
Creating 2 functions that allow for direct usage of MPCA grammar without needing to declare any additional parsers.
Finishes the work and allows usage of mpca_lang_auto as well as mpca_lang_auto_files.
Clarifying some changes
@orangeduck
Copy link
Owner

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?

@Shdorsh
Copy link
Author

Shdorsh commented Apr 28, 2025

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
Copy link
Author

Shdorsh commented Apr 29, 2025

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

@Shdorsh Shdorsh requested a review from orangeduck April 29, 2025 08:59
@Shdorsh Shdorsh marked this pull request as draft April 30, 2025 04:10
@orangeduck
Copy link
Owner

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

@Shdorsh Shdorsh marked this pull request as ready for review May 6, 2025 23:21
@Shdorsh
Copy link
Author

Shdorsh commented May 6, 2025

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
Copy link
Author

Shdorsh commented May 8, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants