src/parse.c
// Find a variable by name.
Find a variable by name.
Find a variable by name .
VarScope *find_var(char *name) {
    for (VarScope *sc = var_scope; sc; sc = sc->next) {
        if (!strcmp(name, sc->name)) {
            if (!sc->var && !sc->enum_type) {
                error_at(ctok->loc, "unexpected variable name '%s'", name);
            }
            return sc;
        }
    }
    return NULL;
}
VarScope * find_var ( char * name ) { for ( VarScope * sc = var_scope ; sc ; sc = sc -> next ) { if ( ! strcmp ( name , sc -> name ) ) { if ( ! sc -> var && ! sc -> enum_type ) { error_at ( ctok -> loc , " " , name ) ; } return sc ; } } return NULL ; }
Find a variable by name.
Find a variable by name .