Skip to content

Commit

Permalink
fix: static can be on its own line
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Apr 18, 2024
1 parent ac10a11 commit 8f4f581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module.exports = grammar({
[$.labeled_statement, $._property_name],
[$.computed_property_name, $.array],
[$.binary_expression, $._initializer],
[$.class_static_block, $._property_name],
],

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

class_static_block: $ => seq(
'static',
optional($._semicolon),
field('body', $.statement_block),
),

Expand Down
3 changes: 2 additions & 1 deletion test/corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ class Foo extends require('another-class') {
super()
}

static {
static
{
this.#foo = 'bar';
}

Expand Down

0 comments on commit 8f4f581

Please sign in to comment.