fdoc

subroutineexpectprivate

subroutine expect(c, s, word)

Go past token word, which must come next.

Arguments

NameTypeIntentAttributesDescription
ctype(fypp_t)inout

the state

stype(scan_t)inout

the expression

wordcharacter(len=*)in

the token

Calls

Source

Show the code
subroutine expect(c, s, word)
    type(fypp_t), intent(inout) :: c        !! the state
    type(scan_t), intent(inout) :: s        !! the expression
    character(len=*), intent(in) :: word    !! the token

    if (at_word(s, word)) then
        call next_token(c, s)
    else
        call fail(c, "expected '"//word//"' in: "//s%text)
    end if
end subroutine expect

Graphs

Calls

Called by