KCL: Fix cryptic error on unexpected tokens in fn call (#7295)
This program: ```kcl 1 |> extrude( length=depth, }) ``` was giving this bad error: ``` unexpected token |> ``` Now it gives ```kcl There was an unexpected }. Try removing it. ``` and it correctly puts the diagnostic on the extra }. Fixes https://github.com/KittyCAD/modeling-app/issues/6126
This commit is contained in:
@ -2072,8 +2072,8 @@ notPipeSub = 1 |> identity(!%))";
|
||||
// a runtime error instead.
|
||||
parse_execute(code11).await.unwrap_err(),
|
||||
KclError::Syntax(KclErrorDetails::new(
|
||||
"Unexpected token: |>".to_owned(),
|
||||
vec![SourceRange::new(44, 46, ModuleId::default())],
|
||||
"There was an unexpected !. Try removing it.".to_owned(),
|
||||
vec![SourceRange::new(56, 57, ModuleId::default())],
|
||||
))
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user