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:
parent
8e7aaadbd0
commit
2425d19f9f
|
@ -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
|
Loading…
Reference in New Issue