From 5d1ddc9c58db991719b3c86c89d6e161cdb4a68f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 12 Oct 2014 20:09:45 -0700 Subject: [PATCH] Report certain errors from parser_t::eval() that were previously ignored --- parser.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/parser.cpp b/parser.cpp index be7e494af..2f96054c4 100644 --- a/parser.cpp +++ b/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; }