Skip to content

Commit

Permalink
Some cond
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jun 21, 2024
1 parent 9728e45 commit 1f2e8b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/swc_ecma_parser/src/lexer/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,10 @@ impl Lexer<'_> {
if let Some(shebang) = self.read_shebang()? {
return Ok(Some(Token::Shebang(shebang)));
}
} else {
self.state.is_first = false;
}

self.state.had_line_break = self.state.is_first;
self.state.is_first = false;

// skip spaces before getting next character, if we are allowed to.
if self.state.can_skip_space() {
self.skip_space::<true>()?;
Expand Down Expand Up @@ -377,7 +376,7 @@ impl State {
State {
is_expr_allowed: true,
next_regexp: None,
had_line_break: false,
had_line_break: true,
had_line_break_before_last: false,
is_first: true,
start: BytePos(0),
Expand Down

0 comments on commit 1f2e8b5

Please sign in to comment.