-
Notifications
You must be signed in to change notification settings - Fork 93
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
Provide more advanced examples #293
Comments
let sub_expr = || parser;
(sub_expr(), many((op, sub_expr())) Should work. There are also a few
Yes, writing your own parser is largely internal now. However for a simple, custom parser you can always use https://docs.rs/combine/4.2.1/combine/fn.parser.html which is basically as efficient as you are going to get without needing to understand the whole |
That was my first attempt. Unfortunately this makes the size of type exponential in layers. With 15 layers it makes the size of type of order of 32768 which effectively hangs even debug build of rust. (On second though - the clone would not help)
I'll take a look. |
For recursive parsers there is also https://docs.rs/combine/4.2.1/combine/parser/combinator/fn.opaque.html |
I'm trying to implement a generic parser:
However I run into number of issues:
sepBy
ignores separator)many
etc. heavily use internal macros making them non-exampleThe text was updated successfully, but these errors were encountered: