Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
fix: 🐛 change expected_node to expected_token
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY committed Sep 10, 2022
1 parent bc210f5 commit 1b63b56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions crates/rome_js_parser/src/syntax/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use super::typescript::*;
use crate::event::rewrite_events;
use crate::event::RewriteParseEvents;
use crate::lexer::{LexContext, ReLexContext};
use crate::parser::expected_node;
use crate::parser::rewrite_parser::{RewriteMarker, RewriteParser};
use crate::parser::ToDiagnostic;
use crate::parser::{expected_token, ParserProgress, RecoveryResult};
Expand Down Expand Up @@ -1699,7 +1698,7 @@ fn parse_call_expression_rest(

if type_arguments.is_some() || p.at(T!['(']) {
parse_call_arguments(p)
.or_add_diagnostic(p, |p, range| expected_node("(", range).to_diagnostic(p));
.or_add_diagnostic(p, |p, _| expected_token(T!['(']).to_diagnostic(p));
lhs = m.complete(p, JS_CALL_EXPRESSION);
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ error[SyntaxError]: expected an expression but instead found ';'
│ ^ Expected an expression here

--
error[SyntaxError]: expected a ( but instead found ';'
error[SyntaxError]: expected `(` but instead found `;`
┌─ ts_instantiation_expressions1.ts:2:23
2 │ const b1 = f?.<number>; // Error, `(` expected
│ ^ Expected a ( here
│ ^ unexpected

--
const a8 = f<number><number>; // Relational operator error
Expand Down

0 comments on commit 1b63b56

Please sign in to comment.