tree-sitter-wasm 1.0.3 → 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/index.d.ts CHANGED
@@ -33,6 +33,7 @@ export type QueryMap = {
33
33
  "embedded_template": "highlights" | "injections" | "injections-ejs" | "injections-erb" | "injections-etlua";
34
34
  "erlang": "folds" | "highlights" | "injections";
35
35
  "fish": "folds" | "highlights" | "indents" | "injections" | "locals";
36
+ "fortran": "folds" | "highlights" | "indents" | "injections" | "locals" | "tags";
36
37
  "gdscript": "folds" | "highlights" | "indents" | "injections" | "locals";
37
38
  "gdshader": "highlights" | "injections" | "locals" | "tags";
38
39
  "git_config": "folds" | "highlights" | "injections";
@@ -93,13 +94,16 @@ export type QueryMap = {
93
94
  "solidity": "folds" | "highlights" | "highlights-nvim" | "injections" | "locals" | "tags";
94
95
  "sql": "folds" | "highlights" | "indents" | "injections";
95
96
  "ssh_config": "folds" | "highlights" | "indents" | "injections" | "locals";
97
+ "svelte": "folds" | "highlights" | "indents" | "injections" | "locals" | "tags";
96
98
  "swift": "folds" | "highlights" | "indents" | "injections" | "locals" | "outline" | "tags" | "textobjects";
99
+ "systemverilog": "folds" | "highlights" | "injections";
97
100
  "templ": "folds" | "highlights" | "injections";
98
101
  "terraform": "folds" | "highlights" | "indents" | "injections";
99
102
  "toml": "folds" | "highlights" | "indents" | "injections" | "locals";
100
103
  "tsv": "highlights";
101
104
  "tsx": "folds" | "highlights" | "indents" | "injections" | "locals" | "tags";
102
105
  "typescript": "folds" | "highlights" | "indents" | "injections" | "locals" | "tags";
106
+ "typst": "folds" | "highlights" | "indents" | "injections";
103
107
  "vim": "folds" | "highlights" | "injections" | "locals";
104
108
  "vimdoc": "highlights" | "injections";
105
109
  "vue": "folds" | "highlights" | "indents" | "injections";
package/manifest.json CHANGED
@@ -213,6 +213,14 @@
213
213
  "injections",
214
214
  "locals"
215
215
  ],
216
+ "fortran": [
217
+ "folds",
218
+ "highlights",
219
+ "indents",
220
+ "injections",
221
+ "locals",
222
+ "tags"
223
+ ],
216
224
  "gdscript": [
217
225
  "folds",
218
226
  "highlights",
@@ -595,6 +603,14 @@
595
603
  "injections",
596
604
  "locals"
597
605
  ],
606
+ "svelte": [
607
+ "folds",
608
+ "highlights",
609
+ "indents",
610
+ "injections",
611
+ "locals",
612
+ "tags"
613
+ ],
598
614
  "swift": [
599
615
  "folds",
600
616
  "highlights",
@@ -605,6 +621,11 @@
605
621
  "tags",
606
622
  "textobjects"
607
623
  ],
624
+ "systemverilog": [
625
+ "folds",
626
+ "highlights",
627
+ "injections"
628
+ ],
608
629
  "templ": [
609
630
  "folds",
610
631
  "highlights",
@@ -642,6 +663,12 @@
642
663
  "locals",
643
664
  "tags"
644
665
  ],
666
+ "typst": [
667
+ "folds",
668
+ "highlights",
669
+ "indents",
670
+ "injections"
671
+ ],
645
672
  "vim": [
646
673
  "folds",
647
674
  "highlights",
package/out/d/tags.scm CHANGED
@@ -26,3 +26,4 @@
26
26
  (variable_declaration (type (identifier) @name) @reference.class (declarator))
27
27
 
28
28
  ((alias_declaration (alias_initializer . (identifier) @name))) @definition.class
29
+ (mixin_template_declaration (mixin) (template_declaration (template) (identifier) @name)) @definition.type
@@ -0,0 +1,12 @@
1
+ ;; by @oponkork
2
+ [
3
+ (if_statement)
4
+ (where_statement)
5
+ (enum_statement)
6
+ (do_loop)
7
+ (derived_type_definition)
8
+ (function)
9
+ (subroutine)
10
+ (module_procedure)
11
+ (interface)
12
+ ] @fold
@@ -0,0 +1,204 @@
1
+ [
2
+ (identifier)
3
+ (module_name)
4
+ ] @variable
5
+
6
+ (string_literal) @string
7
+ (number_literal) @number
8
+ (statement_label) @number
9
+ (statement_label_reference) @number
10
+ (boolean_literal) @boolean
11
+ (comment) @comment
12
+ (custom_directive) @custom_directive
13
+
14
+ [
15
+ (derived_type)
16
+ (derived_type_statement)
17
+ (import_statement)
18
+ (intrinsic_type)
19
+ (type_name)
20
+ ] @type
21
+
22
+ (intrinsic_type) @type.builtin
23
+
24
+ (base_type_specifier
25
+ (identifier) @type)
26
+
27
+ [
28
+ (module_statement)
29
+ (submodule_statement)
30
+ ] @module
31
+
32
+ [
33
+ (abstract_specifier)
34
+ (access_specifier)
35
+ (block_label)
36
+ (block_label_start_expression)
37
+ (none)
38
+ (procedure_attributes)
39
+ (procedure_qualifier)
40
+ (type_qualifier)
41
+ ] @attribute
42
+
43
+ [
44
+ "#define"
45
+ "#elif"
46
+ "#endif"
47
+ "#if"
48
+ "#ifdef"
49
+ (base_type_specifier)
50
+ (block_construct)
51
+ (contains_statement)
52
+ (default)
53
+ (end_associate_statement)
54
+ (end_block_construct_statement)
55
+ (end_block_data_statement)
56
+ (end_coarray_critical_statement)
57
+ (end_coarray_team_statement)
58
+ (end_do_loop_statement)
59
+ (end_enum_statement)
60
+ (end_enumeration_type_statement)
61
+ (end_forall_statement)
62
+ (end_function_statement)
63
+ (end_if_statement)
64
+ (end_interface_statement)
65
+ (end_module_procedure_statement)
66
+ (end_module_statement)
67
+ (end_program_statement)
68
+ (end_select_statement)
69
+ (end_submodule_statement)
70
+ (end_subroutine_statement)
71
+ (end_type_statement)
72
+ (end_where_statement)
73
+ (enum_statement)
74
+ (enumeration_type_statement)
75
+ (enumerator_statement)
76
+ (equivalence_statement)
77
+ (function_statement)
78
+ (implicit_statement)
79
+ (interface_statement)
80
+ (keyword_statement)
81
+ (language_binding)
82
+ (namelist_statement)
83
+ (print_statement)
84
+ (procedure_statement)
85
+ (program_statement)
86
+ (subroutine_statement)
87
+ ] @keyword
88
+
89
+ (use_statement "use" @keyword)
90
+ (use_statement "intrinsic" @keyword)
91
+ (included_items "only" @keyword)
92
+ (allocate_statement "allocate" @keyword)
93
+ (deallocate_statement "deallocate" @keyword)
94
+ (subroutine_call "call" @keyword)
95
+ (do_statement "do" @keyword)
96
+ (while_statement "while" @keyword)
97
+ (if_statement ["if" "then"] @keyword)
98
+ (elseif_clause ["else" "if" "elseif"] @keyword)
99
+ (else_clause "else" @keyword)
100
+ (open_statement "open" @keyword)
101
+ (write_statement "write" @keyword)
102
+ (private_statement "private" @keyword)
103
+ (public_statement "public" @keyword)
104
+
105
+
106
+ (select_case_statement "select" @keyword "case" @keyword)
107
+ (select_type_statement "select" @keyword "type" @keyword)
108
+ (select_rank_statement "select" @keyword "rank" @keyword)
109
+ (case_statement "case" @keyword)
110
+ (type_statement "type" @keyword)
111
+ (rank_statement "rank" @keyword)
112
+
113
+
114
+ [
115
+ "*"
116
+ "+"
117
+ "-"
118
+ "/"
119
+ "="
120
+ "<"
121
+ ">"
122
+ "<="
123
+ ">="
124
+ "=="
125
+ "/="
126
+ ".and."
127
+ ".or."
128
+ ".lt."
129
+ ".gt."
130
+ ".ge."
131
+ ".le."
132
+ ".eq."
133
+ ".eqv."
134
+ ".neqv."
135
+ ".ne."
136
+ ] @operator
137
+
138
+ ;; Brackets
139
+ [
140
+ "("
141
+ ")"
142
+ "["
143
+ "]"
144
+ "<<<"
145
+ ">>>"
146
+ ] @punctuation.bracket
147
+
148
+ ;; Delimiter
149
+ [
150
+ "::"
151
+ ","
152
+ "%"
153
+ ":"
154
+ ] @punctuation.delimiter
155
+
156
+ "&" @punctuation.special
157
+
158
+ (parameters
159
+ (identifier) @variable.parameter)
160
+
161
+ (program_statement
162
+ (name) @variable)
163
+
164
+ (module_statement
165
+ (name) @variable)
166
+
167
+ (submodule_statement
168
+ (module_name) (name) @variable)
169
+
170
+ (function_statement
171
+ (name) @function)
172
+
173
+ (subroutine_statement
174
+ (name) @function)
175
+
176
+ (module_procedure_statement
177
+ (name) @function)
178
+
179
+ (end_program_statement
180
+ (name) @variable)
181
+
182
+ (end_module_statement
183
+ (name) @variable)
184
+
185
+ (end_submodule_statement
186
+ (name) @variable)
187
+
188
+ (end_function_statement
189
+ (name) @function)
190
+
191
+ (end_subroutine_statement
192
+ (name) @function)
193
+
194
+ (end_module_procedure_statement
195
+ (name) @function)
196
+
197
+ (subroutine_call
198
+ (identifier) @function)
199
+
200
+ (keyword_argument
201
+ name: (identifier) @keyword)
202
+
203
+ (derived_type_member_expression
204
+ (type_member) @property)
@@ -0,0 +1,31 @@
1
+ [
2
+ (module)
3
+ (submodule)
4
+ (program)
5
+ (subroutine)
6
+ (module_procedure)
7
+ (function)
8
+ ; (interface)
9
+ (if_statement)
10
+ (do_loop)
11
+ (where_statement)
12
+ (derived_type_definition)
13
+ (enum)
14
+ ] @indent
15
+
16
+ [
17
+ (end_module_statement)
18
+ (end_submodule_statement)
19
+ (end_program_statement)
20
+ (end_subroutine_statement)
21
+ (end_module_procedure_statement)
22
+ (end_function_statement)
23
+ ; (end_interface_statement)
24
+ (end_if_statement)
25
+ (end_do_loop_statement)
26
+ (else_clause)
27
+ (elseif_clause)
28
+ (end_type_statement)
29
+ (end_enum_statement)
30
+ (end_where_statement)
31
+ ] @branch
@@ -0,0 +1,2 @@
1
+ ((comment) @injection.content
2
+ (#set! injection.language "comment"))
@@ -0,0 +1,10 @@
1
+ (derived_type_definition) @local.scope
2
+ (program) @local.scope
3
+ (module) @local.scope
4
+ (submodule) @local.scope
5
+ (interface) @local.scope
6
+ (function) @local.scope
7
+ (subroutine) @local.scope
8
+ (block_construct) @local.scope
9
+
10
+ (variable_declaration declarator: (identifier) @local.definition)
@@ -0,0 +1,42 @@
1
+ (derived_type_statement
2
+ (type_name) @name) @definition.class
3
+
4
+ (base_type_specifier
5
+ (identifier) @name) @reference.class
6
+
7
+ (program_statement
8
+ (name) @name) @definition.module
9
+
10
+ (module_statement
11
+ (name) @name) @definition.module
12
+
13
+ (submodule_statement
14
+ (module_name) (name) @name) @definition.module
15
+
16
+ (interface
17
+ (function
18
+ (function_statement
19
+ (name) @name) @definition.interface))
20
+
21
+ (interface
22
+ (subroutine
23
+ (subroutine_statement
24
+ (name) @name) @definition.interface))
25
+
26
+ (function_statement
27
+ (name) @name) @definition.function
28
+
29
+ (subroutine_statement
30
+ (name) @name) @definition.function
31
+
32
+ (module_procedure_statement
33
+ (name) @name) @reference.implementation
34
+
35
+ (call_expression
36
+ (identifier) @name) @reference.call
37
+
38
+ (subroutine_call
39
+ (identifier) @name) @reference.call
40
+
41
+ (derived_type
42
+ (type_name) @name) @reference.class
@@ -0,0 +1,9 @@
1
+ [
2
+ (style_element)
3
+ (script_element)
4
+ (element)
5
+ (if_statement)
6
+ (else_statement)
7
+ (each_statement)
8
+ (await_statement)
9
+ ] @fold
@@ -0,0 +1,68 @@
1
+ ; Special identifiers
2
+ ;--------------------
3
+
4
+ ; TODO:
5
+ ((element (start_tag (tag_name) @_tag) (text) @text.title)
6
+ (#match? @_tag "^(h[0-9]|title)$"))
7
+
8
+ ((element (start_tag (tag_name) @_tag) (text) @text.strong)
9
+ (#match? @_tag "^(strong|b)$"))
10
+
11
+ ((element (start_tag (tag_name) @_tag) (text) @text.emphasis)
12
+ (#match? @_tag "^(em|i)$"))
13
+
14
+ ((element (start_tag (tag_name) @_tag) (text) @text.strike)
15
+ (#match? @_tag "^(s|del)$"))
16
+
17
+ ((element (start_tag (tag_name) @_tag) (text) @text.underline)
18
+ (#eq? @_tag "u"))
19
+
20
+ ((element (start_tag (tag_name) @_tag) (text) @text.literal)
21
+ (#match? @_tag "^(code|kbd)$"))
22
+
23
+ ((element (start_tag (tag_name) @_tag) (text) @text.uri)
24
+ (#eq? @_tag "a"))
25
+
26
+ ((attribute
27
+ (attribute_name) @_attr
28
+ (quoted_attribute_value (attribute_value) @text.uri))
29
+ (#match? @_attr "^(href|src)$"))
30
+
31
+ (tag_name) @tag
32
+ (attribute_name) @property
33
+ (erroneous_end_tag_name) @error
34
+ (comment) @comment
35
+
36
+ [
37
+ (attribute_value)
38
+ (quoted_attribute_value)
39
+ ] @string
40
+
41
+ [
42
+ (text)
43
+ (raw_text_expr)
44
+ ] @none
45
+
46
+ [
47
+ (special_block_keyword)
48
+ (then)
49
+ (as)
50
+ ] @keyword
51
+
52
+ [
53
+ "{"
54
+ "}"
55
+ ] @punctuation.bracket
56
+
57
+ "=" @operator
58
+
59
+ [
60
+ "<"
61
+ ">"
62
+ "</"
63
+ "/>"
64
+ "#"
65
+ ":"
66
+ "/"
67
+ "@"
68
+ ] @tag.delimiter
@@ -0,0 +1,20 @@
1
+ [
2
+ (element)
3
+ (if_statement)
4
+ (each_statement)
5
+ (await_statement)
6
+ (script_element)
7
+ (style_element)
8
+ ] @indent
9
+
10
+ [
11
+ (end_tag)
12
+ (else_statement)
13
+ (if_end_expr)
14
+ (each_end_expr)
15
+ (await_end_expr)
16
+ ">"
17
+ "/>"
18
+ ] @branch
19
+
20
+ (comment) @ignore
@@ -0,0 +1,33 @@
1
+ ; injections.scm
2
+ ; --------------
3
+ ((style_element
4
+ (raw_text) @css))
5
+
6
+ (
7
+ (style_element
8
+ (start_tag
9
+ (attribute
10
+ (quoted_attribute_value (attribute_value))))
11
+ (raw_text) @css)
12
+ )
13
+
14
+ ((attribute
15
+ (attribute_name) @_attr
16
+ (quoted_attribute_value (attribute_value) @css))
17
+ (#eq? @_attr "style"))
18
+
19
+ ((script_element
20
+ (raw_text) @javascript))
21
+
22
+ ((raw_text_expr) @javascript)
23
+
24
+ (
25
+ (script_element
26
+ (start_tag
27
+ (attribute
28
+ (quoted_attribute_value (attribute_value) @_lang)))
29
+ (raw_text) @typescript)
30
+ (#match? @_lang "(ts|typescript)")
31
+ )
32
+
33
+ (comment) @comment
@@ -0,0 +1 @@
1
+ ;; locals
@@ -0,0 +1 @@
1
+ ;; tags
@@ -0,0 +1,23 @@
1
+ [
2
+ (seq_block)
3
+ (function_body_declaration)
4
+ (task_body_declaration)
5
+ (generate_block)
6
+ (always_construct)
7
+ (property_declaration)
8
+ (checker_declaration)
9
+ (class_declaration)
10
+ (config_declaration)
11
+ (covergroup_declaration)
12
+ (clocking_declaration)
13
+ (interface_declaration)
14
+ (module_declaration)
15
+ (package_declaration)
16
+ (module_instantiation)
17
+ (program_declaration)
18
+ (specify_block)
19
+ (generate_region)
20
+ (package_import_declaration)
21
+ (text_macro_definition)
22
+ (include_compiler_directive)+
23
+ ] @fold
@@ -0,0 +1,325 @@
1
+ ;; Comments
2
+ (one_line_comment) @comment
3
+ (block_comment) @comment
4
+
5
+
6
+ ;; Strings
7
+ (string_literal) @string
8
+ (quoted_string) @string ; `include strings
9
+ (system_lib_string) @string
10
+
11
+
12
+ ;; Keywords
13
+ (["begin" "end" "this"]) @keyword
14
+ (["input" "output" "inout" "ref"]) @keyword
15
+ (["alias" "and" "assert" "assign" "assume" "before" "bind" "binsof" "break"
16
+ "case" "checker" "class" "class" "clocking" "config" "const" "constraint"
17
+ "cover" "covergroup" "coverpoint" "cross" "default" "defparam" "disable"
18
+ "do" "else" "endcase" "endchecker" "endclass" "endclocking" "endconfig"
19
+ "endfunction" "endgenerate" "endgroup" "endinterface" "endmodule"
20
+ "endpackage" "endprogram" "endproperty" "endsequence" "endtask" "enum"
21
+ "extends" "extern" "final" "first_match" "for" "force" "foreach" "forever"
22
+ "fork" "forkjoin" "function" "generate" "genvar" "if" "iff" "illegal_bins"
23
+ "implements" "import" "initial" "inside" "interconnect" "interface"
24
+ "intersect" "join" "join_any" "join_none" "local" "localparam" "matches"
25
+ "modport" "new" "null" "option" "or" "package" "packed" "parameter"
26
+ "program" "property" "pure" "randcase" "randomize" "release" "repeat"
27
+ "return" "sequence" "showcancelled" "soft" "solve" "struct" "super" "tagged"
28
+ "task" "timeprecision" "timeunit" "type" "typedef" "union" "unique"
29
+ "virtual" "wait" "while" "with"
30
+ (always_keyword) ; always, always_comb, always_latch, always_ff
31
+ (bins_keyword) ; bins, illegal_bins, ignore_bins
32
+ (case_keyword) ; case, casez, casex
33
+ (class_item_qualifier) ; static, protected, local
34
+ (edge_identifier) ; posedge, negedge, edge
35
+ (lifetime) ; static, automatic
36
+ (module_keyword) ; module, macromodule
37
+ (random_qualifier) ; rand, randc
38
+ (unique_priority)]) @keyword ; unique, unique0, priority
39
+
40
+
41
+ ;; Preprocessor directives and macro usage
42
+ (["`include" "`define" "`ifdef" "`ifndef" "`timescale" "`default_nettype"
43
+ "`elsif" "`undef" (resetall_compiler_directive) (undefineall_compiler_directive)
44
+ "`endif" "`else" "`unconnected_drive" (celldefine_compiler_directive)
45
+ (endcelldefine_compiler_directive) (endkeywords_directive) "`line"
46
+ "`begin_keywords" "`pragma" "`__FILE__" "`__LINE__"]) @string.special
47
+ (text_macro_usage
48
+ (simple_identifier) @string.special)
49
+
50
+
51
+ ;; Delimiters, operators
52
+ ([";" ":" "," "::"
53
+ "=" "?" "|=" "&=" "^="
54
+ "|->" "|=>" "->"
55
+ ":=" ":/" "-:" "+:"]) @punctuation.delimiter
56
+ (["(" ")"]) @punctuation.bracket
57
+ (["[" "]"]) @punctuation.bracket
58
+ (["{" "}" "'{"]) @punctuation.bracket
59
+
60
+ (["."] @operator)
61
+ (["+" "-" "*" "/" "%" "**"]) @operator
62
+ (["<" "<=" ">" ">="]) @operator
63
+ (["===" "!==" "==" "!="]) @operator
64
+ (["&&" "||" "!"]) @operator
65
+ (["~" "&" "~&" "|" "~|" "^" "~^"]) @operator
66
+ (["<<" ">>" "<<<" ">>>"]) @operator
67
+
68
+ (["@" "#" "##"]) @operator
69
+ (assignment_operator) @operator
70
+ (unary_operator) @operator
71
+ (inc_or_dec_operator) @operator
72
+ (stream_operator) @operator
73
+ (event_trigger) @operator
74
+ (["->" "->>"]) @operator
75
+
76
+
77
+ ;; Declarations
78
+ ;; Module/interface/program/package/class/checker
79
+ (module_nonansi_header
80
+ name: (simple_identifier) @function)
81
+ (module_ansi_header
82
+ name: (simple_identifier) @function)
83
+ (interface_nonansi_header
84
+ name: (simple_identifier) @function)
85
+ (interface_ansi_header
86
+ name: (simple_identifier) @function)
87
+ (program_nonansi_header
88
+ name: (simple_identifier) @function)
89
+ (program_ansi_header
90
+ name: (simple_identifier) @function)
91
+ (package_declaration
92
+ name: (simple_identifier) @function)
93
+ (class_declaration
94
+ name: (simple_identifier) @function)
95
+ (interface_class_declaration
96
+ name: (simple_identifier) @function)
97
+ (checker_declaration
98
+ name: (simple_identifier) @function)
99
+ (class_declaration
100
+ (class_type
101
+ (simple_identifier) @type)) ; Parent class
102
+ ;; Function/task/methods
103
+ (function_body_declaration
104
+ name: (simple_identifier) @function)
105
+ (task_body_declaration
106
+ name: (simple_identifier) @function)
107
+ (function_prototype
108
+ (data_type_or_void)
109
+ name: (simple_identifier) @function)
110
+ (task_prototype
111
+ name: (simple_identifier) @function)
112
+ (class_scope ; Definition of extern defined methods
113
+ (class_type
114
+ (simple_identifier)) @function)
115
+
116
+
117
+ ;; Types
118
+ [(integer_vector_type) ; bit, logic, reg
119
+ (integer_atom_type) ; byte, shortint, int, longint, integer, time
120
+ (non_integer_type) ; shortreal, real, realtime
121
+ (net_type) ; supply0, supply1, tri, triand, trior, trireg, tri0, tri1, uwire, wire, wand, wor
122
+ ["string" "event" "signed" "unsigned" "chandle"]] @type
123
+ (data_type_or_implicit
124
+ (data_type
125
+ (simple_identifier)) @type)
126
+ (data_type
127
+ (class_type
128
+ (simple_identifier) @type
129
+ (parameter_value_assignment)))
130
+ (data_type
131
+ (class_type
132
+ (simple_identifier) @operator
133
+ (simple_identifier) @type))
134
+ (net_port_header
135
+ (net_port_type
136
+ (simple_identifier) @type))
137
+ (variable_port_header
138
+ (variable_port_type
139
+ (data_type
140
+ (simple_identifier) @type)))
141
+ (["void'" (data_type_or_void)]) @type ; void cast of task called as a function
142
+ (interface_port_header ; Interfaces with modports
143
+ interface_name: (simple_identifier) @type
144
+ modport_name: (simple_identifier) @type)
145
+ (type_assignment
146
+ name: (simple_identifier) @type)
147
+ (net_declaration ; User type variable declaration
148
+ (simple_identifier) @type)
149
+ (enum_base_type ; Enum base type with user type
150
+ (simple_identifier) @type)
151
+
152
+
153
+ ;; Instances
154
+ ;; Module names
155
+ (module_instantiation
156
+ instance_type: (simple_identifier) @module)
157
+ (interface_instantiation
158
+ instance_type: (simple_identifier) @module)
159
+ (program_instantiation
160
+ instance_type: (simple_identifier) @module)
161
+ (checker_instantiation
162
+ instance_type: (simple_identifier) @module)
163
+ (udp_instantiation
164
+ instance_type: (simple_identifier) @module)
165
+ (gate_instantiation
166
+ [(cmos_switchtype)
167
+ (mos_switchtype)
168
+ (enable_gatetype)
169
+ (n_input_gatetype)
170
+ (n_output_gatetype)
171
+ (pass_en_switchtype)
172
+ (pass_switchtype)
173
+ "pulldown" "pullup"]
174
+ @module)
175
+ ;; Instance names
176
+ (name_of_instance
177
+ instance_name: (simple_identifier) @constant)
178
+ ;; Instance parameters
179
+ (module_instantiation
180
+ (parameter_value_assignment
181
+ (list_of_parameter_value_assignments
182
+ (named_parameter_assignment
183
+ (simple_identifier) @constant))))
184
+ (module_instantiation
185
+ (parameter_value_assignment
186
+ (list_of_parameter_value_assignments
187
+ (ordered_parameter_assignment
188
+ (param_expression
189
+ (data_type
190
+ (simple_identifier) @constant))))))
191
+ ;; Port names
192
+ (named_port_connection
193
+ port_name: (simple_identifier) @constant)
194
+ (named_parameter_assignment
195
+ (simple_identifier) @constant)
196
+ (named_checker_port_connection
197
+ port_name: (simple_identifier) @constant)
198
+ ;; Bind statements
199
+ (bind_directive
200
+ (bind_target_scope
201
+ (simple_identifier) @constant))
202
+
203
+
204
+ ;; Numbers
205
+ (hex_number
206
+ size: (unsigned_number) @number
207
+ base: (hex_base) @punctuation.delimiter)
208
+ (decimal_number
209
+ size: (unsigned_number) @number
210
+ base: (decimal_base) @punctuation.delimiter)
211
+ (octal_number
212
+ size: (unsigned_number) @number
213
+ base: (octal_base) @punctuation.delimiter)
214
+ (binary_number
215
+ size: (unsigned_number) @number
216
+ base: (binary_base) @punctuation.delimiter)
217
+ ;; Same as before but without the width (width extension)
218
+ (hex_number
219
+ base: (hex_base) @punctuation.delimiter)
220
+ (decimal_number
221
+ base: (decimal_base) @punctuation.delimiter)
222
+ (octal_number
223
+ base: (octal_base) @punctuation.delimiter)
224
+ (binary_number
225
+ base: (binary_base) @punctuation.delimiter)
226
+
227
+
228
+ ;; Arrays
229
+ (unpacked_dimension
230
+ [(constant_expression) (constant_range)] @number)
231
+ (packed_dimension
232
+ (constant_range) @number)
233
+ (select
234
+ (constant_range) @number)
235
+ (constant_select
236
+ (constant_range
237
+ (constant_expression) @number))
238
+ (constant_bit_select
239
+ (constant_expression) @number)
240
+ (bit_select
241
+ (expression) @number)
242
+ (indexed_range
243
+ (expression) @number
244
+ (constant_expression) @number)
245
+ (constant_indexed_range
246
+ (constant_expression) @number)
247
+ (value_range ; inside {[min_range:max_range]}, place here to apply override
248
+ (expression) @constant)
249
+ (dynamic_array_new
250
+ (expression) @constant)
251
+
252
+
253
+ ;; Misc
254
+ ;; Timeunit
255
+ ((time_unit) @constant.builtin)
256
+ ;; Enum labels
257
+ (enum_name_declaration
258
+ (simple_identifier) @constant.builtin)
259
+ ;; Case item label (not radix)
260
+ (case_item_expression
261
+ (expression
262
+ (primary
263
+ (hierarchical_identifier
264
+ (simple_identifier) @constant.builtin))))
265
+ ;; Hierarchical references, interface signals, class members, package scope
266
+ (hierarchical_identifier
267
+ (simple_identifier) @punctuation.delimiter
268
+ "."
269
+ (simple_identifier))
270
+ (method_call
271
+ (primary) @punctuation.delimiter
272
+ (["." "::"])
273
+ (method_call_body))
274
+ (package_scope
275
+ (simple_identifier) @punctuation.delimiter)
276
+ (method_call
277
+ (primary
278
+ (select
279
+ (simple_identifier) @punctuation.delimiter))
280
+ (method_call_body))
281
+ ;; Attributes
282
+ (["(*" "*)"] @constant)
283
+ (attribute_instance
284
+ (attr_spec (simple_identifier) @attribute))
285
+ ;; Typedefs
286
+ (type_declaration
287
+ (class_type (simple_identifier) @type)
288
+ type_name: (simple_identifier) @constant)
289
+ (type_declaration
290
+ type_name: (simple_identifier) @constant)
291
+ ("typedef" "class" (simple_identifier) @constant)
292
+ ;; Coverpoint & cross labels
293
+ (cover_point
294
+ name: (simple_identifier) @constant)
295
+ (cover_cross
296
+ name: (simple_identifier) @constant)
297
+ ;; Loop variables (foreach[i])
298
+ (loop_variables
299
+ (simple_identifier) @constant)
300
+ ;; Bins values
301
+ (bins_or_options
302
+ (expression
303
+ (primary
304
+ (concatenation
305
+ (expression) @constant))))
306
+ ;; Bins ranges
307
+ (covergroup_value_range
308
+ (expression) @constant)
309
+ ;; Queue dimension
310
+ (("$") @punctuation.special)
311
+ ;; Parameterized classes (e.g: uvm_config_db #(axi_stream_agent_config))
312
+ (class_type
313
+ (parameter_value_assignment
314
+ (list_of_parameter_value_assignments) @punctuation.delimiter))
315
+
316
+
317
+ ;; System-tf
318
+ ([(system_tf_identifier) ; System task/function
319
+ "$fatal" "$error" "$warning" "$info" ; (severity_system_task)
320
+ "$stop" "$finish" "$exit"]) ; (simulation_control_task)
321
+ @function.builtin
322
+
323
+
324
+ ;; Errors
325
+ (ERROR) @error
@@ -0,0 +1,8 @@
1
+ ([
2
+ (one_line_comment)
3
+ (block_comment)
4
+ ] @injection.content
5
+ (#set! injection.language "comment"))
6
+
7
+ ((macro_text) @injection.content
8
+ (#set! injection.language "verilog"))
@@ -0,0 +1,11 @@
1
+ [
2
+ (set)
3
+ (let)
4
+ (show)
5
+ (call)
6
+ (section)
7
+ (for)
8
+ (branch)
9
+ (content)
10
+ (raw_blck)
11
+ ] @fold
@@ -0,0 +1,141 @@
1
+ ; punctuation
2
+ "#" @punctuation.special
3
+
4
+ [
5
+ ":"
6
+ ";"
7
+ ","
8
+ ] @punctuation.delimiter
9
+
10
+ ; TODO: context blocks for "[" "]"?
11
+ [
12
+ "("
13
+ ")"
14
+ "{"
15
+ "}"
16
+ "["
17
+ "]"
18
+ ] @punctuation.bracket
19
+
20
+ ; operators
21
+ [
22
+ "-"
23
+ "+"
24
+ "*"
25
+ "/"
26
+ "=="
27
+ "!="
28
+ "<"
29
+ "<="
30
+ ">"
31
+ ">="
32
+ "="
33
+ "in"
34
+ "and"
35
+ "or"
36
+ "not"
37
+ ] @operator
38
+
39
+ ; keywords
40
+ [
41
+ "import"
42
+ "include"
43
+ ] @keyword.import
44
+
45
+ [
46
+ "let"
47
+ "set"
48
+ "show"
49
+ ] @keyword
50
+
51
+ ; control flow
52
+ [
53
+ "for"
54
+ "while"
55
+ "break"
56
+ "continue"
57
+ ] @keyword.repeat
58
+
59
+ [
60
+ "if"
61
+ "else"
62
+ ] @keyword.conditional
63
+
64
+ ; special case: #for (ident) in (expr)
65
+ (for
66
+ "in" @keyword.repeat)
67
+
68
+ ; type literals
69
+ (number) @number
70
+
71
+ (string) @string
72
+
73
+ (bool) @boolean
74
+
75
+ (ident) @constant
76
+
77
+ ; name-value pairs
78
+ (tagged
79
+ field: (ident) @variable.member)
80
+
81
+ (call
82
+ item: (ident) @function.call)
83
+
84
+ ; text
85
+ (text) @spell
86
+
87
+ (heading
88
+ "=" @markup.heading.1) @markup.heading.1
89
+
90
+ (heading
91
+ "==" @markup.heading.2) @markup.heading.2
92
+
93
+ (heading
94
+ "===" @markup.heading.3) @markup.heading.3
95
+
96
+ (heading
97
+ "====" @markup.heading.4) @markup.heading.4
98
+
99
+ (heading
100
+ "=====" @markup.heading.5) @markup.heading.5
101
+
102
+ (heading
103
+ "======" @markup.heading.6) @markup.heading.6
104
+
105
+ (strong) @markup.strong
106
+
107
+ (emph) @markup.italic
108
+
109
+ ((url) @markup.link.url
110
+ (#set! @markup.link.url url @markup.link.url))
111
+
112
+ (call
113
+ item: (ident) @_link
114
+ (#eq? @_link "link")
115
+ (group
116
+ .
117
+ (string) @markup.link.url
118
+ (#offset! @markup.link.url 0 1 0 -1)
119
+ (#set! @markup.link.url url @markup.link.url)))
120
+
121
+ ; code blocks
122
+ (raw_span) @markup.raw
123
+
124
+ (raw_blck) @markup.raw
125
+
126
+ (raw_blck
127
+ lang: (ident) @label)
128
+
129
+ (raw_blck
130
+ (blob) @markup.raw.block)
131
+
132
+ ; refs and labels
133
+ (label) @markup.link.label
134
+
135
+ (ref) @markup.link
136
+
137
+ ; math
138
+ (math) @markup.math
139
+
140
+ ; comments
141
+ (comment) @comment @spell
@@ -0,0 +1,14 @@
1
+ [
2
+ (set)
3
+ (let)
4
+ (show)
5
+ (call)
6
+ (for)
7
+ (branch)
8
+ ] @indent.begin
9
+
10
+ [
11
+ "]"
12
+ "}"
13
+ ")"
14
+ ] @indent.end @indent.branch
@@ -0,0 +1,6 @@
1
+ ((comment) @injection.content
2
+ (#set! injection.language "comment"))
3
+
4
+ (raw_blck
5
+ (ident) @injection.language
6
+ (blob) @injection.content)
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-wasm",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Pre-built WebAssembly binaries and queries for tree-sitter grammars.",
5
5
  "keywords": [
6
6
  "incremental",
@@ -89,6 +89,7 @@
89
89
  "tree-sitter-embedded-template": "^0.25.0",
90
90
  "tree-sitter-erlang": "git+https://github.com/WhatsApp/tree-sitter-erlang.git#e446ec60022a7cafe157805742b41c04b499cc5d",
91
91
  "tree-sitter-fish": "git+https://github.com/ram02z/tree-sitter-fish.git#f435b0bd772578c70e5d158b85267bb886316f88",
92
+ "tree-sitter-fortran": "git+https://github.com/stadelmanma/tree-sitter-fortran.git#7edacd2b21aa80057d9725384a1304a1c758e0f8",
92
93
  "tree-sitter-gdscript": "^6.1.0",
93
94
  "tree-sitter-gdshader": "git+https://github.com/airblast-dev/tree-sitter-gdshader.git#68268631c8b6dc093985f1246b099f81b30ea7d1",
94
95
  "tree-sitter-git-config": "git+https://github.com/the-mikedavis/tree-sitter-git-config.git#0fbc9f99d5a28865f9de8427fb0672d66f9d83a5",
@@ -137,9 +138,12 @@
137
138
  "tree-sitter-scss": "^1.0.0",
138
139
  "tree-sitter-solidity": "^1.2.13",
139
140
  "tree-sitter-ssh-config": "git+https://github.com/tree-sitter-grammars/tree-sitter-ssh-config.git#71d2693deadaca8cdc09e38ba41d2f6042da1616",
141
+ "tree-sitter-svelte": "git+https://github.com/Himujjal/tree-sitter-svelte#60ea1d673a1a3eeeb597e098d9ada9ed0c79ef4b",
140
142
  "tree-sitter-swift": "^0.7.1",
143
+ "tree-sitter-systemverilog": "^0.3.1",
141
144
  "tree-sitter-templ": "git+https://github.com/vrischmann/tree-sitter-templ.git#68d6707ed20159ae7525241b8161c126dc1c620c",
142
145
  "tree-sitter-typescript": "^0.23.2",
146
+ "tree-sitter-typst": "git+https://github.com/uben0/tree-sitter-typst.git#46cf4ded12ee974a70bf8457263b67ad7ee0379d",
143
147
  "tree-sitter-vim": "git+https://github.com/tree-sitter-grammars/tree-sitter-vim.git#3092fcd99eb87bbd0fc434aa03650ba58bd5b43b",
144
148
  "tree-sitter-vimdoc": "git+https://github.com/neovim/tree-sitter-vimdoc.git#f061895a0eff1d5b90e4fb60d21d87be3267031a",
145
149
  "tree-sitter-vue": "git+https://github.com/tree-sitter-grammars/tree-sitter-vue.git#ce8011a414fdf8091f4e4071752efc376f4afb08",