~maelkum/viuavm

d09621f633f6d6efb6191c6393afbe136241b3b1 — Marek Marecki 27 days ago cbfa4ae
Allow lookahead with a set of tokens

Such a lookahead (the same as consume-of-set) will succeed only if the
next token is in the lookahead set.
1 files changed, 7 insertions(+), 0 deletions(-)

M new/src/tools/exec/asm.cpp
M new/src/tools/exec/asm.cpp => new/src/tools/exec/asm.cpp +7 -0
@@ 325,6 325,13 @@ auto look_ahead(
{
    return (not lexemes.empty()) and (lexemes.front() == tk);
}
auto look_ahead(
    std::set<viua::libs::lexer::TOKEN> const ts,
    viua::support::vector_view<viua::libs::lexer::Lexeme> const& lexemes)
    -> bool
{
    return (not lexemes.empty()) and (ts.count(lexemes.front().token) != 0);
}

auto parse_attr_list(
    viua::support::vector_view<viua::libs::lexer::Lexeme>& lexemes)