refactor(grammar): Remove redundent 'semis'
@@ -163,7 +163,7 @@ module.exports = grammar({
import_alias: $ => seq("as", alias($.simple_identifier, $.type_identifier)),
- top_level_object: $ => seq($._declaration, optional($._semis)),
+ top_level_object: $ => seq($._declaration, optional($._semi)),
type_alias: $ => seq(
optional($.modifiers),
@@ -287,7 +287,7 @@ module.exports = grammar({
// Class members
// ==========
- _class_member_declarations: $ => repeat1(seq($._class_member_declaration, $._semis)),
+ _class_member_declarations: $ => repeat1(seq($._class_member_declaration, $._semi)),
_class_member_declaration: $ => choice(
$._declaration,
@@ -514,8 +514,8 @@ module.exports = grammar({
statements: $ => seq(
$._statement,
- repeat(seq($._semis, $._statement)),
- optional($._semis),
+ repeat(seq($._semi, $._statement)),
+ optional($._semi),
),
_statement: $ => choice(
@@ -577,8 +577,6 @@ module.exports = grammar({
// generic EOF/newline token
_semi: $ => choice($._automatic_semicolon, ';'),
- _semis: $ => choice($._automatic_semicolon, ';'),
-
assignment: $ => choice(
prec.left(PREC.ASSIGNMENT, seq($.directly_assignable_expression, $._assignment_and_operator, $._expression)),
prec.left(PREC.ASSIGNMENT, seq($.directly_assignable_expression, "=", $._expression)),
