diff --git a/crates/oxc_parser/src/diagnostics.rs b/crates/oxc_parser/src/diagnostics.rs index cf938ae9a..469c11d6c 100644 --- a/crates/oxc_parser/src/diagnostics.rs +++ b/crates/oxc_parser/src/diagnostics.rs @@ -23,10 +23,6 @@ pub struct ExpectToken(pub &'static str, pub &'static str, #[label("`{0}` expect #[error("Invalid escape sequence")] pub struct InvalidEscapeSequence(#[label] pub Span); -#[derive(Debug, Error, Diagnostic)] -#[error("\\8 and \\9 are not allowed in strict mode")] -pub struct NonOctalDecimalEscapeSequence(#[label] pub Span); - #[derive(Debug, Error, Diagnostic)] #[error("Invalid Unicode escape sequence")] pub struct UnicodeEscapeSequence(#[label] pub Span); @@ -77,11 +73,6 @@ pub struct EscapedKeyword(#[label] pub Span); #[diagnostic(help("Try insert a semicolon here"))] pub struct AutoSemicolonInsertion(#[label] pub Span); -#[derive(Debug, Error, Diagnostic)] -#[error("'0'-prefixed octal literals and octal escape sequences are deprecated")] -#[diagnostic(help("for octal literals use the '0o' prefix instead"))] -pub struct LegacyOctal(#[label] pub Span); - #[derive(Debug, Error, Diagnostic)] #[error("Line terminator not permitted before arrow")] #[diagnostic()] @@ -232,11 +223,6 @@ pub struct TemplateLiteral(#[label] pub Span); #[diagnostic()] pub struct EmptyParenthesizedExpression(#[label] pub Span); -#[derive(Debug, Error, Diagnostic)] -#[error("'{0}' keyword is unexpected here")] -#[diagnostic()] -pub struct UnexpectedKeyword(pub &'static str, #[label] pub Span); - #[derive(Debug, Error, Diagnostic)] #[error("Illegal newline after {0}")] #[diagnostic()] @@ -295,10 +281,3 @@ pub struct ReturnStatementOnlyInFunctionBody(#[label] pub Span); #[error("TS18007: JSX expressions may not use the comma operator.")] #[diagnostic(help("Did you mean to write an array?"))] pub struct JSXExpressionsMayNotUseTheCommaOperator(#[label] pub Span); - -#[derive(Debug, Error, Diagnostic)] -#[error("Leading decorators must be attached to a class declaration")] -#[diagnostic()] -pub struct BadLeadingDecorator( - #[label("Leading decorators must be attached to a class declaration")] pub Span, -); diff --git a/crates/oxc_parser/src/js/statement.rs b/crates/oxc_parser/src/js/statement.rs index e34bc8329..9aea2d829 100644 --- a/crates/oxc_parser/src/js/statement.rs +++ b/crates/oxc_parser/src/js/statement.rs @@ -270,7 +270,7 @@ impl<'a> Parser<'a> { self.error(diagnostics::ForLoopAsyncOf(self.end_span(expr_span))); } if is_let_of { - self.error(diagnostics::UnexpectedKeyword("let", self.end_span(expr_span))); + self.error(diagnostics::UnexpectedToken(self.end_span(expr_span))); } return self.parse_for_in_or_of_loop(span, r#await, for_stmt_left); }