Replies: 4 comments 1 reply
-
This is a running log of what has been done
|
Beta Was this translation helpful? Give feedback.
-
Background: I've not done much streaming parsing I suspect there are two main cases:
|
Beta Was this translation helpful? Give feedback.
-
See also #208 ("Semantics of ErrMode::Incomplete and Needed: need some bytes for what goal?") |
Beta Was this translation helpful? Give feedback.
-
I'm interested in writing a streaming forma-preserving parser for JSON5. E.g. I want to get a stream of events like "begin object", "key", "string value", "newline", "spaces" etc. My goal is to use this for single-pass editing (while minimising the git diff), so I have no need to build up a full document structure like toml_edit does. I deeply care about speed of this program, I will be processing relatively small files, but lots of them. This leads me to believe I should load the full file before parsing, so that I can borrow from the input where possible. Since pretty much everything will have to be treated as opaque string data anyway (otherwise I might not preserve float formatting correctly) I should be able to borrow almost all data. (This is at odds with what you would do if you wanted to stream process a very large file (e.g. larger than fits in RAM), where you would want to load parts of the file in small chunks. In that case borrowing from the input buffer would be complicated (as it would be ephemeral).) I'm wondering if this is something that winnow can currently support, or if I'm better served looking elsewhere. It doesn't seem to fit either of the two use cases you mentioned in #169 (comment) |
Beta Was this translation helpful? Give feedback.
-
How can we improve the state of things to make the experience better?
Beta Was this translation helpful? Give feedback.
All reactions