-Subproject commit b412aa9281f85e4d9f9cd1bb3a0716dbfd1a9432
+Subproject commit 23c2894a2dd6b0f0b3531f7995a3395020fc45bb
-Subproject commit 713f9a6e94f8d3462082ea90ca679f112b449219
+Subproject commit a8194c5a7b1b874d1475cb5af245770327605f9b
}
ANN static m_bool section_fdef(const Gwi gwi, const Func_Def fdef) {
- Section section = (Section) {
- .section_type = ae_section_func,
- .d = { .func_def = fdef }
- };
+ Section section = MK_SECTION(func, func_def, fdef);
gwi_body(gwi, §ion);
return GW_OK;
}
}
ANN static m_bool section_fptr(const Gwi gwi, const Fptr_Def fdef) {
- Section section = (Section) {
- .section_type = ae_section_fptr,
- .d = { .fptr_def = fdef }
- };
+ Section section = MK_SECTION(fptr, fptr_def, fdef);
gwi_body(gwi, §ion);
return GW_OK;
}
.d = { .stmt_exp = { .val = gwi->ck->exp } },
.loc = gwi->loc
}));
- Section section = (Section) {
- .section_type = ae_section_stmt,
- .d = { .stmt_list = slist }
- };
-// Section * section = new_section_stmt_list(mp, slist);
+ Section section = MK_SECTION(stmt, stmt_list, slist);
// const Ast body = new_ast(mp, section, NULL);
// gwi_body(gwi, body);
gwi_body(gwi, §ion);
const Exp bin = new_exp_binary(env->gwion->mp, lhs, impl->e->d.prim.d.var,
rhs, impl->e->loc);
Stmt_List code = new_mp_vector(env->gwion->mp, Stmt, 1);
- mp_vector_set(code, Stmt, 0,
- ((Stmt) {
- .stmt_type = ae_stmt_return, .d = { .stmt_exp = { .val = bin }},
- .loc = impl->e->loc
- }));
+ mp_vector_set(code, Stmt, 0, MK_STMT(ae_stmt_return, impl->e->loc,
+ .stmt_exp = { .val = bin }));
const Func_Def def = new_func_def(env->gwion->mp, base, code);
def->base->tag.sym = impl->e->d.prim.d.var;
// use envset
check_exp(env, cond);
const Stmt_List code = new_mp_vector(mp, Stmt, 1);
- mp_vector_set(code, Stmt, 0, ((Stmt) {
- .stmt_type = ae_stmt_while,
- .d = {
+ mp_vector_set(code, Stmt, 0, MK_STMT(ae_stmt_while, func->loc,
.stmt_flow = {
.cond = cond,
.body = stmt
}
- },
- .loc = func->loc
- }));
+ ));
exp->exp_type = ae_exp_unary;
exp->d.exp_unary.unary_type = unary_code;
exp->d.exp_unary.code = code;
tdef->when = NULL;
when->next = helper;
Stmt_List code = new_mp_vector(env->gwion->mp, Stmt, 2);
- mp_vector_set(code, Stmt, 0,
- ((Stmt) {
- .stmt_type = ae_stmt_exp, .d = { .stmt_exp = { .val = when }},
- .loc = when->loc
- }));
- mp_vector_set(code, Stmt, 1,
- ((Stmt) {
- .stmt_type = ae_stmt_exp,
- .loc = when->loc
- }));
+ mp_vector_set(code, Stmt, 0, MK_STMT_EXP(when->loc, when));
+ mp_vector_set(code, Stmt, 1, MK_STMT_EXP(when->loc, NULL));
const Func_Def fdef = new_func_def(env->gwion->mp, fb, code);
tdef->when_def = fdef;
CHECK_BB(traverse_func_def(env, fdef));
const Exp arg = mk_args(p, lst, max);
const Exp call = new_exp_call(p, func, arg, func->loc);
Stmt_List code = new_mp_vector(p, Stmt, 1);
- mp_vector_set(code, Stmt, 0,
- ((Stmt) {
- .stmt_type = type, .d = { .stmt_exp = { .val = call }},
- .loc = func->loc
- }));
+ mp_vector_set(code, Stmt, 0, MK_STMT(ae_stmt_return, func->loc, .stmt_exp = { .val = call}));
return code;
}
const Exp arg = partial_call(env, args, earg);
const Exp exp = new_exp_call(env->gwion->mp, efun, arg, efun->loc);
Stmt_List code = new_mp_vector(env->gwion->mp, Stmt, 1);
- mp_vector_set(code, Stmt, 0, ((Stmt) {
- .stmt_type = ae_stmt_return,
- .d = { .stmt_exp = { .val = exp }}
- }));
-// stmt->stmt_type = ae_stmt_return;
-// stmt->d.stmt_exp.val = exp;
+ mp_vector_set(code, Stmt, 0, MK_STMT(ae_stmt_return, efun->loc,
+ .stmt_exp = { .val = exp }));
return code;
-// return new_stmt_code(env->gwion->mp, slist, efun->loc);
}
ANN static uint32_t count_args_exp(Exp args) {