Debian Codegraph @

runtime/queries/jq/highlights.scm

raw symbols SCIP
1 ;; From nvim-treesitter, contributed by @ObserverOfTime et al.
2
3 ; Variables
4 (variable) @variable
5
6 ((variable) @constant.builtin
7 (#eq? @constant.builtin "$ENV"))
8
9 ((variable) @constant.builtin
10 (#eq? @constant.builtin "$__loc__"))
11
12 ; Properties
13 (index
14 (identifier) @variable.other.member)
15
16 ; Labels
17 (query
18 label: (variable) @label)
19
20 (query
21 break_statement: (variable) @label)
22
23 ; Literals
24 (number) @constant.numeric
25
26 (string) @string
27
28 [
29 "true"
30 "false"
31 ] @constant.builtin.boolean
32
33 "null" @type.builtin
34
35 ; Interpolation
36 [
37 "\\("
38 ")"
39 ] @special
40
41 ; Format
42 (format) @attribute
43
44 ; Functions
45 (funcdef
46 (identifier) @function)
47
48 (funcdefargs
49 (identifier) @variable.parameter)
50
51 [
52 "reduce"
53 "foreach"
54 ] @function.builtin
55
56 ((funcname) @function
57 .
58 "(")
59
60 ; jq -n 'builtins | map(split("/")[0]) | unique | .[]'
61 ((funcname) @function.builtin
62 (#any-of? @function.builtin
63 "IN" "INDEX" "JOIN" "abs" "acos" "acosh" "add" "all" "any" "arrays" "ascii_downcase"
64 "ascii_upcase" "asin" "asinh" "atan" "atan2" "atanh" "booleans" "bsearch" "builtins" "capture"
65 "cbrt" "ceil" "combinations" "contains" "copysign" "cos" "cosh" "debug" "del" "delpaths" "drem"
66 "empty" "endswith" "env" "erf" "erfc" "error" "exp" "exp10" "exp2" "explode" "expm1" "fabs"
67 "fdim" "finites" "first" "flatten" "floor" "fma" "fmax" "fmin" "fmod" "format" "frexp"
68 "from_entries" "fromdate" "fromdateiso8601" "fromjson" "fromstream" "gamma" "get_jq_origin"
69 "get_prog_origin" "get_search_list" "getpath" "gmtime" "group_by" "gsub" "halt" "halt_error"
70 "has" "hypot" "implode" "in" "index" "indices" "infinite" "input" "input_filename"
71 "input_line_number" "inputs" "inside" "isempty" "isfinite" "isinfinite" "isnan" "isnormal"
72 "iterables" "j0" "j1" "jn" "join" "keys" "keys_unsorted" "last" "ldexp" "length" "lgamma"
73 "lgamma_r" "limit" "localtime" "log" "log10" "log1p" "log2" "logb" "ltrimstr" "map" "map_values"
74 "match" "max" "max_by" "min" "min_by" "mktime" "modf" "modulemeta" "nan" "nearbyint" "nextafter"
75 "nexttoward" "normals" "not" "now" "nth" "nulls" "numbers" "objects" "path" "paths" "pick" "pow"
76 "pow10" "range" "recurse" "remainder" "repeat" "reverse" "rindex" "rint" "round" "rtrimstr"
77 "scalars" "scalb" "scalbln" "scan" "select" "setpath" "significand" "sin" "sinh" "sort"
78 "sort_by" "split" "splits" "sqrt" "startswith" "stderr" "strflocaltime" "strftime" "strings"
79 "strptime" "sub" "tan" "tanh" "test" "tgamma" "to_entries" "todate" "todateiso8601" "tojson"
80 "tonumber" "tostream" "tostring" "transpose" "trunc" "truncate_stream" "type" "unique"
81 "unique_by" "until" "utf8bytelength" "values" "walk" "while" "with_entries" "y0" "y1" "yn"))
82
83 ; Keywords
84 [
85 "def"
86 "as"
87 "label"
88 "module"
89 "break"
90 ] @keyword
91
92 [
93 "import"
94 "include"
95 ] @keyword.control.import
96
97 [
98 "if"
99 "then"
100 "elif"
101 "else"
102 "end"
103 ] @keyword.control.conditional
104
105 [
106 "try"
107 "catch"
108 ] @keyword.control.exception
109
110 [
111 "or"
112 "and"
113 ] @keyword.operator
114
115 ; Operators
116 [
117 "."
118 "=="
119 "!="
120 ">"
121 ">="
122 "<="
123 "<"
124 "="
125 "+"
126 "-"
127 "*"
128 "/"
129 "%"
130 "+="
131 "-="
132 "*="
133 "/="
134 "%="
135 "//="
136 "|"
137 "?"
138 "//"
139 "?//"
140 (recurse) ; ".."
141 ] @operator
142
143 ; Punctuation
144 [
145 ";"
146 ","
147 ":"
148 ] @punctuation.delimiter
149
150 [
151 "["
152 "]"
153 "{"
154 "}"
155 "("
156 ")"
157 ] @punctuation.bracket
158
159 ; Comments
160 (comment) @comment.line