A Format-Preserving YAML Parser
A format-preserving YAML parser.
We are following the YAML 1.2 Spec in
general and use Core Schema as
the reference for YAML native data structure in Haskell.
YAML supports multi-document content in one file. Each document could contains
Directive and Body (YAML Node).
data YAML = YAML Documents
type Documents = [Document]
data Document = Document Directives Node
TODO: Investigate more tricky cases and add more tests.
NOTE: Fixing bugs. Implements parser for escaped character.
Constructing and researching about algorithm & data structure for block-scoped
indentation in YAML. This is the hardest part.
I’m reading Learn YAML in Y Minutes
to think about the implementation and looked at the YAML 1.2 Spec production
grammar for the best outcome. Making sure that the YAML is valid using online
YAML Linter and online
YAML Parser. However, there are
several limitation in those YAML Linter and YAML Parser implementation. Hence,
we stick with the YAML 1.2 Spec to the end.
Example will be added later. There are tests instead in test/
directory.
Licensed under The BSD3 License.