@willbooster/tree-sitter-typescript 1.2.10 → 1.2.12
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/common/defineGrammar.js +26 -0
- package/package.json +1 -1
- package/tree-sitter-tsx.wasm +0 -0
- package/tree-sitter-typescript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/common/defineGrammar.js
CHANGED
|
@@ -77,6 +77,23 @@ module.exports = function defineGrammar(dialect) {
|
|
|
77
77
|
['member', 'unary'],
|
|
78
78
|
['extends', 'instantiation'],
|
|
79
79
|
['new', 'generic_call', 'instantiation', 'unary', 'binary'],
|
|
80
|
+
// `as` and `satisfies` bind like the relational operators: looser than `**`, `*`, `+`, and `<<`, and tighter than
|
|
81
|
+
// `==`, `&`, `&&`, `||`, and `??`.
|
|
82
|
+
[
|
|
83
|
+
'binary_exp',
|
|
84
|
+
'binary_times',
|
|
85
|
+
'binary_plus',
|
|
86
|
+
'binary_shift',
|
|
87
|
+
'binary_relation',
|
|
88
|
+
'binary',
|
|
89
|
+
'binary_equality',
|
|
90
|
+
'bitwise_and',
|
|
91
|
+
'bitwise_xor',
|
|
92
|
+
'bitwise_or',
|
|
93
|
+
'logical_and',
|
|
94
|
+
'logical_or',
|
|
95
|
+
'ternary',
|
|
96
|
+
],
|
|
80
97
|
[
|
|
81
98
|
$.intersection_type,
|
|
82
99
|
$.union_type,
|
|
@@ -182,6 +199,7 @@ module.exports = function defineGrammar(dialect) {
|
|
|
182
199
|
$.instantiation_expression,
|
|
183
200
|
],
|
|
184
201
|
[$.primary_expression, $.call_expression, $.instantiation_expression],
|
|
202
|
+
[$.expression, $.call_expression],
|
|
185
203
|
],
|
|
186
204
|
|
|
187
205
|
inline: ($, previous) => [
|
|
@@ -308,6 +326,14 @@ module.exports = function defineGrammar(dialect) {
|
|
|
308
326
|
field('type_arguments', optional($.type_arguments)),
|
|
309
327
|
field('arguments', $.arguments)
|
|
310
328
|
)
|
|
329
|
+
),
|
|
330
|
+
// An instantiation expression is no primary expression, but it may be called through `?.` (`f<T>?.(x)`). Without
|
|
331
|
+
// a precedence, GLR also keeps the reading in which it is the object of `?.[0]` or `?.x`.
|
|
332
|
+
seq(
|
|
333
|
+
field('function', $.instantiation_expression),
|
|
334
|
+
field('optional_chain', $.optional_chain),
|
|
335
|
+
field('type_arguments', optional($.type_arguments)),
|
|
336
|
+
field('arguments', $.arguments)
|
|
311
337
|
)
|
|
312
338
|
),
|
|
313
339
|
|
package/package.json
CHANGED
package/tree-sitter-tsx.wasm
CHANGED
|
Binary file
|
|
Binary file
|