From: fennecdjay Date: Sun, 30 Dec 2018 22:13:02 +0000 (+0100) Subject: :art: More :smile: X-Git-Tag: nightly~2772 X-Git-Url: http://10.11.0.4:5575/?a=commitdiff_plain;h=90b07284a17bf89a237f8e71b194a1926a079631;p=gwion.git :art: More :smile: --- diff --git a/ast b/ast index 66d993ff..8c2fb420 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 66d993ff6c549baffd5b863a7f9761d8f52b63a5 +Subproject commit 8c2fb420e66bfac4dfec9b11e59c8e8bbe01f956 diff --git a/src/emit/emit.c b/src/emit/emit.c index 99b04bfa..14cffaff 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1225,10 +1225,8 @@ ANN static m_bool emit_stmt_union(const Emitter emit, const Stmt_Union stmt) { G l = stmt->l; do { Var_Decl_List list = l->self->d.exp_decl.list; - do { - list->self->value->d.ptr = ptr; - SET_FLAG(list->self->value, union); - } while((list = list->next)); + list->self->value->d.ptr = ptr; + SET_FLAG(list->self->value, union); } while((l = l->next)); SET_FLAG(stmt->l->self->d.exp_decl.list->self->value, enum); } diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 9c818104..742ef6e1 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -16,12 +16,6 @@ ANN static m_bool scan1_stmt_list(const Env env, Stmt_List list); ANN m_bool scan1_class_def(const Env env, const Class_Def class_def); ANN static m_bool scan1_stmt(const Env env, Stmt stmt); -ANN static inline m_bool check_array_empty(const Array_Sub a, const uint pos) { - if(!a->exp) - return GW_OK; - ERR_B(pos, "type must be defined with empty []'s") -} - ANN static void scan1_exp_decl_template(const Type t, const Exp_Decl* decl) { Exp_Decl* d = (Exp_Decl*)decl; d->base = t->def; @@ -210,12 +204,6 @@ ANN m_bool scan1_stmt_enum(const Env env, const Stmt_Enum stmt) { GWDEBUG_EXE return GW_OK; } -ANN static Type scan1_rettype(const Env env, const Type_Decl* td) { GWDEBUG_EXE - if(td->array) - CHECK_BO(check_array_empty(td->array, td->xid->pos)) - return known_type(env, td); -} - ANN static m_bool scan1_args(const Env env, Arg_List list) { GWDEBUG_EXE do { const Var_Decl var = list->var_decl; @@ -226,7 +214,7 @@ ANN static m_bool scan1_args(const Env env, Arg_List list) { GWDEBUG_EXE } ANN m_bool scan1_stmt_fptr(const Env env, const Stmt_Fptr ptr) { GWDEBUG_EXE - CHECK_OB((ptr->ret_type = scan1_rettype(env, ptr->td))) + CHECK_OB((ptr->ret_type = known_type(env, ptr->td))) return ptr->args ? scan1_args(env, ptr->args) : GW_OK; } @@ -246,7 +234,7 @@ ANN m_bool scan1_stmt_union(const Env env, const Stmt_Union stmt) { GWDEBUG_EXE SET_FLAG(decl.td, checked | stmt->flag); if(GET_FLAG(stmt, static)) SET_FLAG(decl.td, static); - CHECK_BB(scan1_exp_decl(env, &l->self->d.exp_decl)) + CHECK_BB(scan1_exp(env, l->self)) } while((l = l->next)); union_pop(env, stmt, scope); return GW_OK; @@ -297,7 +285,7 @@ ANN m_bool scan1_func_def(const Env env, const Func_Def f) { GWDEBUG_EXE ++env->scope; if(GET_FLAG(f, dtor) && !env->class_def) ERR_B(f->td->xid->pos, "dtor must be in class def!!") - CHECK_OB((f->ret_type = scan1_rettype(env, f->td))) + CHECK_OB((f->ret_type = known_type(env, f->td))) if(f->arg_list) CHECK_BB(scan1_args(env, f->arg_list)) if(!GET_FLAG(f, builtin))