ikatyang / tree-sitter-yaml

YAML grammar for tree-sitter
https://ikatyang.github.io/tree-sitter-yaml/
MIT License
94 stars 38 forks source link

Incorrect parsing of flow sequence entry which is a mapping with a single key/value pair #34

Open char0n opened 2 years ago

char0n commented 2 years ago

YAML fragment:

[key: value]

CST: image

We can clearly see that the flow_mapping node is missing from the CST. Section 7.4.1 of YAML 1.2.2 specification contains explicit direction about how to handle cases like these.

Block style of this syntax parses correctly:

YAML fragment:

- key: value

CST: image