ts-wasms 1.0.2 → 1.0.4
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/hcl/tree-sitter-hcl.wasm +0 -0
- package/out/hcl-terraform/tree-sitter-terraform.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/highlights.scm +52 -0
- package/out/markdown/injections.scm +12 -0
- package/out/markdown/tree-sitter-markdown.wasm +0 -0
- package/out/markdown-inline/highlights.scm +37 -0
- package/out/markdown-inline/injections.scm +2 -0
- package/out/markdown-inline/tree-sitter-markdown_inline.wasm +0 -0
- package/out/nix/highlights.scm +99 -0
- package/out/nix/injections.scm +39 -0
- package/out/nix/locals.scm +33 -0
- package/out/nix/tags.scm +16 -0
- package/out/nix/tree-sitter-nix.wasm +0 -0
- package/out/objc/tree-sitter-objc.wasm +0 -0
- package/out/ocaml/highlights.scm +148 -0
- package/out/ocaml/locals.scm +24 -0
- package/out/ocaml/tags.scm +170 -0
- package/out/ocaml/tree-sitter-ocaml.wasm +0 -0
- package/out/ocaml-interface/highlights.scm +148 -0
- package/out/ocaml-interface/locals.scm +24 -0
- package/out/ocaml-interface/tags.scm +170 -0
- package/out/ocaml-interface/tree-sitter-ocaml_interface.wasm +0 -0
- package/out/ocaml-type/highlights.scm +148 -0
- package/out/ocaml-type/locals.scm +24 -0
- package/out/ocaml-type/tags.scm +170 -0
- package/out/ocaml-type/tree-sitter-ocaml_type.wasm +0 -0
- package/out/perl/folds.scm +27 -0
- package/out/perl/highlights.scm +162 -0
- package/out/perl/injections.scm +14 -0
- package/out/perl/matchup.scm +30 -0
- package/out/perl/tree-sitter-perl.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-only/highlights.scm +203 -0
- package/out/php-only/injections-text.scm +3 -0
- package/out/php-only/injections.scm +10 -0
- package/out/php-only/tags.scm +40 -0
- package/out/{php_only → 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/scss/highlights.scm +69 -0
- package/out/scss/tree-sitter-scss.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 +79 -63
- package/README +0 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
; Modules
|
|
2
|
+
;--------
|
|
3
|
+
|
|
4
|
+
(
|
|
5
|
+
(comment)? @doc .
|
|
6
|
+
(module_definition
|
|
7
|
+
(module_binding (module_name) @name) @definition.module
|
|
8
|
+
)
|
|
9
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
(module_path (module_name) @name) @reference.module
|
|
13
|
+
(extended_module_path (module_name) @name) @reference.module
|
|
14
|
+
|
|
15
|
+
(
|
|
16
|
+
(comment)? @doc .
|
|
17
|
+
(module_type_definition (module_type_name) @name) @definition.interface
|
|
18
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
(module_type_path (module_type_name) @name) @reference.implementation
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
; Classes
|
|
25
|
+
;--------
|
|
26
|
+
|
|
27
|
+
(
|
|
28
|
+
(comment)? @doc .
|
|
29
|
+
[
|
|
30
|
+
(class_definition
|
|
31
|
+
(class_binding (class_name) @name) @definition.class
|
|
32
|
+
)
|
|
33
|
+
(class_type_definition
|
|
34
|
+
(class_type_binding (class_type_name) @name) @definition.class
|
|
35
|
+
)
|
|
36
|
+
]
|
|
37
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
[
|
|
41
|
+
(class_path (class_name) @name)
|
|
42
|
+
(class_type_path (class_type_name) @name)
|
|
43
|
+
] @reference.class
|
|
44
|
+
|
|
45
|
+
(
|
|
46
|
+
(comment)? @doc .
|
|
47
|
+
(method_definition (method_name) @name) @definition.method
|
|
48
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
(method_invocation (method_name) @name) @reference.call
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
; Types
|
|
55
|
+
;------
|
|
56
|
+
|
|
57
|
+
(
|
|
58
|
+
(comment)? @doc .
|
|
59
|
+
(type_definition
|
|
60
|
+
(type_binding
|
|
61
|
+
name: [
|
|
62
|
+
(type_constructor) @name
|
|
63
|
+
(type_constructor_path (type_constructor) @name)
|
|
64
|
+
]
|
|
65
|
+
) @definition.type
|
|
66
|
+
)
|
|
67
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
(type_constructor_path (type_constructor) @name) @reference.type
|
|
71
|
+
|
|
72
|
+
[
|
|
73
|
+
(constructor_declaration (constructor_name) @name)
|
|
74
|
+
(tag_specification (tag) @name)
|
|
75
|
+
] @definition.enum_variant
|
|
76
|
+
|
|
77
|
+
[
|
|
78
|
+
(constructor_path (constructor_name) @name)
|
|
79
|
+
(tag) @name
|
|
80
|
+
] @reference.enum_variant
|
|
81
|
+
|
|
82
|
+
(field_declaration (field_name) @name) @definition.field
|
|
83
|
+
|
|
84
|
+
(field_path (field_name) @name) @reference.field
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
; Functions
|
|
88
|
+
;----------
|
|
89
|
+
|
|
90
|
+
(
|
|
91
|
+
(comment)? @doc .
|
|
92
|
+
(value_definition
|
|
93
|
+
[
|
|
94
|
+
(let_binding pattern: (value_name) @name (parameter))
|
|
95
|
+
(let_binding
|
|
96
|
+
pattern: (value_name) @name
|
|
97
|
+
body: [(fun_expression) (function_expression)]
|
|
98
|
+
)
|
|
99
|
+
] @definition.function
|
|
100
|
+
)
|
|
101
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
(
|
|
105
|
+
(comment)? @doc .
|
|
106
|
+
(external (value_name) @name) @definition.function
|
|
107
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
(application_expression
|
|
111
|
+
function: (value_path (value_name) @name)
|
|
112
|
+
) @reference.call
|
|
113
|
+
|
|
114
|
+
(infix_expression
|
|
115
|
+
left: (value_path (value_name) @name)
|
|
116
|
+
operator: (concat_operator) @reference.call
|
|
117
|
+
(#eq? @reference.call "@@")
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
(infix_expression
|
|
121
|
+
operator: (rel_operator) @reference.call
|
|
122
|
+
right: (value_path (value_name) @name)
|
|
123
|
+
(#eq? @reference.call "|>")
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
; Operators
|
|
128
|
+
;----------
|
|
129
|
+
|
|
130
|
+
(
|
|
131
|
+
(comment)? @doc .
|
|
132
|
+
(value_definition
|
|
133
|
+
[
|
|
134
|
+
(let_binding pattern: (parenthesized_operator (_) @name) (parameter))
|
|
135
|
+
(let_binding
|
|
136
|
+
pattern: (parenthesized_operator (_) @name)
|
|
137
|
+
body: [(fun_expression) (function_expression)]
|
|
138
|
+
)
|
|
139
|
+
] @definition.operator
|
|
140
|
+
)
|
|
141
|
+
(#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
(application_expression
|
|
145
|
+
function: (value_path (parenthesized_operator (_) @name))
|
|
146
|
+
) @reference.call
|
|
147
|
+
|
|
148
|
+
(infix_expression
|
|
149
|
+
left: (value_path (parenthesized_operator (_) @name))
|
|
150
|
+
operator: (concat_operator) @reference.call
|
|
151
|
+
(#eq? @reference.call "@@")
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
(infix_expression
|
|
155
|
+
operator: (rel_operator) @reference.call
|
|
156
|
+
right: (value_path (parenthesized_operator (_) @name))
|
|
157
|
+
(#eq? @reference.call "|>")
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
(prefix_expression operator: (prefix_operator) @name) @reference.call
|
|
161
|
+
|
|
162
|
+
(hash_expression operator: (hash_operator) @name) @reference.call
|
|
163
|
+
|
|
164
|
+
(infix_expression operator: (_) @name) @reference.call
|
|
165
|
+
|
|
166
|
+
(indexing_operator_path (indexing_operator) @name) @reference.call
|
|
167
|
+
|
|
168
|
+
(value_definition [(let_operator) (let_and_operator)] @name) @reference.call
|
|
169
|
+
|
|
170
|
+
(match_expression (match_operator) @name) @reference.call
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(comment)+ @fold
|
|
2
|
+
(pod) @fold
|
|
3
|
+
(heredoc_content) @fold
|
|
4
|
+
|
|
5
|
+
; fold the block-typed package statements only
|
|
6
|
+
(package_statement (block)) @fold
|
|
7
|
+
(class_statement (block)) @fold
|
|
8
|
+
|
|
9
|
+
[(subroutine_declaration_statement)
|
|
10
|
+
(method_declaration_statement)
|
|
11
|
+
(conditional_statement)
|
|
12
|
+
(loop_statement)
|
|
13
|
+
(for_statement)
|
|
14
|
+
(cstyle_for_statement)
|
|
15
|
+
(block_statement)
|
|
16
|
+
(defer_statement)
|
|
17
|
+
(phaser_statement)] @fold
|
|
18
|
+
|
|
19
|
+
(try_statement (block) @fold)
|
|
20
|
+
|
|
21
|
+
(eval_expression (block) @fold)
|
|
22
|
+
|
|
23
|
+
(anonymous_subroutine_expression) @fold
|
|
24
|
+
|
|
25
|
+
; perhaps folks want to fold these too?
|
|
26
|
+
[(anonymous_array_expression)
|
|
27
|
+
(anonymous_hash_expression)] @fold
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
((source_file . (comment) @preproc)
|
|
2
|
+
(#lua-match? @preproc "^#!/"))
|
|
3
|
+
|
|
4
|
+
[ "use" "no" "require" ] @include
|
|
5
|
+
|
|
6
|
+
[ "if" "elsif" "unless" "else" ] @conditional
|
|
7
|
+
|
|
8
|
+
(conditional_expression [ "?" ":" ] @conditional.ternary)
|
|
9
|
+
|
|
10
|
+
[ "while" "until" "for" "foreach" ] @repeat
|
|
11
|
+
("continue" @repeat (block))
|
|
12
|
+
|
|
13
|
+
[ "try" "catch" "finally" ] @exception
|
|
14
|
+
|
|
15
|
+
"return" @keyword.return
|
|
16
|
+
|
|
17
|
+
[ "sub" "method" "async" "extended" ] @keyword.function
|
|
18
|
+
|
|
19
|
+
[ "map" "grep" "sort" ] @function.builtin
|
|
20
|
+
|
|
21
|
+
[ "package" "class" "role" ] @include
|
|
22
|
+
|
|
23
|
+
[
|
|
24
|
+
"defer"
|
|
25
|
+
"do" "eval"
|
|
26
|
+
"my" "our" "local" "dynamically" "state" "field"
|
|
27
|
+
"last" "next" "redo" "goto"
|
|
28
|
+
"undef" "await"
|
|
29
|
+
] @keyword
|
|
30
|
+
|
|
31
|
+
(yadayada) @exception
|
|
32
|
+
|
|
33
|
+
(phaser_statement phase: _ @keyword.phaser)
|
|
34
|
+
(class_phaser_statement phase: _ @keyword.phaser)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
(_ operator: _ @operator)
|
|
39
|
+
"\\" @operator
|
|
40
|
+
|
|
41
|
+
[
|
|
42
|
+
"or" "xor" "and"
|
|
43
|
+
"eq" "ne" "cmp" "lt" "le" "ge" "gt"
|
|
44
|
+
"isa"
|
|
45
|
+
] @keyword.operator
|
|
46
|
+
|
|
47
|
+
(eof_marker) @preproc
|
|
48
|
+
(data_section) @comment
|
|
49
|
+
|
|
50
|
+
(pod) @text
|
|
51
|
+
|
|
52
|
+
[
|
|
53
|
+
(number)
|
|
54
|
+
(version)
|
|
55
|
+
] @number
|
|
56
|
+
|
|
57
|
+
[
|
|
58
|
+
(string_literal)
|
|
59
|
+
(interpolated_string_literal)
|
|
60
|
+
(quoted_word_list)
|
|
61
|
+
(command_string)
|
|
62
|
+
(heredoc_content)
|
|
63
|
+
(replacement)
|
|
64
|
+
(transliteration_content)
|
|
65
|
+
] @string
|
|
66
|
+
|
|
67
|
+
[
|
|
68
|
+
(heredoc_token)
|
|
69
|
+
(command_heredoc_token)
|
|
70
|
+
(heredoc_end)
|
|
71
|
+
] @label
|
|
72
|
+
|
|
73
|
+
[(escape_sequence) (escaped_delimiter)] @string.escape
|
|
74
|
+
|
|
75
|
+
(_ modifiers: _ @character.special)
|
|
76
|
+
[
|
|
77
|
+
(quoted_regexp)
|
|
78
|
+
(match_regexp)
|
|
79
|
+
(regexp_content)
|
|
80
|
+
] @string.regex
|
|
81
|
+
|
|
82
|
+
(autoquoted_bareword) @string.special
|
|
83
|
+
|
|
84
|
+
(use_statement (package) @type)
|
|
85
|
+
(package_statement (package) @type)
|
|
86
|
+
(class_statement (package) @type)
|
|
87
|
+
(require_expression (bareword) @type)
|
|
88
|
+
|
|
89
|
+
(subroutine_declaration_statement name: (bareword) @function)
|
|
90
|
+
(method_declaration_statement name: (bareword) @method)
|
|
91
|
+
(attribute_name) @attribute
|
|
92
|
+
(attribute_value) @string
|
|
93
|
+
|
|
94
|
+
(label) @label
|
|
95
|
+
|
|
96
|
+
(statement_label label: _ @label)
|
|
97
|
+
|
|
98
|
+
(relational_expression operator: "isa" right: (bareword) @type)
|
|
99
|
+
|
|
100
|
+
(function) @function
|
|
101
|
+
|
|
102
|
+
(function_call_expression (function) @function.call)
|
|
103
|
+
(method_call_expression (method) @method.call)
|
|
104
|
+
(method_call_expression invocant: (bareword) @type)
|
|
105
|
+
|
|
106
|
+
(func0op_call_expression function: _ @function.builtin)
|
|
107
|
+
(func1op_call_expression function: _ @function.builtin)
|
|
108
|
+
|
|
109
|
+
([(function)(expression_statement (bareword))] @function.builtin
|
|
110
|
+
(#match? @function.builtin
|
|
111
|
+
"^(accept|atan2|bind|binmode|bless|crypt|chmod|chown|connect|die|dbmopen|exec|fcntl|flock|getpriority|getprotobynumber|gethostbyaddr|getnetbyaddr|getservbyname|getservbyport|getsockopt|glob|index|ioctl|join|kill|link|listen|mkdir|msgctl|msgget|msgrcv|msgsend|opendir|print|printf|push|pack|pipe|return|rename|rindex|read|recv|reverse|say|select|seek|semctl|semget|semop|send|setpgrp|setpriority|seekdir|setsockopt|shmctl|shmread|shmwrite|shutdown|socket|socketpair|split|sprintf|splice|substr|system|symlink|syscall|sysopen|sysseek|sysread|syswrite|tie|truncate|unlink|unpack|utime|unshift|vec|warn|waitpid|formline|open|sort)$"
|
|
112
|
+
))
|
|
113
|
+
|
|
114
|
+
(ERROR) @error
|
|
115
|
+
|
|
116
|
+
(
|
|
117
|
+
[(varname) (filehandle)] @variable.builtin
|
|
118
|
+
(#match? @variable.builtin "^((ENV|ARGV|INC|ARGVOUT|SIG|STDIN|STDOUT|STDERR)|[_ab]|\\W|\\d+|\\^.*)$")
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
[(array) (arraylen)] @variable.array
|
|
122
|
+
(glob) @variable.builtin
|
|
123
|
+
(scalar) @variable.scalar
|
|
124
|
+
(hash) @variable.hash
|
|
125
|
+
(amper_deref_expression [ "&" "*" ] @function.call)
|
|
126
|
+
|
|
127
|
+
(glob_deref_expression "*" @variable.builtin)
|
|
128
|
+
(glob_slot_expression "*" @variable.builtin)
|
|
129
|
+
(scalar_deref_expression [ "$" "*"] @variable.scalar)
|
|
130
|
+
|
|
131
|
+
; gotta be SUPER GENERIC so we can hit up string interp
|
|
132
|
+
(_
|
|
133
|
+
[
|
|
134
|
+
array: (_) @variable.array
|
|
135
|
+
hash: (_) @variable.hash
|
|
136
|
+
])
|
|
137
|
+
(array_deref_expression [ "@" "*"] @variable.array)
|
|
138
|
+
(arraylen_deref_expression [ "$#" "*"] @variable.array)
|
|
139
|
+
(hash_deref_expression [ "%" "*"] @variable.hash)
|
|
140
|
+
(array_element_expression array:(_) @variable.array)
|
|
141
|
+
(slice_expression array:(_) @variable.array)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
(comment) @comment
|
|
146
|
+
|
|
147
|
+
([ "=>" "," ";" "->" ] @punctuation.delimiter)
|
|
148
|
+
|
|
149
|
+
(
|
|
150
|
+
[ "[" "]" "{" "}" "(" ")" ] @punctuation.bracket
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
(_
|
|
154
|
+
"{" @punctuation.special
|
|
155
|
+
(varname)
|
|
156
|
+
"}" @punctuation.special)
|
|
157
|
+
|
|
158
|
+
(varname
|
|
159
|
+
(block
|
|
160
|
+
"{" @punctuation.special
|
|
161
|
+
"}" @punctuation.special))
|
|
162
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
; an injections.scm file for nvim-treesitter
|
|
2
|
+
((comment) @injection.content
|
|
3
|
+
(#set! injection.language "comment"))
|
|
4
|
+
|
|
5
|
+
((pod) @injection.content
|
|
6
|
+
(#set! injection.language "pod"))
|
|
7
|
+
|
|
8
|
+
((substitution_regexp
|
|
9
|
+
(replacement) @injection.content
|
|
10
|
+
(substitution_regexp_modifiers) @_modifiers)
|
|
11
|
+
; match if there's a single `e` in the modifiers list
|
|
12
|
+
(#match? @_modifiers "e")
|
|
13
|
+
(#not-match? @_modifiers "e.*e")
|
|
14
|
+
(#set! injection.language "perl"))
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(conditional_statement
|
|
2
|
+
["if" "unless"] @open.if
|
|
3
|
+
"elsif"? @mid.if.1
|
|
4
|
+
"else"? @mid.if.2
|
|
5
|
+
(block "}" @close.if) .
|
|
6
|
+
) @scope.if
|
|
7
|
+
|
|
8
|
+
(_
|
|
9
|
+
["for" "foreach" "while" "unless"] @open.loop
|
|
10
|
+
(block "}" @close.loop) .
|
|
11
|
+
) @scope.loop
|
|
12
|
+
(loopex_expression) @mid.loop.1
|
|
13
|
+
|
|
14
|
+
(_
|
|
15
|
+
"sub" @open.fun
|
|
16
|
+
(block "}" @close.fun) .
|
|
17
|
+
) @scope.fun
|
|
18
|
+
(return_expression "return" @mid.fun.1)
|
|
19
|
+
|
|
20
|
+
[
|
|
21
|
+
(_ "'" @open.quotelike (string_content) "'" @close.quotelike)
|
|
22
|
+
(quoted_regexp "'" @open.quotelike "'" @close.quotelike)
|
|
23
|
+
(_ "'" @open.quotelike (_) "'"+ @mid.quotelike.1 (replacement) "'" @close.quotelike)
|
|
24
|
+
] @scope.quotelike
|
|
25
|
+
|
|
26
|
+
(try_statement
|
|
27
|
+
"try" @open.try
|
|
28
|
+
"catch"? @mid.try.1
|
|
29
|
+
"finally"? @close.try
|
|
30
|
+
) @scope.try
|
|
Binary file
|
|
@@ -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
|
|
Binary file
|