-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Pratt parser only implemented for tuples A..Z #658
Comments
Hmm, you're right that this is a bit of an annoyance. |
An alternative solution might be to allow |
Yeah it is an issue, but i just created a fork for now and just added some more idents from AA_ to ZZ_. I didn't look at the implementation yet, but would it not make it harder for the compiler to optimize, if we allowed using a vec and boxed parsers? |
It would make it a bit harder for it to optimise most likely, yes. The compiler might still be able to perform devirtualisation if it's smart enough though. |
i guess making it a vec might make things simpler. Maybe we can try this and check the performance impact? One could also add a small macro along the lines of vec! to create a vec of boxed parsers, so that they don't have to be boxed manually? If i find the time, i can try to propose some changes if you'd like. |
I made an attempt to implement this a while back but ran into issues. I might attempt it again later. |
Hi, I'm running into this issue too right now. I'd be happy to attempt to add an implementation for tuples up to 676 items. |
I really appreciate the pratt parser feature. However, it is currently limited in the number of operators you can implement with it, since
impl_pratt_for_tuple!(A_ B_ C_ D_ E_ F_ G_ H_ I_ J_ K_ L_ M_ N_ O_ P_ Q_ R_ S_ T_ U_ V_ W_ X_ Y_ Z_);
only supports up to 26 operations.Maybe this can be fixed by using a proc macro to implement the Pratt parser for tuples of size N, where N can be supplied in some way by the library user? I'm no expert on macros though. A quick fix that would suffice for most cases would probably be to just double the tuple length?
The text was updated successfully, but these errors were encountered: