From 6b5edd67af9eac6749e66ce4bfc7b9223040d69a Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 9 Jul 2019 19:01:45 +0200 Subject: [PATCH] :art: More fixes and tests --- src/arg.gcda | Bin 992 -> 992 bytes src/arg.gcno | Bin 9152 -> 9152 bytes src/compile.gcda | Bin 696 -> 696 bytes src/compile.gcno | Bin 8192 -> 8192 bytes src/gwion.gcda | Bin 724 -> 724 bytes src/gwion.gcno | Bin 8744 -> 8744 bytes src/gwiondata.gcda | Bin 192 -> 192 bytes src/gwiondata.gcno | Bin 1876 -> 1876 bytes src/lib/func.c | 20 +++++++-------- src/main.gcda | Bin 160 -> 160 bytes src/main.gcno | Bin 1348 -> 1348 bytes src/parse/check.c | 24 +++++------------- src/parse/scan1.c | 4 +-- src/parse/scan2.c | 3 +-- src/plug.gcda | Bin 800 -> 792 bytes src/plug.gcno | Bin 11056 -> 10944 bytes src/soundinfo.gcda | Bin 120 -> 120 bytes src/soundinfo.gcno | Bin 848 -> 848 bytes tests/import/driver.so | Bin 23496 -> 0 bytes tests/import/test.log | 42 ++++++++++++++++++++++++++++++++ tests/tree/array_cast.gw | 2 ++ tests/tree/did_you_mean_type.gw | 4 +++ tests/tree/push_func.gw | 1 + tests/tree/reddit.gw | 8 ++++++ tests/tree/template_fptr.gw | 11 +++++++++ 25 files changed, 86 insertions(+), 33 deletions(-) delete mode 100755 tests/import/driver.so create mode 100644 tests/tree/array_cast.gw create mode 100644 tests/tree/did_you_mean_type.gw create mode 100644 tests/tree/push_func.gw create mode 100644 tests/tree/reddit.gw create mode 100644 tests/tree/template_fptr.gw diff --git a/src/arg.gcda b/src/arg.gcda index 3dcc1be1753c780ac1b0ff78b7b65572a2dfe459..bf449aee3bb98e1109a43e981caf545abf9770ed 100644 GIT binary patch literal 992 zcmYdHNlw=?v~*1An|GaofngyNkPrnDGf#*x0-21=KtiqmQ1Cu^l}S6DKQ{uEFmgcE z04cCqY&1{|thc-7g=AD^Gsdf%I?z^@xES1_U5S zfdI&jAOPdTXpj)d&EE?P9Ngw>L>M0FECQJ!1{8ytflDvU3>Xcyf&ra|$-`)vo$h~2 zgx62n6*T3_bY761d_W0wy~OfiW`5Xd=OX+f!^g;ON)O0PHza?!umCwg05cQj9zrxk z7iQSWK_%p23ZOK)c`#{EID-I;hPeYGifKN~99;6miVHz4f|&=4SD=1y+?!_Z(bzXP z{Nldn)5Aew#sidq#W}Gw%&fa=??ud=F22xG2^NOMDY0gttAm+&Z<|~gTlI^}q~wX7 eg6z7SWX}Jq98#4*?m*6iuyBBdKg?dBeGCA?5=~tI literal 992 zcmYdHNlw=?v~-+%$?ggR1H(clAfYe7z@Xmg$PQ#OG6M;<{zJk0AiZor36S|90Ha}gfkI$C?%&zuS=KOddwV>~#NIBD{XmuAnJbrt^aAm`;CGxNhvI~U;>89qjKQ+hyVx&b9j zp@!JW0XaY*451h}p)|~0=zN$sR2c(|4^y|85hAk&N~5cTsfUS6Kp8L^<~Nu;Og)T- z*#nb@@nJNv;tTj8Dp{Z!VBrDeg5%yabC1Tpx#1W0J)a&93Ns#{gbLJg#L_Uc?y9{P zF?YK7LQ5qW7|f73g{50kX_%S!w#kLDRlm55FHgYChUw`k$gayt=KR0PAypaV4p5lF P`~nMKSop)lfl3$v>1b6R diff --git a/src/arg.gcno b/src/arg.gcno index 4b9a987eaf14c13cdb1d160100447e72f66e3b4f..38f07084fca7019cdcc9d8b42711f16f1dc25302 100644 GIT binary patch delta 21 ccmX@$e!!h4KQB35%h1v>rElK#jXYbF0bOJWk^lez delta 21 dcmX@$e!!h4KQB35%h1ws?j^e`8+o=U0{~vR2&@1A diff --git a/src/compile.gcda b/src/compile.gcda index d73115463110ad3aed16bf365cc7e9d9d73388bd..6b4cdd62b09f824fbb385e7b9ea57c664dd612ed 100644 GIT binary patch literal 696 zcmYdHNlw=?v~*nDKkqsN1H(clAR!7QW}XmX1TqOJAM1}w znm-l>nazb{Ho6@!yI?fTj4UVjP}6hViV~kCtI*vCbp`{>T`;{cK1?194feZY=4F{# z4|8TsJE9fAFO-nF7E*ho}XcPkgmcvcT literal 696 zcmYdHNlw=?v~;|C$?ggR1H(clAfYe7z@Xmg$PQ#OG6RY4%|A@?ci7Ca+qC-tPzfUo zP|R8mNC1H;lm;@vYD3kgo9)=lHgWyyZEYa65 zk$7mRG=mV70pkV3;QQWqVx+qC-t$Zae@2~gO90L&~P6Rb8PUf161 zyhD=Dot8@=wMswYaz~Cg6#0F$CG6RXP6;rjcvk&|+c^w9nS;!~> z6#K&pB!EDe5kgOgPz)2H{9-7d6=Vt!!1xtVJ~|CEClzWgPz%^@2Mu@ikf?u5fxFw6 zf$UZQN-zLj0R}i|E~xZ3UI+umC!`OT{C}u9FdAqo*li;9zU3XMiw@dt+I;}zHWr`+ zJGz^oYBS<>?Y+)BB>CKFxdc+H1XK$OXAqz@%?q^$M#J0)qk&EU`{$FfKyAcnZR4HJ zpBq7LU$`^2o))G*)FTlnYj h?I$2T0zfr&V3j}zL1{xMJpmdAu&{y(V}u<@901lVK8gSU diff --git a/src/gwion.gcno b/src/gwion.gcno index 6c8e11e1b66f55d2bb4a97b733c50f5c39f6e6de..db0a66d4ed87b7ea57a2b8bb23b7fb77e8e1380b 100644 GIT binary patch delta 25 hcmZ4CvciQoKQB35%h1yCc;CG1ToV&DHky7`1OS0o3Q7O~ delta 25 hcmZ4CvciQoKQB35%h1ws{*r(zToV&DHky7`1ORcQm&4U%9lVTj9fr5 n5s*S6XrL0X8Iyj*^5*aRBG{fcHx*=t08j#C4+xM;gY*Ib?0^*j literal 192 zcmYdHNlw=?v~-+$$?ggR1H(clAfYe7z@Xmg$PQ#OG6RW+cX&<0V@kO?Ix1fRl`wJv o#bkhLK!6YpR01|*(vMi){C!^p+wLt4?T$3*{X>2r=X9oa<$q8!! diff --git a/src/lib/func.c b/src/lib/func.c index 4d8cc62b..657d336d 100644 --- a/src/lib/func.c +++ b/src/lib/func.c @@ -67,20 +67,20 @@ struct FptrInfo { ANN static m_bool fptr_tmpl_push(const Env env, struct FptrInfo *info) { if(!info->rhs->def->base->tmpl) return GW_OK; -// some kind of template_match ? ID_List t0 = info->lhs->def->base->tmpl->list, t1 = info->rhs->def->base->tmpl->list; -nspc_push_type(env->gwion->mp, env->curr); + nspc_push_type(env->gwion->mp, env->curr); while(t0) { -// CHECK_OB(t1) -nspc_add_type(env->curr, t0->xid, t_undefined);// -nspc_add_type(env->curr, t1->xid, t_undefined);// + if(!t1) { + nspc_pop_type(env->gwion->mp, env->curr); + return GW_ERROR; + } + nspc_add_type(env->curr, t0->xid, t_undefined); + nspc_add_type(env->curr, t1->xid, t_undefined); t0 = t0->next; t1 = t1->next; } -// CHECK_BB(template_push_types(env, info->lhs->def->base->tmpl)) -// return template_push_types(env, info->rhs->def->base->tmpl); -return GW_OK;// + return GW_OK; } @@ -146,10 +146,8 @@ ANN static Type fptr_type(const Env env, struct FptrInfo *info) { if(fptr_rettype(env, info) > 0 && fptr_arity(info) && fptr_args(env, base) > 0) type = info->lhs->value_ref->type; - if(info->rhs->def->base->tmpl) { -// nspc_pop_type(env->gwion->mp, env->curr); + if(info->rhs->def->base->tmpl) nspc_pop_type(env->gwion->mp, env->curr); - } } } return type; diff --git a/src/main.gcda b/src/main.gcda index 1bd518d875d6a85a3783cde2156e2b4266bc65cf..5fce5e273cbc5a4c320d35f4b7d7335ac40cc5aa 100644 GIT binary patch literal 160 zcmYdHNlw=?v~=uTJMTIJ1H(clAR!7QW}XmX1Tqg0yaI5MVVKQ- p0a9SK#LyxjgMk1>1DRm6Z+`X(Jk{=QvZL8x3CL`aGLXeE001on6@UN$ literal 160 zcmYdHNlw=?v~-+(%kByT1H(clAfYe7z@Xmg$PQ#OG6RX%MFnhn9*Z)s9KSCKRKf_9 v2CD&57_21`I@gX|Xs82|+UIeiuo diff --git a/src/main.gcno b/src/main.gcno index 6293d5742f6d765c65ca83ec7a7aea76df4d6def..d737dff5e3aeae9fc2fd71b8cb1a081c96243d42 100644 GIT binary patch delta 25 hcmX@Yb%cvIKQB35%h1xXbM3tAToV&DHk$IY0swfl2=4#@ delta 25 hcmX@Yb%cvIKQB35%h1ws_AR?BToV&DHk$IY0swcQ2+IHf diff --git a/src/parse/check.c b/src/parse/check.c index a3e565eb..f20143ab 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -367,9 +367,7 @@ ANN2(1,2) static Func find_func_match_actual(const Env env, Func func, const Exp CHECK_OO(func->next); return find_func_match_actual(env, func->next, args, implicit, specific); } - if(e1->type == t_undefined || -(GET_FLAG(func, template) && isa(actual_type(func->value_ref->type), t_fptr) > 0) -) { + if(e1->type == t_undefined || (GET_FLAG(func, template) && is_fptr(func->value_ref->type))) { if(func->value_ref->owner_class) CHECK_BO(template_push_types(env, func->value_ref->owner_class->e->def->base.tmpl)) e1->type = known_type(env, e1->td); @@ -381,7 +379,6 @@ ANN2(1,2) static Func find_func_match_actual(const Env env, Func func, const Exp e = e->next; e1 = e1->next; } -printf("end %p %p\n", e1, func); if(!e1) return func; } while((func = func->next)); @@ -469,11 +466,10 @@ ANN static Func _find_template_match(const Env env, const Value v, const Exp_Cal m_func = find_func_match(env, fbase->func, exp->args); nspc_pop_type(env->gwion->mp, env->curr); if(!value && m_func) { -printf("m_func %p\n", m_func); -if(!m_func->def->base->ret_type) -CHECK_BO(traverse_func_def(env, m_func->def)) + if(!m_func->def->base->ret_type) + CHECK_BO(traverse_func_def(env, m_func->def)) map_set(&v->owner->info->type->map, (vtype)sym, (vtype)actual_type(m_func->value_ref->type)); -} + } } free_stmt(env->gwion->mp, stmt); } @@ -587,15 +583,11 @@ ANN static Type check_exp_call_template(const Env env, const Exp_Call *exp) { const Exp call = exp->func; const Exp args = exp->args; m_uint args_number = 0; -puts("here =="); DECL_OO(const Value, value, = nspc_lookup_value1(call->type->e->owner, insert_symbol(call->type->name))) -puts("after here =="); const m_uint type_number = get_type_number(value->d.func_ref->def->base->tmpl->list); -printf("%s func\n", __func__) ; Type_List tl[type_number]; ID_List list = value->d.func_ref->def->base->tmpl->list; while(list) { -printf("%s func\n", __func__) ; Arg_List arg = value->d.func_ref->def->base->args; Exp template_arg = args; while(arg && template_arg) { @@ -620,7 +612,7 @@ printf("%s func\n", __func__) ; DECL_OO(const Func,func, = get_template_func(env, exp, value)) if(!func->def->base->ret_type) // template fptr CHECK_BO(traverse_func_def(env, func->def)) - return func->def->base->ret_type; + return func->def->base->ret_type; } ANN static m_bool check_exp_call1_check(const Env env, const Exp exp) { @@ -715,11 +707,7 @@ ANN static Type check_exp_call(const Env env, Exp_Call* exp) { CHECK_OO((exp->m_func = ret)) return ret->def->base->ret_type; } - - const Type t = check_exp_call1(env, exp); -printf("here exp_call %p\n", t); -return t; -// return check_exp_call1(env, exp); + return check_exp_call1(env, exp); } ANN static Type check_exp_unary(const Env env, const Exp_Unary* unary) { diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 2856ea9e..ded15f44 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -245,8 +245,8 @@ ANN static m_bool scan1_args(const Env env, Arg_List list) { ANN m_bool scan1_stmt_fptr(const Env env, const Stmt_Fptr stmt) { if(!stmt->type) CHECK_BB(scan0_stmt_fptr(env, stmt)) - if(stmt->base->tmpl)// - return GW_OK;// + if(stmt->base->tmpl) + return GW_OK; CHECK_OB((stmt->base->ret_type = known_type(env, stmt->base->td))) return stmt->base->args ? scan1_args(env, stmt->base->args) : GW_OK; } diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 2d0af075..5b5fa989 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -93,8 +93,7 @@ ANN m_bool scan2_stmt_fptr(const Env env, const Stmt_Fptr ptr) { ptr->type->e->d.func = ptr->base->func; def->base->tmpl = ptr->base->tmpl; SET_FLAG(ptr->value, func | ae_flag_checked); -if(!ptr->base->tmpl)// - if(ptr->base->args) + if(!ptr->base->tmpl && ptr->base->args) CHECK_BB(scan2_args(env, def)) if(env->class_def) { if(GET_FLAG(ptr->base->td, global)) { diff --git a/src/plug.gcda b/src/plug.gcda index aa78ce69f691d5983376f3876f14caf6576d78a8..8b664567fd60c97db51de93ac11bfae73e6e2bfc 100644 GIT binary patch literal 792 zcmYdHNlw=?v~+appLd;sfngyNkPrnDGf#*x0-21=K;q*P36rWRVf;VeuTTLhVHAL> z0a6Sg^~3;}I*{2=05<#jk|Q$v3hrGB%sC7cUdYG=BoRtrN^#O)Gd{b#i)9mtb=#b4 z-U~8=52tdXB*11qymYiON~iBZ@W}&bL1u~pwTeI;hVDKXA11E^wFbtwVS@<3_~?hLS*V@jP{$}k`7m)94O0)ZQ@~W$n?WjX z9q-h}Eg(C!fD$mhFn@p&0tmqP5)du}D6T*N#)n$Xpa2#{#3M``7tIM(FA1e#d~_P- t4j2to4h}af_HRD%YkLLkHtjwD@&gOh95f27c0%IekidoJ*9oX)008bIKOq1B delta 185 zcmbQiwt&qvF(o-&%h1wMwZ8E>0|UcCCLjUAaZ*5nfq{`3NPJu(VN!L!_R7!qD^!3= z7zHLy)SDQg8mmHDVS8(r=WtizqkUE};4~-@UuuR;aJ8_D_S!zcj46Xys_oT5E3fOWD7BS-;IKzQPQ*2zbh FLIAfZGv5FJ diff --git a/src/plug.gcno b/src/plug.gcno index de8f8a67e3604c145b1c4cbe7f0ab07bdfd1b5bc..dc4198660920b242182bcccf24cca7a5d985d91b 100644 GIT binary patch delta 318 zcmX|(F-rqc5QN{}y_}cayI{OPE?{xtQUoi52(f!Hc3KEgNgFI8NE9JIz<*#ag9s@E zJ4?mZB0s@SEK>;Sw6${=iN(k6%+Bo7$?Q11yf__fGZkM->E zs5Dhd5u;R_WEL?mrev~@EsTOP5;E0*?Y~HeT;4q<&uH|62;)jz6P06>>X1y)D~z-X zjK(lY@kY8Szl=D{GA&yEN;+hgH}OI|$6fTCcv9M<40C@#6I{6wMpet(&^^bd)_7gB z_|`raegkKY!7Q{$beZzpNRdPaEw@Ftc!;`mhrScxI%hHVR;5kmKh^UNuvoV=efjkE F>%W7NK^_1A delta 351 zcmX|)F-yZx5Xavo@3m=6Vrzv)C|ImQ5d@0}3JwV^IM_i+6-PzEMU;YqqupJ?Uq$F7 zh;zg*(6NKKir>K1Z{VF$had0mcmKOL+|Bm<^RuIq#pZgfNBs{MhgKt9t?1{Q_wRJO zTN)^(h*2sgc_+~e>g1=NE9m4yT+h~)3~P`1i?zt+I?uR_W|V4?WE`e|N2)9oxRR;Z z@l<+A$dw63W2RQeaz!`gwl9Vmr=^#FBpop0nYaLPm|(*SabPsEFrpOwVj0tR8yC(o z0c4kPYIiZ5Ynxl%xWkKGCI=<6i7TgpedFQDkLdo_yXZM}WK$kS)*8DVlh6Z7)daO% X5kp&(|DX6W9lTW|8oXZSw&s5Tk_$n9 diff --git a/src/soundinfo.gcda b/src/soundinfo.gcda index 66d3f7d25d22fe63e535643e6e3fac0844c6e340..ade055bc0206238fcd62c146fc667641a8cc3d07 100644 GIT binary patch delta 68 zcmb=ZkV#BQPS-NDbYz$??>Ykm!$Kw?AqpgBo)BT2C?mrO;)4LwL`P*2kOT<8Xb>9! D;tC0~ delta 68 zcmb=ZkV#BQPS-NDbo_hC?g|3~!$Kw?p)bI|px)`oK2b)7lN-nf0q%*8$|4{M5P;Dj FHUJGN3Y!1` diff --git a/src/soundinfo.gcno b/src/soundinfo.gcno index 6c38817e2d712e48980a868149884fe7ea917968..56f214484dc74f6f50db7695437bc3d606c2e353 100644 GIT binary patch delta 26 icmcb>c7csIKQB35%h1x1VZyxYT$2kKH8z?`GXns6WC(Tu delta 26 icmcb>c7csIKQB35%h1yC?$bM|m{_b=U(+?ntF%{Sl7ovS;ZJ4d%{wA*Y?5hUb5jLZV5M+4@;L+spy0jDq|#!D<^1mdg%0@XiXk&4U zVeGoO<+r50@5)li*}+C~d!^i7DW}Rql3$hFQY(BUKZi-dJmpdg%~UDc1l-tJGedQ6 z%wlLRS6FDKN+q`ga^&a#^ipBpDeb*pTs|S&r%DwbvfG9K4*cJ=Z4dLjmU(M=`hojL zk5r#~{?JvQzv8KTpCVtV`P9!OC;f8<7!QcP2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Iws#e4jFODBm;`9{G4B)L(LOKy z0*kS0UCrlaE|qvy;0K{OR~*pqu$M~7@0Ar*_DgQ{xW^1J=Nbltr*+M~T6d`O5y?$< zF{G_ekSNuYDuFubR`%8UM3riP8Cb+cIvTGe0NN|2)On(U{yW_S^DOo26T)1VQHl2_~0GlL|>SWMjOHzlvi zXF+O|X9>wWWR)sUCAQWcCI3wj8s*ixH!9^7U$eY|pGSpwl>f1WMTxzRJlSfzz7K$K zlD$S!^74yP4X@-?`4cH$V~~|)Qem@RC8zkUb(wP$}8G4p!y!w+I3)uRee+$l9VP8Z)Wq$FWzMd&>q6Zs|jTP4OV>>; + int a; +} diff --git a/tests/tree/push_func.gw b/tests/tree/push_func.gw new file mode 100644 index 00000000..2f7957f6 --- /dev/null +++ b/tests/tree/push_func.gw @@ -0,0 +1 @@ +me.exit; diff --git a/tests/tree/reddit.gw b/tests/tree/reddit.gw new file mode 100644 index 00000000..9b4fd259 --- /dev/null +++ b/tests/tree/reddit.gw @@ -0,0 +1,8 @@ + +#! basic math printed out (note the space after '<<<' and before '>>>' +<<< 1 + 2 >>>; + +#! define and operator +operator $@+-*%~<>^&!= void (int i, int j) { <<< i, " ", j >>>; } + +1 $@+-*%~<>^&!= 2; diff --git a/tests/tree/template_fptr.gw b/tests/tree/template_fptr.gw new file mode 100644 index 00000000..3a130d9f --- /dev/null +++ b/tests/tree/template_fptr.gw @@ -0,0 +1,11 @@ +typedef int ptr_t<~A~>(A); +ptr_t ptr; +<<>>; + +fun int test<~A~>(A a) { <<< a >>>; } +test @=> ptr; +<<< ptr >>>; +#!3; +#!3 => test; +ptr<~int~>(2); +ptr<~float~>(2.3); -- 2.43.0