Skip to content

Commit afd7339

Browse files
committed
chore: formatting
1 parent 07f4633 commit afd7339

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

common/define-grammar.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ module.exports = function defineGrammar(dialect) {
265265
import_specifier: ($, previous) => seq(
266266
optional(choice('type', 'typeof')),
267267
choice(
268-
field('name', $._import_identifier),
269-
seq(
270-
field('name', choice($._module_export_name, alias('type', $.identifier))),
271-
'as',
272-
field('alias', $._import_identifier)
273-
),
274-
)),
268+
field('name', $._import_identifier),
269+
seq(
270+
field('name', choice($._module_export_name, alias('type', $.identifier))),
271+
'as',
272+
field('alias', $._import_identifier)
273+
),
274+
)),
275275

276276
import_clause: ($, previous) => choice(
277277
$.namespace_import,
@@ -471,8 +471,8 @@ module.exports = function defineGrammar(dialect) {
471471
),
472472

473473
_extends_clause_single: $ => prec('extends', seq(
474-
field('value', $.expression),
475-
field('type_arguments', optional($.type_arguments))
474+
field('value', $.expression),
475+
field('type_arguments', optional($.type_arguments))
476476
)),
477477

478478
implements_clause: $ => seq(
@@ -554,7 +554,7 @@ module.exports = function defineGrammar(dialect) {
554554
field('name', $._type_identifier),
555555
field('type_parameters', optional($.type_parameters)),
556556
optional($.extends_type_clause),
557-
field('body', $.object_type)
557+
field('body', alias($.object_type, $.interface_body))
558558
),
559559

560560
extends_type_clause: $ => seq(
@@ -752,16 +752,16 @@ module.exports = function defineGrammar(dialect) {
752752
)),
753753

754754
type_predicate: $ => seq(
755-
field('name', choice(
756-
$.identifier,
757-
$.this,
758-
// Sometimes tree-sitter contextual lexing is not good enough to know
759-
// that 'object' in ':object is foo' is really an identifier and not
760-
// a predefined_type, so we must explicitely list all possibilities.
761-
// TODO: should we use '_reserved_identifier'? Should all the element in
762-
// 'predefined_type' be added to '_reserved_identifier'?
763-
alias($.predefined_type, $.identifier)
764-
)),
755+
field('name', choice(
756+
$.identifier,
757+
$.this,
758+
// Sometimes tree-sitter contextual lexing is not good enough to know
759+
// that 'object' in ':object is foo' is really an identifier and not
760+
// a predefined_type, so we must explicitely list all possibilities.
761+
// TODO: should we use '_reserved_identifier'? Should all the element in
762+
// 'predefined_type' be added to '_reserved_identifier'?
763+
alias($.predefined_type, $.identifier)
764+
)),
765765
'is',
766766
field('type', $._type)
767767
),
@@ -859,7 +859,7 @@ module.exports = function defineGrammar(dialect) {
859859

860860
existential_type: $ => '*',
861861

862-
flow_maybe_type: $ => prec.right(seq( '?', $._primary_type)),
862+
flow_maybe_type: $ => prec.right(seq('?', $._primary_type)),
863863

864864
parenthesized_type: $ => seq(
865865
'(', $._type, ')'
@@ -1021,18 +1021,18 @@ module.exports = function defineGrammar(dialect) {
10211021
});
10221022
}
10231023

1024-
function commaSep1 (rule) {
1024+
function commaSep1(rule) {
10251025
return sepBy1(',', rule);
10261026
}
10271027

1028-
function commaSep (rule) {
1028+
function commaSep(rule) {
10291029
return sepBy(',', rule);
10301030
}
10311031

1032-
function sepBy (sep, rule) {
1032+
function sepBy(sep, rule) {
10331033
return optional(sepBy1(sep, rule))
10341034
}
10351035

1036-
function sepBy1 (sep, rule) {
1036+
function sepBy1(sep, rule) {
10371037
return seq(rule, repeat(seq(sep, rule)));
10381038
}

0 commit comments

Comments
 (0)