Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Aug 1, 2024
1 parent c086132 commit bf1cdfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions crates/swc_common/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ impl<'a> StringInput<'a> {
self.reset_to(self.last_pos + BytePos(n as u32));
}
}

pub fn start_pos(&self) -> BytePos {
self.orig_start
}

pub fn end_pos(&self) -> BytePos {
self.last_pos
}
}

/// Creates an [Input] from [SourceFile]. This is an alias for
Expand Down
3 changes: 2 additions & 1 deletion crates/swc_ecma_parser/src/lexer/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ impl<'a> Lexer<'a> {
self.bump();
}

self.emit_error(start, SyntaxError::UnterminatedBlockComment)
let span = Span::new(start, self.input.end_pos());
self.emit_error_span(span, SyntaxError::UnterminatedBlockComment)
}

#[inline(never)]
Expand Down

0 comments on commit bf1cdfa

Please sign in to comment.