Prompted because I was looking at the tokenization code of the toml crate, and I'm having a big feel of: "this sure would be nice to abstract". -- But the question is *how*.https://github.com/alexcrichton/toml-rs/blob/master/src/tokens.rs#L97-L130 …
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
disclaimer: author of a parser generator library here I like combinators a lot, especially as an introduction to parsing as they're relatively little work to implement and explain, and to test
-
personally, I've got much better performance out of generated code in high-level dynamic langs like ruby and JS; it's hard to make a lot of function calls perform compared to generated code plus I like defining a grammar once and generating multiple languages from it
- 3 more replies
New conversation -
-
-
+ I love what you're doing with extensions to cursors. This is basically what I've used in my parser! + very crude hexdump view on errors. https://github.com/omerbenamram/evtx/blob/master/src/macros.rs … for what I use to read bytes + capture context for error reporting.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I've written a bunch of text and binary parsers in rust - I feel like combinator abstractions are only helpful when the input doesn't do any lookbehind/context sensetive stuff. With text parsing there is usually less lookbehind.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.