-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
Milestone
Description
tree-sitter-yaml playground: https://ikatyang.github.io/tree-sitter-yaml/. There is also a GitHub repo that provides all prebuilt WASM binaries of all supported tree-sitter grammars.
Requirements:
- integrate tree-sitter YAML grammar
- create sensible YAML AST layer with Failsafe schema
- use tree-sitter-yaml grammar to create YAML CST
- write YAML CST -> YAML AST transformer
- support for YAML Directives in YAML transformer
- support for Errors
- discarding all YAML documents except 1st one
- support for comments within the YAML stream
- support for Pairs without value
- create YAML adapter for OpenApi 3.1.0
- create YAML adapter for AsyncApi 2.0.0
Resources for understanding JSON vs YAML differences and YAML feature set:
- https://levelup.gitconnected.com/json-vs-yaml-6aa0243aefc6
- https://yaml.org/spec/1.2/spec.html#id2759572
- https://stackoverflow.com/questions/1726802/what-is-the-difference-between-yaml-and-json
- https://rollout.io/blog/yaml-tutorial-everything-you-need-get-started/
- https://www.tutorialspoint.com/yaml/yaml_basics.htm
- http://blogs.perl.org/users/tinita/2018/01/introduction-to-yaml-schemas-and-tags.html#:~:text=The%20YAML%201.2%20Specification%20lists,them%20available%20via%20an%20option.
- https://yaml-multiline.info/
Resources for creating sensible YAML AST
tree-sitter-yaml seems to have 2 issues
-
extreme size of generated parser which results in extreme size of WASM. Compiled WASM is about 719,3 KiB (736 604 bytes)
-
inability to be build functional WASM with
tree-sitter-cli
with versions higher than0.16.5
(>=0.16.6
).
These issues have been reported to YAML grammar author and other repos:
- Extreme WASM size ikatyang/tree-sitter-yaml#5
- tree-sitter-cli compatibility ikatyang/tree-sitter-yaml#6
- Support for Node 10.x.y ikatyang/tree-sitter-yaml#7
- CST and literals ikatyang/tree-sitter-yaml#9
- Schemas support ikatyang/tree-sitter-yaml#10
- tree-sitter-cli compatibility Menci/tree-sitter-wasm-prebuilt#2
- npm distributions tree-sitter/tree-sitter#740