Joshua Barretto
Joshua Barretto
What worries me about this is that such a `Spanned` type would effectively become a pervasive part of a user's compiler since it would be present in the AST too....
> or to have a trait that needs to be implemented by a "Spanned" type such that chumsky can handle it, right? Imho i believe both would make sens, i.e....
In #713 I've made a first pass attempt at this. Do you have any thoughts @TheOnlyTails, @MeGaGiGaGon, and @Hedgehogo?
I don't think that inference is likely to be powerful enough to infer the output type in enough cases that it would get very annoying. `.map(|i| From::from(i))` can already be...
The current implementation allows the user to specify their own spanning type.
> But such a trait does not allow to impose restrictions on T, and this is necessary to get the missing information from it in case of memory-optimized `Span`. In...
Wow, this is a great PR! I'm going to try to get some time to look through this properly, but unfortunately I'm travelling for 2 weeks as of tomorrow so...
Thanks! Going to try to review this over the weekend.
You can do `a.repeated().exactly(n).then_ignore(a.not())`. The final part expects anything that *isn't* an `a` immediately after the repeating section, effectively preventing more than `n` instances ever occurring.
That said, the pattern you are looking for (the backticks) is context-sensitive and won't be solved with this alone. See my response here about parsing Rust-like raw strings, which pretty...