nix-parsec
nix-parsec copied to clipboard
examples: add xml parser, add parse.sh scripts
parse.sh is useful for prototyping new parsers
also needed because nix repl
caches imports, so i cannot use a devloop like
((import ./examples/uuids/default.nix {})).parseUuid "123e4567-12d3-a456-426614174000"
also
- add xml parser to examples/xml
- parse-xml.nix
- parse-xml.test.js - test runner
- parse-xml.test.md - test snapshots
-
parse-xml-comment.nix - demo parser with lookahead, based on function
takeUntil
- print-xml.nix - serialize parse tree to xml
- print-yaml.nix - serialize parse tree to yaml
todo
- [ ] use examples/xml/parse-xml.sh as template for all parse.sh
- [ ] add markdown parser
- [ ] write test runner in Nix