mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 16:00:02 -04:00
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>
90 lines
1.4 KiB
Scheme
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
|