src/parse.c
// Return true if the kind of the current token is a type name.
Return true if the kind of the current token is a type name.
Return true if the kind of the current token is a type name .
bool at_typename() {
    char *typenames[] = {"void", "_Bool", "char", "short", "int", "long", "struct", "typedef", "enum"};
    for (int i = 0; i < sizeof(typenames) / sizeof(typenames[0]); i++) {
        if (peek(TK_RESERVED, typenames[i])) {
            return true;
        }
    }
    Token *tok = peek(TK_IDENT, NULL);
    if (tok && find_typedef(tok->str)) {
        return true;
    }
    return false;
}
bool at_typename ( ) { char * typenames [ ] = { " " , " " , " " , " " , " " , " " , " " , " " , " " } ; for ( int i = 0 ; i < sizeof ( typenames ) / sizeof ( typenames [ 0 ] ) ; i ++ ) { if ( peek ( TK_RESERVED , typenames [ i ] ) ) { return true ; } } Token * tok = peek ( TK_IDENT , NULL ) ; if ( tok && find_typedef ( tok -> str ) ) { return true ; } return false ; }
Return true if the kind of the current token is a type name.
Return true if the kind of the current token is a type name .