From f26a0c45e1c461901f869c30aefac70cc86820d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 14 Sep 2020 00:40:10 +0200 Subject: [PATCH] :art: Open templates with '[' (second char) --- ast | 2 +- examples/binary_tmpl.gw | 2 +- examples/implicit_fptr_tmpl.gw | 4 ++-- examples/implicit_ptr.gw | 2 +- examples/in_class_class.gw | 2 +- examples/ptr_assign.gw | 2 +- examples/ptr_cast.gw | 2 +- examples/ptr_deref.gw | 2 +- examples/template.gw | 8 ++++---- examples/template_dyn.gw | 10 +++++----- examples/template_guess.gw | 2 +- examples/template_vararg.gw | 6 +++--- plug | 2 +- src/env/func.c | 2 +- src/import/checker.c | 4 ++-- src/lib/object_op.c | 2 +- src/lib/ptr.c | 2 +- src/lib/shred.c | 2 +- src/parse/check.c | 2 +- tests/bug/Tester.gw | 4 ++-- tests/error/call_non_template.gw | 2 +- tests/error/empty_ptr.gw | 2 +- tests/error/invalid_pointer_cast.gw | 2 +- tests/error/non_function_template.gw | 2 +- tests/error/ptr_assign_const.gw | 2 +- tests/error/ptr_assign_invalid.gw | 2 +- tests/error/ptr_from_const.gw | 2 +- tests/error/ptr_implicit_const.gw | 2 +- tests/error/template_class_no_type.gw | 2 +- tests/error/template_dyn2.gw | 10 +++++----- tests/error/template_enough.gw | 2 +- tests/error/template_n_mismatch.gw | 8 ++++---- tests/error/template_no_match.gw | 8 ++++---- tests/error/template_non_member.gw | 2 +- tests/error/template_not_able.gw | 2 +- tests/error/template_overload.gw | 2 +- tests/error/template_ternary.gw | 2 +- tests/error/template_unknown.gw | 4 ++-- tests/error/type_not_template.gw | 2 +- tests/error/typedef_func_tmpl_types.gw | 12 ++++++------ tests/error/typedef_func_tmpl_types2.gw | 8 ++++---- tests/fork/fork_call.gw | 2 +- tests/fptr/fptr_tmpl_cast.gw | 4 ++-- tests/import/class_template.c | 6 +++--- tests/import/class_template.gw | 2 +- tests/import/class_template_fail.c | 2 +- tests/import/class_template_invalid.c | 6 +++--- tests/import/fptr_tmpl.c | 2 +- tests/import/fptr_tmpl_fail.c | 2 +- tests/import/func_fail2.c | 2 +- tests/import/func_fail3.c | 2 +- tests/import/func_fail4.c | 2 +- tests/import/func_tmpl.c | 2 +- tests/import/func_tmpl.gw | 2 +- tests/import/func_tmpl_fail.c | 2 +- tests/import/invalid_names.c | 2 +- tests/import/invalid_names3.c | 2 +- tests/import/map2.gw | 2 +- tests/import/typedef_fail.c | 4 ++-- tests/import/typedef_tmpl.c | 2 +- tests/import/union_tmpl.c | 2 +- tests/import/union_tmpl.gw | 2 +- tests/import/union_tmpl_fail.c | 2 +- tests/import/union_tmpl_fail2.c | 4 ++-- tests/import/union_tmpl_fail3.c | 2 +- tests/new/dottmpl.gw | 2 +- tests/new/dtor.gw | 6 +++--- tests/new/extend_template_union.gw | 14 +++++++------- tests/new/parent.gw | 10 +++++----- tests/new/pure.gw | 2 +- tests/new/pure_member.gw | 2 +- tests/new/recursive_template.gw | 6 +++--- tests/new/recursive_template0.gw | 6 +++--- tests/new/recursive_template1.gw | 6 +++--- tests/new/recursive_template2.gw | 4 ++-- tests/new/recursive_template3.gw | 2 +- tests/new/recursive_template_test.gw | 4 ++-- tests/new/static_tmpl2.gw | 2 +- tests/new/template_class_in_template.gw | 6 +++--- tests/new/template_dyn.gw | 10 +++++----- tests/new/test.gw | 4 ++-- tests/new/test2.gw | 8 ++++---- tests/new/typedef_func_tmpl_class.gw | 6 +++--- tests/new/typedef_func_tmpl_class_static.gw | 6 +++--- tests/new/typedef_func_tmpl_err.gw | 6 +++--- tests/new/typedef_func_tmpl_tmpl.gw | 4 ++-- tests/regression/invalid_template.gw | 10 +++++----- tests/struct/struct_template.gw | 6 +++--- tests/tree/auto_ptr.gw | 2 +- tests/tree/call_nonnull.gw | 4 ++-- tests/tree/class_not_template_inside_template.gw | 4 ++-- tests/tree/class_template.gw | 10 +++++----- tests/tree/cpy_ast.gw | 6 +++--- tests/tree/extent_template.gw | 4 ++-- tests/tree/get_type_name_test.gw | 6 +++--- tests/tree/static_template.gw | 4 ++-- tests/tree/static_tmpl.gw | 6 +++--- tests/tree/template_class_invalid_type_number.gw | 4 ++-- tests/tree/template_class_ref.gw | 4 ++-- tests/tree/template_fptr.gw | 8 ++++---- tests/tree/template_self.gw | 6 +++--- tests/tree/tmpl_fail_inner.gw | 6 +++--- tests/tree/typedef_func_tmpl.gw | 8 ++++---- tests/tree/typedef_func_tmpl2.gw | 8 ++++---- tests/tree/typedef_func_tmpl_class.gw | 6 +++--- tests/tree/union_tmpl.gw | 4 ++-- 106 files changed, 219 insertions(+), 219 deletions(-) diff --git a/ast b/ast index d572b7d3..5dcf6d41 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit d572b7d308e6948f0dd4d328aa07050d42e8fdcd +Subproject commit 5dcf6d41e3441deafd0f76aae4b8797af0732339 diff --git a/examples/binary_tmpl.gw b/examples/binary_tmpl.gw index 0b1d2e32..46a04c6c 100644 --- a/examples/binary_tmpl.gw +++ b/examples/binary_tmpl.gw @@ -2,7 +2,7 @@ class C { class D { } } -fun void test<~A](A a) { <<< a >>>; } +fun void test<[A](A a) { <<< a >>>; } 1 => test; 1.3 => test; test(1); diff --git a/examples/implicit_fptr_tmpl.gw b/examples/implicit_fptr_tmpl.gw index c7f0361a..73ad996b 100644 --- a/examples/implicit_fptr_tmpl.gw +++ b/examples/implicit_fptr_tmpl.gw @@ -1,8 +1,8 @@ -typedef void t_ptr<~A](); +typedef void t_ptr<[A](); fun void test(t_ptr p) { <<< p >>>; } -fun void t<~A]() { +fun void t<[A]() { } t => test; diff --git a/examples/implicit_ptr.gw b/examples/implicit_ptr.gw index 8bbe4202..4f894a4d 100644 --- a/examples/implicit_ptr.gw +++ b/examples/implicit_ptr.gw @@ -1,4 +1,4 @@ -fun void test(Ptr<~int] p) { +fun void test(Ptr<[int] p) { <<< *p >>>; } var int i => test; diff --git a/examples/in_class_class.gw b/examples/in_class_class.gw index e72f76b3..ee81714d 100644 --- a/examples/in_class_class.gw +++ b/examples/in_class_class.gw @@ -1,5 +1,5 @@ class C { - fun void test<~A](A a){ <<< a >>>; } + fun void test<[A](A a){ <<< a >>>; } class D { var int i;} } diff --git a/examples/ptr_assign.gw b/examples/ptr_assign.gw index 2d0ebca9..cd2628c5 100644 --- a/examples/ptr_assign.gw +++ b/examples/ptr_assign.gw @@ -3,4 +3,4 @@ class C { class D extends C { } var D d; -d :=> var Ptr<~C] pd; +d :=> var Ptr<[C] pd; diff --git a/examples/ptr_cast.gw b/examples/ptr_cast.gw index a0355c24..eb499b5e 100644 --- a/examples/ptr_cast.gw +++ b/examples/ptr_cast.gw @@ -1,2 +1,2 @@ 12 => var int i; -<<>>; +<<>>; diff --git a/examples/ptr_deref.gw b/examples/ptr_deref.gw index 90b6e818..e3e5f988 100644 --- a/examples/ptr_deref.gw +++ b/examples/ptr_deref.gw @@ -1,3 +1,3 @@ var int i; -i :=> var Ptr<~int] pti; +i :=> var Ptr<[int] pti; <<<12 => *pti, " ", *pti>>>; diff --git a/examples/template.gw b/examples/template.gw index a893f702..5de4d699 100644 --- a/examples/template.gw +++ b/examples/template.gw @@ -1,4 +1,4 @@ -fun void test<~A] (A a){ <<< a >>>; } -fun void test<~A,B] (A a, B b){ <<< a >>>; } -test<~int](1); -test<~float, float](3, 1.4); +fun void test<[A] (A a){ <<< a >>>; } +fun void test<[A,B] (A a, B b){ <<< a >>>; } +test<[int](1); +test<[float, float](3, 1.4); diff --git a/examples/template_dyn.gw b/examples/template_dyn.gw index 922779d5..87cf3a4a 100644 --- a/examples/template_dyn.gw +++ b/examples/template_dyn.gw @@ -4,15 +4,15 @@ fun void test(C cc, int i) { <<< 1 >>>; <<< cc.test(i, i) >>>; } class C { - fun int test<~A](A a) { <<< " A ", a >>>; } - fun int test<~A](A a, int i) { <<< " ", a >>>; } - fun int test<~A](A a, int i, int j) { <<< a >>>; } + fun int test<[A](A a) { <<< " A ", a >>>; } + fun int test<[A](A a, int i) { <<< " ", a >>>; } + fun int test<[A](A a, int i, int j) { <<< a >>>; } } class D extends C { - fun int test<~A](A a, int i) { <<< this, " extent ", a, __func__ >>>; } + fun int test<[A](A a, int i) { <<< this, " extent ", a, __func__ >>>; } } class E extends D { - fun int test<~A](A a, int i) { <<< this, " Extent ", a, __func__ >>>; } + fun int test<[A](A a, int i) { <<< this, " Extent ", a, __func__ >>>; } } diff --git a/examples/template_guess.gw b/examples/template_guess.gw index a0a0be77..6a95245e 100644 --- a/examples/template_guess.gw +++ b/examples/template_guess.gw @@ -1,4 +1,4 @@ -fun void test<~A,B](A a, B b){<<< a, ", ", b >>>;} +fun void test<[A,B](A a, B b){<<< a, ", ", b >>>;} test(1, 2.1); test(1.1, 2.1); test(1.2, 2); diff --git a/examples/template_vararg.gw b/examples/template_vararg.gw index 82b82bbd..bc292725 100644 --- a/examples/template_vararg.gw +++ b/examples/template_vararg.gw @@ -1,7 +1,7 @@ -fun void test<~A](...) { +fun void test<[A](...) { varloop vararg { <<< vararg $ int >>>; } } -test<~int](1, 2); -test<~float](1, 2, 3); +test<[int](1, 2); +test<[float](1, 2, 3); diff --git a/plug b/plug index 89808730..cf2a0ab7 160000 --- a/plug +++ b/plug @@ -1 +1 @@ -Subproject commit 898087306d77a7abf29f932e85dee4acbc8abd73 +Subproject commit cf2a0ab7afe7f690fa043d6db8aba45c0621e2be diff --git a/src/env/func.c b/src/env/func.c index b33113bb..e039468f 100644 --- a/src/env/func.c +++ b/src/env/func.c @@ -30,7 +30,7 @@ ANN2(1,2) Symbol func_symbol(const Env env, const m_str nspc, const m_str base, const size_t len = base_len + tmpl_len + nspc_len + idx_len + 2; char name[len + 1]; CHECK_BO(sprintf(name, "%s%s%s%s@%" UINT_F "@%s", - base, !tmpl ? "" : "<~", !tmpl ? "" : tmpl, !tmpl ? "" : "]", + base, !tmpl ? "" : "<[", !tmpl ? "" : tmpl, !tmpl ? "" : "]", i, nspc)) return insert_symbol(env->gwion->st, name); } diff --git a/src/import/checker.c b/src/import/checker.c index 0b07cd84..14c2c86c 100644 --- a/src/import/checker.c +++ b/src/import/checker.c @@ -108,7 +108,7 @@ ANN static ID_List _tmpl_list(const Gwi gwi, struct td_checker *tdc) { ANN static ID_List __tmpl_list(const Gwi gwi, struct td_checker *tdc) { if(tdc->str[0] != '<') return NULL; - if(tdc->str[1] != '~') + if(tdc->str[1] != '[') return (ID_List)GW_ERROR; tdc->str += 2; const ID_List list = _tmpl_list(gwi, tdc); @@ -195,7 +195,7 @@ ANN static Type_List td_tmpl(const Gwi gwi, struct td_checker *tdc) { if(*tdc->str != '<') return NULL; // GW_PASS ++tdc->str; - if(*tdc->str != '~') { + if(*tdc->str != '[') { GWI_ERR("invalid character"); return (Type_List)GW_ERROR; } diff --git a/src/lib/object_op.c b/src/lib/object_op.c index f7897fb3..d26ef7a1 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -314,7 +314,7 @@ ANN static void template_name(struct tmpl_info* info, m_str s) { const m_uint size = info->index = vector_size(&info->type) -1; str = tmpl_get(info, str); *str++ = '<'; - *str++ = '~'; + *str++ = '['; for(info->index = 0; info->index < size; ++info->index) { str = tmpl_get(info, str); if(info->index < size - 1) diff --git a/src/lib/ptr.c b/src/lib/ptr.c index 9c827e31..ba9cd4a8 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -158,7 +158,7 @@ GWION_IMPORT(ptr) { GWI_BB(gwi_oper_ini(gwi, "@Ptr", NULL, NULL)) GWI_BB(gwi_oper_add(gwi, opck_ptr_scan)) GWI_BB(gwi_oper_end(gwi, "@scan", NULL)) - const Type t_ptr = gwi_class_ini(gwi, "Ptr<~A]", "@Ptr"); + const Type t_ptr = gwi_class_ini(gwi, "Ptr<[A]", "@Ptr"); gwi->gwion->type[et_ptr] = t_ptr; GWI_BB(gwi_item_ini(gwi, "@internal", "@val")) GWI_BB(gwi_item_end(gwi, 0, NULL)) diff --git a/src/lib/shred.c b/src/lib/shred.c index 6470e0be..13606b5b 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -403,7 +403,7 @@ GWION_IMPORT(shred) { GWI_BB(gwi_class_end(gwi)) SET_FLAG((t_fork), abstract); - const Type t_typed = gwi_class_ini(gwi, "TypedFork<~A]", "Fork"); + const Type t_typed = gwi_class_ini(gwi, "TypedFork<[A]", "Fork"); gwi_item_ini(gwi, "A", "retval"); GWI_BB((gwi_item_end(gwi, ae_flag_const, NULL))) GWI_BB(gwi_class_end(gwi)) diff --git a/src/parse/check.c b/src/parse/check.c index f3ec8508..f2821824 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -704,7 +704,7 @@ ANN static Func get_template_func(const Env env, const Exp_Call* func, const Val assert(exp_self(func)); ERR_O(exp_self(func)->pos, _("function is template. automatic type guess not fully implemented yet.\n" - " please provide template types. eg: '<~type1, type2, ...]'")) + " please provide template types. eg: '<[type1, type2, ...]'")) } ANN static Func predefined_func(const Env env, const Value v, diff --git a/tests/bug/Tester.gw b/tests/bug/Tester.gw index 9543fe41..32820228 100644 --- a/tests/bug/Tester.gw +++ b/tests/bug/Tester.gw @@ -1,7 +1,7 @@ class Tester { - fun int assert_equal<~A](string description, A a, A b){ if(a == b) return 0; return 1; } - fun int assert_not_equal<~A](string description, A a, A b){ if(a != b) return 0; return 1; } + fun int assert_equal<[A](string description, A a, A b){ if(a == b) return 0; return 1; } + fun int assert_not_equal<[A](string description, A a, A b){ if(a != b) return 0; return 1; } } var Tester t; diff --git a/tests/error/call_non_template.gw b/tests/error/call_non_template.gw index 3f4fbc21..53d98116 100644 --- a/tests/error/call_non_template.gw +++ b/tests/error/call_non_template.gw @@ -1,3 +1,3 @@ #! [contains] template call of non-template function fun void test(){} -test<~int](); +test<[int](); diff --git a/tests/error/empty_ptr.gw b/tests/error/empty_ptr.gw index 355f7714..f00c1a23 100644 --- a/tests/error/empty_ptr.gw +++ b/tests/error/empty_ptr.gw @@ -1,3 +1,3 @@ #! [contains] EmptyPointerException -var Ptr<~int] t; +var Ptr<[int] t; <<< *t >>>; diff --git a/tests/error/invalid_pointer_cast.gw b/tests/error/invalid_pointer_cast.gw index 514ec198..831f2502 100644 --- a/tests/error/invalid_pointer_cast.gw +++ b/tests/error/invalid_pointer_cast.gw @@ -1,2 +1,2 @@ #! [contains] invalid pointer cast -<<< 1 $ Ptr<~Object] >>>; +<<< 1 $ Ptr<[Object] >>>; diff --git a/tests/error/non_function_template.gw b/tests/error/non_function_template.gw index 532b399a..dc97b69c 100644 --- a/tests/error/non_function_template.gw +++ b/tests/error/non_function_template.gw @@ -1,3 +1,3 @@ #! [contains] template call of non-function value var int test; -test<~int](); +test<[int](); diff --git a/tests/error/ptr_assign_const.gw b/tests/error/ptr_assign_const.gw index 8242be5a..998d8724 100644 --- a/tests/error/ptr_assign_const.gw +++ b/tests/error/ptr_assign_const.gw @@ -1 +1 @@ -1 :=> var Ptr<~int] pd; +1 :=> var Ptr<[int] pd; diff --git a/tests/error/ptr_assign_invalid.gw b/tests/error/ptr_assign_invalid.gw index b6199792..fcc6da2d 100644 --- a/tests/error/ptr_assign_invalid.gw +++ b/tests/error/ptr_assign_invalid.gw @@ -3,4 +3,4 @@ class C {} class D extends C {} var D d; -d :=> var Ptr<~int] pd; +d :=> var Ptr<[int] pd; diff --git a/tests/error/ptr_from_const.gw b/tests/error/ptr_from_const.gw index 6210cec9..1d30894c 100644 --- a/tests/error/ptr_from_const.gw +++ b/tests/error/ptr_from_const.gw @@ -1 +1 @@ -1 :=> var Ptr<~int] i; +1 :=> var Ptr<[int] i; diff --git a/tests/error/ptr_implicit_const.gw b/tests/error/ptr_implicit_const.gw index 8d2f737a..4c940a29 100644 --- a/tests/error/ptr_implicit_const.gw +++ b/tests/error/ptr_implicit_const.gw @@ -1,3 +1,3 @@ #! [contains] can't cast non-mutable value to Ptr -fun void test(Ptr<~int] i) { <<< *i>>>; } +fun void test(Ptr<[int] i) { <<< *i>>>; } 1 => test; diff --git a/tests/error/template_class_no_type.gw b/tests/error/template_class_no_type.gw index fee35e0f..4e77515b 100644 --- a/tests/error/template_class_no_type.gw +++ b/tests/error/template_class_no_type.gw @@ -1,5 +1,5 @@ #! [contains] you must provide template types -class C<~A] { +class C<[A] { var A a; } diff --git a/tests/error/template_dyn2.gw b/tests/error/template_dyn2.gw index 2ae3194c..6d9e82fd 100644 --- a/tests/error/template_dyn2.gw +++ b/tests/error/template_dyn2.gw @@ -5,15 +5,15 @@ fun void test(C cc, int i) { <<< 1 >>>; <<< cc.test(i, i) >>>; } class C { - fun int test<~A](A a) { <<< " A ", a >>>; } - fun int test<~A](A a, int i) { <<< " ", a >>>; } - fun int test<~A](A a, int i, int j) { <<< a >>>; } + fun int test<[A](A a) { <<< " A ", a >>>; } + fun int test<[A](A a, int i) { <<< " ", a >>>; } + fun int test<[A](A a, int i, int j) { <<< a >>>; } } class D extends C { - fun int test<~A](A a, int i) { <<< this, " extent ", a, __func__ >>>; } + fun int test<[A](A a, int i) { <<< this, " extent ", a, __func__ >>>; } } class E extends D { - fun int test<~A](A a, int i) { <<< this, " Extent ", a, _func__ >>>; } + fun int test<[A](A a, int i) { <<< this, " Extent ", a, _func__ >>>; } } diff --git a/tests/error/template_enough.gw b/tests/error/template_enough.gw index 58f7e56f..243a27ec 100644 --- a/tests/error/template_enough.gw +++ b/tests/error/template_enough.gw @@ -1,3 +1,3 @@ #! [contains] -fun void test<~A,B](){} +fun void test<[A,B](){} test(); diff --git a/tests/error/template_n_mismatch.gw b/tests/error/template_n_mismatch.gw index 2bd8bc51..b9f7ea44 100644 --- a/tests/error/template_n_mismatch.gw +++ b/tests/error/template_n_mismatch.gw @@ -1,6 +1,6 @@ #! [contains] arguments do not match for template call -fun void test<~A](){ <<< "func" >>>;} -fun void test<~A](int i){<<< "other func" >>>;} +fun void test<[A](){ <<< "func" >>>;} +fun void test<[A](int i){<<< "other func" >>>;} -test<~int, float, int](); -#!test<~int](); +test<[int, float, int](); +#!test<[int](); diff --git a/tests/error/template_no_match.gw b/tests/error/template_no_match.gw index 0c08e70e..64ad2a81 100644 --- a/tests/error/template_no_match.gw +++ b/tests/error/template_no_match.gw @@ -1,8 +1,8 @@ #! [contains] arguments do not match for template call class C { - fun void test<~A](float f) {} - fun void test<~A]() {} + fun void test<[A](float f) {} + fun void test<[A]() {} } var C c; -c.test<~int](2.3); -c.test<~int](2.3, 2.3); +c.test<[int](2.3); +c.test<[int](2.3, 2.3); diff --git a/tests/error/template_non_member.gw b/tests/error/template_non_member.gw index 022789d2..7c1fb564 100644 --- a/tests/error/template_non_member.gw +++ b/tests/error/template_non_member.gw @@ -1,2 +1,2 @@ #! [contains] -Math.rand<~int](); +Math.rand<[int](); diff --git a/tests/error/template_not_able.gw b/tests/error/template_not_able.gw index 62c98fec..8047b213 100644 --- a/tests/error/template_not_able.gw +++ b/tests/error/template_not_able.gw @@ -1,3 +1,3 @@ #! [contains] not able to guess types for template call -fun void test<~A,B](A a) {} +fun void test<[A,B](A a) {} test(1); diff --git a/tests/error/template_overload.gw b/tests/error/template_overload.gw index 3963711a..4247b7dd 100644 --- a/tests/error/template_overload.gw +++ b/tests/error/template_overload.gw @@ -1,3 +1,3 @@ #! [contains] must overload template function with template -fun void test<~A](int i){} +fun void test<[A](int i){} fun void test(int i, float f){} diff --git a/tests/error/template_ternary.gw b/tests/error/template_ternary.gw index cf3cb59d..f5c5384b 100644 --- a/tests/error/template_ternary.gw +++ b/tests/error/template_ternary.gw @@ -1,4 +1,4 @@ #! [contains] invalid expression for function call -fun void test<~A](A a){} +fun void test<[A](A a){} (maybe ? test : test)(1); diff --git a/tests/error/template_unknown.gw b/tests/error/template_unknown.gw index 53057e2c..30b6a684 100644 --- a/tests/error/template_unknown.gw +++ b/tests/error/template_unknown.gw @@ -1,4 +1,4 @@ #! [contains] unknown type -fun void my_function<~A]() { <<< "test" >>>; } +fun void my_function<[A]() { <<< "test" >>>; } -my_function<~unknown_type](); +my_function<[unknown_type](); diff --git a/tests/error/type_not_template.gw b/tests/error/type_not_template.gw index 6e4c17ce..dd30ecf6 100644 --- a/tests/error/type_not_template.gw +++ b/tests/error/type_not_template.gw @@ -1,2 +1,2 @@ #! [contains] is not template -var Object<~int] o; +var Object<[int] o; diff --git a/tests/error/typedef_func_tmpl_types.gw b/tests/error/typedef_func_tmpl_types.gw index eac690d1..10bec2e9 100644 --- a/tests/error/typedef_func_tmpl_types.gw +++ b/tests/error/typedef_func_tmpl_types.gw @@ -1,15 +1,15 @@ #! [contains] pre-defined types -typedef void t_ptr<~A](); +typedef void t_ptr<[A](); -var t_ptr<~int] iptr; +var t_ptr<[int] iptr; -fun void test<~A]() { +fun void test<[A]() { var A a; <<< __func__, " ", a>>>; } test @=> iptr; <<< iptr() >>>; -<<< iptr<~int]() >>>; -<<< iptr<~float]() >>>; -<<< iptr<~Object]() >>>; +<<< iptr<[int]() >>>; +<<< iptr<[float]() >>>; +<<< iptr<[Object]() >>>; diff --git a/tests/error/typedef_func_tmpl_types2.gw b/tests/error/typedef_func_tmpl_types2.gw index b6048595..7fad8985 100644 --- a/tests/error/typedef_func_tmpl_types2.gw +++ b/tests/error/typedef_func_tmpl_types2.gw @@ -1,11 +1,11 @@ #! [contains] pre-defined types -typedef void t_ptr<~A](); -typedef t_ptr<~int] B; +typedef void t_ptr<[A](); +typedef t_ptr<[int] B; -fun void test<~A]() { +fun void test<[A]() { <<< __func__ >>>; } test @=> var B b; <<< b() >>>; -<<< b<~int]() >>>; +<<< b<[int]() >>>; diff --git a/tests/fork/fork_call.gw b/tests/fork/fork_call.gw index 37cdb045..abf5b351 100644 --- a/tests/fork/fork_call.gw +++ b/tests/fork/fork_call.gw @@ -2,7 +2,7 @@ fun int test() { return 12; } -fork test() @=> ref TypedFork<~int] sh; +fork test() @=> ref TypedFork<[int] sh; <<< typeof(sh) >>>; sh.ev => now; <<< sh.retval >>>; diff --git a/tests/fptr/fptr_tmpl_cast.gw b/tests/fptr/fptr_tmpl_cast.gw index 325e407f..778231db 100644 --- a/tests/fptr/fptr_tmpl_cast.gw +++ b/tests/fptr/fptr_tmpl_cast.gw @@ -1,5 +1,5 @@ class C { - typedef void ptr_t<~A](); - fun void test<~A]() {} + typedef void ptr_t<[A](); + fun void test<[A]() {} test $ ptr_t; } diff --git a/tests/import/class_template.c b/tests/import/class_template.c index 9cd61bc9..d52811a7 100644 --- a/tests/import/class_template.c +++ b/tests/import/class_template.c @@ -25,17 +25,17 @@ static CTOR(class_template_ctor) { } GWION_IMPORT(class_template) { - GWI_OB(gwi_class_ini(gwi, "<~A,B]ClassTemplate", NULL)) + GWI_OB(gwi_class_ini(gwi, "<[A,B]ClassTemplate", NULL)) gwi_class_xtor(gwi, class_template_ctor, NULL); GWI_BB(gwi_item_ini(gwi, "A[]", "key")) GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL))) GWI_BB(gwi_item_ini(gwi, "B[]", "value")) GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, NULL))) - GWI_BB(gwi_func_ini(gwi, "int", "<~C,D]test")) + GWI_BB(gwi_func_ini(gwi, "int", "<[C,D]test")) GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) GWI_BB(gwi_class_end(gwi)) - GWI_BB(gwi_item_ini(gwi, "<~<~int]Ptr,int[]]ClassTemplate", "testObject")) + GWI_BB(gwi_item_ini(gwi, "<[<[int]Ptr,int[]]ClassTemplate", "testObject")) GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL)) return GW_OK; } diff --git a/tests/import/class_template.gw b/tests/import/class_template.gw index de484b22..17a85b24 100644 --- a/tests/import/class_template.gw +++ b/tests/import/class_template.gw @@ -1,2 +1,2 @@ -var ClassTemplate<~int, int] ct; +var ClassTemplate<[int, int] ct; <<< ct.key >>>; diff --git a/tests/import/class_template_fail.c b/tests/import/class_template_fail.c index bc69736d..1b79d17f 100644 --- a/tests/import/class_template_fail.c +++ b/tests/import/class_template_fail.c @@ -10,7 +10,7 @@ #include "gwi.h" GWION_IMPORT(class_template_fail) { - GWI_OB(gwi_class_ini(gwi, "<~A,B]ClassTemplate", NULL)) + GWI_OB(gwi_class_ini(gwi, "<[A,B]ClassTemplate", NULL)) GWI_BB(gwi_func_ini(gwi, "int", "test")) GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) GWI_BB(gwi_class_end(gwi)) diff --git a/tests/import/class_template_invalid.c b/tests/import/class_template_invalid.c index 34c30e6d..d99513c2 100644 --- a/tests/import/class_template_invalid.c +++ b/tests/import/class_template_invalid.c @@ -15,16 +15,16 @@ static m_int o_map_value; #define MAP_VAL(a) *((M_Object*)(a->data + o_map_value)) GWION_IMPORT(class_template) { - GWI_OB(gwi_class_ini(gwi, "ClassTemplate<~A,B]", NULL)) + GWI_OB(gwi_class_ini(gwi, "ClassTemplate<[A,B]", NULL)) GWI_BB(gwi_item_ini(gwi, "A[]", "key")) GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL))) GWI_BB(gwi_item_ini(gwi, "B[]", "value")) GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, NULL))) - GWI_BB(gwi_func_ini(gwi, "int", "test<~C,D]")) + GWI_BB(gwi_func_ini(gwi, "int", "test<[C,D]")) GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) GWI_BB(gwi_class_end(gwi)) - GWI_BB(gwi_item_ini(gwi, "ClassTemplate<~<~int]Ptr,int[]]", "testObject")) + GWI_BB(gwi_item_ini(gwi, "ClassTemplate<[<[int]Ptr,int[]]", "testObject")) GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL)) return GW_OK; } diff --git a/tests/import/fptr_tmpl.c b/tests/import/fptr_tmpl.c index c43a7576..ad8170ba 100644 --- a/tests/import/fptr_tmpl.c +++ b/tests/import/fptr_tmpl.c @@ -11,7 +11,7 @@ GWION_IMPORT(typedef_test) { Type t_func_typedef; GWI_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT , NULL))) - GWI_BB(gwi_fptr_ini(gwi, "int", "test<~test]")) + GWI_BB(gwi_fptr_ini(gwi, "int", "test<[test]")) GWI_OB(gwi_fptr_end(gwi, 0)) return GW_OK; } diff --git a/tests/import/fptr_tmpl_fail.c b/tests/import/fptr_tmpl_fail.c index 615638c6..c933e51d 100644 --- a/tests/import/fptr_tmpl_fail.c +++ b/tests/import/fptr_tmpl_fail.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(typedef_test) { - GWI_BB(gwi_fptr_ini(gwi, "int~", "test<~A]")) + GWI_BB(gwi_fptr_ini(gwi, "int~", "test<[A]")) GWI_OB(gwi_fptr_end(gwi, 0)) return GW_OK; } diff --git a/tests/import/func_fail2.c b/tests/import/func_fail2.c index e58a38ed..f7ac835a 100644 --- a/tests/import/func_fail2.c +++ b/tests/import/func_fail2.c @@ -10,7 +10,7 @@ #include "instr.h" GWION_IMPORT(too_many_args) { - GWI_BB(gwi_func_ini(gwi, "<~int]Ptr", "test")) + GWI_BB(gwi_func_ini(gwi, "<[int]Ptr", "test")) GWI_BB(gwi_func_arg(gwi, "int", "i[][]")) GWI_BB(gwi_func_arg(gwi, "int", "me")) GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) diff --git a/tests/import/func_fail3.c b/tests/import/func_fail3.c index c7e7b294..0a260a48 100644 --- a/tests/import/func_fail3.c +++ b/tests/import/func_fail3.c @@ -10,7 +10,7 @@ #include "instr.h" GWION_IMPORT(too_many_args) { - GWI_BB(gwi_func_ini(gwi, "Ptr<~int]", "test<~A]")) + GWI_BB(gwi_func_ini(gwi, "Ptr<[int]", "test<[A]")) GWI_BB(gwi_func_ini(gwi, "int", "test")) GWI_BB(gwi_func_arg(gwi, "int", "i[][]")) GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) diff --git a/tests/import/func_fail4.c b/tests/import/func_fail4.c index 2a57fcfc..c7db6f12 100644 --- a/tests/import/func_fail4.c +++ b/tests/import/func_fail4.c @@ -10,7 +10,7 @@ #include "instr.h" GWION_IMPORT(too_many_args) { - GWI_BB(gwi_func_ini(gwi, "Ptr<~int]", "test<~A]")) + GWI_BB(gwi_func_ini(gwi, "Ptr<[int]", "test<[A]")) GWI_BB(gwi_func_arg(gwi, "int", "i[][]")) GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL)) return GW_OK; diff --git a/tests/import/func_tmpl.c b/tests/import/func_tmpl.c index 0d3ce57c..eb0aa9c2 100644 --- a/tests/import/func_tmpl.c +++ b/tests/import/func_tmpl.c @@ -14,7 +14,7 @@ static SFUN(func_tmpl_xfun) { } GWION_IMPORT(func_tmpl) { - GWI_BB(gwi_func_ini(gwi, "int[]", "test<~A]")) + GWI_BB(gwi_func_ini(gwi, "int[]", "test<[A]")) GWI_BB(gwi_func_arg(gwi, "A", "i")) GWI_BB(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none)) return GW_OK; diff --git a/tests/import/func_tmpl.gw b/tests/import/func_tmpl.gw index e197f4d3..de01ac33 100644 --- a/tests/import/func_tmpl.gw +++ b/tests/import/func_tmpl.gw @@ -1,2 +1,2 @@ -test<~int](1); +test<[int](1); test(1); diff --git a/tests/import/func_tmpl_fail.c b/tests/import/func_tmpl_fail.c index af683b11..0096a1e3 100644 --- a/tests/import/func_tmpl_fail.c +++ b/tests/import/func_tmpl_fail.c @@ -14,7 +14,7 @@ static SFUN(func_tmpl_xfun) { } GWION_IMPORT(func_tmpl) { - GWI_BB(gwi_func_ini(gwi, "voit", "test<~A]")) + GWI_BB(gwi_func_ini(gwi, "voit", "test<[A]")) GWI_BB(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none)) return GW_OK; } diff --git a/tests/import/invalid_names.c b/tests/import/invalid_names.c index 71555bd2..1340149c 100644 --- a/tests/import/invalid_names.c +++ b/tests/import/invalid_names.c @@ -22,7 +22,7 @@ GWION_IMPORT(trig) { const Type t2 = gwi_mk_type(gwi, "T", SZ_INT, NULL); gwi_add_type(gwi, t2); - const Type t3 = gwi_mk_type(gwi, "T<~a]", SZ_INT, NULL); + const Type t3 = gwi_mk_type(gwi, "T<[a]", SZ_INT, NULL); gwi_add_type(gwi, t3); return GW_OK; diff --git a/tests/import/invalid_names3.c b/tests/import/invalid_names3.c index e341b701..159640a9 100644 --- a/tests/import/invalid_names3.c +++ b/tests/import/invalid_names3.c @@ -13,6 +13,6 @@ #include "gwi.h" GWION_IMPORT(trig) { - DECL_OB(const Type, t0, = gwi_mk_type(gwi, "T<~a]", SZ_INT, NULL)) + DECL_OB(const Type, t0, = gwi_mk_type(gwi, "T<[a]", SZ_INT, NULL)) return gwi_add_type(gwi, t0); } diff --git a/tests/import/map2.gw b/tests/import/map2.gw index 646fb509..f6f40abd 100644 --- a/tests/import/map2.gw +++ b/tests/import/map2.gw @@ -1,4 +1,4 @@ -var Map<~int, float] pp; +var Map<[int, float] pp; <<< pp >>>; <<< pp.size() >>>; <<< pp.set(1, 2) >>>; diff --git a/tests/import/typedef_fail.c b/tests/import/typedef_fail.c index 07110b16..78bb00f7 100644 --- a/tests/import/typedef_fail.c +++ b/tests/import/typedef_fail.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(typedef_test) { - GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<~A]")) - GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<~A]")) + GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<[A]")) + GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<[A]")) return GW_OK; } diff --git a/tests/import/typedef_tmpl.c b/tests/import/typedef_tmpl.c index 68bb50b7..91e36b81 100644 --- a/tests/import/typedef_tmpl.c +++ b/tests/import/typedef_tmpl.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(typedef_test) { - GWI_BB(gwi_typedef_ini(gwi, "Ptr<~A]", "Typedef<~A]")) + GWI_BB(gwi_typedef_ini(gwi, "Ptr<[A]", "Typedef<[A]")) GWI_OB(gwi_typedef_end(gwi, ae_flag_none)) return GW_OK; } diff --git a/tests/import/union_tmpl.c b/tests/import/union_tmpl.c index ebe75a33..95208de4 100644 --- a/tests/import/union_tmpl.c +++ b/tests/import/union_tmpl.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(union_test) { - GWI_BB(gwi_union_ini(gwi, "U<~A]", NULL)) + GWI_BB(gwi_union_ini(gwi, "U<[A]", NULL)) GWI_BB(gwi_union_add(gwi,"float", "f")) GWI_BB(gwi_union_add(gwi,"int", "i")) GWI_BB(gwi_union_add(gwi,"A", "a")) diff --git a/tests/import/union_tmpl.gw b/tests/import/union_tmpl.gw index 145a65ce..a8c2dc1a 100644 --- a/tests/import/union_tmpl.gw +++ b/tests/import/union_tmpl.gw @@ -1,2 +1,2 @@ -<<< var U<~Event] u>>>; +<<< var U<[Event] u>>>; <<< u.a >>>; diff --git a/tests/import/union_tmpl_fail.c b/tests/import/union_tmpl_fail.c index ed39fe50..1533c1ea 100644 --- a/tests/import/union_tmpl_fail.c +++ b/tests/import/union_tmpl_fail.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(union_test) { - GWI_BB(gwi_union_ini(gwi, "U<~A]", "My")) + GWI_BB(gwi_union_ini(gwi, "U<[A]", "My")) GWI_BB(gwi_union_add(gwi,"float", "f")) GWI_BB(gwi_union_add(gwi,"int", "i")) GWI_BB(gwi_union_add(gwi,"A", "a")) diff --git a/tests/import/union_tmpl_fail2.c b/tests/import/union_tmpl_fail2.c index aa445b2d..f5377937 100644 --- a/tests/import/union_tmpl_fail2.c +++ b/tests/import/union_tmpl_fail2.c @@ -9,11 +9,11 @@ #include "import.h" GWION_IMPORT(union_test) { - GWI_BB(gwi_union_ini(gwi, "U<~A]", NULL)) + GWI_BB(gwi_union_ini(gwi, "U<[A]", NULL)) GWI_BB(gwi_union_add(gwi,"float", "f")) GWI_BB(gwi_union_add(gwi,"int", "i")) GWI_BB(gwi_union_add(gwi,"A", "a")) - GWI_BB(gwi_union_ini(gwi, "U<~A]", NULL)) + GWI_BB(gwi_union_ini(gwi, "U<[A]", NULL)) GWI_OB(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/import/union_tmpl_fail3.c b/tests/import/union_tmpl_fail3.c index 69c3cd87..2973eff2 100644 --- a/tests/import/union_tmpl_fail3.c +++ b/tests/import/union_tmpl_fail3.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(union_test) { - GWI_BB(gwi_union_ini(gwi, "U<~A]", "Test")) + GWI_BB(gwi_union_ini(gwi, "U<[A]", "Test")) GWI_BB(gwi_union_add(gwi,"float", "f")) GWI_BB(gwi_union_add(gwi,"int", "i")) GWI_BB(gwi_union_add(gwi,"A", "a")) diff --git a/tests/new/dottmpl.gw b/tests/new/dottmpl.gw index 46059e84..1ec515e0 100644 --- a/tests/new/dottmpl.gw +++ b/tests/new/dottmpl.gw @@ -1,5 +1,5 @@ class C { - fun void test<~A](A a) { <<< a >>>; } + fun void test<[A](A a) { <<< a >>>; } } class D extends C {} diff --git a/tests/new/dtor.gw b/tests/new/dtor.gw index 994ef812..ff2aa6ff 100644 --- a/tests/new/dtor.gw +++ b/tests/new/dtor.gw @@ -1,10 +1,10 @@ -class C<~A] { +class C<[A] { operator @dtor void () { <<< __func__ >>>; } } -class D<~A] extends C<~A] { +class D<[A] extends C<[A] { operator @dtor void () { <<< __func__ >>>; } } -class E extends D<~int] { +class E extends D<[int] { operator @dtor void () { <<< __func__ >>>; } } diff --git a/tests/new/extend_template_union.gw b/tests/new/extend_template_union.gw index 86a28d10..01062dd9 100644 --- a/tests/new/extend_template_union.gw +++ b/tests/new/extend_template_union.gw @@ -1,25 +1,25 @@ -union U<~A] { +union U<[A] { A a; int i; }; -class C<~A] extends U<~A] { +class C<[A] extends U<[A] { fun void test() { <<< this >>>; } operator @dtor void () { <<< __func__ >>>; } } -var C<~float] c; +var C<[float] c; <<< c >>>; <<< c.test() >>>; <<< c.i >>>; -class D<~A,B] extends C<~float] { +class D<[A,B] extends C<[float] { } -var D<~int,int] d; -class E<~A,B] extends D<~float,B] { +var D<[int,int] d; +class E<[A,B] extends D<[float,B] { } -var E<~int,int] e; +var E<[int,int] e; diff --git a/tests/new/parent.gw b/tests/new/parent.gw index 7a7a9540..8b942f4b 100644 --- a/tests/new/parent.gw +++ b/tests/new/parent.gw @@ -1,14 +1,14 @@ class B { } -class C<~A] extends B { +class C<[A] extends B { } -class D<~A,B] extends C<~A] { - class Child<~A] { +class D<[A,B] extends C<[A] { + class Child<[A] { var A a; } - var Child<~A] child; + var Child<[A] child; } -var D<~int] d; +var D<[int] d; diff --git a/tests/new/pure.gw b/tests/new/pure.gw index eb6ed66d..768ad80e 100644 --- a/tests/new/pure.gw +++ b/tests/new/pure.gw @@ -1,4 +1,4 @@ -fun A pure<~A](A i) { return i; } +fun A pure<[A](A i) { return i; } <<< 2 => pure >>>; <<< 2 => pure >>>; <<< 3 => pure >>>; diff --git a/tests/new/pure_member.gw b/tests/new/pure_member.gw index ddd7fdd6..97b28985 100644 --- a/tests/new/pure_member.gw +++ b/tests/new/pure_member.gw @@ -1,5 +1,5 @@ class C { - fun A pure<~A](A i) { + fun A pure<[A](A i) { return i; } <<< 2 => pure >>>; diff --git a/tests/new/recursive_template.gw b/tests/new/recursive_template.gw index a2cd8a45..6ec6a78d 100644 --- a/tests/new/recursive_template.gw +++ b/tests/new/recursive_template.gw @@ -1,8 +1,8 @@ -fun void test<~A](int i, A a) { +fun void test<[A](int i, A a) { var A b; <<< __func__, " ", a >>>; <<< i, " ", a >>>; if(i) - test<~int]((i-2, b$int)); + test<[int]((i-2, b$int)); } -test<~float](2, 2); +test<[float](2, 2); diff --git a/tests/new/recursive_template0.gw b/tests/new/recursive_template0.gw index 6f4db423..037b7cc0 100644 --- a/tests/new/recursive_template0.gw +++ b/tests/new/recursive_template0.gw @@ -1,8 +1,8 @@ -fun void test<~A](int i) { +fun void test<[A](int i) { var A a; <<< a >>>; <<< __func__, " ", i, " ", a >>>; if(i) - test<~float]((i-2)); + test<[float]((i-2)); } -test<~float](2); +test<[float](2); diff --git a/tests/new/recursive_template1.gw b/tests/new/recursive_template1.gw index 7d117e38..cdc88c9f 100644 --- a/tests/new/recursive_template1.gw +++ b/tests/new/recursive_template1.gw @@ -1,7 +1,7 @@ -fun void test<~A](int i) { +fun void test<[A](int i) { var A a; <<< a >>>; if(i) - test<~float]((i-2)); + test<[float]((i-2)); } -test<~Object](2); +test<[Object](2); diff --git a/tests/new/recursive_template2.gw b/tests/new/recursive_template2.gw index d2d81cc3..7f6b8924 100644 --- a/tests/new/recursive_template2.gw +++ b/tests/new/recursive_template2.gw @@ -1,8 +1,8 @@ -fun void test<~A](A i) { +fun void test<[A](A i) { var A a; <<< a , " ", __func__>>>; <<< i, " ", a >>>; if(i > 0) test(i-2.0); } -test<~int](2); +test<[int](2); diff --git a/tests/new/recursive_template3.gw b/tests/new/recursive_template3.gw index c4daa96a..de5fd67a 100644 --- a/tests/new/recursive_template3.gw +++ b/tests/new/recursive_template3.gw @@ -1,4 +1,4 @@ -fun void test<~A](A i) { +fun void test<[A](A i) { var A a; <<< a >>>; <<< i, " ", a, " ", i > 1 >>>; diff --git a/tests/new/recursive_template_test.gw b/tests/new/recursive_template_test.gw index e9979758..84f91766 100644 --- a/tests/new/recursive_template_test.gw +++ b/tests/new/recursive_template_test.gw @@ -1,6 +1,6 @@ -fun void test<~A](int i) { +fun void test<[A](int i) { <<< __func__ >>>; <<< 1 >>>; } -test<~int](1); +test<[int](1); diff --git a/tests/new/static_tmpl2.gw b/tests/new/static_tmpl2.gw index 47413b3f..e9ea5b68 100644 --- a/tests/new/static_tmpl2.gw +++ b/tests/new/static_tmpl2.gw @@ -3,4 +3,4 @@ class D extends C { } var D d; <<< d >>>; -<<< d.t<~int]() >>>; +<<< d.t<[int]() >>>; diff --git a/tests/new/template_class_in_template.gw b/tests/new/template_class_in_template.gw index 68895230..324c0c06 100644 --- a/tests/new/template_class_in_template.gw +++ b/tests/new/template_class_in_template.gw @@ -1,8 +1,8 @@ -class Parent<~A] { - class C<~B] { +class Parent<[A] { + class C<[B] { 12 => var A a; 13 => var B B; } } -var Parent.C<~int, int] c; +var Parent.C<[int, int] c; <<< c.a >>>; diff --git a/tests/new/template_dyn.gw b/tests/new/template_dyn.gw index 192c794b..aabab6c9 100644 --- a/tests/new/template_dyn.gw +++ b/tests/new/template_dyn.gw @@ -1,13 +1,13 @@ class C { - fun int test<~A](A a) { <<< " A ", a >>>; } - fun int test<~A](A a, int i) { <<< " A ", a, " ", __func__ >>>; } - fun int test<~A](A a, int i, int j) { <<< a >>>; } + fun int test<[A](A a) { <<< " A ", a >>>; } + fun int test<[A](A a, int i) { <<< " A ", a, " ", __func__ >>>; } + fun int test<[A](A a, int i, int j) { <<< a >>>; } } class D extends C { - fun int test<~A](A a, int i) { <<< this, " extent ", a, __func__ >>>; } + fun int test<[A](A a, int i) { <<< this, " extent ", a, __func__ >>>; } } class E extends D { - fun int test<~A](A a, int i) { <<< this, " Extent ", a, __func__ >>>; } + fun int test<[A](A a, int i) { <<< this, " Extent ", a, __func__ >>>; } } diff --git a/tests/new/test.gw b/tests/new/test.gw index f8668643..dcce4fa8 100644 --- a/tests/new/test.gw +++ b/tests/new/test.gw @@ -1,6 +1,6 @@ class C { - typedef static void func_t<~A](A a); - fun static void myfunc<~A](A a) { <<< a >>>; } + typedef static void func_t<[A](A a); + fun static void myfunc<[A](A a) { <<< a >>>; } myfunc @=> var static func_t ptr; ptr(1); } diff --git a/tests/new/test2.gw b/tests/new/test2.gw index 01748a62..65ef15ef 100644 --- a/tests/new/test2.gw +++ b/tests/new/test2.gw @@ -1,8 +1,8 @@ -class C<~A] { - typedef static void func_t<~A](A a); - fun static void myfunc<~A](A a) { <<< a >>>; } +class C<[A] { + typedef static void func_t<[A](A a); + fun static void myfunc<[A](A a) { <<< a >>>; } myfunc @=> var static func_t ptr; ptr(1); } -var C<~int] c; +var C<[int] c; diff --git a/tests/new/typedef_func_tmpl_class.gw b/tests/new/typedef_func_tmpl_class.gw index 9d01d796..798cc7d1 100644 --- a/tests/new/typedef_func_tmpl_class.gw +++ b/tests/new/typedef_func_tmpl_class.gw @@ -1,9 +1,9 @@ class C { - typedef void t_ptr<~A](); + typedef void t_ptr<[A](); - var t_ptr<~int] iptr; + var t_ptr<[int] iptr; - fun void test<~A]() { + fun void test<[A]() { <<< this, " ", __func__ >>>; } diff --git a/tests/new/typedef_func_tmpl_class_static.gw b/tests/new/typedef_func_tmpl_class_static.gw index 0bd3e581..347a7f85 100644 --- a/tests/new/typedef_func_tmpl_class_static.gw +++ b/tests/new/typedef_func_tmpl_class_static.gw @@ -1,9 +1,9 @@ class C { - typedef static void t_ptr<~A](); + typedef static void t_ptr<[A](); - var t_ptr<~int] iptr; + var t_ptr<[int] iptr; - fun static void test<~A]() { + fun static void test<[A]() { <<< __func__ >>>; } diff --git a/tests/new/typedef_func_tmpl_err.gw b/tests/new/typedef_func_tmpl_err.gw index d456c84d..dbf92dc2 100644 --- a/tests/new/typedef_func_tmpl_err.gw +++ b/tests/new/typedef_func_tmpl_err.gw @@ -1,10 +1,10 @@ -typedef void t_ptr<~A](); +typedef void t_ptr<[A](); var t_ptr ptr; -fun void test<~A]() { +fun void test<[A]() { <<< __func_ >>>; } test @=> ptr; -ptr<~int](); +ptr<[int](); diff --git a/tests/new/typedef_func_tmpl_tmpl.gw b/tests/new/typedef_func_tmpl_tmpl.gw index 5e72cf3d..c3cc7cfb 100644 --- a/tests/new/typedef_func_tmpl_tmpl.gw +++ b/tests/new/typedef_func_tmpl_tmpl.gw @@ -1,2 +1,2 @@ -typedef void ptr_t<~A](myPtr ptr); -var ptr_t<~ Ptr<~A] ] t; +typedef void ptr_t<[A](myPtr ptr); +var ptr_t<[ Ptr<[A] ] t; diff --git a/tests/regression/invalid_template.gw b/tests/regression/invalid_template.gw index 099f00e9..b82e5c28 100644 --- a/tests/regression/invalid_template.gw +++ b/tests/regression/invalid_template.gw @@ -1,12 +1,12 @@ class B {} -class C<~A] extends B{} +class C<[A] extends B{} -class D<~A,B] extends C<~A] { - class E<~A] {} +class D<[A,B] extends C<[A] { + class E<[A] {} class G extends ld {A0I:} - var D<~A] d; + var D<[A] d; } -var D<~int] d; +var D<[int] d; diff --git a/tests/struct/struct_template.gw b/tests/struct/struct_template.gw index 9389e121..054e3749 100644 --- a/tests/struct/struct_template.gw +++ b/tests/struct/struct_template.gw @@ -1,10 +1,10 @@ -struct S<~A] { +struct S<[A] { var A a0; var A a1; } -var D<~int] si; -var D<~float] sf; +var D<[int] si; +var D<[float] sf; <<< si.a0 >>>; <<< sf.a0 >>>; diff --git a/tests/tree/auto_ptr.gw b/tests/tree/auto_ptr.gw index 9162990e..c9889e48 100644 --- a/tests/tree/auto_ptr.gw +++ b/tests/tree/auto_ptr.gw @@ -1,4 +1,4 @@ -var Ptr<~int] ptr; +var Ptr<[int] ptr; var int i[4]; foreach(ref a : i) <<< *a >>>; diff --git a/tests/tree/call_nonnull.gw b/tests/tree/call_nonnull.gw index ffd26566..66d621d3 100644 --- a/tests/tree/call_nonnull.gw +++ b/tests/tree/call_nonnull.gw @@ -1,3 +1,3 @@ -typedef void test_t<~A](); +typedef void test_t<[A](); nonnull test_t t; -t<~int](); +t<[int](); diff --git a/tests/tree/class_not_template_inside_template.gw b/tests/tree/class_not_template_inside_template.gw index 3683b2db..00fdecf8 100644 --- a/tests/tree/class_not_template_inside_template.gw +++ b/tests/tree/class_not_template_inside_template.gw @@ -1,7 +1,7 @@ -class C<~A] { +class C<[A] { class D { } } -var C.D<~int] d; +var C.D<[int] d; diff --git a/tests/tree/class_template.gw b/tests/tree/class_template.gw index 32a7dbac..3cbeb052 100644 --- a/tests/tree/class_template.gw +++ b/tests/tree/class_template.gw @@ -1,17 +1,17 @@ -class C<~A,B] { +class C<[A,B] { var A a; var B b; fun A test() { <<< "lol" >>>; } - fun void test2<~C](C o) { + fun void test2<[C](C o) { <<< o >>>; } } -var C<~int, int] c; -var C<~float, int] d; -var C<~Object, int] g; +var C<[int, int] c; +var C<[float, int] d; +var C<[Object, int] g; <<< c.a >>>; <<< d.a >>>; <<< c.test() >>>; diff --git a/tests/tree/cpy_ast.gw b/tests/tree/cpy_ast.gw index 2dd2e143..c95dd2c4 100644 --- a/tests/tree/cpy_ast.gw +++ b/tests/tree/cpy_ast.gw @@ -1,4 +1,4 @@ -class C<~A] { +class C<[A] { \a{}; [ 1 ]; var int i,j; @@ -9,7 +9,7 @@ class C<~A] { i ? i : !i; ++i; union { int ui; } u; - union U<~A] { int ui; }; + union U<[A] { int ui; }; typeof(i); if(i) i; else i; for(var int _i; _i < 1; ++_i); @@ -30,4 +30,4 @@ class C<~A] { while(0){ <<< __func__ >>>; } } -var C<~int] c; +var C<[int] c; diff --git a/tests/tree/extent_template.gw b/tests/tree/extent_template.gw index 630164f4..6fefe48a 100644 --- a/tests/tree/extent_template.gw +++ b/tests/tree/extent_template.gw @@ -1,8 +1,8 @@ -class C<~A] { +class C<[A] { var A a; } -class D extends C<~int] {} +class D extends C<[int] {} var D d; <<>>; diff --git a/tests/tree/get_type_name_test.gw b/tests/tree/get_type_name_test.gw index c20cdbd5..cb087261 100644 --- a/tests/tree/get_type_name_test.gw +++ b/tests/tree/get_type_name_test.gw @@ -1,4 +1,4 @@ -class C<~A, B] {} -class D<~A] {} -var C<~ D<~int], D<~int] ] c; +class C<[A, B] {} +class D<[A] {} +var C<[ D<[int], D<[int] ] c; <<< c >>>; diff --git a/tests/tree/static_template.gw b/tests/tree/static_template.gw index aeb6864d..35cb332f 100644 --- a/tests/tree/static_template.gw +++ b/tests/tree/static_template.gw @@ -1,9 +1,9 @@ -class C<~A] { +class C<[A] { var A a; } class D { - var static C<~int] c; + var static C<[int] c; } var D d; diff --git a/tests/tree/static_tmpl.gw b/tests/tree/static_tmpl.gw index a4eafd0d..6bc86483 100644 --- a/tests/tree/static_tmpl.gw +++ b/tests/tree/static_tmpl.gw @@ -1,14 +1,14 @@ class global StaticTmpl { - fun static void t<~A]() { <<< __func__ >>>; } + fun static void t<[A]() { <<< __func__ >>>; } } class D extends StaticTmpl { } fun void test(StaticTmpl c) { - StaticTmpl.t<~int](); + StaticTmpl.t<[int](); } #!D d; -#!d.t<~int](); +#!d.t<[int](); #!d => test; diff --git a/tests/tree/template_class_invalid_type_number.gw b/tests/tree/template_class_invalid_type_number.gw index e780ec10..bf9eae58 100644 --- a/tests/tree/template_class_invalid_type_number.gw +++ b/tests/tree/template_class_invalid_type_number.gw @@ -1,3 +1,3 @@ -class C<~A] {} +class C<[A] {} -var C<~int, float] c; +var C<[int, float] c; diff --git a/tests/tree/template_class_ref.gw b/tests/tree/template_class_ref.gw index 2c3317c3..068edf84 100644 --- a/tests/tree/template_class_ref.gw +++ b/tests/tree/template_class_ref.gw @@ -1,4 +1,4 @@ -class C<~A] {} +class C<[A] {} -var C<~int] c; +var C<[int] c; <<< c >>>; diff --git a/tests/tree/template_fptr.gw b/tests/tree/template_fptr.gw index f964e5cd..29c4fc09 100644 --- a/tests/tree/template_fptr.gw +++ b/tests/tree/template_fptr.gw @@ -1,9 +1,9 @@ -typedef int ptr_t<~A](A); +typedef int ptr_t<[A](A); var ptr_t ptr; <<>>; -fun int test<~A](A a) { <<< a >>>; } +fun int test<[A](A a) { <<< a >>>; } test @=> ptr; <<< ptr >>>; -ptr<~int](2); -ptr<~float](2.3); +ptr<[int](2); +ptr<[float](2.3); diff --git a/tests/tree/template_self.gw b/tests/tree/template_self.gw index be9d76c2..d1ec8de8 100644 --- a/tests/tree/template_self.gw +++ b/tests/tree/template_self.gw @@ -1,7 +1,7 @@ -class C<~A] { +class C<[A] { fun void test() { - var C<~A] c; + var C<[A] c; } } -var C<~int] c; +var C<[int] c; diff --git a/tests/tree/tmpl_fail_inner.gw b/tests/tree/tmpl_fail_inner.gw index b447f4ab..cbbff371 100644 --- a/tests/tree/tmpl_fail_inner.gw +++ b/tests/tree/tmpl_fail_inner.gw @@ -1,5 +1,5 @@ -fun void test<~A](int i) { - test<~A](2.3); +fun void test<[A](int i) { + test<[A](2.3); } -test<~int](3); +test<[int](3); diff --git a/tests/tree/typedef_func_tmpl.gw b/tests/tree/typedef_func_tmpl.gw index 13226a55..d6a059f8 100644 --- a/tests/tree/typedef_func_tmpl.gw +++ b/tests/tree/typedef_func_tmpl.gw @@ -1,9 +1,9 @@ -typedef void t_ptr<~A](); +typedef void t_ptr<[A](); -var t_ptr<~int] iptr; -var t_ptr<~float] fptr; +var t_ptr<[int] iptr; +var t_ptr<[float] fptr; -fun void test<~A]() { +fun void test<[A]() { <<< __func__ >>>; } diff --git a/tests/tree/typedef_func_tmpl2.gw b/tests/tree/typedef_func_tmpl2.gw index f6d6ee8d..7638b8df 100644 --- a/tests/tree/typedef_func_tmpl2.gw +++ b/tests/tree/typedef_func_tmpl2.gw @@ -1,9 +1,9 @@ -typedef void t_ptr<~A](); -fun void test<~A]() { +typedef void t_ptr<[A](); +fun void test<[A]() { <<< __func__ >>>; } -typedef t_ptr<~int] B; +typedef t_ptr<[int] B; var B b; <<< b >>>; test @=> b; @@ -12,7 +12,7 @@ test @=> b; <<< b() >>>; -typedef t_ptr<~float] C; +typedef t_ptr<[float] C; var C c; <<< c >>>; test @=> c; diff --git a/tests/tree/typedef_func_tmpl_class.gw b/tests/tree/typedef_func_tmpl_class.gw index 308ffc5d..2ff8af8e 100644 --- a/tests/tree/typedef_func_tmpl_class.gw +++ b/tests/tree/typedef_func_tmpl_class.gw @@ -1,9 +1,9 @@ class C { - typedef void t_ptr<~A](); + typedef void t_ptr<[A](); - var t_ptr<~int] iptr; + var t_ptr<[int] iptr; - fun void test<~A]() { + fun void test<[A]() { <<< this, " ", __func__ >>>; } diff --git a/tests/tree/union_tmpl.gw b/tests/tree/union_tmpl.gw index 2e5e7f28..4ca78690 100644 --- a/tests/tree/union_tmpl.gw +++ b/tests/tree/union_tmpl.gw @@ -1,7 +1,7 @@ -union U<~A]{ +union U<[A]{ int i; A a; }; -var U<~float] u; +var U<[float] u; <<< u.a >>>; -- 2.43.0