Debian Codegraph @

runtime/queries/tera/highlights.scm

raw symbols SCIP
1 ; Variables
2 ;----------
3
4 (identifier) @variable
5
6 ((identifier) @variable.builtin
7 (#any-of? @variable.builtin
8 "loop"
9 "__tera_context"))
10
11 ; Properties
12 ;-----------
13
14 (member_expression
15 property: (identifier)? @variable.other.member)
16
17 ; Literals
18 ;-----------
19
20 (string) @string
21
22 (bool) @constant.builtin
23
24 (number) @constant.numeric
25
26 ; Tokens
27 ;-----------
28
29 [
30 "."
31 ","
32 ] @punctuation.delimiter
33
34 [
35 "*"
36 "/"
37 "%"
38 "|"
39 "+"
40 "-"
41 "~"
42 "="
43 "=="
44 "!="
45 "<"
46 ">"
47 "<="
48 ">="
49 ] @operator
50
51 [
52 "("
53 ")"
54 "["
55 "]"
56 "{%"
57 "%}"
58 "-%}"
59 "{%-"
60 "}}"
61 "{{"
62 "-}}"
63 "{{-"
64 "::"
65 ] @punctuation.bracket
66
67 ; Tags
68 ;-----------
69
70 (comment_tag) @comment
71
72 ; Keywords
73 ;-----------
74
75 [
76 "if"
77 "elif"
78 "else"
79 "endif"
80 ] @keyword.control.conditional
81
82 [
83 "for"
84 "endfor"
85 ] @keyword.control.repeat
86
87 [
88 "include"
89 "import"
90 "extends"
91 ] @keyword.control.import
92
93 [
94 "in"
95 "and"
96 "or"
97 "not"
98 "is"
99 ] @keyword.operator
100
101 [
102 "break"
103 "continue"
104 ] @keyword.control.return
105
106 [
107 "set"
108 "set_global"
109 "filter"
110 "endfilter"
111 "block"
112 "endblock"
113 "macro"
114 "endmacro"
115 "raw"
116 "endraw"
117 "as"
118 ] @keyword
119
120 ; Functions
121 ;-----------
122
123 (macro_statement
124 name: (identifier) @function
125 (parameter_list
126 parameter: (identifier) @variable.parameter
127 (optional_parameter
128 name: (identifier) @variable.parameter)))
129
130 (call_expression
131 scope: (identifier)? @namespace
132 name: (identifier) @function)
133
134 (call_expression
135 name: (identifier) @function.builtin
136 (#any-of? @function.builtin
137 ; Functions - https://keats.github.io/tera/docs/#built-in-functions
138 "range"
139 "now"
140 "throw"
141 "get_random"
142 "get_env"))
143
144 (test_expression
145 test: (identifier) @function)
146
147 (test_expression
148 test: (identifier) @function.builtin
149 (#any-of? @function.builtin
150 ; Tests - https://keats.github.io/tera/docs/#built-in-tests
151 "defined"
152 "undefined"
153 "odd"
154 "even"
155 "string"
156 "number"
157 "divisibleby"
158 "iterable"
159 "object"
160 "starting_with"
161 "ending_with"
162 "containing"
163 "matching"))
164
165 (filter_expression
166 filter: (identifier) @function.method)
167
168 (filter_expression
169 filter: (identifier) @function.builtin
170 (#any-of? @function.builtin
171 ; Filters - https://keats.github.io/tera/docs/#built-in-filters
172 "lower"
173 "upper"
174 "wordcount"
175 "capitalize"
176 "replace"
177 "addslashes"
178 "slugify"
179 "title"
180 "trim"
181 "trim_start"
182 "trim_end"
183 "trim_start_matches"
184 "trim_end_matches"
185 "truncate"
186 "linebreaksbr"
187 "spaceless"
188 "indent"
189 "striptags"
190 "first"
191 "last"
192 "nth"
193 "join"
194 "length"
195 "reverse"
196 "sort"
197 "unique"
198 "slice"
199 "group_by"
200 "filter"
201 "map"
202 "concat"
203 "urlencode"
204 "urlencode_strict"
205 "abs"
206 "pluralize"
207 "round"
208 "filesizeformat"
209 "date"
210 "escape"
211 "escape_xml"
212 "safe"
213 "get"
214 "split"
215 "int"
216 "float"
217 "json_encode"
218 "as_str"
219 "default"))
220
221 ; Namespaces
222 ;-----------
223
224 (import_statement
225 scope: (identifier) @namespace)