-Subproject commit f69bdbeee0f878c46de0a1e44c2236cacc332fe3
+Subproject commit a9eaca11c2bf2408316968cad2619a9161f204b5
Range *range = *data;
CHECK_BB(emit_range(emit, range));
const Exp e = range->start ?: range->end;
- const Symbol sym = insert_symbol("@range");
+ const Symbol sym = insert_symbol("[:]");
assert(e);
struct Op_Import opi = {.op = sym,
- .rhs = e->type,
+ .lhs = e->type,
.pos = e->pos,
.data = (uintptr_t)prim_exp(data)};
CHECK_BB(op_emit(emit, &opi));
if (tflag(info->array.type, tflag_typedef))
info->array.type = typedef_base(info->array.type);
// look mum no pos
- struct Op_Import opi = {.op = insert_symbol("@array"),
+ struct Op_Import opi = {.op = insert_symbol("[]"),
.lhs = info->array.exp->type,
.rhs = info->array.type,
.data = (uintptr_t)info};
ANN static m_bool emit_exp_slice(const Emitter emit, const Exp_Slice *range) {
CHECK_BB(emit_exp(emit, range->base));
CHECK_BB(emit_range(emit, range->range));
- const Symbol sym = insert_symbol("@slice");
+ const Symbol sym = insert_symbol("[:]");
const Exp e = range->range->start ?: range->range->end;
assert(e);
struct Op_Import opi = {.op = sym,
ANN static void scan_prim_op(const Env env, const Type t){
struct Op_Func opfunc = { .ck = opck_bit_access, .em = opem_bit_access };
struct Op_Import opi = {
- .op = insert_symbol(env->gwion->st, "@array"),
+ .op = insert_symbol(env->gwion->st, "[]"),
.lhs = env->gwion->type[et_int],
.rhs = t,
.func = &opfunc
GWI_BB(gwi_oper_ini(gwi, "int", "Array", "int"))
GWI_BB(gwi_oper_add(gwi, opck_array_slice))
GWI_BB(gwi_oper_emi(gwi, opem_array_slice))
- GWI_BB(gwi_oper_end(gwi, "@slice", NULL))
+ GWI_BB(gwi_oper_end(gwi, "[:]", NULL))
GWI_BB(gwi_oper_ini(gwi, "int", "Array", NULL))
GWI_BB(gwi_oper_add(gwi, opck_array))
GWI_BB(gwi_oper_emi(gwi, opem_array_access))
- GWI_BB(gwi_oper_end(gwi, "@array", NULL))
+ GWI_BB(gwi_oper_end(gwi, "[]", NULL))
GWI_BB(gwi_oper_ini(gwi, "Array", NULL, "void"))
GWI_BB(gwi_oper_emi(gwi, opem_array_each_init))
GWI_BB(gwi_oper_end(gwi, "@each_init", NULL))
set_tflag(t, tflag_dtor);
}
struct Op_Func opfunc = { .ck = opck_dict_access, .em = opem_dict_access };
- struct Op_Import opi = { .lhs = key, .rhs = t, .ret = val, .op = insert_symbol("@array"), .func = &opfunc };
+ struct Op_Import opi = { .lhs = key, .rhs = t, .ret = val, .op = insert_symbol("[]"), .func = &opfunc };
add_op(env->gwion, &opi);
opi.op = insert_symbol("~~");
opfunc.em = opem_dict_remove;
GWI_BB(gwi_oper_end(gwi, "--", int_pre_dec))
GWI_BB(gwi_oper_add(gwi, opck_int_cmp))
GWI_BB(gwi_oper_end(gwi, "~", int_cmp))
- GWI_BB(gwi_oper_ini(gwi, NULL, "int", NULL))
+ GWI_BB(gwi_oper_ini(gwi, "int", NULL, NULL))
GWI_BB(gwi_oper_add(gwi, opck_int_range))
GWI_BB(gwi_oper_emi(gwi, opem_int_range))
- GWI_BB(gwi_oper_end(gwi, "@range", NULL))
+ GWI_BB(gwi_oper_end(gwi, "[:]", NULL))
GWI_BB(gwi_oper_ini(gwi, "int", NULL, "int"))
GWI_BB(gwi_oper_add(gwi, opck_post))
GWI_BB(gwi_oper_end(gwi, "++", int_post_inc))
GWI_BB(gwi_oper_ini(gwi, "int", "string", NULL))
GWI_BB(gwi_oper_add(gwi, opck_string_access))
GWI_BB(gwi_oper_emi(gwi, opem_string_access))
- GWI_BB(gwi_oper_end(gwi, "@array", NULL))
+ GWI_BB(gwi_oper_end(gwi, "[]", NULL))
GWI_BB(gwi_oper_ini(gwi, "string", "string", "bool"))
GWI_BB(gwi_oper_add(gwi, opck_string_eq))
GWI_BB(gwi_oper_end(gwi, "!=", String_neq))
GWI_BB(gwi_oper_ini(gwi, "int", "string", "string"))
- GWI_BB(gwi_oper_end(gwi, "@slice", StringSlice))
+ GWI_BB(gwi_oper_end(gwi, "[:]", StringSlice))
struct SpecialId_ file_spid = {
.ck = check_filepp, .is_const = 1};
env_weight(env, 1);
const Exp e = range->start ?: range->end;
assert(e);
- const Symbol sym = insert_symbol("@range");
+ const Symbol sym = insert_symbol("[:]");
struct Op_Import opi = {.op = sym,
- .rhs = e->type,
+ .lhs = e->type,
.pos = e->pos,
.data = (uintptr_t)prim_exp(data)};
return op_check(env, &opi);
}
ANN Type check_array_access(const Env env, const Array_Sub array) {
- const Symbol sym = insert_symbol("@array");
+ const Symbol sym = insert_symbol("[]");
struct Op_Import opi = {.op = sym,
.lhs = array->exp->type,
.rhs = array->type,
CHECK_OO(check_exp(env, range->base));
CHECK_BO(check_range(env, range->range));
env_weight(env, 1);
- const Symbol sym = insert_symbol("@slice");
+ const Symbol sym = insert_symbol("[:]");
const Exp e = range->range->start ?: range->range->end;
assert(e);
struct Op_Import opi = {.op = sym,