Skip to content

Commit d59b29d

Browse files
committed
chore: tidying
1 parent d63fbd4 commit d59b29d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

common/define-grammar.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
const JavaScript = require('tree-sitter-javascript/grammar');
2+
13
module.exports = function defineGrammar(dialect) {
2-
return grammar(require('tree-sitter-javascript/grammar'), {
4+
return grammar(JavaScript, {
35
name: dialect,
46

57
externals: ($, previous) => previous.concat([
@@ -257,14 +259,14 @@ module.exports = function defineGrammar(dialect) {
257259
'/>'
258260
)),
259261

260-
export_specifier: ($, previous) => seq(
262+
export_specifier: (_, previous) => seq(
261263
optional(choice('type', 'typeof')),
262264
previous
263265
),
264266

265267
_import_identifier: $ => choice($.identifier, alias('type', $.identifier)),
266268

267-
import_specifier: ($, previous) => seq(
269+
import_specifier: $ => seq(
268270
optional(choice('type', 'typeof')),
269271
choice(
270272
field('name', $._import_identifier),
@@ -275,7 +277,7 @@ module.exports = function defineGrammar(dialect) {
275277
),
276278
)),
277279

278-
import_clause: ($, previous) => choice(
280+
import_clause: $ => choice(
279281
$.namespace_import,
280282
$.named_imports,
281283
seq(
@@ -352,7 +354,7 @@ module.exports = function defineGrammar(dialect) {
352354
$._call_signature
353355
),
354356

355-
parenthesized_expression: ($, previous) => seq(
357+
parenthesized_expression: $ => seq(
356358
'(',
357359
choice(
358360
seq($.expression, field('type', optional($.type_annotation))),
@@ -400,7 +402,7 @@ module.exports = function defineGrammar(dialect) {
400402
$.public_field_definition
401403
),
402404
choice($._semicolon, ',')
403-
)
405+
),
404406
)),
405407
'}'
406408
),
@@ -601,7 +603,7 @@ module.exports = function defineGrammar(dialect) {
601603
$._semicolon
602604
),
603605

604-
accessibility_modifier: $ => choice(
606+
accessibility_modifier: _ => choice(
605607
'public',
606608
'private',
607609
'protected'
@@ -883,15 +885,13 @@ module.exports = function defineGrammar(dialect) {
883885
field('argument', $.number)
884886
)),
885887

886-
existential_type: $ => '*',
888+
existential_type: _ => '*',
887889

888890
flow_maybe_type: $ => prec.right(seq('?', $._primary_type)),
889891

890-
parenthesized_type: $ => seq(
891-
'(', $._type, ')'
892-
),
892+
parenthesized_type: $ => seq('(', $._type, ')'),
893893

894-
predefined_type: $ => choice(
894+
predefined_type: _ => choice(
895895
'any',
896896
'number',
897897
'boolean',

0 commit comments

Comments
 (0)