From c0f7b4cc228b091387df4dd36569b3c1982c44a8 Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 22 Apr 2022 13:07:31 +0200 Subject: [PATCH] Parser.hpp: Change the parameters of the filter_comma_list overload to two input iterators Signed-off-by: Username404 --- src/headers/parsing/Parser.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/headers/parsing/Parser.hpp b/src/headers/parsing/Parser.hpp index 8af5e81..835187e 100644 --- a/src/headers/parsing/Parser.hpp +++ b/src/headers/parsing/Parser.hpp @@ -29,7 +29,11 @@ namespace Parser { } } } - inline vector filter_comma_list(vector&& tokens) { filter_comma_list(tokens); return tokens; } + vector filter_comma_list(input_iterator auto begin, input_iterator auto end) { + vector tokens(begin, end); + filter_comma_list(tokens); + return tokens; + } IS(ParseTree) inline T parse(const input_iterator auto&, const input_iterator auto&); @@ -86,7 +90,7 @@ namespace Parser { if (nextAre({LCOMP, LCOMP, LBRACE})) { Function function(current.toktext); if (parametersDistance > 2) { - function.parameters = parse(filter_comma_list(vector(lexed.begin() + ((i + 2) - parametersDistance), lexed.begin() + i))); + function.parameters = parse(filter_comma_list(lexed.begin() + ((i + 2) - parametersDistance), lexed.begin() + i)); } parseTree << function; i += 2;