Skip to content

Commit fc7624b

Browse files
committed
fix: static can be on its own line
1 parent 3487795 commit fc7624b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

grammar.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ module.exports = grammar({
101101
[$.labeled_statement, $._property_name],
102102
[$.computed_property_name, $.array],
103103
[$.binary_expression, $._initializer],
104+
[$.class_static_block, $._property_name],
104105
],
105106

106107
word: $ => $.identifier,
@@ -1176,6 +1177,7 @@ module.exports = grammar({
11761177

11771178
class_static_block: $ => seq(
11781179
'static',
1180+
optional($._semicolon),
11791181
field('body', $.statement_block),
11801182
),
11811183

test/corpus/expressions.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ class Foo extends require('another-class') {
534534
super()
535535
}
536536

537-
static {
537+
static
538+
{
538539
this.#foo = 'bar';
539540
}
540541

0 commit comments

Comments
 (0)