Skip to content

Commit

Permalink
ConflictMarker
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Dec 31, 2024
1 parent fcf1afb commit 1c4dc31
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions crates/swc_ecma_parser/src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ impl<'a> Lexer<'a> {
return self.read_token(start);
}

RawToken::LConflictMarker | RawToken::RConflictMarker
if self.had_line_break_before_last() =>
{
RawToken::LConflictMarker | RawToken::RConflictMarker => {
// All conflict markers consist of the same character repeated seven times.
// If it is a <<<<<<< or >>>>>>> marker then it is also followed by a space.
// <<<<<<<
Expand All @@ -199,8 +197,8 @@ impl<'a> Lexer<'a> {
// ^

self.emit_error_span(fixed_len_span(*start, 7), SyntaxError::TS1185);
// self.skip_line_comment(5);
// self.skip_space::<true>();
let _ = self.input.next();

*start = self.input.cur_pos();
return self.read_token(start);
}
Expand Down Expand Up @@ -326,10 +324,7 @@ impl<'a> Lexer<'a> {
*start = self.input.cur_pos();
return self.read_token(start);
}
RawToken::LineComment
| RawToken::BlockComment
| RawToken::LConflictMarker
| RawToken::RConflictMarker => {
RawToken::LineComment | RawToken::BlockComment => {
self.input.next().transpose()?;
// self.skip_space::<true>()?;

Expand Down

0 comments on commit 1c4dc31

Please sign in to comment.