Skip to content

Commit

Permalink
fix(parser): allow line breaks between const and enum
Browse files Browse the repository at this point in the history
  • Loading branch information
branchseer committed Dec 30, 2024
1 parent ccaa9f7 commit 8fb50a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ impl<'a> ParserImpl<'a> {
}

match self.cur_kind() {
Kind::Const => !self.peek_token().is_on_new_line && self.peek_kind() == Kind::Enum,
Kind::Const => self.peek_kind() == Kind::Enum,
Kind::Export => {
self.bump_any();
match self.cur_kind() {
Expand Down
2 changes: 2 additions & 0 deletions tasks/coverage/misc/pass/oxc-8193.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const
enum A {}
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/parser_misc.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parser_misc Summary:
AST Parsed : 30/30 (100.00%)
Positive Passed: 30/30 (100.00%)
AST Parsed : 31/31 (100.00%)
Positive Passed: 31/31 (100.00%)
Negative Passed: 26/26 (100.00%)

× Unexpected token
Expand Down

0 comments on commit 8fb50a6

Please sign in to comment.