How to parse between (too) many alternatives? #763
-
I'm writing a lexer and I'm not at the point where I want or need to optimise it, so I'm using a large However, I've run out of parameters in the internal What's the best way to split this up? Is there a trick to extending I am wondering if I can use blocks of Is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, nesting
|
Beta Was this translation helpful? Give feedback.
Yes, nesting
alt()
s withinalt()
s should work. The limitation is similar to(sequenced, parsers)
. This comes from us having to explicitly enumerate a trait implementation for every tuple length we want to support.dispatch!
does not have this problem as its a macro that is directly generating the code and it generates amatch
statement which can be as large as you want.