diff --git a/src/complete.cpp b/src/complete.cpp index b5db905b6..5e77af256 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -1000,8 +1000,7 @@ void completer_t::complete_from_args(const wcstring &str, } std::vector possible_comp; - const parser_t parser; - parser.expand_argument_list(args, eflags, &possible_comp); + parser_t::expand_argument_list(args, eflags, &possible_comp); if (! is_autosuggest) { diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index f6441ffd3..adbc13a53 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -776,7 +776,7 @@ static void test_parser() say(L"Testing eval_args"); completion_list_t comps; - parser_t::principal_parser().expand_argument_list(L"alpha 'beta gamma' delta", 0, &comps); + parser_t::expand_argument_list(L"alpha 'beta gamma' delta", 0, &comps); do_test(comps.size() == 3); do_test(comps.at(0).completion == L"alpha"); do_test(comps.at(1).completion == L"beta gamma"); diff --git a/src/parser.cpp b/src/parser.cpp index aa99a69b5..b89e6f62f 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -465,7 +465,7 @@ 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 *output_arg_list) const +void parser_t::expand_argument_list(const wcstring &arg_list_src, expand_flags_t eflags, std::vector *output_arg_list) { assert(output_arg_list != NULL); diff --git a/src/parser.h b/src/parser.h index dfc4dcf12..1b2bad1b5 100644 --- a/src/parser.h +++ b/src/parser.h @@ -309,7 +309,7 @@ public: \param flags Some expand flags to use \param output List to insert output into */ - void expand_argument_list(const wcstring &arg_src, expand_flags_t flags, std::vector *output) const; + static void expand_argument_list(const wcstring &arg_src, expand_flags_t flags, std::vector *output); /** Returns a string describing the current parser pisition in the format 'FILENAME (line LINE_NUMBER): LINE'.