src/parse.c
// Create a local variable, and registers it to the function.
Create a local variable, and registers it to the function.
Create a local variable and registers it to the function .
Var *new_lvar(Type *type, char *name, Token *tok) {
    for (VarScope *sc = var_scope; sc; sc = sc->next) {
        if (sc->depth != scope_depth) {
            break;
        }
        if (!strcmp(name, sc->name)) {
            error_at(tok->loc, "redeclaration of '%s'", tok->str);
        }
    }
    return push_var(name, new_var(type, name, true, tok));
}
Var * new_lvar ( Type * type , char * name , Token * tok ) { for ( VarScope * sc = var_scope ; sc ; sc = sc -> next ) { if ( sc -> depth != scope_depth ) { break ; } if ( ! strcmp ( name , sc -> name ) ) { error_at ( tok -> loc , " " , tok -> str ) ; } } return push_var ( name , new_var ( type , name , true , tok ) ) ; }
Create a local variable, and registers it to the function.
Create a local variable and registers it to the function .