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:
The text was updated successfully, but these errors were encountered:
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!
I've done a proof-of-concept port to yamlesque, available in yamlesque branch.