@willbooster/tree-sitter-typescript 1.3.0 → 1.3.1

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.
@@ -3,6 +3,7 @@ const JavaScript = require('@willbooster/tree-sitter-javascript/grammar');
3
3
 
4
4
  // Words that are keywords only in some positions and identifiers elsewhere, besides the JavaScript grammar's.
5
5
  const TYPESCRIPT_CONTEXTUAL_KEYWORDS = [
6
+ 'accessor',
6
7
  'declare',
7
8
  'global',
8
9
  'namespace',
@@ -215,9 +216,6 @@ module.exports = function defineGrammar(dialect) {
215
216
  ],
216
217
 
217
218
  rules: {
218
- // A field named `get`, `set`, or `static` is told apart from a member that the word modifies by the line-break
219
- // sentinels allowed right after the name, as in the JavaScript grammar's field_definition. They are not allowed
220
- // after a type annotation, which may continue on the next line.
221
219
  public_field_definition: ($) =>
222
220
  seq(
223
221
  repeat(field('decorator', $.decorator)),
@@ -233,7 +231,8 @@ module.exports = function defineGrammar(dialect) {
233
231
  seq(optional('static'), optional($.override_modifier), optional('readonly')),
234
232
  seq(optional('abstract'), optional('readonly')),
235
233
  seq(optional('readonly'), optional('abstract')),
236
- optional('accessor')
234
+ seq(optional('static'), optional($.override_modifier), 'accessor'),
235
+ seq('abstract', optional($.override_modifier), optional('accessor'))
237
236
  ),
238
237
  choice(
239
238
  seq(
@@ -269,7 +268,8 @@ module.exports = function defineGrammar(dialect) {
269
268
  seq($.override_modifier, optional('readonly')),
270
269
  seq('readonly', optional('abstract')),
271
270
  seq('abstract', optional('readonly')),
272
- 'accessor'
271
+ seq(optional('static'), optional($.override_modifier), 'accessor'),
272
+ seq('abstract', optional($.override_modifier), optional('accessor'))
273
273
  ),
274
274
  field('name', alias('static', $.property_identifier)),
275
275
  choice(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-typescript",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "TypeScript and TSX grammars for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -18,6 +18,7 @@
18
18
  ; Keywords
19
19
 
20
20
  [ "abstract"
21
+ "accessor"
21
22
  "declare"
22
23
  "enum"
23
24
  "export"
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -83,7 +83,7 @@
83
83
  }
84
84
  ],
85
85
  "metadata": {
86
- "version": "1.3.0",
86
+ "version": "1.3.1",
87
87
  "license": "MIT",
88
88
  "description": "TypeScript and TSX grammars for tree-sitter",
89
89
  "authors": [