typedef enum {
et_void, et_int, et_bool, et_char, et_float,
et_null, et_object, et_shred, et_fork, et_event, et_ugen, et_string, et_ptr, et_array, et_gack,
- et_function, et_fptr, et_varloop, et_vararg, et_lambda, et_class, et_union, et_undefined, et_auto,
+ et_function, et_fptr, et_varloop, et_lambda, et_class, et_union, et_undefined, et_auto,
MAX_TYPE
} type_enum;
#endif
#ifndef __SPECIALID
#define __SPECIALID
-//typedef struct SpecialId_* SpecialId;
struct SpecialId_;
typedef Type (*idck)(const Env, const Exp_Primary*);
typedef Instr (*idem)(const Emitter, const Exp_Primary*);
ANN static inline Type specialid_type(const Env env,
struct SpecialId_ *spid, const Exp_Primary* prim) {
+ exp_self(prim)->type = spid->type;
if(spid->is_const)
exp_self(prim)->meta = ae_meta_value;
return spid->ck ? spid->ck(env, prim) : spid->type;
static ID_CHECK(idck_vararg) {
if(env->func && GET_FLAG(env->func->def, variadic))
- return env->gwion->type[et_vararg];
+ return exp_self(prim)->type;
ERR_O(exp_self(prim)->pos, _("'vararg' must be used inside variadic function"))
}
GWI_BB(gwi_set_global_type(gwi, t_varloop, et_varloop))
const Type t_vararg = gwi_class_spe(gwi, "@Vararg", 0);
gwi_gack(gwi, t_vararg, gack_vararg);
- gwi->gwion->type[et_vararg] = t_vararg; // use func
GWI_BB(gwi_union_ini(gwi, NULL, NULL))
GWI_BB(gwi_union_add(gwi, "@VarLoop", "start"))
GWI_BB(gwi_union_add(gwi, "@VarLoop", "end"))