Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Sep 12, 2024
1 parent 5120b4f commit 7925154
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ncc/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ fn parse_atom(input: &mut Input) -> Result<Expr, ParseError>
let float_val: f32 = num_str.parse().unwrap();

if !input.match_char('f') {
return input.parse_error(&concat!("
only floats are supported for now, ",
"e.g. 3.5f (float), not 3.5 (double)"
return input.parse_error(&format!(
"only floats are supported for now, try {}f (float) instead of {} (double)",
num_str, num_str
));
}

Expand Down

0 comments on commit 7925154

Please sign in to comment.