mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
[math] Improve error formatting
This looked like math: Error in expression 'sin(5,4)' ^ Too many arguments Now it looks like math: Too many arguments 'sin(5,4)' ^
This commit is contained in:
parent
0fa0b620b3
commit
4f56ce6d33
1 changed files with 1 additions and 3 deletions
|
@ -152,11 +152,9 @@ static int evaluate_expression(const wchar_t *cmd, parser_t &parser, io_streams_
|
|||
}
|
||||
} else {
|
||||
// TODO: Better error reporting!
|
||||
streams.err.append(L"math: Error in expression\n");
|
||||
streams.err.append_format(L"%ls: Error: %ls\n", cmd, math_describe_error(error).c_str());
|
||||
streams.err.append_format(L"'%ls'\n", expression.c_str());
|
||||
streams.err.append_format(L"%*lc^\n", error.position - 1, L' ');
|
||||
streams.err.append(math_describe_error(error));
|
||||
streams.err.append(L"\n");
|
||||
}
|
||||
free(narrow_str);
|
||||
free(saved_locale);
|
||||
|
|
Loading…
Reference in a new issue