enable using a tokenized input as a Stream input#513
Conversation
|
One thing I worry about is that the API seems to imply that the parser gets turned into a Did you have an example of the sort of patterns that this enables? |
|
Edit: It seems I misread the implementation earlier, I see it is turning the parser directly into a stream. As mentioned, #399 discusses some of these issues. In particular, |
|
Ah, I see #399 (mentioned directly above |
|
Converted this into a draft as this is really just the easier part of #399. |
38bb88c to
02a1373
Compare
0f2b61a to
e350fc6
Compare
Problem
I'm parsing a string into tokens with chumsky, and I would like to also use chumsky to parse those tokens into something else. While
select! { ... }is intended to enable this, it assumes that the stream of tokens is produced externally to chumsky, as in the logos example:chumsky/examples/logos.rs
Lines 130 to 145 in 56762fe
Solution
.parse_iter()outside of#[cfg(test)]and use it to construct aStreaminstance..stream(input)as a public method ofIterParserto generate a stream of transformed input.