src/parse.c
// Create a global variable, and registers it to the program.
Create a global variable, and registers it to the program.
Create a global variable and registers it to the program .
Var *new_gvar(Type *type, char *name, Token *tok) {
    VarScope *sc = find_var(name);
    if (sc) {
        Var *var = sc->var;
        if (!is_same_type(type, var->type)) {
            error_at(tok->loc, "conflicting types for '%s'", name);
        }
        return var;
    }
    return push_var(name, new_var(type, name, false, tok));
}
Var * new_gvar ( Type * type , char * name , Token * tok ) { VarScope * sc = find_var ( name ) ; if ( sc ) { Var * var = sc -> var ; if ( ! is_same_type ( type , var -> type ) ) { error_at ( tok -> loc , " " , name ) ; } return var ; } return push_var ( name , new_var ( type , name , false , tok ) ) ; }
Create a global variable, and registers it to the program.
Create a global variable and registers it to the program .