From 65e4185739ded91f989f74f8ac235e2b9c516788 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 9 Jul 2019 18:15:02 +0200 Subject: [PATCH] :art: Fixes and more tests --- src/arg.gcda | Bin 0 -> 992 bytes src/arg.gcno | Bin 0 -> 9152 bytes src/compile.gcda | Bin 0 -> 696 bytes src/compile.gcno | Bin 0 -> 8192 bytes src/gwion.c | 5 +- src/gwion.gcda | Bin 0 -> 724 bytes src/gwion.gcno | Bin 0 -> 8744 bytes src/gwiondata.gcda | Bin 0 -> 192 bytes src/gwiondata.gcno | Bin 0 -> 1876 bytes src/lib/array.c | 2 +- src/lib/func.c | 12 +- src/main.gcda | Bin 0 -> 160 bytes src/main.gcno | Bin 0 -> 1348 bytes src/parse/check.c | 32 +- src/parse/scan1.c | 2 + src/parse/scan2.c | 1 + src/plug.gcda | Bin 0 -> 800 bytes src/plug.gcno | Bin 0 -> 11056 bytes src/soundinfo.gcda | Bin 0 -> 120 bytes src/soundinfo.gcno | Bin 0 -> 848 bytes tests/error/private_type_err.gw | 7 + tests/error/protect_type_err.gw | 7 + tests/error/ptr_from_const.gw | 1 + tests/error/ptr_implicit_const.gw | 3 + tests/error/ref_class_extend.gw | 4 + tests/error/unary_uniq.gw | 2 + tests/error/vararg_invalid_acces.gw | 7 + tests/import/driver.c | 15 +- tests/import/driver.so | Bin 0 -> 23496 bytes tests/import/test.log | 3795 +++++++++++++++++++++++++++ tests/sh/plugin.sh | 7 +- tests/tree/vararg_assign.gw | 1 + 32 files changed, 3879 insertions(+), 24 deletions(-) create mode 100644 src/arg.gcda create mode 100644 src/arg.gcno create mode 100644 src/compile.gcda create mode 100644 src/compile.gcno create mode 100644 src/gwion.gcda create mode 100644 src/gwion.gcno create mode 100644 src/gwiondata.gcda create mode 100644 src/gwiondata.gcno create mode 100644 src/main.gcda create mode 100644 src/main.gcno create mode 100644 src/plug.gcda create mode 100644 src/plug.gcno create mode 100644 src/soundinfo.gcda create mode 100644 src/soundinfo.gcno create mode 100644 tests/error/private_type_err.gw create mode 100644 tests/error/protect_type_err.gw create mode 100644 tests/error/ptr_from_const.gw create mode 100644 tests/error/ptr_implicit_const.gw create mode 100644 tests/error/ref_class_extend.gw create mode 100644 tests/error/unary_uniq.gw create mode 100644 tests/error/vararg_invalid_acces.gw create mode 100755 tests/import/driver.so create mode 100644 tests/tree/vararg_assign.gw diff --git a/src/arg.gcda b/src/arg.gcda new file mode 100644 index 0000000000000000000000000000000000000000..3dcc1be1753c780ac1b0ff78b7b65572a2dfe459 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/src/arg.gcno b/src/arg.gcno new file mode 100644 index 0000000000000000000000000000000000000000..4b9a987eaf14c13cdb1d160100447e72f66e3b4f GIT binary patch literal 9152 zcmd6s&yN&U5XW~^Pz3z7_!|XeL0p9q6pR-FECc>PO@ILYh|97&ECa*tGCK<*Nbna1 z!I%&dE)wrvyciRV;b8m+P);U#GLf4m9PnbaKKG4aYG%dv; ziSZ{KmfVHK2Pnp#lsLT#i*HbjC2j$g?zF~$B$k4>9emcV`Ff1WM^%-f2g{1 zV4~g>I@a@^iFx-UV~t<)AiLLh9#r4~>r*x2SX6 z8GArUEZ1L|I%mp?-ieF9{<$)UWth@!_6aeuJZc=q@@8un$!X6+jjuhYwKk*+EPnYN zd*OS?!Gj6=z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r*+761w7ZA$=~->O%%5s}DJ6nyfzL zoMGZVY$3;Y`QQ0BjRl7DHExeamE?ODJrMWs{O4;N`+2{cvq$Icy}s@ZVx&A_3{Y&# z*S&g$B_>de^>wdaVet`)vA*urD=aaCVyv%w_3F2_pBMf<>zOqdF7@_o>IP3v)kbQ~ z6w{`Iy^om8Hx6@3XT|@2P7!nB!y3rSH{?b0&A(Uem6Q~J;t0j@_x)YH!sg|R@9!Zt zFJI;glwLdMi|^T?-n@Lt!m4((kBxi?D5+P!eEsm2sfRB8$bYKDVyr%4|ESg)j*H{N zI)hukA*o(z+}Ag^uoZQ96T;>wut8_J4G}tazSD>R literal 0 HcmV?d00001 diff --git a/src/compile.gcda b/src/compile.gcda new file mode 100644 index 0000000000000000000000000000000000000000..d73115463110ad3aed16bf365cc7e9d9d73388bd GIT binary patch literal 696 zcmYdHNlw=?v~;|C$?ggR1H(clAfYe7z@Xmg$PQ#OG6RY4%|A@?ci7Ca+qC-tPzfUo zP|R8mNC1H;lm;@vYD3kgo9)=lHgWyyZEYa655HXb>nw(GO|rRdBp)|m)hDLfEH`SzrHxk+S3zDEQi{8U9{H=FAD3~=viNtp#J}}<{s=0^7p_P zGHMumc1I@T-l4U^?%mSAMA)Z?96jb=Cag3aGZ*ZQ?=Y%sV#}D^qfYMS-_6CLeTus%}QZczJs7y?J1}YO1 zUxUiTG@lQ}oYy6#rJkq7K`7?_947gan1G64E{J|3L9s&DOH4tb*ez90OT{D>p-{{> zRXr^g6D%kcv#sh@CV9Pebo1Uj{`vgR>emNHlDyui*UWaPo#(^?dHq#k%{Q9Y^_(x9 z*L``G9A-X14$wTHd6qUh)YxM#Z#6QQSoC2cH%wy7#dPy}9+Q~C$Mg2EYk3`e_Pu}& zF!U^{@zv5UntM6p=Y=y;AJM&s`$!&>wd%QqW6lW13)w=YrEAqQ3dh~+!7Q40^O)?v zXx@EMFkZ^7m7G>I_k#Jd@GCiNz5$Eo;C{>~zCkd@Pq)^uId}ZK;qAX~z$emgz}{^4 zK)sW$Av9+^F8X|vJS(hmqB%p)=)yT8AB*@Fv49-r4i$IsoRP-_5B~zojc>!Y_%7qy ziu2el{Dkn6!Woql=RQpK3x(d{Q>vbpn&*nf_#Q!fI){sY7mf3NO!e>9uE%D!{;+Q3 zy1$3t<1A)94jy_o4+$P`;-kW@fBSyxm~T<@PM9BCzOc8=C1BQuh`i!B69c1)f+sMqG+AQZi z<$flGGg4gaLD&rWd&0w_w^KMH{r#_d49DFmfK$S|GGJ+y^RD_Zi^iJ|)BHK~Y^ObY zFZ%91;=#0U#L#v2V`{D$Y5uhF*l+D)N4_0>247f7HMMqqE`3Zx?M(y@|bwWV%vydiS#i{ENc=)JSnjH>aC($Vt_#~e=q2VJ{P*PMY46uO_gR6Q+q zKSkr)FweK2>%}6!Lo?F-6wL#7XMoaDOpCM7Ga|+vN^;AgU&nTTIWctR@M~xP=*un6 zKdwUU-6Y1)ybbc_ z{acontext->error) + if(env->context && env->context->error) return; if(env->class_def) gw_err(_("in class: '%s'\n"), env->class_def->name); @@ -120,5 +120,6 @@ ANN void env_err(const Env env, const struct YYLTYPE* pos, const m_str fmt, ...) va_end(arg); fprintf(stderr, "\n"); loc_err(pos, env->name); - env->context->error = 1; + if(env->context) + env->context->error = 1; } diff --git a/src/gwion.gcda b/src/gwion.gcda new file mode 100644 index 0000000000000000000000000000000000000000..d0363d621ff30e26039326b7591b3bae83827d39 GIT binary patch literal 724 zcmYdHNlw=?v~--mB;X1I1H(clAi>Yaz~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 literal 0 HcmV?d00001 diff --git a/src/gwion.gcno b/src/gwion.gcno new file mode 100644 index 0000000000000000000000000000000000000000..6c8e11e1b66f55d2bb4a97b733c50f5c39f6e6de GIT binary patch literal 8744 zcmdU!%WoV-5XN^M2=9|h+72IZ@%fwc+{4h?nQ`_s%N^o`|IxNs;-*d zcB?ksw|D>Orx%X?cw?zls?4j6HnX-OmV;;R$ z{CVb+zS-GJm-qd4VoQ(J8?BXz#^NIFrCW?QgsJJ6YM^Fg=8aj;d1K8rTIRXUxKtV| zZ%Uq}67yY~ypNT6Qm5@2W6ABs`t$DOu1&bYLbla7kH!0DW7@7WcKw|k8Sluo9?gUN zdSk}jU@TG_a%8j>$029WzBc4Ht<#45=5^YTa|XV3BHxm>-D*#f^nn~1YjOIfp4Sn3 zrp`X3n`(Kxy>kXo%-OdDk(Sl+?e-=ehvWJ%wZCx8wr8E_8VcS2f`+H1_KqDwp_uPz zcv=b*JB30q<>A68m4u0XL!p>U8lINIbUqY{xm>`!!|M1G6pGogu`9-_fLtNjKmG`X zVxO_GXA=ZhNDufj6pH(PBqBUS3b|Tp`@p*aYSq4l;QPmwiE@_6_En34$x+qu3Y}iaVjS?G2QxM`q*o@nCW{L80qx zYIs^|o!n_qDCTJmPfKCyyD1!#_?V+4CU1ZL$m++9&%YV|>f$BtKgHz5j?1${*MGvW zu>Dtzb$2T!>n^>bSd030|sBhsSGowd(hXaJ{a@EG7BG?}J;GkEy$5+9XccO z7AR(adj*k}!qvRtxL`h3z~z2re^BUp!5lQ+2gntwCjZ@_A1D+X%*TzNFn-ebDdYXd zL&iBO@3czq=APm4lS4ZX?)rO)J?VR))}CKz&Nb4`q3h_g@x;7-uJh8I)Vpne>~)WEM%D7YR$&cLs16^|@MI62<>p+a*{aQT z>W#`uqqf{$9N_zxJ06?NNcVHBjr#VZGm%c$TMxetV_Q(@zKe5n-|DUk$HWeEl-##F zhQ2(v>8F9uE`R&;ubh?af3j0=wv(=*>*q|!4<0nm+rDy!wYHzPb7%X`Zj(i9@V`>@ zlgDyC07l*ikW#3{7-OPdah*opt9TOK43a4852I|{ zFLKp;vhR&9*%jrioep%9hUx8Us%U))WFskG+I+ao^M@av0| z+`jub3ya71=579v@-BHg{!VSLm|#*5{8rv5x7q&}Zd=aNZ?2xezVd?)`>MkScd`FP zzmTKlnk+?>e|7YWeGA1^Ylhs->def->base->tmpl->list, t1 = info->rhs->def->base->tmpl->list; +nspc_push_type(env->gwion->mp, env->curr); while(t0) { - CHECK_OB(t1) +// CHECK_OB(t1) +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); +// CHECK_BB(template_push_types(env, info->lhs->def->base->tmpl)) +// return template_push_types(env, info->rhs->def->base->tmpl); +return GW_OK;// } @@ -143,7 +147,7 @@ ANN static Type fptr_type(const Env env, struct FptrInfo *info) { 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); +// nspc_pop_type(env->gwion->mp, env->curr); nspc_pop_type(env->gwion->mp, env->curr); } } diff --git a/src/main.gcda b/src/main.gcda new file mode 100644 index 0000000000000000000000000000000000000000..1bd518d875d6a85a3783cde2156e2b4266bc65cf GIT binary patch literal 160 zcmYdHNlw=?v~-+(%kByT1H(clAfYe7z@Xmg$PQ#OG6RX%MFnhn9*Z)s9KSCKRKf_9 v2CD&57_21`I@gX|Xs82|+UIeiuo literal 0 HcmV?d00001 diff --git a/src/main.gcno b/src/main.gcno new file mode 100644 index 0000000000000000000000000000000000000000..6293d5742f6d765c65ca83ec7a7aea76df4d6def GIT binary patch literal 1348 zcmbu9y-EW?5XX1@h##Pc-x1MXFsEQ+BZLsNu<;RMl*os4AJ(5fj|Q{Gn5dI=FQbdA)_v6PwWBz> ziQ>B?OI7d6ymNal>#PVvRn&Lyx>7rNP6lsZ)iIfOTSpJy$dzlX#@nt^jl|Ovgr*hx4j9RPa!;Ys^)DHOJtU@^Tg+ zlo!r*$KaLj0p|!pdFg`!%E|eIP|ghv&$V)LZ$K#LriSNQIk|5jlyghNy|(P{$It26 y`{VJ!>%-m)ce$U$&L5hCz9)7;M0-r%1K;2N4iCQv*q9IZ5_fadUZR$H5szOhJ@3c> literal 0 HcmV?d00001 diff --git a/src/parse/check.c b/src/parse/check.c index e9e1b89d..a3e565eb 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -367,7 +367,9 @@ 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) { + if(e1->type == t_undefined || +(GET_FLAG(func, template) && isa(actual_type(func->value_ref->type), t_fptr) > 0) +) { 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); @@ -379,6 +381,7 @@ 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)); @@ -465,8 +468,12 @@ ANN static Func _find_template_match(const Env env, const Value v, const Exp_Cal (!exp->args || !!check_exp(env, exp->args))) { m_func = find_func_match(env, fbase->func, exp->args); nspc_pop_type(env->gwion->mp, env->curr); - if(!value) + 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)) map_set(&v->owner->info->type->map, (vtype)sym, (vtype)actual_type(m_func->value_ref->type)); +} } free_stmt(env->gwion->mp, stmt); } @@ -512,9 +519,8 @@ ANN static Func _find_template_match(const Env env, const Value v, const Exp_Cal ANN Func find_template_match(const Env env, const Value value, const Exp_Call* exp) { Type t = value->owner_class; const Func f = _find_template_match(env, value, exp); - if(f) { + if(f) return f; - } while(t) { Value v = nspc_lookup_value1(t->nspc, value->d.func_ref->def->base->xid); if(!v) @@ -581,11 +587,15 @@ 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) { @@ -607,8 +617,10 @@ ANN static Type check_exp_call_template(const Env env, const Exp_Call *exp) { ERR_O(call->pos, _("not able to guess types for template call.")) Tmpl tmpl = { .call=tl[0] }; ((Exp_Call*)exp)->tmpl = &tmpl; - const Func func = get_template_func(env, exp, value); - return func ? func->def->base->ret_type : NULL; + 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; } ANN static m_bool check_exp_call1_check(const Env env, const Exp exp) { @@ -703,7 +715,11 @@ ANN static Type check_exp_call(const Env env, Exp_Call* exp) { CHECK_OO((exp->m_func = ret)) return ret->def->base->ret_type; } - return check_exp_call1(env, exp); + + const Type t = check_exp_call1(env, exp); +printf("here exp_call %p\n", t); +return t; +// return check_exp_call1(env, exp); } ANN static Type check_exp_unary(const Env env, const Exp_Unary* unary) { @@ -743,7 +759,7 @@ ANN static Type check_exp_dot(const Env env, Exp_Dot* member) { _("keyword 'this' must be associated with object instance...")) const Value value = find_value(the_base, member->xid); if(!value) { - env_err(env, member->base->pos, + env_err(env, exp_self(member)->pos, _("class '%s' has no member '%s'"), the_base->name, str); if(member->t_base->nspc) did_you_mean_type(member->t_base, str); diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 7d48a02a..2856ea9e 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -245,6 +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;// 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 b4593d14..2d0af075 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -93,6 +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) CHECK_BB(scan2_args(env, def)) if(env->class_def) { diff --git a/src/plug.gcda b/src/plug.gcda new file mode 100644 index 0000000000000000000000000000000000000000..aa78ce69f691d5983376f3876f14caf6576d78a8 GIT binary patch literal 800 zcmYdHNlw=?v~*OhZ@kXHz_5@BNPuvh6p&zGU}OdoAD2j&RNb$=^7H))6`&GE0iYO2 z4LJZwAK2{cOOD9wE4X*bGR$-)$ZQ^R428P$v&*|!Hi1~T&AH~iAhY<$GYh5*?7oMW zj#ftL^gReZdEhL_OfjG=k{@7dQD~SvI?V=Eg)R=`1Es-s&iz|xCzta!s>CqpD7u|6 zwS>%qsUt+g>=ZE7^=6RDTgN-KaSO;!EuaLtUa0fo;<)&P#9{L2G|WDjIE;@@!{m`@ oaJX5qfAfi7+bdwVY4-t;A6SqSAThyeCnO#Y30!D?oq$>f09z9~rT_o{ literal 0 HcmV?d00001 diff --git a/src/plug.gcno b/src/plug.gcno new file mode 100644 index 0000000000000000000000000000000000000000..de8f8a67e3604c145b1c4cbe7f0ab07bdfd1b5bc G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U#W`8>e*SMfFsh`Y}^_a$X^?&&QbfU)ei*lVEH{sVUO+<0Ft) z*BJ9o!76*lgZVg031Q1_e(Uz?|AgQ_DZE8^tME4A4yldi7Xt4bDNM^7yqHgSl$1Bs zlh^`zF`v=lMX8uzL0-)5I=mQfXmkuvVT|d48mBC!05JjoFmd%Y;CNRyHy}I5VVRAmp=0#wxig59XviZq9 z5hngpHa`J#weXq<8#|QEQ^348fy-V&-aP~Jz8t{{J-21^6)^8N$o#42)?&L?-v=U0 zY)jmQ%3wa2BUqujmd%CM8C?EUyIL;f)fLQ#B3%3dhP=2bOl%8zF>5-!DAlI;8PrQm z?lZ`XNxl_O{(om{=KZ~?|H~tNYrp>P6nEq3WUD#Yp2)iqd;jx&mjBmdf2+Q~mH+P- z`5ON>vP4+#Sk2?~&YC@si|=#pP#7%5t7Z77-Pzsfvq<`PsFvY}b~n#9p0TWl96g}? z|Iv=^I=yYn=c~?PC-CyW(P6Bj<80WRTkts-{|8&4kDYsY6{=;Nt8Q&&=bMrL0!dn- AHvj+t literal 0 HcmV?d00001 diff --git a/src/soundinfo.gcda b/src/soundinfo.gcda new file mode 100644 index 0000000000000000000000000000000000000000..66d3f7d25d22fe63e535643e6e3fac0844c6e340 GIT binary patch literal 120 zcmYdHNlw=?v~>J?$?ggR1H(clAfYe7z@Xmg$PQ#OG6RX2Xbl^~GmOo4n|2=nDq&;+ gig5!m2*79{6Rh?{h=4)7RH7uZT9A1l0HZ-{0EEaA=>Px# literal 0 HcmV?d00001 diff --git a/src/soundinfo.gcno b/src/soundinfo.gcno new file mode 100644 index 0000000000000000000000000000000000000000..6c38817e2d712e48980a868149884fe7ea917968 GIT binary patch literal 848 zcmd1LOHS7^v~>J?$?ggl0|SG8Mt*Lpeo9tirG9ZyvVMAIiGF%{W_})o)CKZ0N|S)< z7=ai>$pDF%Xbl^~GmOo4n|2>y0rHFUOY>4P^V0I;lM50>AY%Saby=0(1 zZXgx`VnHB=*z3p$qCs{sFgPeK#YNsu8a~u7R-&5m<=+Q7l=V-@B^^`5F-I_T)YSoFo>5*l!V1aUTS$f xJT#$-DRBcREJ1O>3B-`F8@zD=aw{kuAb=~QIFLh)xB!{U2E^<@%mKtO004MFrD*^F literal 0 HcmV?d00001 diff --git a/tests/error/private_type_err.gw b/tests/error/private_type_err.gw new file mode 100644 index 00000000..4aff3549 --- /dev/null +++ b/tests/error/private_type_err.gw @@ -0,0 +1,7 @@ +#! [contains] can't use private type +class C { + class private D { + } +} + +C->D d; diff --git a/tests/error/protect_type_err.gw b/tests/error/protect_type_err.gw new file mode 100644 index 00000000..90e98bb9 --- /dev/null +++ b/tests/error/protect_type_err.gw @@ -0,0 +1,7 @@ +#! [contains] can't use protected type +class C { + class protect D { + } +} + +C->D d; diff --git a/tests/error/ptr_from_const.gw b/tests/error/ptr_from_const.gw new file mode 100644 index 00000000..63844392 --- /dev/null +++ b/tests/error/ptr_from_const.gw @@ -0,0 +1 @@ +1 :=> <~int~>Ptr i; diff --git a/tests/error/ptr_implicit_const.gw b/tests/error/ptr_implicit_const.gw new file mode 100644 index 00000000..0cfbe996 --- /dev/null +++ b/tests/error/ptr_implicit_const.gw @@ -0,0 +1,3 @@ +#! [contains] can't cast constant to Ptr +fun void test(<~int~>Ptr i) { <<< *i>>>; } +1 => test; diff --git a/tests/error/ref_class_extend.gw b/tests/error/ref_class_extend.gw new file mode 100644 index 00000000..b7003fff --- /dev/null +++ b/tests/error/ref_class_extend.gw @@ -0,0 +1,4 @@ +#! [contains] can't use ref type in class extend +typedef int[] Type; +class C extends Type { +} diff --git a/tests/error/unary_uniq.gw b/tests/error/unary_uniq.gw new file mode 100644 index 00000000..548cfe0e --- /dev/null +++ b/tests/error/unary_uniq.gw @@ -0,0 +1,2 @@ +#! [contains] must be applied to a unique expression +!(1,2); diff --git a/tests/error/vararg_invalid_acces.gw b/tests/error/vararg_invalid_acces.gw new file mode 100644 index 00000000..28e641bb --- /dev/null +++ b/tests/error/vararg_invalid_acces.gw @@ -0,0 +1,7 @@ +#! [contains] InvalidVariadicAccess +fun void test(...) { + vararg.start; + <<>>; + vararg.end; +} +1.3 => test; diff --git a/tests/import/driver.c b/tests/import/driver.c index f2059d98..06d3cc6f 100644 --- a/tests/import/driver.c +++ b/tests/import/driver.c @@ -9,20 +9,23 @@ #include "gwion.h" #include "plug.h" -static DRVRUN(dummy_run) { +static DRVRUN(driver_test_run) { while(di->is_running) { di->run(vm); ++di->pos; } } -static DRVINI(dummy_ini) { +static DRVINI(driver_test_ini) { return GW_OK; } -GWMODSTR(dummy2); +static DRVDEL(driver_test_del) {} -GWDRIVER(dummy2) { - d->ini = dummy_ini; - d->run = dummy_run; +GWMODSTR(driver_test); + +GWDRIVER(driver_test) { + d->ini = driver_test_ini; + d->run = driver_test_run; + d->del = driver_test_del; } diff --git a/tests/import/driver.so b/tests/import/driver.so new file mode 100755 index 0000000000000000000000000000000000000000..f286bf3b834484d8128e955a4b8b1f622a3b3efa GIT binary patch literal 23496 zcmeHPdvseznIAnp*Lql%Y)Q70MrqR4Ew${VY3ejdtHg1lbn|dtrKK%5vUDx0(Zfhr zP8$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!QcP2X4)a&)@We$DY3l)p;-SGd2%}^v#FA z@^$bVfxj64o3A}U1d+|#J1vS&GQ3&hZ!2gO<(e!wG#klyA!zoJUu%*`>g9$RBgANnuvES zx|`f!rzYz4jztMZ`d-X}cMo)+p@HPlx4n`)T0QrRCCPh6&n52}>qiO9muJ6iA<)(_ zo2VWQP;pOU_?;)K-#&i)tEYqxDgPwB1>H6WbzFkSTp#hzp^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