nvim-treesitter/queries/toon/highlights.scm
Danyiel Colin 79880d8d09 feat: add TOON parser support
Add tree-sitter grammar for TOON (Token-Oriented Object Notation),
a JSON-alternative data format with indentation-based structure.

- Add parser config in parsers.lua
- Add query files: highlights, folds, indents, locals

Parser repository: https://github.com/DanEscher98/tree-sitter-toon
TOON spec: https://github.com/toon-format/spec

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 02:06:36 -06:00

90 lines
1.4 KiB
Scheme

; highlights.scm - Syntax highlighting queries for TOON
; Maps grammar nodes to standard Neovim highlight capture groups
; Reference: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md
; Literals
; --------
(null) @constant.builtin
(true) @boolean
(false) @boolean
(number) @number
(integer) @number
; Strings
(quoted_string) @string
(unquoted_string) @string
(escape_sequence) @string.escape
; Properties/Keys
; ---------------
; Object keys
(pair
key: (key
(identifier) @property))
(pair
key: (key
(dotted_key
(identifier) @property)))
(pair
key: (key
(quoted_string) @property))
; Array declaration keys
(array_declaration
key: (key
(identifier) @property))
(array_declaration
key: (key
(dotted_key
(identifier) @property)))
; Field names in tabular arrays
(field_name
(identifier) @property)
(field_name
(quoted_string) @property)
; List item keys (objects as list items)
(list_item
key: (key
(identifier) @property))
; Punctuation
; -----------
; Delimiters
":" @punctuation.delimiter
"," @punctuation.delimiter
"|" @punctuation.delimiter
"." @punctuation.delimiter
(delimiter) @punctuation.delimiter
(field_delimiter) @punctuation.delimiter
(delimiter_marker) @punctuation.delimiter
; Brackets
"[" @punctuation.bracket
"]" @punctuation.bracket
"{" @punctuation.bracket
"}" @punctuation.bracket
; Special
"\"" @punctuation.special
(list_marker) @punctuation.special