Parser.hpp: Change the parameters of the filter_comma_list overload to two input iterators

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-04-22 13:07:31 +02:00
parent d3b05461cb
commit c0f7b4cc22
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,11 @@ namespace Parser {
}
}
}
inline vector<tok> filter_comma_list(vector<tok>&& tokens) { filter_comma_list(tokens); return tokens; }
vector<tok> 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;