on f37ffaa help sign in
208 lines 2.7 kB history raw
1; Special identifiers
2;--------------------
4([
5 (identifier)
6 (shorthand_property_identifier)
7 (shorthand_property_identifier_pattern)
8 ] @constant
9 (#match? @constant "^[A-Z_][A-Z\\d_]+$"))
12((identifier) @constructor
13 (#match? @constructor "^[A-Z]"))
15((identifier) @variable.builtin
16 (#match? @variable.builtin "^(arguments|module|console|window|document)$")
17 (#is-not? local))
19((identifier) @function.builtin
20 (#eq? @function.builtin "require")
21 (#is-not? local))
23; Function and method definitions
24;--------------------------------
26(function
27 name: (identifier) @function)
28(function_declaration
29 name: (identifier) @function)
30(method_definition
31 name: (property_identifier) @function.method)
33(pair
34 key: (property_identifier) @function.method
35 value: [(function) (arrow_function)])
37(assignment_expression
38 left: (member_expression
39 property: (property_identifier) @function.method)
40 right: [(function) (arrow_function)])
42(variable_declarator
43 name: (identifier) @function
44 value: [(function) (arrow_function)])
46(assignment_expression
47 left: (identifier) @function
48 right: [(function) (arrow_function)])
50; Function and method calls
51;--------------------------
53(call_expression
54 function: (identifier) @function)
56(call_expression
57 function: (member_expression
58 property: (property_identifier) @function.method))
60; Variables
61;----------
63(identifier) @variable
65; Properties
66;-----------
68(property_identifier) @variable.other.member
70; Literals
71;---------
73(this) @variable.builtin
74(super) @variable.builtin
77 (true)
78 (false)
79 (null)
80 (undefined)
81] @constant.builtin
83(comment) @comment
86 (string)
87 (template_string)
88] @string
90(regex) @string.regexp
91(number) @constant.numeric.integer
93; Tokens
94;-------
96(template_substitution
97 "${" @punctuation.special
98 "}" @punctuation.special) @embedded
101 ";"
102 "?."
103 "."
104 ","
105] @punctuation.delimiter
108 "-"
109 "--"
110 "-="
111 "+"
112 "++"
113 "+="
114 "*"
115 "*="
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 "^"
141 "&"
142 "|"
143 "^="
144 "&="
145 "|="
146 "&&"
147 "||"
148 "??"
149 "&&="
150 "||="
151 "??="
152] @operator
155 "("
156 ")"
157 "["
158 "]"
159 "{"
160 "}"
161] @punctuation.bracket
164 "as"
165 "async"
166 "class"
167 "const"
168 "debugger"
169 "delete"
170 "export"
171 "extends"
172 "from"
173 "function"
174 "get"
175 "import"
176 "in"
177 "instanceof"
178 "let"
179 "new"
180 "of"
181 "set"
182 "static"
183 "target"
184 "try"
185 "typeof"
186 "var"
187 "void"
188 "with"
189] @keyword
192 "switch"
193 "case"
194 "default"
195 "if"
196 "else"
197 "yield"
198 "throw"
199 "finally"
200 "return"
201 "catch"
202 "continue"
203 "while"
204 "break"
205 "for"
206 "do"
207 "await"
208] @keyword.control