Skip to content

How to make a string parser with escapeable quotes? #692

Answered by zesterer
cAttte asked this question in Q&A
Discussion options

You must be logged in to vote

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:

// Will yield "ab" as the output value
just('a').then('b').to_slice()

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 against 1.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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cAttte
Comment options

Answer selected by cAttte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants