ts-wasms 1.0.2

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.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/README +2 -0
  3. package/out/bash/highlights.scm +56 -0
  4. package/out/bash/tree-sitter-bash.wasm +0 -0
  5. package/out/c/highlights.scm +81 -0
  6. package/out/c/tags.scm +9 -0
  7. package/out/c/tree-sitter-c.wasm +0 -0
  8. package/out/c-sharp/highlights.scm +213 -0
  9. package/out/c-sharp/tags.scm +23 -0
  10. package/out/c-sharp/tree-sitter-c_sharp.wasm +0 -0
  11. package/out/cpp/highlights.scm +70 -0
  12. package/out/cpp/injections.scm +3 -0
  13. package/out/cpp/tags.scm +15 -0
  14. package/out/cpp/tree-sitter-cpp.wasm +0 -0
  15. package/out/css/highlights.scm +76 -0
  16. package/out/css/tree-sitter-css.wasm +0 -0
  17. package/out/dart/folds.scm +8 -0
  18. package/out/dart/highlights.scm +224 -0
  19. package/out/dart/tree-sitter-dart.wasm +0 -0
  20. package/out/elisp/highlights.scm +72 -0
  21. package/out/elisp/tags.scm +5 -0
  22. package/out/elisp/tree-sitter-elisp.wasm +0 -0
  23. package/out/elixir/highlights.scm +223 -0
  24. package/out/elixir/injections.scm +55 -0
  25. package/out/elixir/tags.scm +54 -0
  26. package/out/elixir/tree-sitter-elixir.wasm +0 -0
  27. package/out/embedded-template/highlights.scm +12 -0
  28. package/out/embedded-template/injections-ejs.scm +7 -0
  29. package/out/embedded-template/injections-erb.scm +7 -0
  30. package/out/embedded-template/injections-etlua.scm +7 -0
  31. package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
  32. package/out/go/highlights.scm +123 -0
  33. package/out/go/tags.scm +42 -0
  34. package/out/go/tree-sitter-go.wasm +0 -0
  35. package/out/haskell/highlights.scm +443 -0
  36. package/out/haskell/injections.scm +76 -0
  37. package/out/haskell/locals.scm +4 -0
  38. package/out/haskell/tree-sitter-haskell.wasm +0 -0
  39. package/out/html/highlights.scm +13 -0
  40. package/out/html/injections.scm +7 -0
  41. package/out/html/tree-sitter-html.wasm +0 -0
  42. package/out/java/highlights.scm +149 -0
  43. package/out/java/tags.scm +20 -0
  44. package/out/java/tree-sitter-java.wasm +0 -0
  45. package/out/javascript/highlights-jsx.scm +8 -0
  46. package/out/javascript/highlights-params.scm +12 -0
  47. package/out/javascript/highlights.scm +204 -0
  48. package/out/javascript/injections.scm +31 -0
  49. package/out/javascript/locals.scm +23 -0
  50. package/out/javascript/tags.scm +99 -0
  51. package/out/javascript/tree-sitter-javascript.wasm +0 -0
  52. package/out/json/highlights.scm +16 -0
  53. package/out/json/tree-sitter-json.wasm +0 -0
  54. package/out/kotlin/highlights.scm +380 -0
  55. package/out/kotlin/tree-sitter-kotlin.wasm +0 -0
  56. package/out/objc/folds.scm +20 -0
  57. package/out/objc/highlights.scm +216 -0
  58. package/out/objc/indents.scm +1 -0
  59. package/out/objc/injections.scm +10 -0
  60. package/out/objc/locals.scm +1 -0
  61. package/out/objc/tree-sitter-objc.wasm +0 -0
  62. package/out/php/tree-sitter-php.wasm +0 -0
  63. package/out/php_only/tree-sitter-php_only.wasm +0 -0
  64. package/out/python/highlights.scm +137 -0
  65. package/out/python/tags.scm +14 -0
  66. package/out/python/tree-sitter-python.wasm +0 -0
  67. package/out/regex/highlights.scm +63 -0
  68. package/out/regex/tree-sitter-regex.wasm +0 -0
  69. package/out/ruby/highlights.scm +154 -0
  70. package/out/ruby/locals.scm +27 -0
  71. package/out/ruby/tags.scm +64 -0
  72. package/out/ruby/tree-sitter-ruby.wasm +0 -0
  73. package/out/rust/highlights.scm +161 -0
  74. package/out/rust/injections.scm +9 -0
  75. package/out/rust/tags.scm +60 -0
  76. package/out/rust/tree-sitter-rust.wasm +0 -0
  77. package/out/scala/highlights.scm +260 -0
  78. package/out/scala/indents.scm +30 -0
  79. package/out/scala/locals.scm +30 -0
  80. package/out/scala/tags.scm +66 -0
  81. package/out/scala/tree-sitter-scala.wasm +0 -0
  82. package/out/swift/folds.scm +35 -0
  83. package/out/swift/highlights.scm +336 -0
  84. package/out/swift/indents.scm +123 -0
  85. package/out/swift/injections.scm +10 -0
  86. package/out/swift/locals.scm +23 -0
  87. package/out/swift/outline.scm +66 -0
  88. package/out/swift/tags.scm +51 -0
  89. package/out/swift/textobjects.scm +19 -0
  90. package/out/swift/tree-sitter-swift.wasm +0 -0
  91. package/out/tsx/tree-sitter-tsx.wasm +0 -0
  92. package/out/typescript/tree-sitter-typescript.wasm +0 -0
  93. package/out/vue/tree-sitter-vue.wasm +0 -0
  94. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Crysthamus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README ADDED
@@ -0,0 +1,2 @@
1
+ # A tree-sitter WASM builder
2
+ Please visit https://www.jsdelivr.com/package/npm/ts-wasms
@@ -0,0 +1,56 @@
1
+ [
2
+ (string)
3
+ (raw_string)
4
+ (heredoc_body)
5
+ (heredoc_start)
6
+ ] @string
7
+
8
+ (command_name) @function
9
+
10
+ (variable_name) @property
11
+
12
+ [
13
+ "case"
14
+ "do"
15
+ "done"
16
+ "elif"
17
+ "else"
18
+ "esac"
19
+ "export"
20
+ "fi"
21
+ "for"
22
+ "function"
23
+ "if"
24
+ "in"
25
+ "select"
26
+ "then"
27
+ "unset"
28
+ "until"
29
+ "while"
30
+ ] @keyword
31
+
32
+ (comment) @comment
33
+
34
+ (function_definition name: (word) @function)
35
+
36
+ (file_descriptor) @number
37
+
38
+ [
39
+ (command_substitution)
40
+ (process_substitution)
41
+ (expansion)
42
+ ]@embedded
43
+
44
+ [
45
+ "$"
46
+ "&&"
47
+ ">"
48
+ ">>"
49
+ "<"
50
+ "|"
51
+ ] @operator
52
+
53
+ (
54
+ (command (_) @constant)
55
+ (#match? @constant "^-")
56
+ )
Binary file
@@ -0,0 +1,81 @@
1
+ (identifier) @variable
2
+
3
+ ((identifier) @constant
4
+ (#match? @constant "^[A-Z][A-Z\\d_]*$"))
5
+
6
+ "break" @keyword
7
+ "case" @keyword
8
+ "const" @keyword
9
+ "continue" @keyword
10
+ "default" @keyword
11
+ "do" @keyword
12
+ "else" @keyword
13
+ "enum" @keyword
14
+ "extern" @keyword
15
+ "for" @keyword
16
+ "if" @keyword
17
+ "inline" @keyword
18
+ "return" @keyword
19
+ "sizeof" @keyword
20
+ "static" @keyword
21
+ "struct" @keyword
22
+ "switch" @keyword
23
+ "typedef" @keyword
24
+ "union" @keyword
25
+ "volatile" @keyword
26
+ "while" @keyword
27
+
28
+ "#define" @keyword
29
+ "#elif" @keyword
30
+ "#else" @keyword
31
+ "#endif" @keyword
32
+ "#if" @keyword
33
+ "#ifdef" @keyword
34
+ "#ifndef" @keyword
35
+ "#include" @keyword
36
+ (preproc_directive) @keyword
37
+
38
+ "--" @operator
39
+ "-" @operator
40
+ "-=" @operator
41
+ "->" @operator
42
+ "=" @operator
43
+ "!=" @operator
44
+ "*" @operator
45
+ "&" @operator
46
+ "&&" @operator
47
+ "+" @operator
48
+ "++" @operator
49
+ "+=" @operator
50
+ "<" @operator
51
+ "==" @operator
52
+ ">" @operator
53
+ "||" @operator
54
+
55
+ "." @delimiter
56
+ ";" @delimiter
57
+
58
+ (string_literal) @string
59
+ (system_lib_string) @string
60
+
61
+ (null) @constant
62
+ (number_literal) @number
63
+ (char_literal) @number
64
+
65
+ (field_identifier) @property
66
+ (statement_identifier) @label
67
+ (type_identifier) @type
68
+ (primitive_type) @type
69
+ (sized_type_specifier) @type
70
+
71
+ (call_expression
72
+ function: (identifier) @function)
73
+ (call_expression
74
+ function: (field_expression
75
+ field: (field_identifier) @function))
76
+ (function_declarator
77
+ declarator: (identifier) @function)
78
+ (preproc_function_def
79
+ name: (identifier) @function.special)
80
+
81
+ (comment) @comment
package/out/c/tags.scm ADDED
@@ -0,0 +1,9 @@
1
+ (struct_specifier name: (type_identifier) @name body:(_)) @definition.class
2
+
3
+ (declaration type: (union_specifier name: (type_identifier) @name)) @definition.class
4
+
5
+ (function_declarator declarator: (identifier) @name) @definition.function
6
+
7
+ (type_definition declarator: (type_identifier) @name) @definition.type
8
+
9
+ (enum_specifier name: (type_identifier) @name) @definition.type
Binary file
@@ -0,0 +1,213 @@
1
+ (identifier) @variable
2
+
3
+ ;; Methods
4
+
5
+ (method_declaration name: (identifier) @function)
6
+ (local_function_statement name: (identifier) @function)
7
+
8
+ ;; Types
9
+
10
+ (interface_declaration name: (identifier) @type)
11
+ (class_declaration name: (identifier) @type)
12
+ (enum_declaration name: (identifier) @type)
13
+ (struct_declaration (identifier) @type)
14
+ (record_declaration (identifier) @type)
15
+ (namespace_declaration name: (identifier) @module)
16
+
17
+ (generic_name (identifier) @type)
18
+ (type_parameter (identifier) @property.definition)
19
+ (parameter type: (identifier) @type)
20
+ (type_argument_list (identifier) @type)
21
+ (as_expression right: (identifier) @type)
22
+ (is_expression right: (identifier) @type)
23
+
24
+ (constructor_declaration name: (identifier) @constructor)
25
+ (destructor_declaration name: (identifier) @constructor)
26
+
27
+ (_ type: (identifier) @type)
28
+
29
+ (base_list (identifier) @type)
30
+
31
+ (predefined_type) @type.builtin
32
+
33
+ ;; Enum
34
+ (enum_member_declaration (identifier) @property.definition)
35
+
36
+ ;; Literals
37
+
38
+ [
39
+ (real_literal)
40
+ (integer_literal)
41
+ ] @number
42
+
43
+ [
44
+ (character_literal)
45
+ (string_literal)
46
+ (raw_string_literal)
47
+ (verbatim_string_literal)
48
+ (interpolated_string_expression)
49
+ (interpolation_start)
50
+ (interpolation_quote)
51
+ ] @string
52
+
53
+ (escape_sequence) @string.escape
54
+
55
+ [
56
+ (boolean_literal)
57
+ (null_literal)
58
+ ] @constant.builtin
59
+
60
+ ;; Comments
61
+
62
+ (comment) @comment
63
+
64
+ ;; Tokens
65
+
66
+ [
67
+ ";"
68
+ "."
69
+ ","
70
+ ] @punctuation.delimiter
71
+
72
+ [
73
+ "--"
74
+ "-"
75
+ "-="
76
+ "&"
77
+ "&="
78
+ "&&"
79
+ "+"
80
+ "++"
81
+ "+="
82
+ "<"
83
+ "<="
84
+ "<<"
85
+ "<<="
86
+ "="
87
+ "=="
88
+ "!"
89
+ "!="
90
+ "=>"
91
+ ">"
92
+ ">="
93
+ ">>"
94
+ ">>="
95
+ ">>>"
96
+ ">>>="
97
+ "|"
98
+ "|="
99
+ "||"
100
+ "?"
101
+ "??"
102
+ "??="
103
+ "^"
104
+ "^="
105
+ "~"
106
+ "*"
107
+ "*="
108
+ "/"
109
+ "/="
110
+ "%"
111
+ "%="
112
+ ":"
113
+ ".."
114
+ ] @operator
115
+
116
+ [
117
+ "("
118
+ ")"
119
+ "["
120
+ "]"
121
+ "{"
122
+ "}"
123
+ (interpolation_brace)
124
+ ] @punctuation.bracket
125
+
126
+ ;; Keywords
127
+
128
+ [
129
+ (modifier)
130
+ "this"
131
+ (implicit_type)
132
+ ] @keyword
133
+
134
+ [
135
+ "add"
136
+ "alias"
137
+ "as"
138
+ "base"
139
+ "break"
140
+ "case"
141
+ "catch"
142
+ "checked"
143
+ "class"
144
+ "continue"
145
+ "default"
146
+ "delegate"
147
+ "do"
148
+ "else"
149
+ "enum"
150
+ "event"
151
+ "explicit"
152
+ "extern"
153
+ "finally"
154
+ "for"
155
+ "foreach"
156
+ "global"
157
+ "goto"
158
+ "if"
159
+ "implicit"
160
+ "interface"
161
+ "is"
162
+ "lock"
163
+ "namespace"
164
+ "notnull"
165
+ "operator"
166
+ "params"
167
+ "return"
168
+ "remove"
169
+ "sizeof"
170
+ "stackalloc"
171
+ "static"
172
+ "struct"
173
+ "switch"
174
+ "throw"
175
+ "try"
176
+ "typeof"
177
+ "unchecked"
178
+ "using"
179
+ "while"
180
+ "new"
181
+ "await"
182
+ "in"
183
+ "yield"
184
+ "get"
185
+ "set"
186
+ "when"
187
+ "out"
188
+ "ref"
189
+ "from"
190
+ "where"
191
+ "select"
192
+ "record"
193
+ "init"
194
+ "with"
195
+ "let"
196
+ ] @keyword
197
+
198
+ ;; Attribute
199
+
200
+ (attribute name: (identifier) @attribute)
201
+
202
+ ;; Parameters
203
+
204
+ (parameter
205
+ name: (identifier) @variable.parameter)
206
+
207
+ ;; Type constraints
208
+
209
+ (type_parameter_constraints_clause (identifier) @property.definition)
210
+
211
+ ;; Method calls
212
+
213
+ (invocation_expression (member_access_expression name: (identifier) @function))
@@ -0,0 +1,23 @@
1
+ (class_declaration name: (identifier) @name) @definition.class
2
+
3
+ (class_declaration (base_list (_) @name)) @reference.class
4
+
5
+ (interface_declaration name: (identifier) @name) @definition.interface
6
+
7
+ (interface_declaration (base_list (_) @name)) @reference.interface
8
+
9
+ (method_declaration name: (identifier) @name) @definition.method
10
+
11
+ (object_creation_expression type: (identifier) @name) @reference.class
12
+
13
+ (type_parameter_constraints_clause (identifier) @name) @reference.class
14
+
15
+ (type_parameter_constraint (type type: (identifier) @name)) @reference.class
16
+
17
+ (variable_declaration type: (identifier) @name) @reference.class
18
+
19
+ (invocation_expression function: (member_access_expression name: (identifier) @name)) @reference.send
20
+
21
+ (namespace_declaration name: (identifier) @name) @definition.module
22
+
23
+ (namespace_declaration name: (identifier) @name) @module
@@ -0,0 +1,70 @@
1
+ ; Functions
2
+
3
+ (call_expression
4
+ function: (qualified_identifier
5
+ name: (identifier) @function))
6
+
7
+ (template_function
8
+ name: (identifier) @function)
9
+
10
+ (template_method
11
+ name: (field_identifier) @function)
12
+
13
+ (template_function
14
+ name: (identifier) @function)
15
+
16
+ (function_declarator
17
+ declarator: (qualified_identifier
18
+ name: (identifier) @function))
19
+
20
+ (function_declarator
21
+ declarator: (field_identifier) @function)
22
+
23
+ ; Types
24
+
25
+ ((namespace_identifier) @type
26
+ (#match? @type "^[A-Z]"))
27
+
28
+ (auto) @type
29
+
30
+ ; Constants
31
+
32
+ (this) @variable.builtin
33
+ (null "nullptr" @constant)
34
+
35
+ ; Keywords
36
+
37
+ [
38
+ "catch"
39
+ "class"
40
+ "co_await"
41
+ "co_return"
42
+ "co_yield"
43
+ "constexpr"
44
+ "constinit"
45
+ "consteval"
46
+ "delete"
47
+ "explicit"
48
+ "final"
49
+ "friend"
50
+ "mutable"
51
+ "namespace"
52
+ "noexcept"
53
+ "new"
54
+ "override"
55
+ "private"
56
+ "protected"
57
+ "public"
58
+ "template"
59
+ "throw"
60
+ "try"
61
+ "typename"
62
+ "using"
63
+ "concept"
64
+ "requires"
65
+ "virtual"
66
+ ] @keyword
67
+
68
+ ; Strings
69
+
70
+ (raw_string_literal) @string
@@ -0,0 +1,3 @@
1
+ (raw_string_literal
2
+ delimiter: (raw_string_delimiter) @injection.language
3
+ (raw_string_content) @injection.content)
@@ -0,0 +1,15 @@
1
+ (struct_specifier name: (type_identifier) @name body:(_)) @definition.class
2
+
3
+ (declaration type: (union_specifier name: (type_identifier) @name)) @definition.class
4
+
5
+ (function_declarator declarator: (identifier) @name) @definition.function
6
+
7
+ (function_declarator declarator: (field_identifier) @name) @definition.function
8
+
9
+ (function_declarator declarator: (qualified_identifier scope: (namespace_identifier) @local.scope name: (identifier) @name)) @definition.method
10
+
11
+ (type_definition declarator: (type_identifier) @name) @definition.type
12
+
13
+ (enum_specifier name: (type_identifier) @name) @definition.type
14
+
15
+ (class_specifier name: (type_identifier) @name) @definition.class
Binary file
@@ -0,0 +1,76 @@
1
+ (comment) @comment
2
+
3
+ (tag_name) @tag
4
+ (nesting_selector) @tag
5
+ (universal_selector) @tag
6
+
7
+ "~" @operator
8
+ ">" @operator
9
+ "+" @operator
10
+ "-" @operator
11
+ "*" @operator
12
+ "/" @operator
13
+ "=" @operator
14
+ "^=" @operator
15
+ "|=" @operator
16
+ "~=" @operator
17
+ "$=" @operator
18
+ "*=" @operator
19
+
20
+ "and" @operator
21
+ "or" @operator
22
+ "not" @operator
23
+ "only" @operator
24
+
25
+ (attribute_selector (plain_value) @string)
26
+
27
+ ((property_name) @variable
28
+ (#match? @variable "^--"))
29
+ ((plain_value) @variable
30
+ (#match? @variable "^--"))
31
+
32
+ (class_name) @property
33
+ (id_name) @property
34
+ (namespace_name) @property
35
+ (property_name) @property
36
+ (feature_name) @property
37
+
38
+ (pseudo_element_selector (tag_name) @attribute)
39
+ (pseudo_class_selector (class_name) @attribute)
40
+ (attribute_name) @attribute
41
+
42
+ (function_name) @function
43
+
44
+ "@media" @keyword
45
+ "@import" @keyword
46
+ "@charset" @keyword
47
+ "@namespace" @keyword
48
+ "@supports" @keyword
49
+ "@keyframes" @keyword
50
+ (at_keyword) @keyword
51
+ (to) @keyword
52
+ (from) @keyword
53
+ (important) @keyword
54
+
55
+ (string_value) @string
56
+ (color_value) @string.special
57
+
58
+ (integer_value) @number
59
+ (float_value) @number
60
+ (unit) @type
61
+
62
+ [
63
+ "#"
64
+ ","
65
+ "."
66
+ ":"
67
+ "::"
68
+ ";"
69
+ ] @punctuation.delimiter
70
+
71
+ [
72
+ "{"
73
+ ")"
74
+ "("
75
+ "}"
76
+ ] @punctuation.bracket
Binary file
@@ -0,0 +1,8 @@
1
+ [
2
+ (class_definition)
3
+ (enum_declaration)
4
+
5
+ (function_body)
6
+
7
+ (block)
8
+ ] @fold