From: fennecdjay Date: Fri, 24 May 2019 09:23:26 +0000 (+0200) Subject: :art: Change template def definition X-Git-Tag: nightly~2445^2~8 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9c1c1375e34f1511d460a7bf1baa25cc8c0a59ba;p=gwion.git :art: Change template def definition --- diff --git a/ast b/ast index 66353d14..9c066c01 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 66353d14748fdb971a9414370918edaf12cb0245 +Subproject commit 9c066c017f339b4a00b0cd1beda732bd49194aaa diff --git a/examples/binary_tmpl.gw b/examples/binary_tmpl.gw index 34b11cc1..9b2a9107 100644 --- a/examples/binary_tmpl.gw +++ b/examples/binary_tmpl.gw @@ -1,4 +1,4 @@ -fun<~A~> void test(A a) { <<>>; } +fun void test<~A~>(A a) { <<>>; } 1 => test; 1.3 => test; test(1); diff --git a/examples/class_func_pointer.gw b/examples/class_func_pointer.gw index 5e79ffb4..937ba7ea 100644 --- a/examples/class_func_pointer.gw +++ b/examples/class_func_pointer.gw @@ -1,13 +1,13 @@ -function void test() { <<<"member function.">>>; } +fun void test() { <<<"member function.">>>; } class C { typedef void func_t(); // typedef static void s_func_t(); func_t func_p; // static fun c_t s_func_p; // static s_func_t s_ptr; - function void test() { <<<"member function.">>>; } - function void test2() { <<<"member function variant.">>>; } -// fun static void s_test() { <<<"member function.">>>; } + fun void test() { <<<"member function.">>>; } + fun void test2() { <<<"member function variant.">>>; } +// fun static void s_test() { <<<"member fun.">>>; } // test @=> func_p; // test @=> s_ptr; diff --git a/examples/class_spork_func.gw b/examples/class_spork_func.gw index e375e598..180fd4f1 100644 --- a/examples/class_spork_func.gw +++ b/examples/class_spork_func.gw @@ -1,6 +1,6 @@ class C { - function void test() { + fun void test() { <<<"here">>>; samp => now; <<<"and now">>>; diff --git a/examples/func.gw b/examples/func.gw index d8b70aa2..74f319f1 100644 --- a/examples/func.gw +++ b/examples/func.gw @@ -1,4 +1,4 @@ -function float testf(){ return 1.1; } -function float testf(float f){ return f; } +fun float testf(){ return 1.1; } +fun float testf(float f){ return f; } <<>>; <<>>; diff --git a/examples/func_pointer.gw b/examples/func_pointer.gw index 49600abc..6eb9d8f5 100644 --- a/examples/func_pointer.gw +++ b/examples/func_pointer.gw @@ -1,7 +1,7 @@ typedef void func_t(); func_t func_p; -function void test1() { <<<"test1">>>; } -function void test2() { <<<"test2">>>; } +fun void test1() { <<<"test1">>>; } +fun void test2() { <<<"test2">>>; } test1 @=> func_p; func_p(); func_p(); diff --git a/examples/func_ptr.gw b/examples/func_ptr.gw index a98de761..c0cb1da2 100644 --- a/examples/func_ptr.gw +++ b/examples/func_ptr.gw @@ -1,15 +1,15 @@ -// define a function pointer type +// define a fun pointer type typedef void Test() -// define a few functions -function void test1(){ <<<"test">>>; }; -function void test2(){ <<<"another test">>>; }; -function void test3(){ <<<"yet another test">>>; }; +// define a few funs +fun void test1(){ <<<"test">>>; }; +fun void test2(){ <<<"another test">>>; }; +fun void test3(){ <<<"yet another test">>>; }; -// create a function pointer instance +// create a fun pointer instance Test test; -// assign it a function +// assign it a fun test1 @=> test; // test it test(); diff --git a/examples/in_class_class.gw b/examples/in_class_class.gw index 3ef4deee..724b1296 100644 --- a/examples/in_class_class.gw +++ b/examples/in_class_class.gw @@ -1,5 +1,5 @@ class C { - function<~a~> void test(a var){ <<>>; } + fun void test<~a~>(a var){ <<>>; } class D { int i;} } diff --git a/examples/member.gw b/examples/member.gw index 8759dd05..f4be6565 100644 --- a/examples/member.gw +++ b/examples/member.gw @@ -7,19 +7,19 @@ class C Vec4 w; Object o; - function int m_i() { return i; } - function float m_f() { return f; } - function complex m_c() { return c; } - function Vec3 m_v() { return v; } - function Vec4 m_w() { return w; } - function Object m_o() { return o; } + fun int m_i() { return i; } + fun float m_f() { return f; } + fun complex m_c() { return c; } + fun Vec3 m_v() { return v; } + fun Vec4 m_w() { return w; } + fun Object m_o() { return o; } } C c; // read members <<< c.i, c.c, c.f, c.v, c.w, c.o >>>; -// call function members +// call fun members <<< c.m_i(), " ", c.m_f(), " ", c.m_c(), " ", c.m_v(), " ", c.m_w(), " ", c.m_o()>>>; diff --git a/examples/member_func.gw b/examples/member_func.gw index 05742d14..b56ed704 100644 --- a/examples/member_func.gw +++ b/examples/member_func.gw @@ -1,9 +1,9 @@ class C { - function float testf() { + fun float testf() { return 1.1; } - function float testf(float f) { + fun float testf(float f) { return f; } } diff --git a/examples/ptr_assign_class.gw b/examples/ptr_assign_class.gw index 05a6f23c..b49465fa 100644 --- a/examples/ptr_assign_class.gw +++ b/examples/ptr_assign_class.gw @@ -1,7 +1,7 @@ class C { typedef void Test(); - function void test1(){}; + fun void test1(){}; Test test0; << test0>>>; } diff --git a/examples/sinosc_extend.gw b/examples/sinosc_extend.gw index 3a4aa80f..8c7f7aeb 100644 --- a/examples/sinosc_extend.gw +++ b/examples/sinosc_extend.gw @@ -1,6 +1,6 @@ class Sine extends SinOsc { - function float freq(float f) { (2 * f) => (this $ SinOsc).freq; } + fun float freq(float f) { (2 * f) => (this $ SinOsc).freq; } } Sine s => dac; diff --git a/examples/spork_func.gw b/examples/spork_func.gw index 14252342..ed40d747 100644 --- a/examples/spork_func.gw +++ b/examples/spork_func.gw @@ -1,6 +1,6 @@ class C { - function void test(int i) { + fun void test(int i) { <<<"here => ", i>>>; samp => now; <<<"and now">>>; diff --git a/examples/static.gw b/examples/static.gw index 6877968d..a1fec3bb 100644 --- a/examples/static.gw +++ b/examples/static.gw @@ -7,12 +7,12 @@ class C static Vec4 w; static Object o; - function int m_i() { return i; } - function float m_f() { return f; } - function complex m_c() { return c; } - function Vec3 m_v() { return v; } - function Vec4 m_w() { return w; } - function Object m_o() { return o; } + fun int m_i() { return i; } + fun float m_f() { return f; } + fun complex m_c() { return c; } + fun Vec3 m_v() { return v; } + fun Vec4 m_w() { return w; } + fun Object m_o() { return o; } fun static int _i() { return i; } fun static float _f() { return f; } @@ -25,7 +25,7 @@ class C // read members <<< C.i, C.c, C.f, C.v, C.w, C.o >>>; -// call function members +// call fun members <<< C._i(), " ", C._f(), " ", C._c(), " ", C._v(), " ", C._w(), " ", C._o()>>>; // write members diff --git a/examples/switch.gw b/examples/switch.gw index 9b576f35..c34fb47d 100644 --- a/examples/switch.gw +++ b/examples/switch.gw @@ -1,6 +1,6 @@ int i; -function void test(int i) { +fun void test(int i) { switch(i) { case 1: <<<"'i' is 1">>>; diff --git a/examples/template.gw b/examples/template.gw index d4d2dfc4..32323111 100644 --- a/examples/template.gw +++ b/examples/template.gw @@ -1,4 +1,4 @@ -function<~A~> void test (A var){ <<< var>>>; } -function<~A,B~> void test (A var, B var2){ <<< var>>>; } +fun void test<~A~> (A var){ <<< var>>>; } +fun void test<~A,B~> (A var, B var2){ <<< var>>>; } test<~int~>(1); test<~float, float~>(3, 1.4); diff --git a/examples/template_dyn.gw b/examples/template_dyn.gw index 793907a5..aa64a717 100644 --- a/examples/template_dyn.gw +++ b/examples/template_dyn.gw @@ -4,15 +4,15 @@ fun void test(C cc, int i) { <<<1>>>; <<>>; } class C { - fun<~A~> int test(A a) { <<<" A ", a>>>; } - fun<~A~> int test(A a, int i) { <<<" ", a >>>; } - fun<~A~> int test(A a, int i, int j) { <<>>; } + 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) { <<>>; } } class D extends C { - fun<~A~> int test(A a, int i) { <<>>; } + fun int test<~A~>(A a, int i) { <<>>; } } class E extends D { - fun<~A~> int test(A a, int i) { <<>>; } + fun int test<~A~>(A a, int i) { <<>>; } } diff --git a/examples/template_guess.gw b/examples/template_guess.gw index 26dadbcb..40202949 100644 --- a/examples/template_guess.gw +++ b/examples/template_guess.gw @@ -1,4 +1,4 @@ -function <~A,B~> void test(A a, B b){<<>>;} +fun void test<~A,B~>(A a, B 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 77ad4f94..d2d52b6f 100644 --- a/examples/template_vararg.gw +++ b/examples/template_vararg.gw @@ -1,4 +1,4 @@ -fun<~A~> void test(...) { +fun void test<~A~>(...) { vararg.start; <<>>; vararg.end; diff --git a/tests/bug/Tester.gw b/tests/bug/Tester.gw index 73a675d7..d7a633dc 100644 --- a/tests/bug/Tester.gw +++ b/tests/bug/Tester.gw @@ -1,7 +1,7 @@ class Tester { - function<~A~> int assert_equal(string description, A a, A b){ if(a == b) return 0; return 1; } - function<~A~> int assert_not_equal(string description, A a, A b){ if(a != b) return 0; return 1; } + fun int assert<~A~>_equal(string description, A a, A b){ if(a == b) return 0; return 1; } + fun int assert<~A~>_not_equal(string description, A a, A b){ if(a != b) return 0; return 1; } } Tester t; diff --git a/tests/bug/class_doc.gw b/tests/bug/class_doc.gw index 17d094a6..c20e5b00 100644 --- a/tests/bug/class_doc.gw +++ b/tests/bug/class_doc.gw @@ -3,8 +3,8 @@ class C { //! has an int int i; - //! a function - function void test() {} + //! a fun + fun void test() {} //! operator operator => void(C c, C d){ <<>>; diff --git a/tests/bug/template_no_guess.gw b/tests/bug/template_no_guess.gw index c160b6f2..822f852e 100644 --- a/tests/bug/template_no_guess.gw +++ b/tests/bug/template_no_guess.gw @@ -1,2 +1,2 @@ -function void test(){} +fun void test(){} test([1], 2.3); diff --git a/tests/error/arg_prim_ref.gw b/tests/error/arg_prim_ref.gw index cd27414d..2e78acc6 100644 --- a/tests/error/arg_prim_ref.gw +++ b/tests/error/arg_prim_ref.gw @@ -1,2 +1,2 @@ // [contains] primitive types cannot be used as reference -function void test(int @i){} +fun void test(int @i){} diff --git a/tests/error/arg_res.gw b/tests/error/arg_res.gw index b3aee8e4..a94baa56 100644 --- a/tests/error/arg_res.gw +++ b/tests/error/arg_res.gw @@ -1,2 +1,2 @@ // [contains] this is reserved -function void test(int this){} +fun void test(int this){} diff --git a/tests/error/conflict_super.gw b/tests/error/conflict_super.gw index da190c9c..c9fbeecb 100644 --- a/tests/error/conflict_super.gw +++ b/tests/error/conflict_super.gw @@ -3,5 +3,5 @@ class C { int test; } class D extends C { - function void test(){} + fun void test(){} } diff --git a/tests/error/func_arg_array_empty.gw b/tests/error/func_arg_array_empty.gw index a15fd232..70d28d36 100644 --- a/tests/error/func_arg_array_empty.gw +++ b/tests/error/func_arg_array_empty.gw @@ -1,2 +1,2 @@ // [contains] must be defined with empty -function int[] my_func(int i[2]){} +fun int[] my_func(int i[2]){} diff --git a/tests/error/func_arg_defined.gw b/tests/error/func_arg_defined.gw index 8aebbb25..3b5fbf85 100644 --- a/tests/error/func_arg_defined.gw +++ b/tests/error/func_arg_defined.gw @@ -1,2 +1,2 @@ // [contains] already declared -function void test(int i, int i){} +fun void test(int i, int i){} diff --git a/tests/error/func_arg_unknown.gw b/tests/error/func_arg_unknown.gw index cc803901..c64c738e 100644 --- a/tests/error/func_arg_unknown.gw +++ b/tests/error/func_arg_unknown.gw @@ -1,2 +1,2 @@ // [contains] unknown type - function void my_func(unknown_type unknown_arg){} + fun void my_func(unknown_type unknown_arg){} diff --git a/tests/error/func_code_error.gw b/tests/error/func_code_error.gw index 81c1df2e..cb6a91aa 100644 --- a/tests/error/func_code_error.gw +++ b/tests/error/func_code_error.gw @@ -1,2 +1,2 @@ // [contains] in function: -function void test() { <<>>; } +fun void test() { <<>>; } diff --git a/tests/error/func_error_scan2.gw b/tests/error/func_error_scan2.gw index 1ff25d4b..5909dd8b 100644 --- a/tests/error/func_error_scan2.gw +++ b/tests/error/func_error_scan2.gw @@ -1,2 +1,2 @@ // [contains] unknown type -function void test() { skfuv sd; } +fun void test() { skfuv sd; } diff --git a/tests/error/func_no_match.gw b/tests/error/func_no_match.gw index ca53f52e..b59e3c4b 100644 --- a/tests/error/func_no_match.gw +++ b/tests/error/func_no_match.gw @@ -1,4 +1,4 @@ -// [contains] argument type(s) do not match for function -function void test(){} -function void test(int i[], int j[]){} +// [contains] argument type(s) do not match for fun +fun void test(){} +fun void test(int i[], int j[]){} test(1,2); diff --git a/tests/error/func_ret_array_empty.gw b/tests/error/func_ret_array_empty.gw index e45efd3b..7ff64da7 100644 --- a/tests/error/func_ret_array_empty.gw +++ b/tests/error/func_ret_array_empty.gw @@ -1,2 +1,2 @@ // [contains] must be defined with empty - function int[1] my_func(int i[]){} + fun int[1] my_func(int i[]){} diff --git a/tests/error/func_unknown_ret.gw b/tests/error/func_unknown_ret.gw index ee15a0eb..70fc88b6 100644 --- a/tests/error/func_unknown_ret.gw +++ b/tests/error/func_unknown_ret.gw @@ -1,2 +1,2 @@ // [contains] unknown type - function unknwon_type my_function(){} + fun unknwon_type my_function(){} diff --git a/tests/error/function_arg_no_size.gw b/tests/error/function_arg_no_size.gw index a85b12be..daca37ab 100644 --- a/tests/error/function_arg_no_size.gw +++ b/tests/error/function_arg_no_size.gw @@ -1,2 +1,2 @@ // [contains] cannot declare variables of size - function void test(void v){} + fun void test(void v){} diff --git a/tests/error/function_nested.gw b/tests/error/function_nested.gw index 96176466..4c7f35aa 100644 --- a/tests/error/function_nested.gw +++ b/tests/error/function_nested.gw @@ -1,5 +1,5 @@ // [contains] - function void test() + fun void test() { - function void nested(){} + fun void nested(){} } diff --git a/tests/error/function_ret_ref_prim.gw b/tests/error/function_ret_ref_prim.gw index 1b5d56d1..df101357 100644 --- a/tests/error/function_ret_ref_prim.gw +++ b/tests/error/function_ret_ref_prim.gw @@ -1,2 +1,2 @@ // [contains] primitive types cannot be used as reference -function int@ test(){} +fun int@ test(){} diff --git a/tests/error/function_used.gw b/tests/error/function_used.gw index bae0d6b9..9e2e417e 100644 --- a/tests/error/function_used.gw +++ b/tests/error/function_used.gw @@ -1,3 +1,3 @@ // [contains] is already used by another value int i; -function void i(){} +fun void i(){} diff --git a/tests/error/global_func_already_defined.gw b/tests/error/global_func_already_defined.gw index 8c865c6d..7678ce18 100644 --- a/tests/error/global_func_already_defined.gw +++ b/tests/error/global_func_already_defined.gw @@ -1,3 +1,3 @@ // [contains] global function 'test' already defined for those arguments -function void test(){} -function void test(){} +fun void test(){} +fun void test(){} diff --git a/tests/error/invalid_return.gw b/tests/error/invalid_return.gw index 0a05d8f3..03ebbf66 100644 --- a/tests/error/invalid_return.gw +++ b/tests/error/invalid_return.gw @@ -1,2 +1,2 @@ // [contains] invalid return type -function void test() { return 1; } +fun void test() { return 1; } diff --git a/tests/error/name_conflict.gw b/tests/error/name_conflict.gw index f6726bbd..48a252fe 100644 --- a/tests/error/name_conflict.gw +++ b/tests/error/name_conflict.gw @@ -4,5 +4,5 @@ class C { } class D extends C { - function int test() {} + fun int test() {} } diff --git a/tests/error/override_confict.gw b/tests/error/override_confict.gw index f1f8b1d8..0f05c714 100644 --- a/tests/error/override_confict.gw +++ b/tests/error/override_confict.gw @@ -6,7 +6,7 @@ class C class D extends C { - function void test() {} + fun void test() {} } C c; diff --git a/tests/error/override_static.gw b/tests/error/override_static.gw index a14b2fb7..47fa35f0 100644 --- a/tests/error/override_static.gw +++ b/tests/error/override_static.gw @@ -6,5 +6,5 @@ class C class D extends C { - function void test() {} + fun void test() {} } diff --git a/tests/error/override_static2.gw b/tests/error/override_static2.gw index 6127e243..4b326b83 100644 --- a/tests/error/override_static2.gw +++ b/tests/error/override_static2.gw @@ -1,7 +1,7 @@ // [contains] but cannot override class C { - function void test() {} + fun void test() {} } class D extends C diff --git a/tests/error/pointer_outside_class.gw b/tests/error/pointer_outside_class.gw index e957a443..51c099c8 100644 --- a/tests/error/pointer_outside_class.gw +++ b/tests/error/pointer_outside_class.gw @@ -1,2 +1,2 @@ // [contains] can only be used at class scope -typedef static void my_function(){} +typedef static void my_fun(){} diff --git a/tests/error/pointer_unknown.gw b/tests/error/pointer_unknown.gw index 7d54e104..d53fc486 100644 --- a/tests/error/pointer_unknown.gw +++ b/tests/error/pointer_unknown.gw @@ -1,2 +1,2 @@ // [contains] unknown type - typedef unknown_type my_function(){} + typedef unknown_type my_fun(){} diff --git a/tests/error/ptr_assign_global.gw b/tests/error/ptr_assign_global.gw index 9ba840d9..17038c96 100644 --- a/tests/error/ptr_assign_global.gw +++ b/tests/error/ptr_assign_global.gw @@ -4,6 +4,6 @@ class C { Test test; } -function void test(){} +fun void test(){} C c; test @=> c.test; diff --git a/tests/error/ptr_assign_member.gw b/tests/error/ptr_assign_member.gw index 47212ef7..fa68cf44 100644 --- a/tests/error/ptr_assign_member.gw +++ b/tests/error/ptr_assign_member.gw @@ -2,7 +2,7 @@ typedef void Test(); Test test; class D { - function void test(){} + fun void test(){} } D d; diff --git a/tests/error/ptr_assign_other.gw b/tests/error/ptr_assign_other.gw index 51560b6a..cdbf537d 100644 --- a/tests/error/ptr_assign_other.gw +++ b/tests/error/ptr_assign_other.gw @@ -5,7 +5,7 @@ class C { } class D { - function void test(){} + fun void test(){} } C c; diff --git a/tests/error/ptr_no_match.gw b/tests/error/ptr_no_match.gw index 10ca6d1c..0dc5b75d 100644 --- a/tests/error/ptr_no_match.gw +++ b/tests/error/ptr_no_match.gw @@ -1,6 +1,6 @@ // [contains] no match found -function void test(int i){} -function void test(float f){} +fun void test(int i){} +fun void test(float f){} typedef void Test(); Test t; diff --git a/tests/error/template_enough.gw b/tests/error/template_enough.gw index 6261d084..af3391ac 100644 --- a/tests/error/template_enough.gw +++ b/tests/error/template_enough.gw @@ -1,3 +1,3 @@ // [contains] -function<~A,B~> void test(){} +fun void test<~A,B~>(){} test(); diff --git a/tests/error/template_n_mismatch.gw b/tests/error/template_n_mismatch.gw index a5892457..c912840c 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 -function<~A~> void test(){ <<<"func">>>;} -function<~A~> void test(int i){<<<"other func">>>;} +fun void test<~A~>(){ <<<"func">>>;} +fun void test<~A~>(int i){<<<"other func">>>;} test<~int, float, int~>(); //test<~int~>(); diff --git a/tests/error/template_no_match.gw b/tests/error/template_no_match.gw index 08586135..0868e24a 100644 --- a/tests/error/template_no_match.gw +++ b/tests/error/template_no_match.gw @@ -1,7 +1,7 @@ // [contains] arguments do not match for template call class C { - function<~A~> void test(float f) {} - function<~A~> void test() {} + fun void test<~A~>(float f) {} + fun void test<~A~>() {} } C c; //c.test<~int~>(); diff --git a/tests/error/template_ternary.gw b/tests/error/template_ternary.gw index 86318b6a..6b99bf58 100644 --- a/tests/error/template_ternary.gw +++ b/tests/error/template_ternary.gw @@ -1,4 +1,4 @@ // [contains] invalid expression for function call -function<~A~> void test(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 503d7a3e..85e15132 100644 --- a/tests/error/template_unknown.gw +++ b/tests/error/template_unknown.gw @@ -1,4 +1,4 @@ // [contains] unknown type -function<~A~> void my_function() { <<<"test">>>; } +fun void my_function<~A~>() { <<<"test">>>; } my_function<~unknown_type~>(); diff --git a/tests/error/type_path_test.gw b/tests/error/type_path_test.gw index c604e5d7..1e255e09 100644 --- a/tests/error/type_path_test.gw +++ b/tests/error/type_path_test.gw @@ -1,2 +1,2 @@ // [contains] unknown type -function void test(B->C a){} +fun void test(B->C a){} diff --git a/tests/import/core.10177 b/tests/import/core.10177 new file mode 100644 index 00000000..7bddbb31 Binary files /dev/null and b/tests/import/core.10177 differ diff --git a/tests/import/core.22575 b/tests/import/core.22575 new file mode 100644 index 00000000..fd8f3e37 Binary files /dev/null and b/tests/import/core.22575 differ diff --git a/tests/import/core.4309 b/tests/import/core.4309 new file mode 100644 index 00000000..19340db8 Binary files /dev/null and b/tests/import/core.4309 differ diff --git a/tests/import/variadic.gw b/tests/import/variadic.gw index c315163f..fe54f6f1 100644 --- a/tests/import/variadic.gw +++ b/tests/import/variadic.gw @@ -1,4 +1,4 @@ -<<<"test builtin variadic function">>>; +<<<"test builtin variadic fun">>>; Variadic v; "iiii" => string format; <<>>; diff --git a/tests/new/spork_in_func.gw b/tests/new/spork_in_func.gw index a6835f18..e5bfe256 100644 --- a/tests/new/spork_in_func.gw +++ b/tests/new/spork_in_func.gw @@ -1,4 +1,4 @@ -function void test() { +fun void test() { // <<<1>>>; //spork \{<<<2>>>;}(); } diff --git a/tests/tree/arg_array.gw b/tests/tree/arg_array.gw index b4aa8c6a..b834990f 100644 --- a/tests/tree/arg_array.gw +++ b/tests/tree/arg_array.gw @@ -1 +1 @@ -function void test(int i[]){} +fun void test(int i[]){} diff --git a/tests/tree/array_test.gw b/tests/tree/array_test.gw index c17c8605..82abecbc 100644 --- a/tests/tree/array_test.gw +++ b/tests/tree/array_test.gw @@ -1,4 +1,4 @@ -function void print_array(int a[]){ +fun void print_array(int a[]){ for(int i; i < a.size(); i++) <<>>; } diff --git a/tests/tree/assign_member_ptr.gw b/tests/tree/assign_member_ptr.gw index 00f3144b..2da5caa0 100644 --- a/tests/tree/assign_member_ptr.gw +++ b/tests/tree/assign_member_ptr.gw @@ -2,7 +2,7 @@ class C { typedef void Test(); Test test; - function void func(){} + fun void func(){} } C c; c.func @=> c.test; diff --git a/tests/tree/balance.gw b/tests/tree/balance.gw index 49f99771..50c65479 100644 --- a/tests/tree/balance.gw +++ b/tests/tree/balance.gw @@ -1,13 +1,13 @@ -function float test() {} -function float test(int i) {} -function float test(float f) {} -function float test(complex c) {} -function float test(Vec3 v) {} -function float test(Vec4 w) {} - -function complex ctest(){} -function Vec3 vtest(){} -function Vec4 wtest(){} +fun float test() {} +fun float test(int i) {} +fun float test(float f) {} +fun float test(complex c) {} +fun float test(Vec3 v) {} +fun float test(Vec4 w) {} + +fun complex ctest(){} +fun Vec3 vtest(){} +fun Vec4 wtest(){} ctest(); vtest(); wtest(); @@ -31,12 +31,12 @@ test(@(1.2, 2.3, 3.4, 4.5)); class C { - function float test() {} - function float test(int i) {} - function float test(float f) {} - function float test(complex c) {} - function float test(Vec3 v) {} - function float test(Vec4 w) {} + fun float test() {} + fun float test(int i) {} + fun float test(float f) {} + fun float test(complex c) {} + fun float test(Vec3 v) {} + fun float test(Vec4 w) {} fun static float s_test() {} fun static float s_test(int i) {} diff --git a/tests/tree/class_template.gw b/tests/tree/class_template.gw index fc23b029..ed469426 100644 --- a/tests/tree/class_template.gw +++ b/tests/tree/class_template.gw @@ -4,7 +4,7 @@ class<~A,B~> C { fun A test() { <<<"lol">>>; } - fun<~C~> void test2(C c) { + fun void test2<~C~>(C c) { <<>>; } } diff --git a/tests/tree/f2i_cast.gw b/tests/tree/f2i_cast.gw index b6cfc7cc..ddb179e4 100644 --- a/tests/tree/f2i_cast.gw +++ b/tests/tree/f2i_cast.gw @@ -1,5 +1,5 @@ <<<"test">>>; <<< 2.3 $ int >>>; 1 => float f; -function void test(float f){} +fun void test(float f){} 1 => test; diff --git a/tests/tree/func_extend_error.gw b/tests/tree/func_extend_error.gw index 18d01393..dd39ee3b 100644 --- a/tests/tree/func_extend_error.gw +++ b/tests/tree/func_extend_error.gw @@ -1,6 +1,6 @@ class Sine extends SinOsc { - function int freq(float f) { + fun int freq(float f) { (2 * f) => (this $ SinOsc).freq; } } diff --git a/tests/tree/func_ret_void.gw b/tests/tree/func_ret_void.gw index 25531a97..88eb7a5d 100644 --- a/tests/tree/func_ret_void.gw +++ b/tests/tree/func_ret_void.gw @@ -1,2 +1,2 @@ -function void test() { <<<"test">>>; return; <<<"this won't print. ever.">>>; } +fun void test() { <<<"test">>>; return; <<<"this won't print. ever.">>>; } test(); diff --git a/tests/tree/func_return_coverage.gw b/tests/tree/func_return_coverage.gw index 5886e748..490211fe 100644 --- a/tests/tree/func_return_coverage.gw +++ b/tests/tree/func_return_coverage.gw @@ -1,6 +1,6 @@ -function complex testc() {}; -function Vec3 testv3() {}; -function Vec4 testv4() {}; +fun complex testc() {}; +fun Vec3 testv3() {}; +fun Vec4 testv4() {}; testc(); testv3(); testv4(); diff --git a/tests/tree/func_sig_differ.gw b/tests/tree/func_sig_differ.gw index 595c3634..607fddf7 100644 --- a/tests/tree/func_sig_differ.gw +++ b/tests/tree/func_sig_differ.gw @@ -1,4 +1,4 @@ -function void test(int i){} -function int test(){} +fun void test(int i){} +fun int test(){} <<>>; <<>>; diff --git a/tests/tree/member_op.gw b/tests/tree/member_op.gw index 2c9da371..27ab7e60 100644 --- a/tests/tree/member_op.gw +++ b/tests/tree/member_op.gw @@ -2,7 +2,7 @@ class C { operator => void(C c, int i){<<>>;} // this => this; -//function void test_op(C c){ this => c; } +//fun void test_op(C c){ this => c; } this => int i; } C c; diff --git a/tests/tree/object_func.gw b/tests/tree/object_func.gw index 9a0ac934..ab3df037 100644 --- a/tests/tree/object_func.gw +++ b/tests/tree/object_func.gw @@ -1,2 +1,2 @@ -function Object test(){ Object o; <<>>; return new Object; } +fun Object test(){ Object o; <<>>; return new Object; } test(); diff --git a/tests/tree/ptr_decl_assign.gw b/tests/tree/ptr_decl_assign.gw index 7c511541..6edb9197 100644 --- a/tests/tree/ptr_decl_assign.gw +++ b/tests/tree/ptr_decl_assign.gw @@ -1,4 +1,4 @@ typedef void Test(); -function void t(){<<<"lol">>>;} +fun void t(){<<<"lol">>>;} t @=> Test test; test(); diff --git a/tests/tree/ptr_test.gw b/tests/tree/ptr_test.gw index 642a35ab..e44119a4 100644 --- a/tests/tree/ptr_test.gw +++ b/tests/tree/ptr_test.gw @@ -1,4 +1,4 @@ typedef void Test(); -function void t0(){} +fun void t0(){} t0 @=> Test test; test(); diff --git a/tests/tree/push_mem.gw b/tests/tree/push_mem.gw index 05d0e0b3..85b3961b 100644 --- a/tests/tree/push_mem.gw +++ b/tests/tree/push_mem.gw @@ -1,2 +1,2 @@ -function void test() { complex c; c; Vec3 v; v; Vec4 w; w; } +fun void test() { complex c; c; Vec3 v; v; Vec4 w; w; } test(); diff --git a/tests/tree/return_void.gw b/tests/tree/return_void.gw index 44127338..d23fe444 100644 --- a/tests/tree/return_void.gw +++ b/tests/tree/return_void.gw @@ -1,7 +1,7 @@ // define a simple variable: 'i'. int i; -// define a functions that returns 1 if 'i' is non zero, and 0 othervise. -function int test() { return i ? 1 : 0; } +// define a funs that returns 1 if 'i' is non zero, and 0 othervise. +fun int test() { return i ? 1 : 0; } <<>>; 1 => i; <<>>; diff --git a/tests/tree/spork_arg.gw b/tests/tree/spork_arg.gw index bdbae8fd..8ffaa84e 100644 --- a/tests/tree/spork_arg.gw +++ b/tests/tree/spork_arg.gw @@ -1,2 +1,2 @@ -function void test(int i, int j){} +fun void test(int i, int j){} spork test(1,2); diff --git a/tests/tree/spork_in_func.gw b/tests/tree/spork_in_func.gw index 250380d2..72b71082 100644 --- a/tests/tree/spork_in_func.gw +++ b/tests/tree/spork_in_func.gw @@ -1,4 +1,4 @@ -function void test() { +fun void test() { spork { <<<2>>>; }; } //spork { <<<1>>>; }; diff --git a/tests/tree/spork_member.gw b/tests/tree/spork_member.gw index 29c2e97f..192ba5db 100644 --- a/tests/tree/spork_member.gw +++ b/tests/tree/spork_member.gw @@ -1,6 +1,6 @@ class C { - function void test(int i){ + fun void test(int i){ <<>>; spork { <<<"test2">>>; diff --git a/tests/tree/this.gw b/tests/tree/this.gw index a741751a..890fa20d 100644 --- a/tests/tree/this.gw +++ b/tests/tree/this.gw @@ -1,6 +1,6 @@ class C { - function C test() { + fun C test() { return this; } } diff --git a/tests/tree/this_valid.gw b/tests/tree/this_valid.gw index aebba4f3..a526f220 100644 --- a/tests/tree/this_valid.gw +++ b/tests/tree/this_valid.gw @@ -1,6 +1,6 @@ class C { - function void test() { + fun void test() { <<>>; } } diff --git a/tests/tree/uncalled_functions.gw b/tests/tree/uncalled_functions.gw index 0c5ec670..79c3ebfe 100644 --- a/tests/tree/uncalled_functions.gw +++ b/tests/tree/uncalled_functions.gw @@ -1,4 +1,4 @@ -// just to check uncalled function to not push the stack +// just to check uncalled fun to not push the stack class C { fun void test(){} fun static void stest() {}} C c;