Meanwhile, I appear to have accidentally written another parser combinator library.
Conversation
And I spent all day improving and generalising it. Still not admitting it should be split out from its parent package.
Besides, it's alarmingly similar to, if not entirely identical to, a thing that's already on crates.io, and I don't really want to compete.
2
10
Super curious in how you've done it! I've tried it in Rust before but always ended up with crazy exploding traits with annoying type errors. ☹️
1
impl Trait all over, and seamless boxing where necessary.
1
1
Nice! Super curious to see!
What did you use as your input stream thing?
2
Initially just slices, but I'm in the middle of generalising it.
2
1
/me wishes for a parser combinator lib:
- nice separate tokenizer support (tokenizer is just another parser that emits a stream of tokens, that you feed into another parser)
- error recovery (emit a broken AST)
- incremental parsing (for IDE support)
😍
3
2
ATM I'm moving away from LALRPOP due to grammar composition problems and compilation size, but now I am left with a dodgey recursive descent + pratt parser with no error recovery:
github.com/brendanzab/rus
bleh :(
So hard to write recursive descent without ending up making it a parser combinator lib! D:
1
I dream of a proc macro that can compile a *BNF grammar into parser combinators.
2
3
Show replies

