Add a Parser::parse overload which takes input iterators as arguments

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-03-09 20:47:15 +01:00
parent 8e7aaadbd0
commit 2425d19f9f
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,10 @@ namespace Parser {
const tok& token, const string& text,
const bool& quoteTokenText = false
) { error(token, text, token.line, quoteTokenText); }
IS(ParseTree)
inline T parse(const input_iterator auto&, const input_iterator auto&);
IS(ParseTree)
T parse(const span<const tok>&& lexed) {
T parseTree;
@ -95,6 +99,8 @@ namespace Parser {
}
return parseTree;
}
template<derived_from<ParseTree> T>
inline T parse(const input_iterator auto& begin, const input_iterator auto& end) { return parse(span(begin, end)); }
}
#endif //YERBACON_PARSER_HPP