From: Jérémie Astor Date: Wed, 17 Feb 2021 19:16:17 +0000 (+0100) Subject: :art: Cursed Horse Refactor, step 1 X-Git-Tag: nightly~947^2~1 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ad8a2cab98793525619a877186850699c5a013e9;p=gwion.git :art: Cursed Horse Refactor, step 1 --- diff --git a/examples/Gain.gw b/examples/Gain.gw index b1b21b87..c01ef28a 100644 --- a/examples/Gain.gw +++ b/examples/Gain.gw @@ -1,4 +1,4 @@ -adc => var Gain g => dac; +adc ~> var Gain g ~> dac; g.chan(0); spork { while(true) { g.gain() == (.2 ? .2 : .1) => g.gain; .15::second => now; }}; for(var int i; i < 5; i++) { diff --git a/examples/array_lit.gw b/examples/array_lit.gw index 6a151491..11cafee6 100644 --- a/examples/array_lit.gw +++ b/examples/array_lit.gw @@ -8,7 +8,7 @@ var Object p[2][3]; var Object r[2][3][4]; var Object s[2][3][4][5]; var Object t[2][12][3][4][5]; -[1,2,3,4] @=> i; +[1,2,3,4] => i; var int k[1][1]; diff --git a/examples/class_spork_exp.gw b/examples/class_spork_exp.gw index efd42f18..93599e4d 100644 --- a/examples/class_spork_exp.gw +++ b/examples/class_spork_exp.gw @@ -7,7 +7,7 @@ class C second => now; var string s; <<< "test spork exp." >>>; - } @=> var Shred shred; + } => var Shred shred; } var C c; diff --git a/examples/dac.gw b/examples/dac.gw index aa29f508..e53c8827 100644 --- a/examples/dac.gw +++ b/examples/dac.gw @@ -1,2 +1,2 @@ -adc => dac; +adc ~> dac; second => now; diff --git a/examples/empty_string.gw b/examples/empty_string.gw index 7ac5532f..60b3984d 100644 --- a/examples/empty_string.gw +++ b/examples/empty_string.gw @@ -1,2 +1,2 @@ -"test" @=> var string s; +"test" => var string s; <<< s >>>; diff --git a/examples/fullrect.gw b/examples/fullrect.gw index 66274ff3..0efe44c0 100644 --- a/examples/fullrect.gw +++ b/examples/fullrect.gw @@ -1,4 +1,4 @@ -var Impulse imp => var FullRect fr => dac; +var Impulse imp ~> var FullRect fr ~> dac; samp => now; 1 => imp.next; samp => now; diff --git a/examples/halfrect.gw b/examples/halfrect.gw index b558daf2..f22dec43 100644 --- a/examples/halfrect.gw +++ b/examples/halfrect.gw @@ -1,4 +1,4 @@ -var Impulse imp => var HalfRect fr => dac; +var Impulse imp ~> var HalfRect fr ~> dac; samp => now; 1 => imp.next; samp => now; diff --git a/examples/impulse.gw b/examples/impulse.gw index ff3724f6..225c1721 100644 --- a/examples/impulse.gw +++ b/examples/impulse.gw @@ -1,4 +1,4 @@ -var Impulse imp => dac; +var Impulse imp ~> dac; 1 => imp.next; <<< imp.next() >>>; samp => now; diff --git a/examples/op.gw b/examples/op.gw index f16849bf..bb99b95b 100644 --- a/examples/op.gw +++ b/examples/op.gw @@ -10,7 +10,7 @@ class C { #!! assign object to C.ref operator void => (Object o, C c) { - o @=> c.ref_object; + o => c.ref_object; <<< "success" >>>; } diff --git a/examples/ptr_assign_class.gw b/examples/ptr_assign_class.gw index 9b73e8a5..5b560f28 100644 --- a/examples/ptr_assign_class.gw +++ b/examples/ptr_assign_class.gw @@ -2,7 +2,7 @@ class C { funcdef void Test(); fun void test1(){}; var Test test0; - <<< test1 @=> test0 >>>; + <<< test1 => test0 >>>; } var C c; diff --git a/examples/spork_exp.gw b/examples/spork_exp.gw index 13d513a0..f840c042 100644 --- a/examples/spork_exp.gw +++ b/examples/spork_exp.gw @@ -9,7 +9,7 @@ class C var string s; <<< this, " test spork exp. " , s >>>; - } @=> var Shred shred; + } => var Shred shred; } var C c; diff --git a/examples/step.gw b/examples/step.gw index 3d6fc573..7646e377 100644 --- a/examples/step.gw +++ b/examples/step.gw @@ -1,4 +1,4 @@ -var Step step => dac; +var Step step ~> dac; .1 => step.next; samp => now; <<>>; diff --git a/examples/zerox.gw b/examples/zerox.gw index 369fc12b..efd02cdd 100644 --- a/examples/zerox.gw +++ b/examples/zerox.gw @@ -1,4 +1,4 @@ -var Impulse imp => var ZeroX fr => dac; +var Impulse imp ~> var ZeroX fr ~> dac; samp => now; -1 => imp.next; samp => now; diff --git a/src/lib/array.c b/src/lib/array.c index 1bba21a0..1998a89e 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -190,7 +190,7 @@ static OP_CHECK(opck_array_at) { if(bin->rhs->exp_type == ae_exp_decl) { if(bin->rhs->d.exp_decl.list->self->array && bin->rhs->d.exp_decl.list->self->array->exp) - ERR_N(exp_self(bin)->pos, _("do not provide array for 'xxx @=> declaration'.")) + ERR_N(exp_self(bin)->pos, _("do not provide array for 'xxx => declaration'.")) } exp_setvar(bin->rhs, 1); return bin->rhs->type; @@ -506,7 +506,7 @@ GWION_IMPORT(array) { GWI_BB(gwi_class_end(gwi)) GWI_BB(gwi_oper_ini(gwi, "Array", "Array", NULL)) GWI_BB(gwi_oper_add(gwi, opck_array_at)) - GWI_BB(gwi_oper_end(gwi, "@=>", NULL)) + GWI_BB(gwi_oper_end(gwi, "=>", NULL)) GWI_BB(gwi_oper_add(gwi, opck_array_implicit)) GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) GWI_BB(gwi_oper_ini(gwi, "Array", (m_str)OP_ANY_TYPE, NULL)) diff --git a/src/lib/object_op.c b/src/lib/object_op.c index 0f9ab262..5fdc04ac 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -29,6 +29,7 @@ describe_logical(Neq, !=) static OP_CHECK(opck_object_at) { const Exp_Binary* bin = (Exp_Binary*)data; +printf("HERE %s\n", env->name); if(opck_rassign(env, data) == env->gwion->type[et_error]) return env->gwion->type[et_error]; if(bin->rhs->exp_type == ae_exp_decl) @@ -316,7 +317,7 @@ GWION_IMPORT(object_op) { GWI_BB(gwi_oper_ini(gwi, "Object", "Object", NULL)) GWI_BB(gwi_oper_add(gwi, opck_object_at)) GWI_BB(gwi_oper_emi(gwi, opem_object_at)) - GWI_BB(gwi_oper_end(gwi, "@=>", NULL)) + GWI_BB(gwi_oper_end(gwi, "=>", NULL)) GWI_BB(gwi_oper_ini(gwi, "Object", "Object", "bool")) GWI_BB(gwi_oper_end(gwi, "==", EqObject)) GWI_BB(gwi_oper_end(gwi, "!=", NeqObject)) diff --git a/src/lib/ptr.c b/src/lib/ptr.c index 7f2ac1c9..ebd6eb51 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -195,6 +195,6 @@ GWION_IMPORT(ptr) { GWI_BB(gwi_oper_ini(gwi, "Ptr", "Ptr", "Ptr")) GWI_BB(gwi_oper_add(gwi, opck_ptr_ref)) // GWI_BB(gwi_oper_emi(gwi, opem_ptr_ref)) - GWI_BB(gwi_oper_end(gwi, "@=>", int_r_assign)) + GWI_BB(gwi_oper_end(gwi, "=>", int_r_assign)) return GW_OK; } diff --git a/src/lib/ugen.c b/src/lib/ugen.c index 294497a9..428a53a6 100644 --- a/src/lib/ugen.c +++ b/src/lib/ugen.c @@ -398,28 +398,28 @@ GWION_IMPORT(ugen) { GWI_BB(gwi_class_end(gwi)) GWI_BB(gwi_oper_ini(gwi, "UGen", "UGen", "UGen")) - _CHECK_OP("=>", chuck_ugen, UgenConnect) - _CHECK_OP("=<", chuck_ugen, UgenDisconnect) - _CHECK_OP(":=>", chuck_ugen, TrigConnect) - _CHECK_OP(":=<", chuck_ugen, TrigDisconnect) + _CHECK_OP("~>", chuck_ugen, UgenConnect) + _CHECK_OP("~<", chuck_ugen, UgenDisconnect) + _CHECK_OP(":~>", chuck_ugen, TrigConnect) + _CHECK_OP(":~<", chuck_ugen, TrigDisconnect) GWI_BB(gwi_oper_ini(gwi, "UGen[]", "UGen[]", "UGen[]")) - _CHECK_OP("=>", chuck_ugen, UgenAAConnect) - _CHECK_OP("=<", chuck_ugen, UgenAADisconnect) - _CHECK_OP(":=>", chuck_ugen, TrigAAConnect) - _CHECK_OP(":=<", chuck_ugen, TrigAADisconnect) + _CHECK_OP("~>", chuck_ugen, UgenAAConnect) + _CHECK_OP("~<", chuck_ugen, UgenAADisconnect) + _CHECK_OP(":~>", chuck_ugen, TrigAAConnect) + _CHECK_OP(":~<", chuck_ugen, TrigAADisconnect) GWI_BB(gwi_oper_ini(gwi, "UGen", "UGen[]", "UGen[]")) - _CHECK_OP("=>", chuck_ugen, UgenUAConnect) - _CHECK_OP("=<", chuck_ugen, UgenUADisconnect) - _CHECK_OP(":=>", chuck_ugen, TrigUAConnect) - _CHECK_OP(":=<", chuck_ugen, TrigUADisconnect) + _CHECK_OP("~>", chuck_ugen, UgenUAConnect) + _CHECK_OP("~<", chuck_ugen, UgenUADisconnect) + _CHECK_OP(":~>", chuck_ugen, TrigUAConnect) + _CHECK_OP(":~<", chuck_ugen, TrigUADisconnect) GWI_BB(gwi_oper_ini(gwi, "UGen[]", "UGen", "UGen")) - _CHECK_OP("=>", chuck_ugen, UgenAUConnect) - _CHECK_OP("=<", chuck_ugen, UgenAUDisconnect) - _CHECK_OP(":=>", chuck_ugen, TrigAUConnect) - _CHECK_OP(":=<", chuck_ugen, TrigAUDisconnect) + _CHECK_OP("~>", chuck_ugen, UgenAUConnect) + _CHECK_OP("~<", chuck_ugen, UgenAUDisconnect) + _CHECK_OP(":~>", chuck_ugen, TrigAUConnect) + _CHECK_OP(":~<", chuck_ugen, TrigAUDisconnect) return import_global_ugens(gwi); } diff --git a/tests/UsrUgen/UsrUGen.gw b/tests/UsrUgen/UsrUGen.gw index 9c9b4bf5..fda4d079 100644 --- a/tests/UsrUgen/UsrUGen.gw +++ b/tests/UsrUgen/UsrUGen.gw @@ -10,7 +10,7 @@ class C extends UsrUGen { <<>>; } -var C u => dac; +var C u ~> dac; <<< u >>>; #! use default tick diff --git a/tests/UsrUgen/UsrUGen_more_arg.gw b/tests/UsrUgen/UsrUGen_more_arg.gw index 03a14b53..3560e70b 100644 --- a/tests/UsrUgen/UsrUGen_more_arg.gw +++ b/tests/UsrUgen/UsrUGen_more_arg.gw @@ -11,7 +11,7 @@ class C extends UsrUGen { <<>>; } -var C u => dac; +var C u ~> dac; <<< u >>>; samp => now; <<< u.last() >>>; diff --git a/tests/UsrUgen/UsrUGen_no_arg.gw b/tests/UsrUgen/UsrUGen_no_arg.gw index 0804718d..74aad154 100644 --- a/tests/UsrUgen/UsrUGen_no_arg.gw +++ b/tests/UsrUgen/UsrUGen_no_arg.gw @@ -11,7 +11,7 @@ class C extends UsrUGen { <<>>; } -var C u => dac; +var C u ~> dac; <<< u >>>; samp => now; <<< u.last() >>>; diff --git a/tests/UsrUgen/UsrUGen_no_float.gw b/tests/UsrUgen/UsrUGen_no_float.gw index 2614e276..0a055c88 100644 --- a/tests/UsrUgen/UsrUGen_no_float.gw +++ b/tests/UsrUgen/UsrUGen_no_float.gw @@ -10,7 +10,7 @@ class C extends UsrUGen { <<>>; } -var C u => dac; +var C u ~> dac; <<< u >>>; samp => now; <<< u.last() >>>; diff --git a/tests/UsrUgen/UsrUGen_ret_no_float.gw b/tests/UsrUgen/UsrUGen_ret_no_float.gw index f3628368..19ef3278 100644 --- a/tests/UsrUgen/UsrUGen_ret_no_float.gw +++ b/tests/UsrUgen/UsrUGen_ret_no_float.gw @@ -10,7 +10,7 @@ class C extends UsrUGen { <<>>; } -var C u => dac; +var C u ~> dac; <<< u >>>; samp => now; <<< u.last() >>>; diff --git a/tests/bug/play_with_str.gw b/tests/bug/play_with_str.gw index 0dd00278..07ae0ee3 100644 --- a/tests/bug/play_with_str.gw +++ b/tests/bug/play_with_str.gw @@ -1,4 +1,4 @@ -"lol" @=> var string s; +"lol" => var string s; "test" => s; <<< "testmem".replace(2, 3, "UKUH") >>>; diff --git a/tests/error/UgenConnectException.gw b/tests/error/UgenConnectException.gw index 75ca2dcb..73c111b4 100644 --- a/tests/error/UgenConnectException.gw +++ b/tests/error/UgenConnectException.gw @@ -1 +1 @@ -late Gain g => dac; +late Gain g ~> dac; diff --git a/tests/error/array_assign_exp.gw b/tests/error/array_assign_exp.gw index 492df23c..be574067 100644 --- a/tests/error/array_assign_exp.gw +++ b/tests/error/array_assign_exp.gw @@ -1,2 +1,2 @@ #! [contains] do not provide array -[1,2,3,4] @=> var int loop[1]; +[1,2,3,4] => var int loop[1]; diff --git a/tests/error/array_depth_match.gw b/tests/error/array_depth_match.gw index 9b85fb01..70f583cf 100644 --- a/tests/error/array_depth_match.gw +++ b/tests/error/array_depth_match.gw @@ -1,2 +1,2 @@ #! [contains] array depths do not match -[1,2,3,4] @=> var int k[1][1]; +[1,2,3,4] => var int k[1][1]; diff --git a/tests/error/array_mutable.gw b/tests/error/array_mutable.gw index 59446465..e20aee66 100644 --- a/tests/error/array_mutable.gw +++ b/tests/error/array_mutable.gw @@ -1,2 +1,2 @@ #! [contains] non-mutable -[1,2,3,4] @=> [1][1]; +[1,2,3,4] => [1][1]; diff --git a/tests/error/array_type_match.gw b/tests/error/array_type_match.gw index 3b085a95..d7876ef6 100644 --- a/tests/error/array_type_match.gw +++ b/tests/error/array_type_match.gw @@ -1,2 +1,2 @@ #! [contains] array types do not match -[1,2,3,4] @=> var Object k[1]; +[1,2,3,4] => var Object k[1]; diff --git a/tests/error/auto_fail.gw b/tests/error/auto_fail.gw index 1598b5ea..33976383 100644 --- a/tests/error/auto_fail.gw +++ b/tests/error/auto_fail.gw @@ -1,2 +1,2 @@ #! [contains] no match found for operator -var int i => var auto ae @=> var auto A; +var int i => var auto ae :=> var auto A; diff --git a/tests/error/invalid_array_acces.gw b/tests/error/invalid_array_acces.gw index acfa9821..bb466857 100644 --- a/tests/error/invalid_array_acces.gw +++ b/tests/error/invalid_array_acces.gw @@ -1,3 +1,3 @@ #! [contains] invalid array acces expression var int j[]; -j[1,2,3,4] @=> i; +j[1,2,3,4] => i; diff --git a/tests/error/op_test.gw b/tests/error/op_test.gw index 608bbc9c..f719617e 100644 --- a/tests/error/op_test.gw +++ b/tests/error/op_test.gw @@ -6,4 +6,4 @@ class C var C c[1]; var C d[2][4]; -c => d; +c :=> d; diff --git a/tests/fork/fork.gw b/tests/fork/fork.gw index 7bc937ac..00465c14 100644 --- a/tests/fork/fork.gw +++ b/tests/fork/fork.gw @@ -3,7 +3,7 @@ fork { 12::samp => now; me.test_cancel(); <<< "stop" >>>; -} @=> var Fork f; +} => var Fork f; 1 => f.set_cancel; 2::samp => now; diff --git a/tests/fork/fork_join.gw b/tests/fork/fork_join.gw index 699826e3..e9526cf7 100644 --- a/tests/fork/fork_join.gw +++ b/tests/fork/fork_join.gw @@ -1,3 +1,3 @@ -fork { <<< __func__ >>>; } @=> var Fork f; +fork { <<< __func__ >>>; } => var Fork f; second => now; f.join(); diff --git a/tests/fork/fork_join2.gw b/tests/fork/fork_join2.gw index c8e1bd71..05af271a 100644 --- a/tests/fork/fork_join2.gw +++ b/tests/fork/fork_join2.gw @@ -1,2 +1,2 @@ -fork { <<< __func__ >>>; minute => now; } @=> var Fork f; +fork { <<< __func__ >>>; minute => now; } => var Fork f; f.join(); diff --git a/tests/interp/to_string.gw b/tests/interp/to_string.gw index 14d9af9f..eb827980 100644 --- a/tests/interp/to_string.gw +++ b/tests/interp/to_string.gw @@ -1,4 +1,4 @@ #! [contains] Hello, interpolation! 1 1 => var int my; -"Hello, interpolation! ${ my }" @=> var string s; +"Hello, interpolation! ${ my }" => var string s; <<< s >>>; diff --git a/tests/new/ref.gw b/tests/new/ref.gw index d3657fcf..8c7cba9c 100644 --- a/tests/new/ref.gw +++ b/tests/new/ref.gw @@ -1 +1 @@ -new Object @=> var Object? o; +new Object => var Object? o; diff --git a/tests/new/vararg_cpy.gw b/tests/new/vararg_cpy.gw index 66f04212..dc8e149a 100644 --- a/tests/new/vararg_cpy.gw +++ b/tests/new/vararg_cpy.gw @@ -1,5 +1,5 @@ fun void test(...) { <<< vararg >>>; - <<< vararg.cpy() @=> var Vararg new_arg >>>; + <<< vararg.cpy() => var Vararg new_arg >>>; } test(1); diff --git a/tests/plug/callback2.gw b/tests/plug/callback2.gw index e1ed907a..d1355753 100644 --- a/tests/plug/callback2.gw +++ b/tests/plug/callback2.gw @@ -1,7 +1,7 @@ fun int test(int i) { <<< "test with arg ", i >>>; } var PtrTypeI p; -test @=> p; +test => p; <<< test >>>; <<< p >>>; <<< "test" >>>; diff --git a/tests/plug/union.gw b/tests/plug/union.gw index 591ef1cf..9bbb846b 100644 --- a/tests/plug/union.gw +++ b/tests/plug/union.gw @@ -6,4 +6,4 @@ var Union u; <<< u.i >>>; <<< u.f >>>; <<< 0 => u.i >>>; -<<< null @=> u.o >>>; +<<< null => u.o >>>; diff --git a/tests/slice/slice_array.gw b/tests/slice/slice_array.gw index bdf15944..8534a146 100644 --- a/tests/slice/slice_array.gw +++ b/tests/slice/slice_array.gw @@ -1,4 +1,4 @@ -<<< [1,2,3] @=> var auto i >>>; +<<< [1,2,3] => var auto i >>>; <<< i[1:2] >>>; <<< i[:2] >>>; <<< i[2: -1] >>>; diff --git a/tests/string/eq.gw b/tests/string/eq.gw index 14ace808..25bfe8a6 100644 --- a/tests/string/eq.gw +++ b/tests/string/eq.gw @@ -1,5 +1,5 @@ -"test" @=> var string s0; -"_test" @=> var string s1; +"test" => var string s0; +"_test" => var string s1; <<< s0 == s0 >>>; <<< s0 == s1 >>>; diff --git a/tests/tree/auto_decl.gw b/tests/tree/auto_decl.gw index b4c5b51a..a3b98a84 100644 --- a/tests/tree/auto_decl.gw +++ b/tests/tree/auto_decl.gw @@ -1,2 +1,2 @@ -<<< new float[3] @=> var auto i >>>; +<<< new float[3] => var auto i >>>; <<< i >>>; diff --git a/tests/tree/auto_ref.gw b/tests/tree/auto_ref.gw index b8ad9ae0..6ec42a1c 100644 --- a/tests/tree/auto_ref.gw +++ b/tests/tree/auto_ref.gw @@ -1 +1 @@ -me @=> var auto a; +me => var auto a; diff --git a/tests/tree/new.gw b/tests/tree/new.gw index f46ee7c9..439ddd55 100644 --- a/tests/tree/new.gw +++ b/tests/tree/new.gw @@ -1,7 +1,7 @@ new Object; -new Object @=> var Object refref; +new Object => var Object refref; new Event; var Event ev; -ev @=> var Event e; -new Event @=> e; -ev @=> e; +ev => var Event e; +new Event => e; +ev => e; diff --git a/tests/tree/ptr_test.gw b/tests/tree/ptr_test.gw index 509a5be8..ff8b06d0 100644 --- a/tests/tree/ptr_test.gw +++ b/tests/tree/ptr_test.gw @@ -1,4 +1,4 @@ funcdef void Test(); -fun void t0(){} +fun void t0(){} t0 @=> var Test test; test(); diff --git a/tests/tree/shredule_test.gw b/tests/tree/shredule_test.gw index 09458f0d..9b2d5a07 100644 --- a/tests/tree/shredule_test.gw +++ b/tests/tree/shredule_test.gw @@ -2,8 +2,8 @@ var Event e; spork { e => now; }; spork { samp => now; 4::samp => now;}; -spork { 5::samp => now;} @=> var Shred s; -spork { samp => now; 4::samp => now; } @=> var Shred t; +spork { 5::samp => now;} => var Shred s; +spork { samp => now; 4::samp => now; } => var Shred t; spork { 2::samp => now; me.exit(); }; spork { new Object; <<< "garbage collect me" >>>; 3::samp => now; }; 2::samp => now; diff --git a/tests/tree/ugen_disconnect.gw b/tests/tree/ugen_disconnect.gw index 95bda7eb..2b668305 100644 --- a/tests/tree/ugen_disconnect.gw +++ b/tests/tree/ugen_disconnect.gw @@ -1,2 +1,2 @@ -adc => dac; -adc =< dac; +adc ~> dac; +adc ~< dac; diff --git a/tests/tree/varobject_assign.gw b/tests/tree/varobject_assign.gw index 27012d54..ee239f61 100644 --- a/tests/tree/varobject_assign.gw +++ b/tests/tree/varobject_assign.gw @@ -1,6 +1,6 @@ fun void test(...) { var Object o; varloop vararg { - vararg $ Object @=> o; + vararg $ Object => o; } }