@@ -1,66 +1,107 @@
1(ERROR) @error
3(ERROR) @error
3−(line_comment) @comment
5+; Comments
5−; keywords and symbols
7+(comment) @comment
7−(keyword) @keyword
9+; Operators
12−(bool_literal) @constant.builtin.boolean
31+(ternary_expression
13−(num_literal) @constant.numeric
32+ ["?" ":"] @operator)
15−; strings
34+; Punctuation
16−(string_interpolation
35+
17− (string_interpolation_start) @punctuation.special
36+[ ":" "." "," ] @punctuation.delimiter
18− (string_interpolation_end) @punctuation.special)
37+
38+[ "{" "}" "[" "]" "(" ")" ] @punctuation.bracket
42+(number (float)) @constant.numeric.float
44+(number (integer)) @constant.numeric.integer
46+(boolean) @constant.builtin.boolean
20(escape_sequence) @constant.character.escape
50(escape_sequence) @constant.character.escape
22−(string
52+(string_interpolation
23− [
53+ "${" @punctuation.special
24− (unescaped_single_quote_string_fragment)
54+ "}" @punctuation.special)
25− (unescaped_double_quote_string_fragment)
26− (unescaped_backtick_string_fragment)
32−; operators and general punctuation
56+[ (string_fragment) "\"" "'" "`" ] @string
34−(unary_expression
58+; Attributes & Fields
35− operator: _ @operator)
37−(binary_expression
60+(keyword) @attribute
38− operator: _ @operator)
40−(ternary_expression
62+; Functions
41− operator: _ @operator)
44− ":"
65+ name: (ident) @function)
47−] @punctuation.delimiter
56−] @punctuation.bracket
61−] @punctuation.delimiter
63−; Rest (general identifiers that are not yet catched)
69+(ident) @variable
77+ ((symbol) @tag.builtin
78+ (#match? @tag.builtin "^(box|button|calendar|centerbox|checkbox|circular-progress|color-button|color-chooser|combo-box-text|eventbox|expander|graph|image|input|label|literal|overlay|progress|revealer|scale|scroll|transform)$")))
82+; I think there's a bug in tree-sitter the anchor doesn't seem to be working, see
83+; https://github.com/tree-sitter/tree-sitter/pull/2107
86+ (#match? @keyword "^(defwindow|defwidget|defvar|defpoll|deflisten|geometry|children|struts)$")))
89+ ((symbol) @keyword.control.import
90+ (#eq? @keyword.control.import "include")))
94+(loop_widget . "for" @keyword.control.repeat . (symbol) @variable . "in" @keyword.operator . (symbol) @variable)
96+(loop_widget . "for" @keyword.control.repeat . (symbol) @variable . "in" @keyword.operator)
100+; TODO apply to every symbol in list? I think it should probably only be applied to the first child of the list
104+; Other stuff that has not been catched by the previous queries yet
66(ident) @variable
106(ident) @variable