Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Better (our own?) YAML parser #229
This is the question that was discussed a zillion of times, but I'd want to create a separate issue for this one.
Current state of things
Right now we're using external YAML parsers to parse .ksy files, that is:
What we're generally ok to drop
Some YAML compatibility, i.e. we're generally ok to implement a smaller YAML subset. For example, we don't need:
However, we shouldn't add and modify YAML semantics, i.e. all our .ksy files should still stay valid YAML documents, available for parsing in other YAML parsers.
What we'd want to have
A parser that:
If this is about string parsing then the formats repo currently use the
I forgot to mention but I would need a mode where the parser also stores every node's original position (file byte offset, row and column number in an optimal situation), so if I want to select the
I can also revert this position-node map and if ex. the user is currently at the 153 byte offset, I'll know he is at the
Or if we ever create source maps then those will store that "this JS code was generated by the
Currently my AST parser stores every node's exact start and end position (separately even for a map's key, etc). Maybe it's enough to store only the start position, but I wanted to be future-proof.
If that's for
Makes sense, thanks!