void Scanner::fail_if_eof() const
{
    if (is_eof()) {
        msg.error(cur_loc(), "unexpected end of input");
        exit(1);
    }
}
void Scanner::fail_if_eof() const
{
    if (is_eof()) {
        msg.error(cur_loc(), "unexpected end of input");
        exit(1);
    }
}