@kerebron/wasm 0.4.12 → 0.4.14

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 (60) hide show
  1. package/README.md +1 -1
  2. package/assets/tree-sitter-css/highlights.scm +76 -0
  3. package/assets/tree-sitter-css/release.json +15 -0
  4. package/assets/tree-sitter-css/tree-sitter-css.wasm +0 -0
  5. package/assets/tree-sitter-diff/highlights.scm +49 -0
  6. package/assets/tree-sitter-diff/release.json +15 -0
  7. package/assets/tree-sitter-diff/tree-sitter-diff.wasm +0 -0
  8. package/assets/tree-sitter-html/highlights.scm +13 -0
  9. package/assets/tree-sitter-html/injections.scm +7 -0
  10. package/assets/tree-sitter-html/release.json +15 -0
  11. package/assets/tree-sitter-html/tree-sitter-html.wasm +0 -0
  12. package/assets/tree-sitter-java/highlights.scm +149 -0
  13. package/assets/tree-sitter-java/release.json +15 -0
  14. package/assets/tree-sitter-java/tags.scm +20 -0
  15. package/assets/tree-sitter-java/tree-sitter-java.wasm +0 -0
  16. package/assets/tree-sitter-javascript/highlights-jsx.scm +8 -0
  17. package/assets/tree-sitter-javascript/highlights-params.scm +12 -0
  18. package/assets/tree-sitter-javascript/highlights.scm +204 -0
  19. package/assets/tree-sitter-javascript/injections.scm +31 -0
  20. package/assets/tree-sitter-javascript/locals.scm +23 -0
  21. package/assets/tree-sitter-javascript/release.json +15 -0
  22. package/assets/tree-sitter-javascript/tags.scm +99 -0
  23. package/assets/tree-sitter-javascript/tree-sitter-javascript.wasm +0 -0
  24. package/assets/tree-sitter-json/highlights.scm +16 -0
  25. package/assets/tree-sitter-json/release.json +15 -0
  26. package/assets/tree-sitter-json/tree-sitter-json.wasm +0 -0
  27. package/assets/tree-sitter-markdown/highlights-inline.scm +37 -0
  28. package/assets/tree-sitter-markdown/highlights.scm +52 -0
  29. package/assets/tree-sitter-markdown/injections-inline.scm +2 -0
  30. package/assets/tree-sitter-markdown/injections.scm +14 -0
  31. package/assets/tree-sitter-markdown/release.json +15 -0
  32. package/assets/tree-sitter-markdown/tree-sitter-markdown.wasm +0 -0
  33. package/assets/tree-sitter-markdown/tree-sitter-markdown_inline.wasm +0 -0
  34. package/assets/tree-sitter-regex/highlights.scm +63 -0
  35. package/assets/tree-sitter-regex/release.json +15 -0
  36. package/assets/tree-sitter-regex/tree-sitter-regex.wasm +0 -0
  37. package/assets/tree-sitter-rust/highlights.scm +161 -0
  38. package/assets/tree-sitter-rust/injections.scm +9 -0
  39. package/assets/tree-sitter-rust/release.json +15 -0
  40. package/assets/tree-sitter-rust/tags.scm +60 -0
  41. package/assets/tree-sitter-rust/tree-sitter-rust.wasm +0 -0
  42. package/assets/tree-sitter-toml/highlights.scm +53 -0
  43. package/assets/tree-sitter-toml/release.json +15 -0
  44. package/assets/tree-sitter-toml/tree-sitter-toml.wasm +0 -0
  45. package/assets/tree-sitter-typescript/highlights.scm +35 -0
  46. package/assets/tree-sitter-typescript/locals.scm +2 -0
  47. package/assets/tree-sitter-typescript/release.json +20 -0
  48. package/assets/tree-sitter-typescript/tags.scm +23 -0
  49. package/assets/tree-sitter-typescript/tree-sitter-tsx.wasm +0 -0
  50. package/assets/tree-sitter-typescript/tree-sitter-typescript.wasm +0 -0
  51. package/assets/tree-sitter-xml/highlights-dtd.scm +129 -0
  52. package/assets/tree-sitter-xml/highlights.scm +168 -0
  53. package/assets/tree-sitter-xml/release.json +20 -0
  54. package/assets/tree-sitter-xml/tree-sitter-dtd.wasm +0 -0
  55. package/assets/tree-sitter-xml/tree-sitter-xml.wasm +0 -0
  56. package/assets/tree-sitter-yaml/highlights.scm +79 -0
  57. package/assets/tree-sitter-yaml/release.json +15 -0
  58. package/assets/tree-sitter-yaml/tree-sitter-yaml.wasm +0 -0
  59. package/esm/src/deno.js +1 -1
  60. package/package.json +4 -1
package/README.md CHANGED
@@ -32,7 +32,7 @@ number of output npm modules.
32
32
  ### Build static examples and `.wasm` files
33
33
 
34
34
  ```sh
35
- deno task build
35
+ deno task -f @kerebron build
36
36
  ```
37
37
 
38
38
  ## Development
@@ -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
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "v0.25.0",
3
+ "assets": [
4
+ {
5
+ "name": "tree-sitter-css.tar.gz",
6
+ "url": "https://github.com/tree-sitter/tree-sitter-css/releases/download/v0.25.0/tree-sitter-css.tar.gz",
7
+ "size": 132158
8
+ },
9
+ {
10
+ "name": "tree-sitter-css.wasm",
11
+ "url": "https://github.com/tree-sitter/tree-sitter-css/releases/download/v0.25.0/tree-sitter-css.wasm",
12
+ "size": 128668
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,49 @@
1
+ (comment) @comment @spell
2
+
3
+ [
4
+ (addition)
5
+ (new_file)
6
+ ] @diff.plus
7
+
8
+ [
9
+ (deletion)
10
+ (old_file)
11
+ ] @diff.minus
12
+
13
+ (commit) @constant
14
+
15
+ (location) @attribute
16
+
17
+ (command
18
+ "diff" @function
19
+ (argument) @variable.parameter)
20
+
21
+ (filename) @string.special.path
22
+
23
+ (mode) @number
24
+
25
+ ([
26
+ ".."
27
+ "+"
28
+ "++"
29
+ "+++"
30
+ "++++"
31
+ "-"
32
+ "--"
33
+ "---"
34
+ "----"
35
+ ] @punctuation.special
36
+ (#set! priority 95))
37
+
38
+ [
39
+ (binary_change)
40
+ (similarity)
41
+ (file_change)
42
+ ] @label
43
+
44
+ (index
45
+ "index" @keyword)
46
+
47
+ (similarity
48
+ (score) @number
49
+ "%" @number)
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "v0.1.0",
3
+ "assets": [
4
+ {
5
+ "name": "tree-sitter-diff.tar.gz",
6
+ "url": "https://github.com/tree-sitter-grammars/tree-sitter-diff/releases/download/v0.1.0/tree-sitter-diff.tar.gz",
7
+ "size": 652529
8
+ },
9
+ {
10
+ "name": "tree-sitter-diff.wasm",
11
+ "url": "https://github.com/tree-sitter-grammars/tree-sitter-diff/releases/download/v0.1.0/tree-sitter-diff.wasm",
12
+ "size": 22125
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,13 @@
1
+ (tag_name) @tag
2
+ (erroneous_end_tag_name) @tag.error
3
+ (doctype) @constant
4
+ (attribute_name) @attribute
5
+ (attribute_value) @string
6
+ (comment) @comment
7
+
8
+ [
9
+ "<"
10
+ ">"
11
+ "</"
12
+ "/>"
13
+ ] @punctuation.bracket
@@ -0,0 +1,7 @@
1
+ ((script_element
2
+ (raw_text) @injection.content)
3
+ (#set! injection.language "javascript"))
4
+
5
+ ((style_element
6
+ (raw_text) @injection.content)
7
+ (#set! injection.language "css"))
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "v0.23.2",
3
+ "assets": [
4
+ {
5
+ "name": "tree-sitter-html.tar.xz",
6
+ "url": "https://github.com/tree-sitter/tree-sitter-html/releases/download/v0.23.2/tree-sitter-html.tar.xz",
7
+ "size": 49305
8
+ },
9
+ {
10
+ "name": "tree-sitter-html.wasm",
11
+ "url": "https://github.com/tree-sitter/tree-sitter-html/releases/download/v0.23.2/tree-sitter-html.wasm",
12
+ "size": 18385
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,149 @@
1
+ ; Variables
2
+
3
+ (identifier) @variable
4
+
5
+ ; Methods
6
+
7
+ (method_declaration
8
+ name: (identifier) @function.method)
9
+ (method_invocation
10
+ name: (identifier) @function.method)
11
+ (super) @function.builtin
12
+
13
+ ; Annotations
14
+
15
+ (annotation
16
+ name: (identifier) @attribute)
17
+ (marker_annotation
18
+ name: (identifier) @attribute)
19
+
20
+ "@" @operator
21
+
22
+ ; Types
23
+
24
+ (type_identifier) @type
25
+
26
+ (interface_declaration
27
+ name: (identifier) @type)
28
+ (class_declaration
29
+ name: (identifier) @type)
30
+ (enum_declaration
31
+ name: (identifier) @type)
32
+
33
+ ((field_access
34
+ object: (identifier) @type)
35
+ (#match? @type "^[A-Z]"))
36
+ ((scoped_identifier
37
+ scope: (identifier) @type)
38
+ (#match? @type "^[A-Z]"))
39
+ ((method_invocation
40
+ object: (identifier) @type)
41
+ (#match? @type "^[A-Z]"))
42
+ ((method_reference
43
+ . (identifier) @type)
44
+ (#match? @type "^[A-Z]"))
45
+
46
+ (constructor_declaration
47
+ name: (identifier) @type)
48
+
49
+ [
50
+ (boolean_type)
51
+ (integral_type)
52
+ (floating_point_type)
53
+ (floating_point_type)
54
+ (void_type)
55
+ ] @type.builtin
56
+
57
+ ; Constants
58
+
59
+ ((identifier) @constant
60
+ (#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
61
+
62
+ ; Builtins
63
+
64
+ (this) @variable.builtin
65
+
66
+ ; Literals
67
+
68
+ [
69
+ (hex_integer_literal)
70
+ (decimal_integer_literal)
71
+ (octal_integer_literal)
72
+ (decimal_floating_point_literal)
73
+ (hex_floating_point_literal)
74
+ ] @number
75
+
76
+ [
77
+ (character_literal)
78
+ (string_literal)
79
+ ] @string
80
+ (escape_sequence) @string.escape
81
+
82
+ [
83
+ (true)
84
+ (false)
85
+ (null_literal)
86
+ ] @constant.builtin
87
+
88
+ [
89
+ (line_comment)
90
+ (block_comment)
91
+ ] @comment
92
+
93
+ ; Keywords
94
+
95
+ [
96
+ "abstract"
97
+ "assert"
98
+ "break"
99
+ "case"
100
+ "catch"
101
+ "class"
102
+ "continue"
103
+ "default"
104
+ "do"
105
+ "else"
106
+ "enum"
107
+ "exports"
108
+ "extends"
109
+ "final"
110
+ "finally"
111
+ "for"
112
+ "if"
113
+ "implements"
114
+ "import"
115
+ "instanceof"
116
+ "interface"
117
+ "module"
118
+ "native"
119
+ "new"
120
+ "non-sealed"
121
+ "open"
122
+ "opens"
123
+ "package"
124
+ "permits"
125
+ "private"
126
+ "protected"
127
+ "provides"
128
+ "public"
129
+ "requires"
130
+ "record"
131
+ "return"
132
+ "sealed"
133
+ "static"
134
+ "strictfp"
135
+ "switch"
136
+ "synchronized"
137
+ "throw"
138
+ "throws"
139
+ "to"
140
+ "transient"
141
+ "transitive"
142
+ "try"
143
+ "uses"
144
+ "volatile"
145
+ "when"
146
+ "while"
147
+ "with"
148
+ "yield"
149
+ ] @keyword
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "v0.23.5",
3
+ "assets": [
4
+ {
5
+ "name": "tree-sitter-java.tar.xz",
6
+ "url": "https://github.com/tree-sitter/tree-sitter-java/releases/download/v0.23.5/tree-sitter-java.tar.xz",
7
+ "size": 120752
8
+ },
9
+ {
10
+ "name": "tree-sitter-java.wasm",
11
+ "url": "https://github.com/tree-sitter/tree-sitter-java/releases/download/v0.23.5/tree-sitter-java.wasm",
12
+ "size": 414641
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,20 @@
1
+ (class_declaration
2
+ name: (identifier) @name) @definition.class
3
+
4
+ (method_declaration
5
+ name: (identifier) @name) @definition.method
6
+
7
+ (method_invocation
8
+ name: (identifier) @name
9
+ arguments: (argument_list) @reference.call)
10
+
11
+ (interface_declaration
12
+ name: (identifier) @name) @definition.interface
13
+
14
+ (type_list
15
+ (type_identifier) @name) @reference.implementation
16
+
17
+ (object_creation_expression
18
+ type: (type_identifier) @name) @reference.class
19
+
20
+ (superclass (type_identifier) @name) @reference.class
@@ -0,0 +1,8 @@
1
+ (jsx_opening_element (identifier) @tag (#match? @tag "^[a-z][^.]*$"))
2
+ (jsx_closing_element (identifier) @tag (#match? @tag "^[a-z][^.]*$"))
3
+ (jsx_self_closing_element (identifier) @tag (#match? @tag "^[a-z][^.]*$"))
4
+
5
+ (jsx_attribute (property_identifier) @attribute)
6
+ (jsx_opening_element (["<" ">"]) @punctuation.bracket)
7
+ (jsx_closing_element (["</" ">"]) @punctuation.bracket)
8
+ (jsx_self_closing_element (["<" "/>"]) @punctuation.bracket)
@@ -0,0 +1,12 @@
1
+ (formal_parameters
2
+ [
3
+ (identifier) @variable.parameter
4
+ (array_pattern
5
+ (identifier) @variable.parameter)
6
+ (object_pattern
7
+ [
8
+ (pair_pattern value: (identifier) @variable.parameter)
9
+ (shorthand_property_identifier_pattern) @variable.parameter
10
+ ])
11
+ ]
12
+ )
@@ -0,0 +1,204 @@
1
+ ; Variables
2
+ ;----------
3
+
4
+ (identifier) @variable
5
+
6
+ ; Properties
7
+ ;-----------
8
+
9
+ (property_identifier) @property
10
+
11
+ ; Function and method definitions
12
+ ;--------------------------------
13
+
14
+ (function_expression
15
+ name: (identifier) @function)
16
+ (function_declaration
17
+ name: (identifier) @function)
18
+ (method_definition
19
+ name: (property_identifier) @function.method)
20
+
21
+ (pair
22
+ key: (property_identifier) @function.method
23
+ value: [(function_expression) (arrow_function)])
24
+
25
+ (assignment_expression
26
+ left: (member_expression
27
+ property: (property_identifier) @function.method)
28
+ right: [(function_expression) (arrow_function)])
29
+
30
+ (variable_declarator
31
+ name: (identifier) @function
32
+ value: [(function_expression) (arrow_function)])
33
+
34
+ (assignment_expression
35
+ left: (identifier) @function
36
+ right: [(function_expression) (arrow_function)])
37
+
38
+ ; Function and method calls
39
+ ;--------------------------
40
+
41
+ (call_expression
42
+ function: (identifier) @function)
43
+
44
+ (call_expression
45
+ function: (member_expression
46
+ property: (property_identifier) @function.method))
47
+
48
+ ; Special identifiers
49
+ ;--------------------
50
+
51
+ ((identifier) @constructor
52
+ (#match? @constructor "^[A-Z]"))
53
+
54
+ ([
55
+ (identifier)
56
+ (shorthand_property_identifier)
57
+ (shorthand_property_identifier_pattern)
58
+ ] @constant
59
+ (#match? @constant "^[A-Z_][A-Z\\d_]+$"))
60
+
61
+ ((identifier) @variable.builtin
62
+ (#match? @variable.builtin "^(arguments|module|console|window|document)$")
63
+ (#is-not? local))
64
+
65
+ ((identifier) @function.builtin
66
+ (#eq? @function.builtin "require")
67
+ (#is-not? local))
68
+
69
+ ; Literals
70
+ ;---------
71
+
72
+ (this) @variable.builtin
73
+ (super) @variable.builtin
74
+
75
+ [
76
+ (true)
77
+ (false)
78
+ (null)
79
+ (undefined)
80
+ ] @constant.builtin
81
+
82
+ (comment) @comment
83
+
84
+ [
85
+ (string)
86
+ (template_string)
87
+ ] @string
88
+
89
+ (regex) @string.special
90
+ (number) @number
91
+
92
+ ; Tokens
93
+ ;-------
94
+
95
+ [
96
+ ";"
97
+ (optional_chain)
98
+ "."
99
+ ","
100
+ ] @punctuation.delimiter
101
+
102
+ [
103
+ "-"
104
+ "--"
105
+ "-="
106
+ "+"
107
+ "++"
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
+ ] @operator
148
+
149
+ [
150
+ "("
151
+ ")"
152
+ "["
153
+ "]"
154
+ "{"
155
+ "}"
156
+ ] @punctuation.bracket
157
+
158
+ (template_substitution
159
+ "${" @punctuation.special
160
+ "}" @punctuation.special) @embedded
161
+
162
+ [
163
+ "as"
164
+ "async"
165
+ "await"
166
+ "break"
167
+ "case"
168
+ "catch"
169
+ "class"
170
+ "const"
171
+ "continue"
172
+ "debugger"
173
+ "default"
174
+ "delete"
175
+ "do"
176
+ "else"
177
+ "export"
178
+ "extends"
179
+ "finally"
180
+ "for"
181
+ "from"
182
+ "function"
183
+ "get"
184
+ "if"
185
+ "import"
186
+ "in"
187
+ "instanceof"
188
+ "let"
189
+ "new"
190
+ "of"
191
+ "return"
192
+ "set"
193
+ "static"
194
+ "switch"
195
+ "target"
196
+ "throw"
197
+ "try"
198
+ "typeof"
199
+ "var"
200
+ "void"
201
+ "while"
202
+ "with"
203
+ "yield"
204
+ ] @keyword
@@ -0,0 +1,31 @@
1
+ ; Parse the contents of tagged template literals using
2
+ ; a language inferred from the tag.
3
+
4
+ (call_expression
5
+ function: [
6
+ (identifier) @injection.language
7
+ (member_expression
8
+ property: (property_identifier) @injection.language)
9
+ ]
10
+ arguments: (template_string (string_fragment) @injection.content)
11
+ (#set! injection.combined)
12
+ (#set! injection.include-children))
13
+
14
+
15
+ ; Parse regex syntax within regex literals
16
+
17
+ ((regex_pattern) @injection.content
18
+ (#set! injection.language "regex"))
19
+
20
+ ; Parse JSDoc annotations in comments
21
+
22
+ ((comment) @injection.content
23
+ (#set! injection.language "jsdoc"))
24
+
25
+ ; Parse Ember/Glimmer/Handlebars/HTMLBars/etc. template literals
26
+ ; e.g.: await render(hbs`<SomeComponent />`)
27
+ (call_expression
28
+ function: ((identifier) @_name
29
+ (#eq? @_name "hbs"))
30
+ arguments: ((template_string) @glimmer
31
+ (#offset! @glimmer 0 1 0 -1)))
@@ -0,0 +1,23 @@
1
+ ; Scopes
2
+ ;-------
3
+
4
+ [
5
+ (statement_block)
6
+ (function_expression)
7
+ (arrow_function)
8
+ (function_declaration)
9
+ (method_definition)
10
+ ] @local.scope
11
+
12
+ ; Definitions
13
+ ;------------
14
+
15
+ (pattern/identifier) @local.definition
16
+
17
+ (variable_declarator
18
+ name: (identifier) @local.definition)
19
+
20
+ ; References
21
+ ;------------
22
+
23
+ (identifier) @local.reference
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "v0.25.0",
3
+ "assets": [
4
+ {
5
+ "name": "tree-sitter-javascript.tar.gz",
6
+ "url": "https://github.com/tree-sitter/tree-sitter-javascript/releases/download/v0.25.0/tree-sitter-javascript.tar.gz",
7
+ "size": 309045
8
+ },
9
+ {
10
+ "name": "tree-sitter-javascript.wasm",
11
+ "url": "https://github.com/tree-sitter/tree-sitter-javascript/releases/download/v0.25.0/tree-sitter-javascript.wasm",
12
+ "size": 411770
13
+ }
14
+ ]
15
+ }