aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-02-27 18:37:59 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2016-02-27 18:37:59 -0800
commitd628fe0deaa134efa1205a25e538f3cb828661a0 (patch)
treeda788321b10efb8740607bf454857de10fb783c3 /src/parser.cpp
parentcbd3fa6b01bab709d0b6f5277a984685d8c45888 (diff)
Eliminate parser_t::show_errors
Errors are now unconditionally shown
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 325b053d..aa99a69b 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -162,8 +162,7 @@ static wcstring user_presentable_path(const wcstring &path)
}
-parser_t::parser_t(bool errors) :
- show_errors(errors),
+parser_t::parser_t() :
cancellation_requested(false),
is_within_fish_initialization(false)
{
@@ -176,7 +175,7 @@ parser_t &parser_t::principal_parser(void)
{
ASSERT_IS_NOT_FORKED_CHILD();
ASSERT_IS_MAIN_THREAD();
- static parser_t parser(true);
+ static parser_t parser;
if (! s_principal_parser)
{
s_principal_parser = &parser;
@@ -466,11 +465,9 @@ void parser_t::emit_profiling(const char *path) const
}
}
-void parser_t::expand_argument_list(const wcstring &arg_list_src, expand_flags_t eflags, std::vector<completion_t> *output_arg_list)
+void parser_t::expand_argument_list(const wcstring &arg_list_src, expand_flags_t eflags, std::vector<completion_t> *output_arg_list) const
{
assert(output_arg_list != NULL);
- if (! show_errors)
- eflags |= EXPAND_NO_DESCRIPTIONS;
/* Parse the string as an argument list */
parse_node_tree_t tree;
@@ -831,17 +828,14 @@ 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;
parse_error_list_t error_list;
- if (! parse_tree_from_string(cmd, parse_flag_none, &tree, this->show_errors ? &error_list : NULL))
+ if (! parse_tree_from_string(cmd, parse_flag_none, &tree, &error_list))
{
- if (this->show_errors)
- {
- /* Get a backtrace */
- wcstring backtrace_and_desc;
- this->get_backtrace(cmd, error_list, &backtrace_and_desc);
+ /* Get a backtrace. This includes the message. */
+ wcstring backtrace_and_desc;
+ this->get_backtrace(cmd, error_list, &backtrace_and_desc);
- /* Print it */
- fprintf(stderr, "%ls", backtrace_and_desc.c_str());
- }
+ /* Print it */
+ fprintf(stderr, "%ls", backtrace_and_desc.c_str());
return 1;
}