@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-typescript",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "TypeScript and TSX grammars for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -83,7 +83,7 @@
83
83
  }
84
84
  ],
85
85
  "metadata": {
86
- "version": "1.2.10",
86
+ "version": "1.2.12",
87
87
  "license": "MIT",
88
88
  "description": "TypeScript and TSX grammars for tree-sitter",
89
89
  "authors": [