mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(yaml): capture "boolean strings" (#7512)
See for example: https://www.bram.us/2022/01/11/yaml-the-norway-problem/ values based on: https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.truthy Parser targets YAML 1.2, which has stricter promotions.
This commit is contained in:
parent
c32b59a8fd
commit
36bbf51842
1 changed files with 17 additions and 0 deletions
|
|
@ -80,3 +80,20 @@
|
|||
"---"
|
||||
"..."
|
||||
] @punctuation.special
|
||||
|
||||
; help deal with for yaml's norway problem https://www.bram.us/2022/01/11/yaml-the-norway-problem/
|
||||
; only using `true` and `false`, since Treesitter parser targets YAML spec 1.2 https://github.com/nvim-treesitter/nvim-treesitter/pull/7512#issuecomment-2565397302
|
||||
(block_mapping_pair
|
||||
value: (block_node
|
||||
(block_sequence
|
||||
(block_sequence_item
|
||||
(flow_node
|
||||
(plain_scalar
|
||||
(string_scalar) @boolean
|
||||
(#any-of? @boolean "TRUE" "FALSE" "True" "False")))))))
|
||||
|
||||
(block_mapping_pair
|
||||
value: (flow_node
|
||||
(plain_scalar
|
||||
(string_scalar) @boolean
|
||||
(#any-of? @boolean "TRUE" "FALSE" "True" "False"))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue