From: Jérémie Astor Date: Wed, 15 Dec 2021 13:37:34 +0000 (+0100) Subject: :art: Few fixes X-Git-Tag: nightly~395 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=6d7085028febaff06289cd5ce4b59ba4f4955396;p=gwion.git :art: Few fixes --- diff --git a/examples/auto.gw b/examples/auto.gw index f13495c6..c4056df1 100644 --- a/examples/auto.gw +++ b/examples/auto.gw @@ -1,3 +1,3 @@ var Object i[4]; -for(a: i) +foreach(a: i) <<< a >>>; diff --git a/tests/dict/dict_lit_float.gw b/tests/dict/dict_lit_float.gw new file mode 100644 index 00000000..0dc24cc7 --- /dev/null +++ b/tests/dict/dict_lit_float.gw @@ -0,0 +1 @@ +<<< { 1.2 : 1} >>>; diff --git a/tests/functionnal_array/concatmap.gw b/tests/functionnal_array/concatmap.gw index c9df7e1c..70b40a9a 100644 --- a/tests/functionnal_array/concatmap.gw +++ b/tests/functionnal_array/concatmap.gw @@ -6,7 +6,7 @@ const float ii; 123=> var float f; -for(a : [12, 1, 2 ,3].compactMap:[int]( \a { +foreach(a : [12, 1, 2 ,3].compactMap:[int]( \a { var int?i; 145 => i.val; if(maybe) @@ -24,6 +24,6 @@ fun int? t(int x) { i.val++; return i; } -for(a : [12, 1, 2 ,3].compactMap:[int](t)) +foreach(a : [12, 1, 2 ,3].compactMap:[int](t)) <<< "mapped to => ${a}" >>>; <<< "test" >>>; diff --git a/tests/functionnal_array/map.gw b/tests/functionnal_array/map.gw index 83e659c3..c323decf 100644 --- a/tests/functionnal_array/map.gw +++ b/tests/functionnal_array/map.gw @@ -1,13 +1,13 @@ fun float t(float i) { return 2; } -for(a : [12., 1, 2 ,3].map:[float](t)) +foreach(a : [12., 1, 2 ,3].map:[float](t)) <<< "mapped to => ${a}" >>>; -#!for(a : [12, 1, 2 ,3].map:[int](t)) +#!foreach(a : [12, 1, 2 ,3].map:[int](t)) #! <<< "mapped to => ${a}" >>>; -#!for(a : [12, 1, 2 ,3].map:[int](t)) +#!foreach(a : [12, 1, 2 ,3].map:[int](t)) #! <<< "mapped to => ${a}" >>>; -#!for(a : [12, 1, 2 ,3].map:[int](t)) +#!foreach(a : [12, 1, 2 ,3].map:[int](t)) #! <<< "mapped to => ${a}" >>>; -#!for(a : [12, 1, 2 ,3].map:[int]( \a {145 => a;return 2;})) +#!foreach(a : [12, 1, 2 ,3].map:[int]( \a {145 => a;return 2;})) #! <<< "mapped to => ${a}" >>>; -#!for(a : [12, 1, 2 ,3].map:[int]( \a {145 => a;return 2;})) +#!foreach(a : [12, 1, 2 ,3].map:[int]( \a {145 => a;return 2;})) #! <<< "mapped to => ${a}" >>>; diff --git a/tests/new/array.gw b/tests/new/array.gw index b9198e26..7401126c 100644 --- a/tests/new/array.gw +++ b/tests/new/array.gw @@ -3,5 +3,5 @@ j << 23; i << 2; j >> i; 1234 >> i; -for(a : i) +foreach(a : i) <<< a >>>; diff --git a/tests/pp/pragma_unroll.gw b/tests/pp/pragma_unroll.gw index 560d9f62..9dd92231 100644 --- a/tests/pp/pragma_unroll.gw +++ b/tests/pp/pragma_unroll.gw @@ -1,4 +1,4 @@ #! contains 23 #pragma unroll 2 -for(a, i : [ 0, 1, 3 ]) +foreach(a, i : [ 0, 1, 3 ]) <<< a, i >>>; diff --git a/tests/range/range_char.gw b/tests/range/range_char.gw index 0cf7a051..7be54285 100644 --- a/tests/range/range_char.gw +++ b/tests/range/range_char.gw @@ -1,3 +1,3 @@ #! [contains] b -for(a : [ 'a' : 'c' ]) +foreach(a : [ 'a' : 'c' ]) <<< a >>>; diff --git a/tests/range/range_int.gw b/tests/range/range_int.gw index 4b9c0914..870d1fd1 100644 --- a/tests/range/range_int.gw +++ b/tests/range/range_int.gw @@ -1,3 +1,3 @@ #! [contains] \-5 -for(a : [ -1 : -6 ]) +foreach(a : [ -1 : -6 ]) <<< a >>>; diff --git a/tests/tree/auto_array.gw b/tests/tree/auto_array.gw index 444fd163..03fdc986 100644 --- a/tests/tree/auto_array.gw +++ b/tests/tree/auto_array.gw @@ -1,4 +1,4 @@ var int i[2][2]; -for(a : i) +foreach(a : i) <<< a >>>; <<< i >>>; diff --git a/tests/tree/auto_fun.gw b/tests/tree/auto_fun.gw index e1ef04de..92f23720 100644 --- a/tests/tree/auto_fun.gw +++ b/tests/tree/auto_fun.gw @@ -4,6 +4,6 @@ class C { var C i[2]; -for(a : i) +foreach(a : i) <<< a >>>; diff --git a/tests/tree/auto_ptr.gw b/tests/tree/auto_ptr.gw index ac842559..0da29291 100644 --- a/tests/tree/auto_ptr.gw +++ b/tests/tree/auto_ptr.gw @@ -1,5 +1,5 @@ var int i[4]; -for(a : i) +foreach(a : i) <<< 1 => a >>>; -for(a : i) +foreach(a : i) <<< a >>>; diff --git a/tests/tree/cpy_ast.gw b/tests/tree/cpy_ast.gw index 13588e82..25c18fb6 100644 --- a/tests/tree/cpy_ast.gw +++ b/tests/tree/cpy_ast.gw @@ -13,7 +13,7 @@ class C:[A] { for(var int _i; _i < 1; ++_i); var int array[2]; array[0]; - for(a : array); + foreach(a : array); repeat(1); match i,2 { case 12 when 0:; diff --git a/tests/tree/set_obj.gw b/tests/tree/set_obj.gw index 2e599a4d..ae8180a6 100644 --- a/tests/tree/set_obj.gw +++ b/tests/tree/set_obj.gw @@ -1,4 +1,4 @@ typedef int[2] Type; Type type; <<>>; -for(ref a : type); +foreach(ref a : type); diff --git a/tests/tree/typedef_auto_loop.gw b/tests/tree/typedef_auto_loop.gw index 5f2a0e97..9c300b43 100644 --- a/tests/tree/typedef_auto_loop.gw +++ b/tests/tree/typedef_auto_loop.gw @@ -1,3 +1,3 @@ typedef int[2] Type; var Type type; -for(a : type); +foreach(a : type);