From fa8ff507843a7c57d60fce22fb343d8923161ede Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 6 Mar 2020 14:10:01 +0100 Subject: [PATCH] some cleaning --- examples/class_spork_exp.gw | 2 +- examples/empty_string.gw | 2 +- examples/fork.gw | 2 +- examples/in_class_class.gw | 2 +- examples/int.gw | 2 +- examples/op.gw | 4 +- examples/spork_exp.gw | 2 +- examples/string.gw | 14 +++--- src/emit/emit.c | 8 ---- src/lib/tuple.c | 57 ++++------------------- src/parse/check.c | 5 +- tests/bug/Tester.gw | 2 +- tests/bug/dot_member_func.gw | 2 +- tests/bug/play_with_str.gw | 2 +- tests/bug/ugen.gw | 2 +- tests/error/array_ref_exp.gw | 2 +- tests/error/connect_except.gw | 2 +- tests/error/empty_obj_data.gw | 2 +- tests/error/ev.gw | 2 +- tests/error/nonnull_class_extend.gw | 2 +- tests/nonnull/cast_non_null.gw | 4 +- tests/nonnull/cast_non_null2.gw | 2 +- tests/nonnull/dynamic_implicit_nonnull.gw | 4 +- tests/nonnull/nonnull2nullable.gw | 2 +- tests/nonnull/nonnull_assign_nonnull.gw | 2 +- tests/nonnull/nonnull_at_nonnull.gw | 2 +- tests/nonnull/nonnull_cast_nonnull.gw | 2 +- tests/nonnull/nonnull_decl.gw | 2 +- tests/nonnull/nonnull_decl_ref_assign.gw | 2 +- tests/nonnull/nonnull_err_cast_dynamic.gw | 4 +- tests/nonnull/nonnull_err_dynamic.gw | 4 +- tests/nonnull/nonnull_err_static_cast.gw | 4 +- tests/nonnull/nonnull_impl_nonnull.gw | 4 +- tests/nonnull/nonnull_implicit_nonnull.gw | 4 +- tests/nonnull/normal_at_nonnull.gw | 2 +- tests/nonnull/normal_cast_nonnull.gw | 2 +- tests/nonnull/normal_impl_nonnull.gw | 2 +- tests/nonnull/null_at_nonnull.gw | 2 +- tests/nonnull/null_cast_nonnull.gw | 2 +- tests/nonnull/null_impl_nonnull.gw | 2 +- tests/nonnull/ref.gw | 2 +- tests/nonnull/ref_at_nonnull.gw | 2 +- tests/nonnull/ref_cast_nonnull.gw | 2 +- tests/nonnull/ref_impl_nonnull.gw | 4 +- tests/nonnull/ref_nonnull.gw | 2 +- tests/nonnull/static_implicit_nonnull.gw | 2 +- tests/nonnull/void_nonnull.gw | 2 +- tests/tree/auto_array.gw | 2 +- tests/tree/auto_fun.gw | 2 +- tests/tree/call_nonnull.gw | 2 +- tests/tree/fork_join.gw | 2 +- tests/tree/fork_join2.gw | 2 +- tests/tree/new.gw | 5 +- tests/tree/set_obj.gw | 3 +- tests/tree/shredule_test.gw | 4 +- tests/tree/vararg_assign.gw | 2 +- tests/tuple/array_tuple_array.gw | 2 +- tests/tuple/object2tuple.gw | 4 +- tests/tuple/object2tuple_err.gw | 2 +- tests/tuple/object2tuple_err2.gw | 2 +- tests/tuple/tupl_decl.gw | 2 +- tests/tuple/tuple.gw | 2 +- tests/tuple/tuple_at.gw | 2 +- tests/tuple/tuple_at_err.gw | 2 +- tests/tuple/tuple_cast.gw | 2 +- tests/tuple/tuple_cast2.gw | 2 +- tests/tuple/tuple_decl.gw | 2 +- tests/tuple/tuple_empty.gw | 2 +- tests/tuple/tuple_member_float.gw | 2 +- tests/tuple/tuple_skip2.gw | 2 +- tests/tuple/tuple_undefined.gw | 2 +- tests/tuple/tuple_unknown.gw | 4 +- 72 files changed, 98 insertions(+), 150 deletions(-) diff --git a/examples/class_spork_exp.gw b/examples/class_spork_exp.gw index 5dc34ac4..5a0d897c 100644 --- a/examples/class_spork_exp.gw +++ b/examples/class_spork_exp.gw @@ -7,7 +7,7 @@ class C second => now; string s; <<< "test spork exp." >>>; - } @=> Shred @shred; + } @=> Shred ref shred; } C c; diff --git a/examples/empty_string.gw b/examples/empty_string.gw index 35e4ed41..7f67f5c4 100644 --- a/examples/empty_string.gw +++ b/examples/empty_string.gw @@ -1,2 +1,2 @@ -"test" => string @s; +"test" => string ref s; <<< s >>>; diff --git a/examples/fork.gw b/examples/fork.gw index e423f54d..63256ea8 100644 --- a/examples/fork.gw +++ b/examples/fork.gw @@ -3,7 +3,7 @@ fork { 12::samp => now; me.test_cancel(); <<< "stop" >>>; -} @=> Fork @f; +} @=> Fork ref f; 1 => f.set_cancel; 2::samp => now; diff --git a/examples/in_class_class.gw b/examples/in_class_class.gw index 8b68810b..1a1a21eb 100644 --- a/examples/in_class_class.gw +++ b/examples/in_class_class.gw @@ -5,6 +5,6 @@ class C { C c; C->D d; -C->D @d_ref; +C->D ref d_ref; <<< c, " ", d, d_ref >>>; diff --git a/examples/int.gw b/examples/int.gw index e9d4db81..39f164c6 100644 --- a/examples/int.gw +++ b/examples/int.gw @@ -67,7 +67,7 @@ int a; #!testing operator for Object and { - Object @variable1; + Object ref variable1; <<< variable1!= null >>>; } #!testing operator for int and int diff --git a/examples/op.gw b/examples/op.gw index 54976283..51832807 100644 --- a/examples/op.gw +++ b/examples/op.gw @@ -5,12 +5,12 @@ operator => void (Object o, int i) { } class C { - Object @ref; + Object ref ref_object; } #!! assign object to C.ref operator => void (Object o, C c) { - o @=> c.ref; + o @=> c.ref_object; <<< "success" >>>; } diff --git a/examples/spork_exp.gw b/examples/spork_exp.gw index fd46f212..7f4e907e 100644 --- a/examples/spork_exp.gw +++ b/examples/spork_exp.gw @@ -9,7 +9,7 @@ class C string s; <<< this, " test spork exp. " , s >>>; - } @=> Shred @shred; + } @=> Shred ref shred; } C c; diff --git a/examples/string.gw b/examples/string.gw index 2554d32e..802af15b 100644 --- a/examples/string.gw +++ b/examples/string.gw @@ -20,13 +20,13 @@ string s; #!me.exit(); -{ (1 + s) @=> string @str; } -{ (2.0 +s) @=> string @str; } -{ (complex(2,1) + s) @=> string @str; } -{ (polar(2,1) + s) @=> string @str; } -{ (Vec3(2,1, 0) + s) @=> string @str; } -{ (Vec4(2,1, 0, -1) + s) @=> string @str; } -#!{ ("test" + s) @=> string @str; } // leak +{ (1 + s) @=> string ref str; } +{ (2.0 +s) @=> string ref str; } +{ (complex(2,1) + s) @=> string ref str; } +{ (polar(2,1) + s) @=> string ref str; } +{ (Vec3(2,1, 0) + s) @=> string ref str; } +{ (Vec4(2,1, 0, -1) + s) @=> string ref str; } +#!{ ("test" + s) @=> string ref str; } // leak <<< 11 +=> s >>>; diff --git a/src/emit/emit.c b/src/emit/emit.c index 289e9751..66018ecc 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -583,12 +583,6 @@ ANN static m_bool emit_prim_str(const Emitter emit, const m_str *str) { return GW_OK; } -ANN static m_bool emit_prim_unpack(const Emitter emit NUSED, const Tuple *tuple) { - if(prim_exp(tuple)->meta == ae_meta_var) - return GW_OK; - ERR_B(prim_pos(tuple), _("unused Tuple unpack")) -} - #define emit_prim_complex emit_prim_vec #define emit_prim_polar emit_prim_vec #define emit_prim_nil (void*)dummy_func @@ -1577,8 +1571,6 @@ ANN static m_bool case_value(const Emitter emit, const Exp base, const Exp e) { #define CASE_PASS (Symbol)1 ANN static Symbol case_op(const Emitter emit, const Exp base, const Exp e) { if(e->exp_type == ae_exp_primary) { - if(e->d.prim.prim_type == ae_prim_unpack) - return insert_symbol("@=>"); if(e->d.prim.prim_type == ae_prim_id) { if(e->d.prim.d.var == insert_symbol("_")) return CASE_PASS; diff --git a/src/lib/tuple.c b/src/lib/tuple.c index fe0eb5d6..780cd87b 100644 --- a/src/lib/tuple.c +++ b/src/lib/tuple.c @@ -127,30 +127,6 @@ static OP_CHECK(opck_at_object_tuple) { return bin->rhs->type; } -static OP_CHECK(opck_at_tuple) { - const Exp_Binary *bin = (Exp_Binary*)data; - if(bin->rhs->exp_type == ae_exp_primary && - bin->rhs->d.prim.prim_type == ae_prim_unpack) { - Exp e = bin->rhs->d.prim.d.tuple.exp; - int i = 0; - do { - if(e->exp_type == ae_exp_decl) { - DECL_OO(const Type, t, = (Type)VPTR(&bin->lhs->type->e->tuple->types, i)) - e->d.exp_decl.td->xid->xid = insert_symbol(t->name); - const Exp next = e->next; - e->next = NULL; - const m_bool ret = traverse_exp(env, e); - e->next = next; - CHECK_BO(ret) - bin->rhs->meta = ae_meta_var; - } - ++i; - } while((e = e->next)); - return bin->lhs->type; - } - return opck_at_object_tuple(env, data, mut); -} - static OP_CHECK(opck_at_tuple_object) { const Exp_Binary *bin = (Exp_Binary*)data; if(opck_rassign(env, data, mut) == env->gwion->type[et_null]) @@ -213,19 +189,6 @@ static OP_CHECK(opck_impl_tuple) { return imp->t; } -static OP_EMIT(opem_at_tuple) { - const Exp_Binary *bin = (Exp_Binary*)data; - if(!(bin->rhs->exp_type == ae_exp_primary && - bin->rhs->d.prim.prim_type == ae_prim_unpack)) { - return emit_add_instr(emit, ObjectAssign); - } - const Exp e = bin->rhs->d.prim.d.tuple.exp; - const Vector v = &bin->lhs->type->e->tuple->types; - struct TupleEmit te = { .e=e, .v=v }; - emit_unpack_instr(emit, &te); - return (Instr)GW_OK; -} - ANN void tuple_info(const Env env, Type_Decl *base, const Var_Decl var) { const Value v = var->value; const m_uint offset = vector_back(&env->class_def->e->tuple->offset); @@ -381,20 +344,20 @@ static OP_CHECK(unpack_ck) { const Symbol decl = insert_symbol("auto"); const Symbol skip = insert_symbol("_"); Exp e = call->args; -const Value v = nspc_lookup_value1(env->global_nspc, insert_symbol("false")); + const Value v = nspc_lookup_value1(env->global_nspc, insert_symbol("false")); while(e) { if(e->exp_type != ae_exp_primary || e->d.prim.prim_type != ae_prim_id) ERR_O(e->pos, _("invalid expression for unpack")) if(e->d.prim.d.var != skip) { const Symbol var = e->d.prim.d.var; memset(&e->d, 0, sizeof(union exp_data)); -e->type = env->gwion->type[et_auto]; -e->d.exp_decl.type = env->gwion->type[et_auto]; + e->type = env->gwion->type[et_auto]; + e->d.exp_decl.type = env->gwion->type[et_auto]; e->exp_type = ae_exp_decl; e->d.exp_decl.td = new_type_decl(env->gwion->mp, new_id_list(env->gwion->mp, decl, loc_cpy(env->gwion->mp, e->pos))); e->d.exp_decl.list = new_var_decl_list(env->gwion->mp, new_var_decl(env->gwion->mp, var, NULL, loc_cpy(env->gwion->mp, e->pos)), NULL); -e->d.exp_decl.list->self->value = v; + e->d.exp_decl.list->self->value = v; } else { e->d.prim.prim_type = ae_prim_nil; e->type = env->gwion->type[et_null]; @@ -464,8 +427,7 @@ GWION_IMPORT(tuple) { GWI_BB(gwi_oper_emi(gwi, tuple_em)) GWI_BB(gwi_oper_end(gwi, "@ctor", NULL)) GWI_BB(gwi_oper_ini(gwi, "Object", "Tuple", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_at_tuple)) - GWI_BB(gwi_oper_emi(gwi, opem_at_tuple)) + GWI_BB(gwi_oper_add(gwi, opck_at_object_tuple)) GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) GWI_BB(gwi_oper_add(gwi, opck_cast_tuple)) GWI_BB(gwi_oper_end(gwi, "$", NoOp)) @@ -481,19 +443,18 @@ GWION_IMPORT(tuple) { GWI_BB(gwi_oper_add(gwi, opck_impl_tuple)) GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) GWI_BB(gwi_oper_ini(gwi, "Tuple", "Tuple", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_at_tuple)) - GWI_BB(gwi_oper_emi(gwi, opem_at_tuple)) - GWI_BB(gwi_oper_end(gwi, "@=>", NULL)) + GWI_BB(gwi_oper_add(gwi, opck_at_object_tuple)) + GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) GWI_BB(gwi_oper_ini(gwi, "int", "Tuple", NULL)) GWI_BB(gwi_oper_add(gwi, opck_tuple)) // GWI_BB(gwi_oper_emi(gwi, opem_at_tuple)) GWI_BB(gwi_oper_end(gwi, "@array", NULL)) gwi_register_freearg(gwi, TupleUnpack, freearg_tuple_at); - const Type t_unpack = gwi_mk_type(gwi, "Unpack", SZ_INT, "Tuple"); + const Type t_unpack = gwi_mk_type(gwi, "Unpack", 0, NULL); gwi_add_type(gwi, t_unpack); SET_FLAG(t_unpack, checked | ae_flag_scan2 | ae_flag_check | ae_flag_emit); - SET_FLAG(t_unpack, abstract | ae_flag_template); +// SET_FLAG(t_unpack, abstract | ae_flag_template); GWI_BB(gwi_oper_ini(gwi, "Unpack", NULL, NULL)) GWI_BB(gwi_oper_add(gwi, unpack_ck)) GWI_BB(gwi_oper_emi(gwi, unpack_em)) diff --git a/src/parse/check.c b/src/parse/check.c index 001794f9..67eb2d15 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -307,7 +307,6 @@ describe_prim_xxx(num, env->gwion->type[et_int]) describe_prim_xxx(char, env->gwion->type[et_char]) describe_prim_xxx(float, env->gwion->type[et_float]) describe_prim_xxx(nil, env->gwion->type[et_void]) -describe_prim_xxx(unpack, env->gwion->type[et_tuple]) #define check_prim_complex check_prim_vec #define check_prim_polar check_prim_vec @@ -1125,9 +1124,7 @@ ANN static Value match_value(const Env env, const Exp_Primary* prim, const m_uin ANN static Symbol case_op(const Env env, const Exp e, const m_uint i) { if(e->exp_type == ae_exp_primary) { - if(e->d.prim.prim_type == ae_prim_unpack) - return insert_symbol("@=>"); - else if(e->d.prim.prim_type == ae_prim_id) { + if(e->d.prim.prim_type == ae_prim_id) { if(e->d.prim.d.var == insert_symbol("_")) return NULL; if(!nspc_lookup_value1(env->curr, e->d.prim.d.var)) { diff --git a/tests/bug/Tester.gw b/tests/bug/Tester.gw index ad9e9ab7..1bb75922 100644 --- a/tests/bug/Tester.gw +++ b/tests/bug/Tester.gw @@ -6,7 +6,7 @@ class Tester Tester t; Object o; -Object @ref; +Object ref ref; "test" => string s; #!<<< t.assert_equal("test", 1, 1) >>>; #!<<< t.assert_equal("test", 2, 1) >>>; diff --git a/tests/bug/dot_member_func.gw b/tests/bug/dot_member_func.gw index 24a85023..4b63417e 100644 --- a/tests/bug/dot_member_func.gw +++ b/tests/bug/dot_member_func.gw @@ -1,5 +1,5 @@ #! thanks to afl-fuzz -SinOsc@s, t; +SinOsc ref s, t; Gain g => dac; 1 => t.freq; s => g; diff --git a/tests/bug/play_with_str.gw b/tests/bug/play_with_str.gw index 3daf3001..b0a4ad78 100644 --- a/tests/bug/play_with_str.gw +++ b/tests/bug/play_with_str.gw @@ -1,4 +1,4 @@ -"lol" @=> string @s; +"lol" @=> string ref s; "test" => s; <<< "testmem".replace(2, 3, "UKUH") >>>; diff --git a/tests/bug/ugen.gw b/tests/bug/ugen.gw index f97efbab..275c0073 100644 --- a/tests/bug/ugen.gw +++ b/tests/bug/ugen.gw @@ -1,4 +1,4 @@ -UGen @u; +UGen ref u; #!u.last(); #! should fail => fails. SinOsc s => Gain g => dac; for(-1 => int i;i < 6; i++) diff --git a/tests/error/array_ref_exp.gw b/tests/error/array_ref_exp.gw index cfb9bcb8..484dbb1e 100644 --- a/tests/error/array_ref_exp.gw +++ b/tests/error/array_ref_exp.gw @@ -1,2 +1,2 @@ #! [contains] ref array must not have array expression -int @my_array[2]; +int ref my_array[2]; diff --git a/tests/error/connect_except.gw b/tests/error/connect_except.gw index e352deda..a71e9bd8 100644 --- a/tests/error/connect_except.gw +++ b/tests/error/connect_except.gw @@ -1,3 +1,3 @@ #! [contains] UgenConnectException -UGen @u; +UGen ref u; adc => u; diff --git a/tests/error/empty_obj_data.gw b/tests/error/empty_obj_data.gw index 8921e2b9..10c4c321 100644 --- a/tests/error/empty_obj_data.gw +++ b/tests/error/empty_obj_data.gw @@ -4,5 +4,5 @@ class C int i; } -C @c; +C ref c; c.i; diff --git a/tests/error/ev.gw b/tests/error/ev.gw index 45864d29..09b83520 100644 --- a/tests/error/ev.gw +++ b/tests/error/ev.gw @@ -1,3 +1,3 @@ #! [contains] NullEventWait -Event @e; +Event ref e; e => now; diff --git a/tests/error/nonnull_class_extend.gw b/tests/error/nonnull_class_extend.gw index ebc08724..dde54194 100644 --- a/tests/error/nonnull_class_extend.gw +++ b/tests/error/nonnull_class_extend.gw @@ -1,4 +1,4 @@ #! [contains] can't use nonnull type in class extend -class C extends Object! { +class C extends Object nonnull { } diff --git a/tests/nonnull/cast_non_null.gw b/tests/nonnull/cast_non_null.gw index 63d002e5..38b28e49 100644 --- a/tests/nonnull/cast_non_null.gw +++ b/tests/nonnull/cast_non_null.gw @@ -1,2 +1,2 @@ -Object @o; -o $ Event!; +Object ref o; +o $ Event nonnull; diff --git a/tests/nonnull/cast_non_null2.gw b/tests/nonnull/cast_non_null2.gw index 8d104b15..d77a95df 100644 --- a/tests/nonnull/cast_non_null2.gw +++ b/tests/nonnull/cast_non_null2.gw @@ -1,2 +1,2 @@ -Object @o; +Object ref o; o $ Object; diff --git a/tests/nonnull/dynamic_implicit_nonnull.gw b/tests/nonnull/dynamic_implicit_nonnull.gw index 89748315..d18089a3 100644 --- a/tests/nonnull/dynamic_implicit_nonnull.gw +++ b/tests/nonnull/dynamic_implicit_nonnull.gw @@ -1,3 +1,3 @@ -fun void test(Object !o) { <<< o >>>; } +fun void test(Object nonnull o) { <<< o >>>; } -Object @o => test; +Object ref o => test; diff --git a/tests/nonnull/nonnull2nullable.gw b/tests/nonnull/nonnull2nullable.gw index e1561f1d..2d4bfde1 100644 --- a/tests/nonnull/nonnull2nullable.gw +++ b/tests/nonnull/nonnull2nullable.gw @@ -1 +1 @@ -Object ! o @=> Object @p; +Object nonnull o @=> Object ref p; diff --git a/tests/nonnull/nonnull_assign_nonnull.gw b/tests/nonnull/nonnull_assign_nonnull.gw index f282af6b..82af6dca 100644 --- a/tests/nonnull/nonnull_assign_nonnull.gw +++ b/tests/nonnull/nonnull_assign_nonnull.gw @@ -1,2 +1,2 @@ -Object ! o, p; +Object nonnull o, p; o @=> p; diff --git a/tests/nonnull/nonnull_at_nonnull.gw b/tests/nonnull/nonnull_at_nonnull.gw index 5dd55161..fc515563 100644 --- a/tests/nonnull/nonnull_at_nonnull.gw +++ b/tests/nonnull/nonnull_at_nonnull.gw @@ -1 +1 @@ -new Object! @=> Object !o; +new Object nonnull @=> Object nonnull o; diff --git a/tests/nonnull/nonnull_cast_nonnull.gw b/tests/nonnull/nonnull_cast_nonnull.gw index fc8b291e..307e6976 100644 --- a/tests/nonnull/nonnull_cast_nonnull.gw +++ b/tests/nonnull/nonnull_cast_nonnull.gw @@ -1 +1 @@ -(Object! o) $ Object!; +(Object nonnull o) $ Object nonnull; diff --git a/tests/nonnull/nonnull_decl.gw b/tests/nonnull/nonnull_decl.gw index e32f1aa7..437d9607 100644 --- a/tests/nonnull/nonnull_decl.gw +++ b/tests/nonnull/nonnull_decl.gw @@ -1 +1 @@ -Object !o; +Object nonnull o; diff --git a/tests/nonnull/nonnull_decl_ref_assign.gw b/tests/nonnull/nonnull_decl_ref_assign.gw index 34c99852..b055145b 100644 --- a/tests/nonnull/nonnull_decl_ref_assign.gw +++ b/tests/nonnull/nonnull_decl_ref_assign.gw @@ -1 +1 @@ -new Object @=> Object ! @ o; +new Object @=> Object nonnull ref o; diff --git a/tests/nonnull/nonnull_err_cast_dynamic.gw b/tests/nonnull/nonnull_err_cast_dynamic.gw index 08c0545b..5653b123 100644 --- a/tests/nonnull/nonnull_err_cast_dynamic.gw +++ b/tests/nonnull/nonnull_err_cast_dynamic.gw @@ -1,3 +1,3 @@ #! [contains] NullPtrException -Object @o; -<<< o $ Object! >>>; +Object ref o; +<<< o $ Object nonnull >>>; diff --git a/tests/nonnull/nonnull_err_dynamic.gw b/tests/nonnull/nonnull_err_dynamic.gw index f2ed8dbc..6b1427d3 100644 --- a/tests/nonnull/nonnull_err_dynamic.gw +++ b/tests/nonnull/nonnull_err_dynamic.gw @@ -1,5 +1,5 @@ #! [contains} NullPtrException -fun void test(Object !o) { +fun void test(Object nonnull o) { <<< o >>>; } -Object @ref => test; +Object ref ref => test; diff --git a/tests/nonnull/nonnull_err_static_cast.gw b/tests/nonnull/nonnull_err_static_cast.gw index a86c1107..bbebc528 100644 --- a/tests/nonnull/nonnull_err_static_cast.gw +++ b/tests/nonnull/nonnull_err_static_cast.gw @@ -1,3 +1,3 @@ #! [contains] NullPtrException -Object @ref; -<<< ref $ Object! >>>; +Object ref ref_object; +<<< ref_object $ Object nonnull >>>; diff --git a/tests/nonnull/nonnull_impl_nonnull.gw b/tests/nonnull/nonnull_impl_nonnull.gw index c8566b97..99b23480 100644 --- a/tests/nonnull/nonnull_impl_nonnull.gw +++ b/tests/nonnull/nonnull_impl_nonnull.gw @@ -1,2 +1,2 @@ -fun void test(Object !o) { <<< o >>>; } -Object !o => test; +fun void test(Object nonnull o) { <<< o >>>; } +Object nonnull o => test; diff --git a/tests/nonnull/nonnull_implicit_nonnull.gw b/tests/nonnull/nonnull_implicit_nonnull.gw index 96122fb9..99b23480 100644 --- a/tests/nonnull/nonnull_implicit_nonnull.gw +++ b/tests/nonnull/nonnull_implicit_nonnull.gw @@ -1,2 +1,2 @@ -fun void test(Object !o) { <<< o >>>; } -Object! o => test; +fun void test(Object nonnull o) { <<< o >>>; } +Object nonnull o => test; diff --git a/tests/nonnull/normal_at_nonnull.gw b/tests/nonnull/normal_at_nonnull.gw index 72d689a2..8923bf10 100644 --- a/tests/nonnull/normal_at_nonnull.gw +++ b/tests/nonnull/normal_at_nonnull.gw @@ -1 +1 @@ -new Object @=> Object !o; +new Object @=> Object nonnull o; diff --git a/tests/nonnull/normal_cast_nonnull.gw b/tests/nonnull/normal_cast_nonnull.gw index 9fb6fb4b..f8f4beb6 100644 --- a/tests/nonnull/normal_cast_nonnull.gw +++ b/tests/nonnull/normal_cast_nonnull.gw @@ -1 +1 @@ -new Object $ Object!; +new Object $ Object nonnull; diff --git a/tests/nonnull/normal_impl_nonnull.gw b/tests/nonnull/normal_impl_nonnull.gw index 2e16439b..cbdeae77 100644 --- a/tests/nonnull/normal_impl_nonnull.gw +++ b/tests/nonnull/normal_impl_nonnull.gw @@ -1,2 +1,2 @@ -fun void test(Object !o) { <<< o >>>; } +fun void test(Object nonnull o) { <<< o >>>; } new Object => test; diff --git a/tests/nonnull/null_at_nonnull.gw b/tests/nonnull/null_at_nonnull.gw index 3fd7de70..40b4ae2b 100644 --- a/tests/nonnull/null_at_nonnull.gw +++ b/tests/nonnull/null_at_nonnull.gw @@ -1,2 +1,2 @@ #! [contains] can't assign -null @=> Object !o; +null @=> Object nonnull o; diff --git a/tests/nonnull/null_cast_nonnull.gw b/tests/nonnull/null_cast_nonnull.gw index 8f66ffdc..4ed42ffb 100644 --- a/tests/nonnull/null_cast_nonnull.gw +++ b/tests/nonnull/null_cast_nonnull.gw @@ -1,2 +1,2 @@ #! [contains] can't cast -null $ Object!; +null $ Object nonnull; diff --git a/tests/nonnull/null_impl_nonnull.gw b/tests/nonnull/null_impl_nonnull.gw index 92a9010f..55b7dd03 100644 --- a/tests/nonnull/null_impl_nonnull.gw +++ b/tests/nonnull/null_impl_nonnull.gw @@ -1,3 +1,3 @@ #! [contains] can't implicitly cast -fun void test(Object !o) { <<< o >>>; } +fun void test(Object nonnull o) { <<< o >>>; } null => test; diff --git a/tests/nonnull/ref.gw b/tests/nonnull/ref.gw index 72d689a2..8923bf10 100644 --- a/tests/nonnull/ref.gw +++ b/tests/nonnull/ref.gw @@ -1 +1 @@ -new Object @=> Object !o; +new Object @=> Object nonnull o; diff --git a/tests/nonnull/ref_at_nonnull.gw b/tests/nonnull/ref_at_nonnull.gw index 0c8738e3..100d3fba 100644 --- a/tests/nonnull/ref_at_nonnull.gw +++ b/tests/nonnull/ref_at_nonnull.gw @@ -1,2 +1,2 @@ #! [contains] NullPtrException -Object @o @=> Object !p; +Object ref o @=> Object nonnull p; diff --git a/tests/nonnull/ref_cast_nonnull.gw b/tests/nonnull/ref_cast_nonnull.gw index 35cc4984..9e19dd9f 100644 --- a/tests/nonnull/ref_cast_nonnull.gw +++ b/tests/nonnull/ref_cast_nonnull.gw @@ -1,2 +1,2 @@ #! [contains] NullPtrException -(Object @ o) $ Object!; +(Object ref o) $ Object nonnull; diff --git a/tests/nonnull/ref_impl_nonnull.gw b/tests/nonnull/ref_impl_nonnull.gw index 35a7cd7c..6b53612a 100644 --- a/tests/nonnull/ref_impl_nonnull.gw +++ b/tests/nonnull/ref_impl_nonnull.gw @@ -1,3 +1,3 @@ #! [contains] NullPtrException -fun void test(Object !o) { <<< o >>>; } -Object @o => test; +fun void test(Object nonnull o) { <<< o >>>; } +Object ref o => test; diff --git a/tests/nonnull/ref_nonnull.gw b/tests/nonnull/ref_nonnull.gw index cfad18bb..9266a8d3 100644 --- a/tests/nonnull/ref_nonnull.gw +++ b/tests/nonnull/ref_nonnull.gw @@ -1,3 +1,3 @@ #! [contains] NullPtrException -Object @a @=> Object !o; +Object ref a @=> Object nonnull o; <<< o >>>; diff --git a/tests/nonnull/static_implicit_nonnull.gw b/tests/nonnull/static_implicit_nonnull.gw index df693b00..8f0c5dc8 100644 --- a/tests/nonnull/static_implicit_nonnull.gw +++ b/tests/nonnull/static_implicit_nonnull.gw @@ -1,4 +1,4 @@ #! [contains] can't implicitly cast -fun void test(Object !o) { <<< o >>>; } +fun void test(Object nonnull o) { <<< o >>>; } null => test; diff --git a/tests/nonnull/void_nonnull.gw b/tests/nonnull/void_nonnull.gw index 4ad08a50..2ac07158 100644 --- a/tests/nonnull/void_nonnull.gw +++ b/tests/nonnull/void_nonnull.gw @@ -1,2 +1,2 @@ #! [contains] void types can't be nonnull -void! i; +void nonnull i; diff --git a/tests/tree/auto_array.gw b/tests/tree/auto_array.gw index e5bb5284..f4d33e6e 100644 --- a/tests/tree/auto_array.gw +++ b/tests/tree/auto_array.gw @@ -1,4 +1,4 @@ int i[2][2]; -for(auto @a : i) +for(auto ref a : i) <<< a >>>; <<< i >>>; diff --git a/tests/tree/auto_fun.gw b/tests/tree/auto_fun.gw index 068381f4..30eaf3d3 100644 --- a/tests/tree/auto_fun.gw +++ b/tests/tree/auto_fun.gw @@ -4,6 +4,6 @@ class C { C i[2]; -for(auto @a : i) +for(auto ref a : i) <<< a >>>; diff --git a/tests/tree/call_nonnull.gw b/tests/tree/call_nonnull.gw index 1402c57b..c0122d34 100644 --- a/tests/tree/call_nonnull.gw +++ b/tests/tree/call_nonnull.gw @@ -1,3 +1,3 @@ typedef void test_t<~A~>(); -test_t !t; +test_t nonnull t; t<~int~>(); diff --git a/tests/tree/fork_join.gw b/tests/tree/fork_join.gw index 6e8dfdba..e0b85d7e 100644 --- a/tests/tree/fork_join.gw +++ b/tests/tree/fork_join.gw @@ -1,3 +1,3 @@ -fork { <<< __func__ >>>; } @=> Fork @f; +fork { <<< __func__ >>>; } @=> Fork ref f; second => now; f.join(); diff --git a/tests/tree/fork_join2.gw b/tests/tree/fork_join2.gw index e6654c8a..dd8d58f0 100644 --- a/tests/tree/fork_join2.gw +++ b/tests/tree/fork_join2.gw @@ -1,2 +1,2 @@ -fork { <<< __func__ >>>; minute => now; } @=> Fork @f; +fork { <<< __func__ >>>; minute => now; } @=> Fork ref f; f.join(); diff --git a/tests/tree/new.gw b/tests/tree/new.gw index 44c21df5..6734daa9 100644 --- a/tests/tree/new.gw +++ b/tests/tree/new.gw @@ -1,9 +1,8 @@ new Object; -new Object @=> Object @ref; +new Object @=> Object refref; new Event; Event ev; -ev @=> -Event @e; +ev @=> Event ref e; new Event @=> e; ev @=> e; null @=> e; diff --git a/tests/tree/set_obj.gw b/tests/tree/set_obj.gw index 7796e2e6..06a52846 100644 --- a/tests/tree/set_obj.gw +++ b/tests/tree/set_obj.gw @@ -1,5 +1,4 @@ typedef int[2]Type; Type!type; <<>>; -for(auto@a:type); -#!for(auto a:type); +for(auto ref a : type); diff --git a/tests/tree/shredule_test.gw b/tests/tree/shredule_test.gw index 896f4839..9e5754f7 100644 --- a/tests/tree/shredule_test.gw +++ b/tests/tree/shredule_test.gw @@ -2,8 +2,8 @@ Event e; spork { e => now; }; spork { samp => now; 4::samp => now;}; -spork { 5::samp => now;} @=> Shred @s; -spork { samp => now; 4::samp => now; } @=> Shred @t; +spork { 5::samp => now;} @=> Shred ref s; +spork { samp => now; 4::samp => now; } @=> Shred ref t; spork { 2::samp => now; me.exit(); }; spork { new Object; <<< "garbage collect me" >>>; 3::samp => now; }; 2::samp => now; diff --git a/tests/tree/vararg_assign.gw b/tests/tree/vararg_assign.gw index c8d456e5..86094b6e 100644 --- a/tests/tree/vararg_assign.gw +++ b/tests/tree/vararg_assign.gw @@ -1 +1 @@ -new Object @=> VarObject @o; +new Object @=> VarObject ref o; diff --git a/tests/tuple/array_tuple_array.gw b/tests/tuple/array_tuple_array.gw index af90f45e..10849561 100644 --- a/tests/tuple/array_tuple_array.gw +++ b/tests/tuple/array_tuple_array.gw @@ -1,4 +1,4 @@ -Tuple([1,2], "Tom") @=> <~int[], string~>Tuple @tup; +Tuple([1,2], "Tom") @=> <~int[], string~>Tuple ref tup; #!<<>>; #!<<>>; diff --git a/tests/tuple/object2tuple.gw b/tests/tuple/object2tuple.gw index 407b2371..ad2a8f9e 100644 --- a/tests/tuple/object2tuple.gw +++ b/tests/tuple/object2tuple.gw @@ -1,3 +1,3 @@ class C { int i; } -C c @=> <~int~>Tuple @t; -t @=> C @d; +C c @=> <~int~>Tuple ref t; +t @=> C ref d; diff --git a/tests/tuple/object2tuple_err.gw b/tests/tuple/object2tuple_err.gw index 78d6554c..c08e5766 100644 --- a/tests/tuple/object2tuple_err.gw +++ b/tests/tuple/object2tuple_err.gw @@ -3,6 +3,6 @@ class Person { 45 => int age; } -Person p @=> <~string,string~>Tuple @t; +Person p @=> <~string,string~>Tuple ref t; <<>>; <<>>; diff --git a/tests/tuple/object2tuple_err2.gw b/tests/tuple/object2tuple_err2.gw index 14d412da..8e20f44e 100644 --- a/tests/tuple/object2tuple_err2.gw +++ b/tests/tuple/object2tuple_err2.gw @@ -3,6 +3,6 @@ class Person { 45 => int age; } -Person p @=> <~string,int,float~>Tuple @t; +Person p @=> <~string,int,float~>Tuple ref t; <<>>; <<>>; diff --git a/tests/tuple/tupl_decl.gw b/tests/tuple/tupl_decl.gw index 9ee94d53..3127e9ce 100644 --- a/tests/tuple/tupl_decl.gw +++ b/tests/tuple/tupl_decl.gw @@ -1 +1 @@ -Tuple @u; +Tuple ref u; diff --git a/tests/tuple/tuple.gw b/tests/tuple/tuple.gw index 9ee94d53..3127e9ce 100644 --- a/tests/tuple/tuple.gw +++ b/tests/tuple/tuple.gw @@ -1 +1 @@ -Tuple @u; +Tuple ref u; diff --git a/tests/tuple/tuple_at.gw b/tests/tuple/tuple_at.gw index aa669c50..cf29a057 100644 --- a/tests/tuple/tuple_at.gw +++ b/tests/tuple/tuple_at.gw @@ -1,5 +1,5 @@ <<< Tuple("Tom", 6) @=> -<~string, int~>Tuple @tup >>>; +<~string, int~>Tuple ref tup >>>; <<< typeof(tup) >>>; <<< tup >>>; <<< tup[0] >>>; diff --git a/tests/tuple/tuple_at_err.gw b/tests/tuple/tuple_at_err.gw index fe93e754..5be9b3e1 100644 --- a/tests/tuple/tuple_at_err.gw +++ b/tests/tuple/tuple_at_err.gw @@ -1,4 +1,4 @@ Tuple("Tom", 6) @=> -<~float, int~>Tuple @tup; +<~float, int~>Tuple ref tup; <<< typeof(tup) >>>; <<< tup >>>; diff --git a/tests/tuple/tuple_cast.gw b/tests/tuple/tuple_cast.gw index 2c036120..7b35faaf 100644 --- a/tests/tuple/tuple_cast.gw +++ b/tests/tuple/tuple_cast.gw @@ -1,4 +1,4 @@ -<~int~>Tuple @a; +<~int~>Tuple ref a; <<< a >>>; <<< a $ Tuple >>>; diff --git a/tests/tuple/tuple_cast2.gw b/tests/tuple/tuple_cast2.gw index df197328..b6b3c891 100644 --- a/tests/tuple/tuple_cast2.gw +++ b/tests/tuple/tuple_cast2.gw @@ -1,4 +1,4 @@ -<~int,int~>Tuple @a; +<~int,int~>Tuple ref a; <<< a >>>; <<< a $ <~int~>Tuple >>>; diff --git a/tests/tuple/tuple_decl.gw b/tests/tuple/tuple_decl.gw index c14ce68b..b8e7cc78 100644 --- a/tests/tuple/tuple_decl.gw +++ b/tests/tuple/tuple_decl.gw @@ -1 +1 @@ -<~int~>Tuple @a; +<~int~>Tuple ref a; diff --git a/tests/tuple/tuple_empty.gw b/tests/tuple/tuple_empty.gw index 9d1e488d..ff732b28 100644 --- a/tests/tuple/tuple_empty.gw +++ b/tests/tuple/tuple_empty.gw @@ -1,2 +1,2 @@ -Tuple @tup; +Tuple ref tup; tup[1]; diff --git a/tests/tuple/tuple_member_float.gw b/tests/tuple/tuple_member_float.gw index c6c9fca1..02d0aec6 100644 --- a/tests/tuple/tuple_member_float.gw +++ b/tests/tuple/tuple_member_float.gw @@ -1,4 +1,4 @@ -Tuple(.2, Vec3(1), 3) @=> <~float, Vec3, int~>Tuple @t; +Tuple(.2, Vec3(1), 3) @=> <~float, Vec3, int~>Tuple ref t; t[0]; t[1]; 3 => t[2]; diff --git a/tests/tuple/tuple_skip2.gw b/tests/tuple/tuple_skip2.gw index 8b4f0e91..971feb97 100644 --- a/tests/tuple/tuple_skip2.gw +++ b/tests/tuple/tuple_skip2.gw @@ -1,4 +1,4 @@ -Tuple("Tom", 2, "Taxi driver") @=> <~string,_, string~>Tuple @t; +Tuple("Tom", 2, "Taxi driver") @=> <~string,_, string~>Tuple ref t; <<< t>>>; <<< t[0]>>>; Tuple("Tom", 2.3, "Cook") @=> t; diff --git a/tests/tuple/tuple_undefined.gw b/tests/tuple/tuple_undefined.gw index 4beee885..844164e0 100644 --- a/tests/tuple/tuple_undefined.gw +++ b/tests/tuple/tuple_undefined.gw @@ -1,3 +1,3 @@ #! [contains] tuple subscripts is undefined -<~string, _~>Tuple @t; +<~string, _~>Tuple ref t; t[1]; diff --git a/tests/tuple/tuple_unknown.gw b/tests/tuple/tuple_unknown.gw index 2e9ca60d..5f52865c 100644 --- a/tests/tuple/tuple_unknown.gw +++ b/tests/tuple/tuple_unknown.gw @@ -1,2 +1,2 @@ -<~int, strong~>Tuple @a; -<~int, string~>Tuple @a; +<~int, strong~>Tuple ref a; +<~int, string~>Tuple ref a; -- 2.43.0