ts-wasms 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/out/bash/tree-sitter-bash.wasm +0 -0
- package/out/c/tree-sitter-c.wasm +0 -0
- package/out/c-sharp/tree-sitter-c_sharp.wasm +0 -0
- package/out/clojure/highlights.scm +29 -0
- package/out/clojure/tree-sitter-clojure.wasm +0 -0
- package/out/clojurescript/highlights.scm +29 -0
- package/out/clojurescript/tree-sitter-clojure.wasm +0 -0
- package/out/commonlisp/tags.scm +122 -0
- package/out/commonlisp/tree-sitter-commonlisp.wasm +0 -0
- package/out/cpp/tree-sitter-cpp.wasm +0 -0
- package/out/css/tree-sitter-css.wasm +0 -0
- package/out/dart/tree-sitter-dart.wasm +0 -0
- package/out/elisp/tree-sitter-elisp.wasm +0 -0
- package/out/elixir/tree-sitter-elixir.wasm +0 -0
- package/out/elm/highlights.scm +76 -0
- package/out/elm/injections.scm +4 -0
- package/out/elm/locals.scm +15 -0
- package/out/elm/tags.scm +19 -0
- package/out/elm/tree-sitter-elm.wasm +0 -0
- package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
- package/out/erlang/highlights.scm +230 -0
- package/out/erlang/tree-sitter-erlang.wasm +0 -0
- package/out/go/tree-sitter-go.wasm +0 -0
- package/out/graphql/tree-sitter-graphql.wasm +0 -0
- package/out/haskell/tree-sitter-haskell.wasm +0 -0
- package/out/html/tree-sitter-html.wasm +0 -0
- package/out/java/tree-sitter-java.wasm +0 -0
- package/out/javascript/tree-sitter-javascript.wasm +0 -0
- package/out/json/tree-sitter-json.wasm +0 -0
- package/out/julia/highlights.scm +375 -0
- package/out/julia/injections.scm +42 -0
- package/out/julia/locals.scm +71 -0
- package/out/julia/tree-sitter-julia.wasm +0 -0
- package/out/kotlin/tree-sitter-kotlin.wasm +0 -0
- package/out/lua/highlights.scm +201 -0
- package/out/lua/injections.scm +12 -0
- package/out/lua/locals.scm +32 -0
- package/out/lua/tags.scm +36 -0
- package/out/lua/tree-sitter-lua.wasm +0 -0
- package/out/markdown-tree-sitter-markdown/highlights.scm +52 -0
- package/out/markdown-tree-sitter-markdown/injections.scm +12 -0
- package/out/markdown-tree-sitter-markdown/tree-sitter-markdown.wasm +0 -0
- package/out/markdown-tree-sitter-markdown-inline/highlights.scm +37 -0
- package/out/markdown-tree-sitter-markdown-inline/injections.scm +2 -0
- package/out/markdown-tree-sitter-markdown-inline/tree-sitter-markdown_inline.wasm +0 -0
- package/out/objc/tree-sitter-objc.wasm +0 -0
- package/out/php/highlights.scm +203 -0
- package/out/php/injections-text.scm +3 -0
- package/out/php/injections.scm +10 -0
- package/out/php/tags.scm +40 -0
- package/out/php/tree-sitter-php.wasm +0 -0
- package/out/php-php_only/highlights.scm +203 -0
- package/out/php-php_only/injections-text.scm +3 -0
- package/out/php-php_only/injections.scm +10 -0
- package/out/php-php_only/tags.scm +40 -0
- package/out/{php_only → php-php_only}/tree-sitter-php_only.wasm +0 -0
- package/out/prisma/highlights.scm +39 -0
- package/out/prisma/tree-sitter-prisma.wasm +0 -0
- package/out/python/tree-sitter-python.wasm +0 -0
- package/out/query/tree-sitter-query.wasm +0 -0
- package/out/r/highlights.scm +112 -0
- package/out/r/locals.scm +18 -0
- package/out/r/tags.scm +21 -0
- package/out/r/tree-sitter-r.wasm +0 -0
- package/out/racket/highlights.scm +108 -0
- package/out/racket/locals.scm +34 -0
- package/out/racket/tags.scm +12 -0
- package/out/racket/tree-sitter-racket.wasm +0 -0
- package/out/regex/tree-sitter-regex.wasm +0 -0
- package/out/ruby/tree-sitter-ruby.wasm +0 -0
- package/out/rust/tree-sitter-rust.wasm +0 -0
- package/out/scala/tree-sitter-scala.wasm +0 -0
- package/out/scheme/highlights.scm +84 -0
- package/out/scheme/tree-sitter-scheme.wasm +0 -0
- package/out/sql/tree-sitter-SQL.wasm +0 -0
- package/out/swift/tree-sitter-swift.wasm +0 -0
- package/out/toml/highlights.scm +53 -0
- package/out/toml/tree-sitter-toml.wasm +0 -0
- package/out/typescript/highlights.scm +35 -0
- package/out/typescript/locals.scm +2 -0
- package/out/typescript/tags.scm +23 -0
- package/out/typescript/tree-sitter-typescript.wasm +0 -0
- package/out/typescript-tsx/highlights.scm +35 -0
- package/out/typescript-tsx/locals.scm +2 -0
- package/out/typescript-tsx/tags.scm +23 -0
- package/out/{tsx → typescript-tsx}/tree-sitter-tsx.wasm +0 -0
- package/out/vimdoc/tree-sitter-vimdoc.wasm +0 -0
- package/out/vue/tree-sitter-vue.wasm +0 -0
- package/out/xml/tree-sitter-xml.wasm +0 -0
- package/out/xml-dtd/tree-sitter-dtd.wasm +0 -0
- package/out/yaml/tree-sitter-yaml.wasm +0 -0
- package/out/zig/folds.scm +23 -0
- package/out/zig/highlights.scm +291 -0
- package/out/zig/indents.scm +22 -0
- package/out/zig/injections.scm +10 -0
- package/out/zig/tree-sitter-zig.wasm +0 -0
- package/package.json +76 -63
- package/README +0 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
; Scopes
|
|
2
|
+
[
|
|
3
|
+
(chunk)
|
|
4
|
+
(do_statement)
|
|
5
|
+
(while_statement)
|
|
6
|
+
(repeat_statement)
|
|
7
|
+
(if_statement)
|
|
8
|
+
(for_statement)
|
|
9
|
+
(function_declaration)
|
|
10
|
+
(function_definition)
|
|
11
|
+
] @local.scope
|
|
12
|
+
|
|
13
|
+
; Definitions
|
|
14
|
+
(assignment_statement
|
|
15
|
+
(variable_list
|
|
16
|
+
(identifier) @local.definition))
|
|
17
|
+
|
|
18
|
+
(function_declaration
|
|
19
|
+
name: (identifier) @local.definition)
|
|
20
|
+
|
|
21
|
+
(for_generic_clause
|
|
22
|
+
(variable_list
|
|
23
|
+
(identifier) @local.definition))
|
|
24
|
+
|
|
25
|
+
(for_numeric_clause
|
|
26
|
+
name: (identifier) @local.definition)
|
|
27
|
+
|
|
28
|
+
(parameters
|
|
29
|
+
(identifier) @local.definition)
|
|
30
|
+
|
|
31
|
+
; References
|
|
32
|
+
(identifier) @local.reference
|
package/out/lua/tags.scm
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
(function_declaration
|
|
2
|
+
name: [
|
|
3
|
+
(identifier) @name
|
|
4
|
+
(dot_index_expression
|
|
5
|
+
field: (identifier) @name)
|
|
6
|
+
]) @definition.function
|
|
7
|
+
|
|
8
|
+
(function_declaration
|
|
9
|
+
name: (method_index_expression
|
|
10
|
+
method: (identifier) @name)) @definition.method
|
|
11
|
+
|
|
12
|
+
(assignment_statement
|
|
13
|
+
(variable_list
|
|
14
|
+
.
|
|
15
|
+
name: [
|
|
16
|
+
(identifier) @name
|
|
17
|
+
(dot_index_expression
|
|
18
|
+
field: (identifier) @name)
|
|
19
|
+
])
|
|
20
|
+
(expression_list
|
|
21
|
+
.
|
|
22
|
+
value: (function_definition))) @definition.function
|
|
23
|
+
|
|
24
|
+
(table_constructor
|
|
25
|
+
(field
|
|
26
|
+
name: (identifier) @name
|
|
27
|
+
value: (function_definition))) @definition.function
|
|
28
|
+
|
|
29
|
+
(function_call
|
|
30
|
+
name: [
|
|
31
|
+
(identifier) @name
|
|
32
|
+
(dot_index_expression
|
|
33
|
+
field: (identifier) @name)
|
|
34
|
+
(method_index_expression
|
|
35
|
+
method: (identifier) @name)
|
|
36
|
+
]) @reference.call
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
;From nvim-treesitter/nvim-treesitter
|
|
2
|
+
(atx_heading (inline) @text.title)
|
|
3
|
+
(setext_heading (paragraph) @text.title)
|
|
4
|
+
|
|
5
|
+
[
|
|
6
|
+
(atx_h1_marker)
|
|
7
|
+
(atx_h2_marker)
|
|
8
|
+
(atx_h3_marker)
|
|
9
|
+
(atx_h4_marker)
|
|
10
|
+
(atx_h5_marker)
|
|
11
|
+
(atx_h6_marker)
|
|
12
|
+
(setext_h1_underline)
|
|
13
|
+
(setext_h2_underline)
|
|
14
|
+
] @punctuation.special
|
|
15
|
+
|
|
16
|
+
[
|
|
17
|
+
(link_title)
|
|
18
|
+
(indented_code_block)
|
|
19
|
+
(fenced_code_block)
|
|
20
|
+
] @text.literal
|
|
21
|
+
|
|
22
|
+
[
|
|
23
|
+
(fenced_code_block_delimiter)
|
|
24
|
+
] @punctuation.delimiter
|
|
25
|
+
|
|
26
|
+
(code_fence_content) @none
|
|
27
|
+
|
|
28
|
+
[
|
|
29
|
+
(link_destination)
|
|
30
|
+
] @text.uri
|
|
31
|
+
|
|
32
|
+
[
|
|
33
|
+
(link_label)
|
|
34
|
+
] @text.reference
|
|
35
|
+
|
|
36
|
+
[
|
|
37
|
+
(list_marker_plus)
|
|
38
|
+
(list_marker_minus)
|
|
39
|
+
(list_marker_star)
|
|
40
|
+
(list_marker_dot)
|
|
41
|
+
(list_marker_parenthesis)
|
|
42
|
+
(thematic_break)
|
|
43
|
+
] @punctuation.special
|
|
44
|
+
|
|
45
|
+
[
|
|
46
|
+
(block_continuation)
|
|
47
|
+
(block_quote_marker)
|
|
48
|
+
] @punctuation.special
|
|
49
|
+
|
|
50
|
+
[
|
|
51
|
+
(backslash_escape)
|
|
52
|
+
] @string.escape
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(fenced_code_block
|
|
2
|
+
(info_string
|
|
3
|
+
(language) @injection.language)
|
|
4
|
+
(code_fence_content) @injection.content)
|
|
5
|
+
|
|
6
|
+
((html_block) @injection.content (#set! injection.language "html"))
|
|
7
|
+
|
|
8
|
+
(document . (section . (thematic_break) (_) @injection.content (thematic_break)) (#set! injection.language "yaml"))
|
|
9
|
+
|
|
10
|
+
([(minus_metadata) (plus_metadata)] @injection.content (#set! injection.language "yml"))
|
|
11
|
+
|
|
12
|
+
((inline) @injection.content (#set! injection.language "markdown_inline"))
|
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
;; From nvim-treesitter/nvim-treesitter
|
|
2
|
+
[
|
|
3
|
+
(code_span)
|
|
4
|
+
(link_title)
|
|
5
|
+
] @text.literal
|
|
6
|
+
|
|
7
|
+
[
|
|
8
|
+
(emphasis_delimiter)
|
|
9
|
+
(code_span_delimiter)
|
|
10
|
+
] @punctuation.delimiter
|
|
11
|
+
|
|
12
|
+
(emphasis) @text.emphasis
|
|
13
|
+
|
|
14
|
+
(strong_emphasis) @text.strong
|
|
15
|
+
|
|
16
|
+
[
|
|
17
|
+
(link_destination)
|
|
18
|
+
(uri_autolink)
|
|
19
|
+
] @text.uri
|
|
20
|
+
|
|
21
|
+
[
|
|
22
|
+
(link_label)
|
|
23
|
+
(link_text)
|
|
24
|
+
(image_description)
|
|
25
|
+
] @text.reference
|
|
26
|
+
|
|
27
|
+
[
|
|
28
|
+
(backslash_escape)
|
|
29
|
+
(hard_line_break)
|
|
30
|
+
] @string.escape
|
|
31
|
+
|
|
32
|
+
(image ["!" "[" "]" "(" ")"] @punctuation.delimiter)
|
|
33
|
+
(inline_link ["[" "]" "(" ")"] @punctuation.delimiter)
|
|
34
|
+
(shortcut_link ["[" "]"] @punctuation.delimiter)
|
|
35
|
+
|
|
36
|
+
; NOTE: extension not enabled by default
|
|
37
|
+
; (wiki_link ["[" "|" "]"] @punctuation.delimiter)
|
|
File without changes
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
[
|
|
2
|
+
(php_tag)
|
|
3
|
+
(php_end_tag)
|
|
4
|
+
] @tag
|
|
5
|
+
|
|
6
|
+
; Keywords
|
|
7
|
+
|
|
8
|
+
[
|
|
9
|
+
"and"
|
|
10
|
+
"as"
|
|
11
|
+
"break"
|
|
12
|
+
"case"
|
|
13
|
+
"catch"
|
|
14
|
+
"class"
|
|
15
|
+
"clone"
|
|
16
|
+
"const"
|
|
17
|
+
"continue"
|
|
18
|
+
"declare"
|
|
19
|
+
"default"
|
|
20
|
+
"do"
|
|
21
|
+
"echo"
|
|
22
|
+
"else"
|
|
23
|
+
"elseif"
|
|
24
|
+
"enddeclare"
|
|
25
|
+
"endfor"
|
|
26
|
+
"endforeach"
|
|
27
|
+
"endif"
|
|
28
|
+
"endswitch"
|
|
29
|
+
"endwhile"
|
|
30
|
+
"enum"
|
|
31
|
+
"exit"
|
|
32
|
+
"extends"
|
|
33
|
+
"finally"
|
|
34
|
+
"fn"
|
|
35
|
+
"for"
|
|
36
|
+
"foreach"
|
|
37
|
+
"function"
|
|
38
|
+
"global"
|
|
39
|
+
"goto"
|
|
40
|
+
"if"
|
|
41
|
+
"implements"
|
|
42
|
+
"include"
|
|
43
|
+
"include_once"
|
|
44
|
+
"instanceof"
|
|
45
|
+
"insteadof"
|
|
46
|
+
"interface"
|
|
47
|
+
"match"
|
|
48
|
+
"namespace"
|
|
49
|
+
"new"
|
|
50
|
+
"or"
|
|
51
|
+
"print"
|
|
52
|
+
"require"
|
|
53
|
+
"require_once"
|
|
54
|
+
"return"
|
|
55
|
+
"switch"
|
|
56
|
+
"throw"
|
|
57
|
+
"trait"
|
|
58
|
+
"try"
|
|
59
|
+
"use"
|
|
60
|
+
"while"
|
|
61
|
+
"xor"
|
|
62
|
+
"yield"
|
|
63
|
+
"yield from"
|
|
64
|
+
(abstract_modifier)
|
|
65
|
+
(final_modifier)
|
|
66
|
+
(readonly_modifier)
|
|
67
|
+
(static_modifier)
|
|
68
|
+
(visibility_modifier)
|
|
69
|
+
] @keyword
|
|
70
|
+
|
|
71
|
+
(function_static_declaration "static" @keyword)
|
|
72
|
+
|
|
73
|
+
; Namespace
|
|
74
|
+
|
|
75
|
+
(namespace_definition
|
|
76
|
+
name: (namespace_name
|
|
77
|
+
(name) @module))
|
|
78
|
+
|
|
79
|
+
(namespace_name
|
|
80
|
+
(name) @module)
|
|
81
|
+
|
|
82
|
+
(namespace_use_clause
|
|
83
|
+
[
|
|
84
|
+
(name) @type
|
|
85
|
+
(qualified_name
|
|
86
|
+
(name) @type)
|
|
87
|
+
alias: (name) @type
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
(namespace_use_clause
|
|
91
|
+
type: "function"
|
|
92
|
+
[
|
|
93
|
+
(name) @function
|
|
94
|
+
(qualified_name
|
|
95
|
+
(name) @function)
|
|
96
|
+
alias: (name) @function
|
|
97
|
+
])
|
|
98
|
+
|
|
99
|
+
(namespace_use_clause
|
|
100
|
+
type: "const"
|
|
101
|
+
[
|
|
102
|
+
(name) @constant
|
|
103
|
+
(qualified_name
|
|
104
|
+
(name) @constant)
|
|
105
|
+
alias: (name) @constant
|
|
106
|
+
])
|
|
107
|
+
|
|
108
|
+
(relative_name "namespace" @module.builtin)
|
|
109
|
+
|
|
110
|
+
; Variables
|
|
111
|
+
|
|
112
|
+
(relative_scope) @variable.builtin
|
|
113
|
+
|
|
114
|
+
(variable_name) @variable
|
|
115
|
+
|
|
116
|
+
(method_declaration name: (name) @constructor
|
|
117
|
+
(#eq? @constructor "__construct"))
|
|
118
|
+
|
|
119
|
+
(object_creation_expression [
|
|
120
|
+
(name) @constructor
|
|
121
|
+
(qualified_name (name) @constructor)
|
|
122
|
+
(relative_name (name) @constructor)
|
|
123
|
+
])
|
|
124
|
+
|
|
125
|
+
((name) @constant
|
|
126
|
+
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
|
|
127
|
+
((name) @constant.builtin
|
|
128
|
+
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
|
|
129
|
+
(const_declaration (const_element (name) @constant))
|
|
130
|
+
|
|
131
|
+
; Types
|
|
132
|
+
|
|
133
|
+
(primitive_type) @type.builtin
|
|
134
|
+
(cast_type) @type.builtin
|
|
135
|
+
(named_type [
|
|
136
|
+
(name) @type
|
|
137
|
+
(qualified_name (name) @type)
|
|
138
|
+
(relative_name (name) @type)
|
|
139
|
+
]) @type
|
|
140
|
+
(named_type (name) @type.builtin
|
|
141
|
+
(#any-of? @type.builtin "static" "self"))
|
|
142
|
+
|
|
143
|
+
(scoped_call_expression
|
|
144
|
+
scope: [
|
|
145
|
+
(name) @type
|
|
146
|
+
(qualified_name (name) @type)
|
|
147
|
+
(relative_name (name) @type)
|
|
148
|
+
])
|
|
149
|
+
|
|
150
|
+
; Functions
|
|
151
|
+
|
|
152
|
+
(array_creation_expression "array" @function.builtin)
|
|
153
|
+
(list_literal "list" @function.builtin)
|
|
154
|
+
(exit_statement "exit" @function.builtin "(")
|
|
155
|
+
|
|
156
|
+
(method_declaration
|
|
157
|
+
name: (name) @function.method)
|
|
158
|
+
|
|
159
|
+
(function_call_expression
|
|
160
|
+
function: [
|
|
161
|
+
(qualified_name (name))
|
|
162
|
+
(relative_name (name))
|
|
163
|
+
(name)
|
|
164
|
+
] @function)
|
|
165
|
+
|
|
166
|
+
(scoped_call_expression
|
|
167
|
+
name: (name) @function)
|
|
168
|
+
|
|
169
|
+
(member_call_expression
|
|
170
|
+
name: (name) @function.method)
|
|
171
|
+
|
|
172
|
+
(function_definition
|
|
173
|
+
name: (name) @function)
|
|
174
|
+
|
|
175
|
+
; Member
|
|
176
|
+
|
|
177
|
+
(property_element
|
|
178
|
+
(variable_name) @property)
|
|
179
|
+
|
|
180
|
+
(member_access_expression
|
|
181
|
+
name: (variable_name (name)) @property)
|
|
182
|
+
(member_access_expression
|
|
183
|
+
name: (name) @property)
|
|
184
|
+
|
|
185
|
+
; Basic tokens
|
|
186
|
+
[
|
|
187
|
+
(string)
|
|
188
|
+
(string_content)
|
|
189
|
+
(encapsed_string)
|
|
190
|
+
(heredoc)
|
|
191
|
+
(heredoc_body)
|
|
192
|
+
(nowdoc_body)
|
|
193
|
+
] @string
|
|
194
|
+
(boolean) @constant.builtin
|
|
195
|
+
(null) @constant.builtin
|
|
196
|
+
(integer) @number
|
|
197
|
+
(float) @number
|
|
198
|
+
(comment) @comment
|
|
199
|
+
|
|
200
|
+
((name) @variable.builtin
|
|
201
|
+
(#eq? @variable.builtin "this"))
|
|
202
|
+
|
|
203
|
+
"$" @operator
|
package/out/php/tags.scm
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
(namespace_definition
|
|
2
|
+
name: (namespace_name) @name) @definition.module
|
|
3
|
+
|
|
4
|
+
(interface_declaration
|
|
5
|
+
name: (name) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(trait_declaration
|
|
8
|
+
name: (name) @name) @definition.interface
|
|
9
|
+
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (name) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(class_interface_clause [(name) (qualified_name)] @name) @reference.implementation
|
|
14
|
+
|
|
15
|
+
(property_declaration
|
|
16
|
+
(property_element (variable_name (name) @name))) @definition.field
|
|
17
|
+
|
|
18
|
+
(function_definition
|
|
19
|
+
name: (name) @name) @definition.function
|
|
20
|
+
|
|
21
|
+
(method_declaration
|
|
22
|
+
name: (name) @name) @definition.function
|
|
23
|
+
|
|
24
|
+
(object_creation_expression
|
|
25
|
+
[
|
|
26
|
+
(qualified_name (name) @name)
|
|
27
|
+
(variable_name (name) @name)
|
|
28
|
+
]) @reference.class
|
|
29
|
+
|
|
30
|
+
(function_call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(qualified_name (name) @name)
|
|
33
|
+
(variable_name (name)) @name
|
|
34
|
+
]) @reference.call
|
|
35
|
+
|
|
36
|
+
(scoped_call_expression
|
|
37
|
+
name: (name) @name) @reference.call
|
|
38
|
+
|
|
39
|
+
(member_call_expression
|
|
40
|
+
name: (name) @name) @reference.call
|
|
File without changes
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
[
|
|
2
|
+
(php_tag)
|
|
3
|
+
(php_end_tag)
|
|
4
|
+
] @tag
|
|
5
|
+
|
|
6
|
+
; Keywords
|
|
7
|
+
|
|
8
|
+
[
|
|
9
|
+
"and"
|
|
10
|
+
"as"
|
|
11
|
+
"break"
|
|
12
|
+
"case"
|
|
13
|
+
"catch"
|
|
14
|
+
"class"
|
|
15
|
+
"clone"
|
|
16
|
+
"const"
|
|
17
|
+
"continue"
|
|
18
|
+
"declare"
|
|
19
|
+
"default"
|
|
20
|
+
"do"
|
|
21
|
+
"echo"
|
|
22
|
+
"else"
|
|
23
|
+
"elseif"
|
|
24
|
+
"enddeclare"
|
|
25
|
+
"endfor"
|
|
26
|
+
"endforeach"
|
|
27
|
+
"endif"
|
|
28
|
+
"endswitch"
|
|
29
|
+
"endwhile"
|
|
30
|
+
"enum"
|
|
31
|
+
"exit"
|
|
32
|
+
"extends"
|
|
33
|
+
"finally"
|
|
34
|
+
"fn"
|
|
35
|
+
"for"
|
|
36
|
+
"foreach"
|
|
37
|
+
"function"
|
|
38
|
+
"global"
|
|
39
|
+
"goto"
|
|
40
|
+
"if"
|
|
41
|
+
"implements"
|
|
42
|
+
"include"
|
|
43
|
+
"include_once"
|
|
44
|
+
"instanceof"
|
|
45
|
+
"insteadof"
|
|
46
|
+
"interface"
|
|
47
|
+
"match"
|
|
48
|
+
"namespace"
|
|
49
|
+
"new"
|
|
50
|
+
"or"
|
|
51
|
+
"print"
|
|
52
|
+
"require"
|
|
53
|
+
"require_once"
|
|
54
|
+
"return"
|
|
55
|
+
"switch"
|
|
56
|
+
"throw"
|
|
57
|
+
"trait"
|
|
58
|
+
"try"
|
|
59
|
+
"use"
|
|
60
|
+
"while"
|
|
61
|
+
"xor"
|
|
62
|
+
"yield"
|
|
63
|
+
"yield from"
|
|
64
|
+
(abstract_modifier)
|
|
65
|
+
(final_modifier)
|
|
66
|
+
(readonly_modifier)
|
|
67
|
+
(static_modifier)
|
|
68
|
+
(visibility_modifier)
|
|
69
|
+
] @keyword
|
|
70
|
+
|
|
71
|
+
(function_static_declaration "static" @keyword)
|
|
72
|
+
|
|
73
|
+
; Namespace
|
|
74
|
+
|
|
75
|
+
(namespace_definition
|
|
76
|
+
name: (namespace_name
|
|
77
|
+
(name) @module))
|
|
78
|
+
|
|
79
|
+
(namespace_name
|
|
80
|
+
(name) @module)
|
|
81
|
+
|
|
82
|
+
(namespace_use_clause
|
|
83
|
+
[
|
|
84
|
+
(name) @type
|
|
85
|
+
(qualified_name
|
|
86
|
+
(name) @type)
|
|
87
|
+
alias: (name) @type
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
(namespace_use_clause
|
|
91
|
+
type: "function"
|
|
92
|
+
[
|
|
93
|
+
(name) @function
|
|
94
|
+
(qualified_name
|
|
95
|
+
(name) @function)
|
|
96
|
+
alias: (name) @function
|
|
97
|
+
])
|
|
98
|
+
|
|
99
|
+
(namespace_use_clause
|
|
100
|
+
type: "const"
|
|
101
|
+
[
|
|
102
|
+
(name) @constant
|
|
103
|
+
(qualified_name
|
|
104
|
+
(name) @constant)
|
|
105
|
+
alias: (name) @constant
|
|
106
|
+
])
|
|
107
|
+
|
|
108
|
+
(relative_name "namespace" @module.builtin)
|
|
109
|
+
|
|
110
|
+
; Variables
|
|
111
|
+
|
|
112
|
+
(relative_scope) @variable.builtin
|
|
113
|
+
|
|
114
|
+
(variable_name) @variable
|
|
115
|
+
|
|
116
|
+
(method_declaration name: (name) @constructor
|
|
117
|
+
(#eq? @constructor "__construct"))
|
|
118
|
+
|
|
119
|
+
(object_creation_expression [
|
|
120
|
+
(name) @constructor
|
|
121
|
+
(qualified_name (name) @constructor)
|
|
122
|
+
(relative_name (name) @constructor)
|
|
123
|
+
])
|
|
124
|
+
|
|
125
|
+
((name) @constant
|
|
126
|
+
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
|
|
127
|
+
((name) @constant.builtin
|
|
128
|
+
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
|
|
129
|
+
(const_declaration (const_element (name) @constant))
|
|
130
|
+
|
|
131
|
+
; Types
|
|
132
|
+
|
|
133
|
+
(primitive_type) @type.builtin
|
|
134
|
+
(cast_type) @type.builtin
|
|
135
|
+
(named_type [
|
|
136
|
+
(name) @type
|
|
137
|
+
(qualified_name (name) @type)
|
|
138
|
+
(relative_name (name) @type)
|
|
139
|
+
]) @type
|
|
140
|
+
(named_type (name) @type.builtin
|
|
141
|
+
(#any-of? @type.builtin "static" "self"))
|
|
142
|
+
|
|
143
|
+
(scoped_call_expression
|
|
144
|
+
scope: [
|
|
145
|
+
(name) @type
|
|
146
|
+
(qualified_name (name) @type)
|
|
147
|
+
(relative_name (name) @type)
|
|
148
|
+
])
|
|
149
|
+
|
|
150
|
+
; Functions
|
|
151
|
+
|
|
152
|
+
(array_creation_expression "array" @function.builtin)
|
|
153
|
+
(list_literal "list" @function.builtin)
|
|
154
|
+
(exit_statement "exit" @function.builtin "(")
|
|
155
|
+
|
|
156
|
+
(method_declaration
|
|
157
|
+
name: (name) @function.method)
|
|
158
|
+
|
|
159
|
+
(function_call_expression
|
|
160
|
+
function: [
|
|
161
|
+
(qualified_name (name))
|
|
162
|
+
(relative_name (name))
|
|
163
|
+
(name)
|
|
164
|
+
] @function)
|
|
165
|
+
|
|
166
|
+
(scoped_call_expression
|
|
167
|
+
name: (name) @function)
|
|
168
|
+
|
|
169
|
+
(member_call_expression
|
|
170
|
+
name: (name) @function.method)
|
|
171
|
+
|
|
172
|
+
(function_definition
|
|
173
|
+
name: (name) @function)
|
|
174
|
+
|
|
175
|
+
; Member
|
|
176
|
+
|
|
177
|
+
(property_element
|
|
178
|
+
(variable_name) @property)
|
|
179
|
+
|
|
180
|
+
(member_access_expression
|
|
181
|
+
name: (variable_name (name)) @property)
|
|
182
|
+
(member_access_expression
|
|
183
|
+
name: (name) @property)
|
|
184
|
+
|
|
185
|
+
; Basic tokens
|
|
186
|
+
[
|
|
187
|
+
(string)
|
|
188
|
+
(string_content)
|
|
189
|
+
(encapsed_string)
|
|
190
|
+
(heredoc)
|
|
191
|
+
(heredoc_body)
|
|
192
|
+
(nowdoc_body)
|
|
193
|
+
] @string
|
|
194
|
+
(boolean) @constant.builtin
|
|
195
|
+
(null) @constant.builtin
|
|
196
|
+
(integer) @number
|
|
197
|
+
(float) @number
|
|
198
|
+
(comment) @comment
|
|
199
|
+
|
|
200
|
+
((name) @variable.builtin
|
|
201
|
+
(#eq? @variable.builtin "this"))
|
|
202
|
+
|
|
203
|
+
"$" @operator
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
(namespace_definition
|
|
2
|
+
name: (namespace_name) @name) @definition.module
|
|
3
|
+
|
|
4
|
+
(interface_declaration
|
|
5
|
+
name: (name) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(trait_declaration
|
|
8
|
+
name: (name) @name) @definition.interface
|
|
9
|
+
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (name) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(class_interface_clause [(name) (qualified_name)] @name) @reference.implementation
|
|
14
|
+
|
|
15
|
+
(property_declaration
|
|
16
|
+
(property_element (variable_name (name) @name))) @definition.field
|
|
17
|
+
|
|
18
|
+
(function_definition
|
|
19
|
+
name: (name) @name) @definition.function
|
|
20
|
+
|
|
21
|
+
(method_declaration
|
|
22
|
+
name: (name) @name) @definition.function
|
|
23
|
+
|
|
24
|
+
(object_creation_expression
|
|
25
|
+
[
|
|
26
|
+
(qualified_name (name) @name)
|
|
27
|
+
(variable_name (name) @name)
|
|
28
|
+
]) @reference.class
|
|
29
|
+
|
|
30
|
+
(function_call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(qualified_name (name) @name)
|
|
33
|
+
(variable_name (name)) @name
|
|
34
|
+
]) @reference.call
|
|
35
|
+
|
|
36
|
+
(scoped_call_expression
|
|
37
|
+
name: (name) @name) @reference.call
|
|
38
|
+
|
|
39
|
+
(member_call_expression
|
|
40
|
+
name: (name) @name) @reference.call
|
|
File without changes
|