aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-27 11:17:05 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-27 11:17:05 -0700
commit62b3ed17ba42150e1107b87b0e719cf793ae8d0f (patch)
tree2eb16f6f505416d311c2c45b9125af53f8368b2f /parser.cpp
parent31bf50b2d495222925371556169f61c1c5a81ed7 (diff)
Teach parser_t how to parse an argument list that contains newlines, for
complete -a support. Fixes #1369
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/parser.cpp b/parser.cpp
index 4a7ee602..e95cb878 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -493,7 +493,7 @@ void parser_t::expand_argument_list(const wcstring &arg_list_src, std::vector<co
/* Parse the string as an argument list */
parse_node_tree_t tree;
- if (! parse_tree_from_string(arg_list_src, parse_flag_none, &tree, NULL /* errors */, symbol_argument_list))
+ if (! parse_tree_from_string(arg_list_src, parse_flag_none, &tree, NULL /* errors */, symbol_freestanding_argument_list))
{
/* Failed to parse. Here we expect to have reported any errors in test_args */
return;
@@ -502,7 +502,7 @@ void parser_t::expand_argument_list(const wcstring &arg_list_src, std::vector<co
/* Get the root argument list */
assert(! tree.empty());
const parse_node_t *arg_list = &tree.at(0);
- assert(arg_list->type == symbol_argument_list);
+ assert(arg_list->type == symbol_freestanding_argument_list);
/* Extract arguments from it */
while (arg_list != NULL)
@@ -968,18 +968,18 @@ bool parser_t::detect_errors_in_argument_list(const wcstring &arg_list_src, wcst
/* Parse the string as an argument list */
parse_node_tree_t tree;
- if (! parse_tree_from_string(arg_list_src, parse_flag_none, &tree, &errors, symbol_argument_list))
+ if (! parse_tree_from_string(arg_list_src, parse_flag_none, &tree, &errors, symbol_freestanding_argument_list))
{
/* Failed to parse. */
errored = true;
}
-
+
if (! errored)
{
/* Get the root argument list */
assert(! tree.empty());
const parse_node_t *arg_list = &tree.at(0);
- assert(arg_list->type == symbol_argument_list);
+ assert(arg_list->type == symbol_freestanding_argument_list);
/* Extract arguments from it */
while (arg_list != NULL && ! errored)