Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion crates/oxc_parser/src/js/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,25 @@ impl<'a> ParserImpl<'a> {
{
self.parse_using_statement()
}
_ if self.is_ts && self.at_start_of_ts_declaration() => {
Kind::Async
| Kind::Interface
| Kind::Type
| Kind::Module
| Kind::Namespace
| Kind::Declare
| Kind::Const
| Kind::Enum
| Kind::Import
| Kind::Private
| Kind::Protected
| Kind::Public
| Kind::Abstract
| Kind::Accessor
| Kind::Static
| Kind::Readonly
| Kind::Global
if self.is_ts && self.at_start_of_ts_declaration() =>
{
self.parse_ts_declaration_statement(start_span)
}
_ => self.parse_expression_or_labeled_statement(),
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/ts/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ impl<'a> ParserImpl<'a> {
self.lookahead(Self::at_start_of_ts_declaration_worker)
}

/// Check if the parser is at a start of a declaration
/// Check if the parser is at a start of a ts declaration
fn at_start_of_ts_declaration_worker(&mut self) -> bool {
loop {
match self.cur_kind() {
Expand Down
Loading