-
hey! i've been ripping my hair out for a few hours now; i haven't been able to implement a quoted-string parser that allows for escaping quotes (so something like i've tried looking in the sample JSON parser but (a) i don't know where the after several iterations, i've been able to get this working in a horrible 200-char line of code, but i feel like there has to be a better way. help would be really appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The // Will yield "ab" as the output value
just('a').then('b').to_slice() It might be that your confusion is due to using the If you're starting a new project afresh I would strongly recommend using 1.0: it is 'the future' of chumsky, and it's much faster, more expressive, and will have support going forward. 0.9 is now considered legacy. If you want to persist with 0.9 though, you can check out the examples as they are in the |
Beta Was this translation helpful? Give feedback.
The
.to_slice()
method is part of chumsky: it gives you a parser whose output is a slice of the input that was accepted by the original parser. For example:It might be that your confusion is due to using the
0.9
release (the latest stable release on crates.io), but the examples in the repository are written against1.0
(which is still in alpha, although is nearing a stable release).If you're starting a new project afresh I would strongly recommend using 1.0: it is 'the future' of chumsky, and it's much faster, more expressive, and will have support going forward. 0.9 is now considered legacy. If you want to persist wi…