mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
Report certain errors from parser_t::eval() that were previously ignored
This commit is contained in:
13
parser.cpp
13
parser.cpp
@@ -868,8 +868,19 @@ int parser_t::eval(const wcstring &cmd, const io_chain_t &io, enum block_type_t
|
||||
|
||||
/* Parse the source into a tree, if we can */
|
||||
parse_node_tree_t tree;
|
||||
if (! parse_tree_from_string(cmd, parse_flag_none, &tree, NULL))
|
||||
parse_error_list_t error_list;
|
||||
if (! parse_tree_from_string(cmd, parse_flag_none, &tree, this->show_errors ? &error_list : NULL))
|
||||
{
|
||||
if (this->show_errors)
|
||||
{
|
||||
/* Get a backtrace */
|
||||
wcstring backtrace_and_desc;
|
||||
this->get_backtrace(cmd, error_list, &backtrace_and_desc);
|
||||
|
||||
/* Print it */
|
||||
fprintf(stderr, "%ls", backtrace_and_desc.c_str());
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user