]> Nishi Git Mirror - gwion.git/commitdiff
:art: Make storage/access flag placement consistent
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Sat, 12 Sep 2020 09:25:58 +0000 (11:25 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Sat, 12 Sep 2020 09:25:58 +0000 (11:25 +0200)
47 files changed:
ast
examples/check.gw [deleted file]
examples/complex/event2_1.gw
examples/decl_object2.gw [deleted file]
examples/doc.gw [deleted file]
examples/module_coverage.gw [deleted file]
examples/sine.gw [deleted file]
examples/sine2.gw [deleted file]
examples/sinosc_extend.gw [deleted file]
examples/static.gw
examples/trig.gw [deleted file]
examples/ugen_connect_no_in.gw [deleted file]
examples/ugen_disconnect_no_in.gw [deleted file]
tests/bug/dot_member_func.gw [deleted file]
tests/bug/machine_check_trash.gw [deleted file]
tests/bug/static_data.gw
tests/bug/ugen.gw [deleted file]
tests/error/invalid_global_class.gw
tests/error/invalid_global_file.gw
tests/error/not_global.gw
tests/error/private.gw
tests/error/private_global.gw
tests/error/private_other.gw
tests/error/static_out.gw
tests/fptr/class_ptr2.gw
tests/fptr/class_ptr3.gw
tests/fptr/class_ptr31.gw
tests/new/global_func0.gw
tests/new/global_var.gw
tests/new/test.gw
tests/new/test2.gw
tests/struct/struct_global0.gw
tests/struct/struct_static.gw
tests/struct/struct_static_func.gw
tests/tree/check_compile_file.gw [deleted file]
tests/tree/check_invalid_file.gw [deleted file]
tests/tree/dot.gw [deleted file]
tests/tree/func_extend_error.gw [deleted file]
tests/tree/global_var.gw
tests/tree/map.gw [deleted file]
tests/tree/not_global.gw
tests/tree/pair.gw [deleted file]
tests/tree/private_access.gw
tests/tree/protect.gw
tests/tree/static_data_test.gw
tests/tree/static_template.gw
tests/tree/template_typedef.gw [deleted file]

diff --git a/ast b/ast
index a065796b43b43260ef290667711261058467158d..c83cc91cd55f2ee3036bfe5a04fc06cd191b6ded 160000 (submodule)
--- a/ast
+++ b/ast
@@ -1 +1 @@
-Subproject commit a065796b43b43260ef290667711261058467158d
+Subproject commit c83cc91cd55f2ee3036bfe5a04fc06cd191b6ded
diff --git a/examples/check.gw b/examples/check.gw
deleted file mode 100644 (file)
index 78160b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<<< Machine.check("SinOsc s => dac; second => now;") >>>;
index 533a401099ed3b804091abc55d4362ee67bc3d00..8029064875ba2ed373341e585bea8268f636c389 100644 (file)
@@ -1,5 +1,5 @@
 class global TestEvent {
-       static var Event e;
+       var static Event e;
 }
 second => now;
 #!second => now;
diff --git a/examples/decl_object2.gw b/examples/decl_object2.gw
deleted file mode 100644 (file)
index 5068eb3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var SinOsc s;
diff --git a/examples/doc.gw b/examples/doc.gw
deleted file mode 100644 (file)
index 5610282..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Machine.add("examples/int.gw");
-Machine.compile("int i;<<< 120 >>>;");
-#!Machine.compile("int i[error];");
-
-<<< Machine.check("12 => int i; <<< i >>>") >>>;
-Machine.check("int i[error];");
-Machine.check(null);
diff --git a/examples/module_coverage.gw b/examples/module_coverage.gw
deleted file mode 100644 (file)
index bd93e1a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-var SinOsc s => var Gain g => var HalfRect h => blackhole;
-s => var ZeroX z => blackhole;
-17 => s.init;
-(1024, .17) => s.init;
-var Impulse i => var FullRect f => blackhole;
-var Step step => blackhole;
-second => now;
-<<< "end" >>>;
-step =< blackhole;
diff --git a/examples/sine.gw b/examples/sine.gw
deleted file mode 100644 (file)
index c5f06ee..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-var SinOsc sinosc => dac;
-1::second => now;
-sinosc.freq(220);
-1::second => now;
diff --git a/examples/sine2.gw b/examples/sine2.gw
deleted file mode 100644 (file)
index 711dbb2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var SinOsc sinosc => dac;
-<<< second >>>;
-5::second => now;
diff --git a/examples/sinosc_extend.gw b/examples/sinosc_extend.gw
deleted file mode 100644 (file)
index 33d6905..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-class Sine extends SinOsc
-{
-  fun float freq(float f) { (2 * f) => (this $ SinOsc).freq; }
-}
-
-var Sine s => dac;
-220 => s.freq;
-second => now;
index 527645f9ed9c95389703b8c05dcf979ea5289049..1287dbc8b8c6fe7886f87a301b1008154160d297 100644 (file)
@@ -1,8 +1,8 @@
 class C
 {
-       static var int i;
-       static var float f;
-       static var Object o;
+       var static int i;
+       var static float f;
+       var static Object o;
 
        fun int     m_i() { return i; }
        fun float   m_f() { return f; }
diff --git a/examples/trig.gw b/examples/trig.gw
deleted file mode 100644 (file)
index c8d83f5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var SinOsc s :=> var Dtrig dtrig => blackhole;
-second => now;
-s :=< dtrig;
diff --git a/examples/ugen_connect_no_in.gw b/examples/ugen_connect_no_in.gw
deleted file mode 100644 (file)
index fecd310..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var Gain a => var SinOsc s => blackhole;
diff --git a/examples/ugen_disconnect_no_in.gw b/examples/ugen_disconnect_no_in.gw
deleted file mode 100644 (file)
index 2c2a33f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var Gain a;
-var SinOsc s => blackhole;
-a =< s;
diff --git a/tests/bug/dot_member_func.gw b/tests/bug/dot_member_func.gw
deleted file mode 100644 (file)
index c18ce7e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#! thanks to afl-fuzz
-ref SinOsc s, t;
-var Gain g => dac;
-1 => t.freq;
-s => g;
-t => g;
-g.chan(0);
-spork  { while(true) { Math.rand2f(100, 800) => s.freq; .15::second => now; }};
-for(var int i; i < 5; i++) {
-    <<< g.op() >>>;
-    i => g.op;
-    2::second => now;
-}
-
diff --git a/tests/bug/machine_check_trash.gw b/tests/bug/machine_check_trash.gw
deleted file mode 100644 (file)
index 255aac9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Machine.compile(null);
-Machine.check("jgjl.");
index de5cabd26886490bc724f89319f7c536189b967d..1d67cfa48be4b13b398b777168f51c30ed5e1f2b 100644 (file)
@@ -1,8 +1,8 @@
 class C
 {
-       static var int     i;
-       static var float   f;
-       static var Object  o;
+       var static int     i;
+       var static float   f;
+       var static Object  o;
 }
 <<< C.i >>>;
 <<< C.f >>>;
diff --git a/tests/bug/ugen.gw b/tests/bug/ugen.gw
deleted file mode 100644 (file)
index b41e593..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-ref UGen u;
-#!u.last(); #! should fail => fails.
-ref SinOsc s => ref Gain g => dac;
-for(-1 => var int i;i < 6; i++)
-       i => g.op;
-samp => now;
-s.last();
-#!s.chan(2);
-#!dac.chan(1);
-samp => now;
-
-
-#! there a bug somewhere.
-#! probably deref 'dac' to many mul  ...
-#!dac => blackhole;
-#!dac =< blackhole;
-#!dac =< s;
-#!dac =< s;
-s =< dac;
-s =< dac;
-#!dac =< s;
index 38b1bcb5dbaaed1eef3b6dd16399b452bac26b3d..d9841a826045311ba5eeb986db7f6f4385c9a554 100644 (file)
@@ -1,6 +1,6 @@
 #! [contains] 'global' can only be used at class scope
 class C {
   {
-    global var int i;
+    var global int i;
   }
 }
index 8f3884ac26a109d70ba0120d8abeb5602cd9d7b6..14981d1386bdc8176ea01d997acbea945692f701 100644 (file)
@@ -1,4 +1,4 @@
 #! [contains] 'global' can only be used at file scope
 {
-global var int i;
+var global int i;
 }
index 12d4beb033055c701b1abb2208dc92595b8b050f..060d405f552948ec66f0238914735a663e6fc1af 100644 (file)
@@ -3,4 +3,4 @@ class C {
 
 }
 
-global var C c;
+var global C c;
index ec3add2ba7235716e559c68983e788e78f447d14..864fed9b7f5b4bea0ea31bf73d0af5666ef695ce 100644 (file)
@@ -1,5 +1,5 @@
 #! [contains] can't access private
-class C { private var int i;  }
+class C { var private int i;  }
 
 var C c;
 <<< c.i >>>;
index c473d576b6d13b74c63dbbe87b462d72abd2650d..acd64f0bcb1fdd17733c5cd67a01d0f34a307c98 100644 (file)
@@ -1,2 +1,2 @@
 #! [contains] can only be used at class scope
-private var int i;
+var private int i;
index f9be3a75096edf8c948ed0d5dd09ac204d4457c5..34cec0f8e02d9aac83cfd42b84058e8ec5dfba82 100644 (file)
@@ -1,5 +1,5 @@
 #! [contains] can't access private
-class C { private var int i;  }
+class C { var private int i;  }
 
 class D {
   var C c;
index 47b52b38769d8ae717c8387e7e93b5a09a259ad0..4b116e27be2e8e680c5fa942fbe322f695365309 100644 (file)
@@ -1,2 +1,2 @@
 #! [contains] can only be used at class scope
-static var int i;
+var static int i;
index 3998bb63c10e0618342cb0d9a172bda48ea33f3b..96b0c441eaca5e38cfbc1d8c7425cabdd721d19e 100644 (file)
@@ -1,7 +1,7 @@
 class C {
   fun void test(int i) { <<<  "int arg"  >>>; }
   typedef void PtrType(int i);
-  test @=> static var PtrType p;
+  test @=> var static PtrType p;
   p(1);
   test @=> p;
   p(1);
index 96b66cfe7f6907f39c8f69c5427edbd69e6c4bc5..0ceb2c65e842f932d1377c41b21bd8ab73e8b1f2 100644 (file)
@@ -1,7 +1,7 @@
 class C {
   fun static void test(int i) { <<<  "int arg"  >>>; }
   typedef static void PtrType(int i);
-  test @=> static var PtrType p;
+  test @=> var static PtrType p;
   p(1);
   test @=> p;
   p(1);
index afaeb1a74dcadb6bc9618a4f664f6435c386f445..8721a99befec88aff50853c243b9ca361f98bba7 100644 (file)
@@ -2,7 +2,7 @@
 class C {
   fun void test(int i) { <<<  "int arg"  >>>; }
   typedef static void PtrType(int i);
-  test @=> static var PtrType p;
+  test @=> var static PtrType p;
   p(1);
   test @=> p;
   p(1);
index e2493ac1020f2fabf055e6deb6b782c519408798..335ee433128b5e10feb4082c2c40f035a3649452 100644 (file)
@@ -1,9 +1,9 @@
-123 => global var int global_func_i;
+123 => var global int global_func_i;
 class global GlobalFuncClass {
   13 => var int i;
 }
 <<< global_func_i >>>;
-global var GlobalFuncClass g_c;
+var global GlobalFuncClass g_c;
 <<< g_c, "->i => ", g_c.i >>>;
 fun global void g_test() { <<< global_func_i >>>; <<< g_c >>>; <<< g_c.i >>>; <<< "test" >>>; }
 #!fun global void g_test() { <<< "test" >>>; }
index 54017c3767de18cfd62ccdd08c7cc64958c4e37a..207eb08f037b0656efdbdf315c7863376d348945 100644 (file)
@@ -1 +1 @@
-<<< global var int global_var_i >>>;
+<<< var global int global_var_i >>>;
index f28cf2954af38dafa09a4b62bae9bf1947d35f80..1472590d54c53271573aa1576f182256618e2330 100644 (file)
@@ -1,7 +1,7 @@
 class C {
   typedef static void func_t<~A~>(A a);
   fun static void myfunc<~A~>(A a) { <<< a >>>; }
-  myfunc @=> static var func_t ptr;
+  myfunc @=> var static func_t ptr;
   ptr(1);
 }
 
index c98144820dacc45b0ec7e7c39ead8ac96aa36a21..044dd500168f7ba22f707103d65feae304ec4671 100644 (file)
@@ -1,7 +1,7 @@
 class <~A~>C {
   typedef static void func_t<~A~>(A a);
   fun static void myfunc<~A~>(A a) { <<< a >>>; }
-  myfunc @=> static var func_t ptr;
+  myfunc @=> var static func_t ptr;
   ptr(1);
 }
 
index d9eac97d6aa5f22c57b25bc58870fa985b438cfb..bd901ee8488705ff8a16fdd009eb915c36e382f6 100644 (file)
@@ -10,5 +10,5 @@ struct global GlobalStructWithCtor {
   var string s;
 }
 
-global var GlobalStruct global_s;
+var global GlobalStruct global_s;
 var GlobalStructWithCtor sctor;
index 6368b30e9de8c0933ebeae5a3e2a18753245f0e6..c3269cdddd0ee7b4c48c4870034e6a40bd1fd5d6 100644 (file)
@@ -5,7 +5,7 @@ class C {
     13 => var float f;
     <<< __func__ >>>;
   }
-  static var S s;
+  var static S s;
 }
 
 var C c;
index 7f809a3c5f098f9b2f9491086fcc7c5c62ea054f..a69fba1e12783b81d288e3d3194abfbb3b5ce929 100644 (file)
@@ -1,7 +1,7 @@
 struct S {
   var int i;
   var int j;
-  12 => static var int si;
+  12 => var static int si;
   fun static void test() { <<< __func__, si >>>; }
   test();
 }
diff --git a/tests/tree/check_compile_file.gw b/tests/tree/check_compile_file.gw
deleted file mode 100644 (file)
index 81cf4f5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Machine.compile("int i");
diff --git a/tests/tree/check_invalid_file.gw b/tests/tree/check_invalid_file.gw
deleted file mode 100644 (file)
index 3f8100a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Machine.check("int i");
diff --git a/tests/tree/dot.gw b/tests/tree/dot.gw
deleted file mode 100644 (file)
index 5e26e81..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-var int i[];
-Machine.shreds() @=> i;
diff --git a/tests/tree/func_extend_error.gw b/tests/tree/func_extend_error.gw
deleted file mode 100644 (file)
index 3f4d84b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-class Sine extends SinOsc
-{
-  fun int freq(float f) {
-    (2 * f) => (this $ SinOsc).freq;
-  }
-}
-
-var Sine s => dac;
-220 => s.freq;
-second => now;
index 9b447a4b4326eb1ad037b85082fb47396e9aa2a4..2b5c16b80ec55db028447967effe12270a32fbac 100644 (file)
@@ -1 +1 @@
-<<< global var int g_i >>>;
+<<< var global int g_i >>>;
diff --git a/tests/tree/map.gw b/tests/tree/map.gw
deleted file mode 100644 (file)
index 069c7af..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-var <~int, int~>Map pp;
-<<< pp >>>;
-<<< pp.size() >>>;
-<<< pp.set(1, 2) >>>;
-<<< pp.get(1) >>>;
index 12d4beb033055c701b1abb2208dc92595b8b050f..060d405f552948ec66f0238914735a663e6fc1af 100644 (file)
@@ -3,4 +3,4 @@ class C {
 
 }
 
-global var C c;
+var global C c;
diff --git a/tests/tree/pair.gw b/tests/tree/pair.gw
deleted file mode 100644 (file)
index 4cec49e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-var <~float, int~>Pair p;
-<<< p >>>;
-1 => p.key;
-2 => p.val;
-
-<<< p.key, " ", p.val >>>;
-
-(2,3) => p.set;
-<<< p.key, " ", p.val >>>;
index 0c4d64e604e809e6e566794b977f934d34ff1e17..41820a754ef5a9bf5f413581a25d17bb64c5b86e 100644 (file)
@@ -1,5 +1,5 @@
 class C {
-  private var int i;
+  var private int i;
   <<< i >>>;
 }
 
index 02f82b72411311440cc56b26e0b1326655070cb5..06085bc2ecd6f21937e204bb92d75845f5bebda0 100644 (file)
@@ -1,5 +1,5 @@
 class C {
-  protect var int i;
+  var protect int i;
   <<< ++i >>>;
 }
 
index 38f9e0c1cbecdc53583a830248d768772a5ce689..46cfbdb224c59b30efdc31fb1fa6ab125a359ffa 100644 (file)
@@ -1,7 +1,7 @@
 class C {
-  static var int i;
+  var static int i;
   typedef static void Test();
-  static var Test test;
+  var static Test test;
 }
 
 var C c;
index 046b20d6c43e39789a88ae3bc973f23061b74606..784667ef53f1f05d8b47845737052fbd2af5a83f 100644 (file)
@@ -3,7 +3,7 @@ class<~A~> C {
 }
 
 class D {
-  static var <~int~>C c;
+  var static <~int~>C c;
 }
 
 var D d;
diff --git a/tests/tree/template_typedef.gw b/tests/tree/template_typedef.gw
deleted file mode 100644 (file)
index 747c12e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-var <~int, int~>Pair p;
-typedef <~int, int~>Pair lol;
-var lol t;
-<<< t >>>;
-<<< t.key >>>;
-class C extends lol { var int i;}
-var C c;
-<<< c.i >>>;
-class<~A~> D {
-  <<< "lol" >>>;
-  var int i;
-}
-typedef <~int~>D Lol;
-class E extends Lol {
-  var float f;
-}
-var E d;
-<<< d >>>;
-<<< d.i >>>;
-<<< d.f >>>;