-Subproject commit 039b37610ecc8f3ed162e6a9f7a20b1612109dea
+Subproject commit 03ba6e84913b026d77a02152010a08850aa93f3e
fun void test() { <<< "member function." >>>; }
class C {
- funcdef void func_t();
-#! funcdef static void s_func_t();
+ funptr void func_t();
+#! funptr static void s_func_t();
var func_t func_p;
#! static fun c_t s_func_p;
#! static s_func_t s_ptr;
-funcdef void func_t();
+funptr void func_t();
var func_t func_p;
fun void test1() { <<< "test1" >>>; }
fun void test2() { <<< "test2" >>>; }
#! define a fun pointer type
-funcdef void Test();
+funptr void Test();
#! define a few funs
fun void test1(){ <<< "test" >>>; };
-funcdef void t_ptr();
+funptr void t_ptr();
fun void test(t_ptr p) {
<<< p >>>;
}
class C {
- funcdef void t_ptr();
- funcdef void t_ptr1(int);
+ funptr void t_ptr();
+ funptr void t_ptr1(int);
fun void test(t_ptr p) {
<<< p >>>;
}
-funcdef void t_ptr:[A]();
+funptr void t_ptr:[A]();
fun void test(t_ptr p) {
<<< p >>>;
}
class C {
- funcdef void Test();
+ funptr void Test();
fun void test1(){};
var Test test0;
<<< test1 @=> test0 >>>;
-Subproject commit 88fdb929584524f29d8eeb23b0fc7afd80fd57ee
+Subproject commit aaf3e8eea9c665f609d98a573cfa9b442f1f6eb7
Func func;
opck ck;
opem em;
- m_uint emit_var;
} M_Operator;
ANN void free_op_map(Map map, struct Gwion_ *gwion) {
-funcdef int test_t(int, int);
+funptr int test_t(int, int);
fun void test(test_t t) {
<<<t(1,2)>>>;
}
--- /dev/null
+0 => var auto i;
+
+try { #! it will resume here
+ <<< "value of i ${i}" >>>;
+ 1/i; #! will perform ZeroDiveException on first try
+} handle ZeroDivideException {
+ <<< "set i to ${ 42 => i } and resume" >>>;
+ retry;
+}
+<<< "value of i at the end ${i}" >>>;
+
+#!perform Something;
#! [contains] Can't call late function pointer at declaration site
-funcdef void test(int);
+funptr void test(int);
(var test t)(2);
#! [contains] can't use non global fptr of other class
class C {
- funcdef void t_ptr();
+ funptr void t_ptr();
}
class D {
- funcdef void t_ptr();
+ funptr void t_ptr();
var C.t_ptr ptr;
}
#! [contains] argument number does not match for lambda
-funcdef void ptr_t(int i);
+funptr void ptr_t(int i);
\a b { <<< a, " ", b >>>; } @=> var ptr_t ptr;
ptr(2);
#! [contains] argument number does not match for lambda
-funcdef void ptr_t(int i);
+funptr void ptr_t(int i);
\a b { <<< a, " ", b >>>; } @=> var ptr_t ptr;
fun void test(ptr_t p) {
p(2);
#! [contains] can only be used at class scope
-funcdef static void my_fun();
+funptr static void my_fun();
#! [contains] unknown type
-funcdef unknown_type my_fun();
+funptr unknown_type my_fun();
#! [contains] unknown type
-funcdef void my_func(unknown_type type);
+funptr void my_func(unknown_type type);
#! [contains] cannot declare variables of size '0'
-funcdef void my_func(void arg);
+funptr void my_func(void arg);
#! [contains] must be defined with empty
-funcdef void my_func (int i[4]);
+funptr void my_func (int i[4]);
#! [contains] can't assign non member function to member function pointer
class C {
- funcdef void Test();
+ funptr void Test();
var Test test;
}
#! [contains] can't assign member function to non member function pointer
-funcdef void Test();
+funptr void Test();
var Test test;
class D {
fun void test(){}
#! [contains] can't assign member function to a pointer of an other class
class C {
- funcdef void Test();
+ funptr void Test();
var Test test;
}
#! [contains] has already been defined in the same scope
var int i;
-funcdef void i();
+funptr void i();
fun void test(int i){}
fun void test(float f){}
-funcdef void Test();
+funptr void Test();
var Test t;
test @=> t;
#! [contains] can only be used at class scope
-funcdef static void Test();
+funptr static void Test();
#! [contains] can only be used at class scope
-funcdef static void Test(int i);
+funptr static void Test(int i);
#! [contains] pre-defined types
-funcdef void t_ptr:[A]();
+funptr void t_ptr:[A]();
var t_ptr:[int] iptr;
#! [contains] pre-defined types
-funcdef void t_ptr:[A]();
+funptr void t_ptr:[A]();
typedef t_ptr:[int] B;
fun void test:[A]() {
#! [contains] can't assign
class C {
fun static void test(int i) { <<< "int arg" >>>; }
- funcdef void PtrType(int i);
+ funptr void PtrType(int i);
test @=> var PtrType p;
p(1);
test @=> p;
class C {
fun void test(int i) { <<< "int arg" >>>; }
- funcdef static void PtrType(int i);
+ funptr static void PtrType(int i);
test @=>
var PtrType p;
p(1);
class C {
fun void test(int i) { <<< "int arg" >>>; }
- funcdef void PtrType(int i);
+ funptr void PtrType(int i);
test @=> var static PtrType p;
p(1);
test @=> p;
class C {
fun static void test(int i) { <<< "int arg" >>>; }
- funcdef static void PtrType(int i);
+ funptr static void PtrType(int i);
test @=> var static PtrType p;
p(1);
test @=> p;
#! [contains] can't assign
class C {
fun void test(int i) { <<< "int arg" >>>; }
- funcdef static void PtrType(int i);
+ funptr static void PtrType(int i);
test @=> var static PtrType p;
p(1);
test @=> p;
-funcdef void ptr_t();
+funptr void ptr_t();
var ptr_t t @=> var ptr_t t2;
class C {
-funcdef global void global_fptr(int i);
+funptr global void global_fptr(int i);
}
class C {
- funcdef void ptr_t:[A]();
+ funptr void ptr_t:[A]();
fun void test:[A]() {}
test $ ptr_t;
}
class C {
var int m_i;
- funcdef void t_fptr0();
- funcdef void t_fptr1(int i);
+ funptr void t_fptr0();
+ funptr void t_fptr1(int i);
fun void test() { <<< this , " ", __func__ >>>;}
fun void test(int i) { <<< __func__, " ", i >>>;}
test @=> var t_fptr0 ptr0;
class C {
- funcdef void T();
+ funptr void T();
fun int f(T t) { <<< t >>>; t();}
fun void test() { <<< __func__ >>>; }
test => f;
class C {
- funcdef void ptr_t(int i,int j);
+ funptr void ptr_t(int i,int j);
\a b { <<< this, " ", a, " ", b, " test" >>>; } @=> var ptr_t ptr;
fun void test(int i, int j) { <<< this, " ", i, " ", j >>>; }
}
class C {
- funcdef void ptr_t(int i);
+ funptr void ptr_t(int i);
\a { <<< this, " ", a >>>; } @=> var ptr_t ptr;
fun void t1(int i) { <<< this, " t1 ", i >>>; }
fun void test(ptr_t p) {
class C {
- funcdef void t_fptr(int i);
+ funptr void t_fptr(int i);
fun void test(int i) { <<< this , " ", __func__, " ", i >>>;}
test @=> var t_fptr ptr;
}
-funcdef void t_fptr(int i);
+funptr void t_fptr(int i);
fun void test(int i) { <<< __func__, " ", i >>>;}
test @=> var t_fptr ptr;
<<< ptr >>>;
class C {
- funcdef void t_fptr(int i, int);
+ funptr void t_fptr(int i, int);
fun void test(int i, int j) { <<< this ,
" ", __func__, " ", i, " " , j >>>;}
test @=> var t_fptr ptr;
class C {
- funcdef static void func_t:[A](A a);
+ funptr static void func_t:[A](A a);
fun static void myfunc:[A](A a) { <<< a >>>; }
myfunc @=> var static func_t ptr;
ptr(1);
class C:[A] {
- funcdef static void func_t:[A](A a);
+ funptr static void func_t:[A](A a);
fun static void myfunc:[A](A a) { <<< a >>>; }
myfunc @=> var static func_t ptr;
ptr(1);
class C {
- funcdef void t_ptr();
+ funptr void t_ptr();
var t_ptr iptr;
class C {
- funcdef void t_ptr(...);
+ funptr void t_ptr(...);
var t_ptr iptr;
class C {
- funcdef void t_ptr:[A]();
+ funptr void t_ptr:[A]();
var t_ptr:[int] iptr;
class C {
- funcdef static void t_ptr:[A]();
+ funptr static void t_ptr:[A]();
var t_ptr:[int] iptr;
-funcdef void t_ptr:[A]();
+funptr void t_ptr:[A]();
var t_ptr ptr;
-funcdef void ptr_t:[A](myPtr ptr);
+funptr void ptr_t:[A](myPtr ptr);
var ptr_t:[ Ptr:[A] ] t;
class C
{
- funcdef void Test();
+ funptr void Test();
var Test test;
fun void func(){}
}
-funcdef void test(int);
+funptr void test(int);
(var test t)(2);
class C {
fun void test(int i) { <<< "int arg" >>>; }
- funcdef void ptr_t(int i);
+ funptr void ptr_t(int i);
test @=> var ptr_t p;
p(1);
test @=> p;
class C {
- funcdef global void global_fptr(int i);
+ funptr global void global_fptr(int i);
}
#! [contains] can't use non global fptr of other class
class C {
- funcdef void t_ptr();
+ funptr void t_ptr();
}
class D {
- funcdef void t_ptr();
+ funptr void t_ptr();
var C.t_ptr ptr;
}
-funcdef int[] test(int i);
+funptr int[] test(int i);
-funcdef void test(int i[]);
+funptr void test(int i[]);
-funcdef void Test();
+funptr void Test();
fun void t(){<<< "lol" >>>;}
t @=> var Test test;
test();
-funcdef void Test();
+funptr void Test();
fun void t0(){}
t0 @=> var Test test;
test();
class C {
var static int i;
- funcdef static void Test();
+ funptr static void Test();
var static Test test;
}
-funcdef int ptr_t:[A](A);
+funptr int ptr_t:[A](A);
var ptr_t ptr;
<<<ptr>>>;
-funcdef void t_ptr(int i);
+funptr void t_ptr(int i);
typedef t_ptr A;
var A a;
<<<a>>>;
class C {
-funcdef void t_ptr();
+funptr void t_ptr();
typedef t_ptr A;
var A a;
<<<a>>>;
-funcdef void t_ptr:[A]();
+funptr void t_ptr:[A]();
var t_ptr:[int] iptr;
var t_ptr:[float] fptr;
-funcdef void t_ptr:[A]();
+funptr void t_ptr:[A]();
fun void test:[A]() {
<<< __func__ >>>;
}
class C {
- funcdef void t_ptr:[A]();
+ funptr void t_ptr:[A]();
var t_ptr:[int] iptr;