diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-27 18:40:54 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-27 18:40:54 -0800 |
commit | 88a785e32117081b91b813ac6b5437deb33ef0f7 (patch) | |
tree | 3a01e073dffd166256f7ccebeeb61c7e7ea58212 | |
parent | d628fe0deaa134efa1205a25e538f3cb828661a0 (diff) |
Make expand_argument_list a static function
It doesn't use any properties of parser_t
-rw-r--r-- | src/complete.cpp | 3 | ||||
-rw-r--r-- | src/fish_tests.cpp | 2 | ||||
-rw-r--r-- | src/parser.cpp | 2 | ||||
-rw-r--r-- | src/parser.h | 2 |
4 files changed, 4 insertions, 5 deletions
diff --git a/src/complete.cpp b/src/complete.cpp index b5db905b..5e77af25 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -1000,8 +1000,7 @@ void completer_t::complete_from_args(const wcstring &str, } std::vector<completion_t> 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 f6441ffd..adbc13a5 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 aa99a69b..b89e6f62 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<completion_t> *output_arg_list) const +void parser_t::expand_argument_list(const wcstring &arg_list_src, expand_flags_t eflags, std::vector<completion_t> *output_arg_list) { assert(output_arg_list != NULL); diff --git a/src/parser.h b/src/parser.h index dfc4dcf1..1b2bad1b 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<completion_t> *output) const; + static void expand_argument_list(const wcstring &arg_src, expand_flags_t flags, std::vector<completion_t> *output); /** Returns a string describing the current parser pisition in the format 'FILENAME (line LINE_NUMBER): LINE'. |