Skip to content

Commit

Permalink
Fix fail case
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscerie committed Apr 7, 2024
1 parent f52d390 commit 760c3c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion full-moon/src/ast/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,16 @@ fn parse_unary_expression(

let primary_expression = match parse_primary_expression(state) {
ParserResult::Value(expression) => expression,
ParserResult::NotFound => return ParserResult::NotFound,
ParserResult::NotFound => {
state.token_error(
unary_operator.token().clone(),
format!(
"expected an expression after {}",
unary_operator.token().token()
),
);
return ParserResult::NotFound;
}
ParserResult::LexerMoved => return ParserResult::LexerMoved,
};

Expand Down

0 comments on commit 760c3c5

Please sign in to comment.