aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-10-12 20:09:45 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-10-12 20:09:45 -0700
commit5d1ddc9c58db991719b3c86c89d6e161cdb4a68f (patch)
tree55d0ea540eae7b4c5209f35729d8550684b9ab88 /parser.cpp
parentc0b8e81b023bf1f118311a060662bea1ad565a19 (diff)
Report certain errors from parser_t::eval() that were previously ignored
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/parser.cpp b/parser.cpp
index be7e494a..2f96054c 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;
}