From: Jérémie Astor Date: Tue, 29 Mar 2022 18:01:34 +0000 (+0200) Subject: :art: Remove xxxfix X-Git-Tag: nightly~347 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e70ebda2c52c35000a738aff6e6c621f2af8df79;p=gwion.git :art: Remove xxxfix --- diff --git a/ast b/ast index 8d7ea623..c1f3c9f3 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 8d7ea62306b8ef35567f01c994ec837e2ff2da04 +Subproject commit c1f3c9f30ab17aae64b61f5635f745abf88ef8e3 diff --git a/src/parse/scan0.c b/src/parse/scan0.c index b5e41bd3..9e1e5f77 100644 --- a/src/parse/scan0.c +++ b/src/parse/scan0.c @@ -62,7 +62,6 @@ static void fptr_def(const Env env, const Fptr_Def fptr) { ANN m_bool scan0_fptr_def(const Env env, const Fptr_Def fptr) { CHECK_BB(env_access(env, fptr->base->flag, fptr->base->td->pos)); CHECK_BB(scan0_defined(env, fptr->base->xid, fptr->base->td->pos)); - ; const m_str name = s_name(fptr->base->xid); const Type t = scan0_type(env, name, env->gwion->type[et_fptr]); const bool global = !env->class_def && GET_FLAG(fptr->base, global); diff --git a/src/parse/scan1.c b/src/parse/scan1.c index cc2d969c..04b22415 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -169,42 +169,8 @@ ANN m_bool scan1_exp_decl(const Env env, const Exp_Decl *decl) { return ret; } -ANN static inline int opiscall(const Symbol sym) { - const m_str opname = s_name(sym); - return (opname[0] == '@' || opname[0] == '&') && - (isalpha(opname[1]) || opname[1] == '_'); -} - -ANN static inline Exp sym2func(const Env env, const Symbol sym, - const loc_t pos) { - MemPool mp = env->gwion->mp; - const m_str name = s_name(sym); - return new_prim_id(mp, insert_symbol(name + 1), pos); -} - -ANN static void binary_args(const Exp_Binary *bin) { - Exp arg = bin->lhs; - while (arg->next) arg = arg->next; - arg->next = bin->rhs; -} - -ANN static m_bool exp2call(const Env env, const Exp e, const Symbol sym, - const Exp args) { - e->exp_type = ae_exp_call; - e->d.exp_call.func = sym2func(env, sym, e->pos); - e->d.exp_call.args = args; - e->d.exp_call.tmpl = NULL; - return scan1_exp(env, e); -} - -ANN static m_bool binary2call(const Env env, const Exp_Binary *bin) { - binary_args(bin); - return exp2call(env, exp_self(bin), bin->op, bin->lhs); -} - ANN static inline m_bool scan1_exp_binary(const Env env, const Exp_Binary *bin) { - if (opiscall(bin->op)) return binary2call(env, bin); CHECK_BB(scan1_exp(env, bin->lhs)); return scan1_exp(env, bin->rhs); } @@ -241,8 +207,6 @@ ANN static inline m_bool scan1_exp_cast(const Env env, const Exp_Cast *cast) { } ANN static m_bool scan1_exp_post(const Env env, const Exp_Postfix *post) { - if (opiscall(post->op)) - return exp2call(env, exp_self(post), post->op, post->exp); CHECK_BB(scan1_exp(env, post->exp)); const m_str access = exp_access(post->exp); if (!access) return GW_OK; @@ -273,8 +237,7 @@ ANN static inline m_bool scan1_exp_unary(const restrict Env env, const Exp_Unary * unary) { if (unary->unary_type == unary_code) { RET_NSPC(scan1_stmt(env, unary->code)) - } else if (opiscall(unary->op)) - return exp2call(env, exp_self(unary), unary->op, unary->exp); + } return unary->unary_type == unary_exp ? scan1_exp(env, unary->exp) : GW_OK; } diff --git a/tests/xxxfix/bin_func.gw b/tests/xxxfix/bin_func.gw deleted file mode 100644 index 8b0fcf63..00000000 --- a/tests/xxxfix/bin_func.gw +++ /dev/null @@ -1,5 +0,0 @@ -fun int add(int i, int j) { - return i + j; -} - -<<< 1 @add 2 >>>; diff --git a/tests/xxxfix/post_func.gw b/tests/xxxfix/post_func.gw deleted file mode 100644 index aa59f5e9..00000000 --- a/tests/xxxfix/post_func.gw +++ /dev/null @@ -1,5 +0,0 @@ -fun int add(int i) { - return i + 3; -} - -<<< 2 (&add)>>>; diff --git a/tests/xxxfix/unary_func.gw b/tests/xxxfix/unary_func.gw deleted file mode 100644 index 51c9081e..00000000 --- a/tests/xxxfix/unary_func.gw +++ /dev/null @@ -1,5 +0,0 @@ -fun int add(int i) { - return i + 3; -} - -<<< (&add) 2 >>>;