var Object[2][3][4] r;
var Object[2][3][4][5] s;
var Object[2][12][3][4][5] t;
-[1,2,3,4] => i;
+[1,2,3,4] :=> i;
var int k[1][1];
var A a[4][4];
<<< a[2][3] >>>;
-<<< 2 => a[2][3].i >>>;
+<<< 2 :=> a[2][3].i >>>;
var int i[4][4];
-<<< 54 => i[2][3] >>>;
+<<< 54 :=> i[2][3] >>>;
var float f[4][4];
<<< f[2][3] >>>;
-<<< 12.345 => f[2][3] >>>;
+<<< 12.345 :=> f[2][3] >>>;
fun void test() { <<< "member function." >>>; }
fun void test2() { <<< "member function variant." >>>; }
#! fun static void s_test() { <<< "member fun." >>>; }
-#! test @=> func_p;
-#! test @=> s_ptr;
+#! test :=> func_p;
+#! test :=> s_ptr;
#! those are forbidden
#!func_p();
#!this.func_p();
- test2 @=> func_p;
+ test2 :=> func_p;
#!func_p();
test();
var C c;
c.func_p();
-#!test @=> c.s_func_p;
-c.test @=> c.func_p;
+#!test :=> c.s_func_p;
+c.test :=> c.func_p;
c.func_p();
-c.test2 @=> c.func_p;
+c.test2 :=> c.func_p;
c.func_p();
class C
{
- 12 => var int i;
+ 12 :=> var int i;
var Object o;
spork {
"test";
second => now;
var string s;
<<< "test spork exp." >>>;
- } => var Shred shred;
+ } :=> var Shred shred;
}
var C c;
var int i;
-<<< 2 => i >>>;
+<<< 2 :=> i >>>;
<<< i >>>;
<<< i +=> i >>>;
<<< 13 => i >>>;
-"test" => var string s;
+"test" :=> var string s;
<<< s >>>;
class C extends int[2] {
<<< "test" >>>;
- 123 => var int i;
+ 123 :=> var int i;
}
var C c;
{
var float variable1;
var float variable2;
- <<< variable1=>variable2 >>>;
+ <<< variable1:=>variable2 >>>;
}
#!testing operator for float and float
#!testing operator for float and float
{
- 1 => var float variable1;
- 1 => var float variable2;
+ 1 :=> var float variable1;
+ 1 :=> var float variable2;
<<< variable1/=>variable2 >>>;
}
{
var int variable1;
var float variable2;
- <<< variable1=>variable2 >>>;
+ <<< variable1:=>variable2 >>>;
}
#!testing operator for int and float
#!testing operator for int and float
{
var int variable1;
- 1 => var float variable2;
+ 1 :=> var float variable2;
<<< variable1/=>variable2 >>>;
}
{
var float variable1;
var int variable2;
- <<< variable1=>variable2 >>>;
+ <<< variable1:=>variable2 >>>;
}
#!testing operator for float and int
#!testing operator for float and int
{
- 1 => var float variable1;
- 1 => var int variable2;
+ 1 :=> var float variable1;
+ 1 :=> var int variable2;
<<< variable1/=>variable2 >>>;
}
var func_t func_p;
fun void test1() { <<< "test1" >>>; }
fun void test2() { <<< "test2" >>>; }
-test1 @=> func_p;
+test1 :=> func_p;
func_p();
func_p();
func_p();
() => func_p;
<<< func_p >>>;
<<< func_p() >>>;
-test2 @=> func_p;
+test2 :=> func_p;
func_p();
func_p();
func_p();
var Test test;
#! assign it a fun
-test1 @=> test;
+test1 :=> test;
#! test it
test();
#! ...
-test2 @=> test;
+test2 :=> test;
test();
-test3 @=> test;
+test3 :=> test;
test();
<<< test3 $ Test >>>;
test $ t_ptr;
\{ <<< __func__ >>>; } $ t_ptr;#!; => test;
\{ <<< __func__ >>>; } => test;
- \a{} @=> var t_ptr1 ptr1;
+ \a{} :=> var t_ptr1 ptr1;
}
var C c;
#!testing operator for int and int
{
var int variable1;
- 1 => var int variable2;
+ 1 :=> var int variable2;
<<< variable1/variable2 >>>;
}
#!testing operator for int and int
{
var int variable1;
- 1 => var int variable2;
+ 1 :=> var int variable2;
<<< variable1%variable2 >>>;
}
{
var int variable1;
var int variable2;
-<<< variable1=>variable2 >>>;
+<<< variable1:=>variable2 >>>;
}
#!testing operator for int and int
#!testing operator for int and int
{
- 1 => var int variable1;
- 1 => var int variable2;
+ 1 :=> var int variable1;
+ 1 :=> var int variable2;
<<< variable1/=>variable2 >>>;
}
#!testing operator for int and int
{
- 1 => var int variable1;
+ 1 :=> var int variable1;
var int variable2;
<<< variable1%=>variable2 >>>;
}
<<< c.m_i(), " ", c.m_f(), " ", c.m_o() >>>;
#! write members
-<<< 12 => c.i >>>;
-<<< 1.2 => c.f >>>;
+<<< 12 :=> c.i >>>;
+<<< 1.2 :=> c.f >>>;
funptr void Test();
fun void test1(){};
var Test test0;
- <<< test1 @=> test0 >>>;
+ <<< test1 :=> test0 >>>;
}
var C c;
-12 => var int i;
+12 :=> var int i;
<<<i $ Ptr:[int] >>>;
class C
{
- 12 => var int i;
+ 12 :=> var int i;
var Object o;
<<< this >>>;
spork {
var string s;
<<< this, " test spork exp. " , s >>>;
- } => var Shred shred;
+ } :=> var Shred shred;
}
var C c;
<<< C._i(), " ", C._f(), " ", C._o() >>>;
#! write members
-<<< 12 => C.i >>>;
-<<< 1.2 => C.f >>>;
+<<< 12 :=> C.i >>>;
+<<< 1.2 :=> C.f >>>;
var string s;
-"CamelCase" => s;
-<<< "test" => s >>>;
+"CamelCase" :=> s;
+<<< "test" :=> s >>>;
-Subproject commit c9321c371bd077408face4d5c036b46bb0c9d5af
+Subproject commit 280932ab822dc4ba6ec530b2df1308286fab4322
GWI_BB(gwi_oper_ini(gwi, "Array", "Array", NULL))
GWI_BB(gwi_oper_add(gwi, opck_array_at))
- GWI_BB(gwi_oper_end(gwi, "=>", NULL))
+ GWI_BB(gwi_oper_end(gwi, ":=>", NULL))
GWI_BB(gwi_oper_add(gwi, opck_array_implicit))
// GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
GWI_BB(gwi_oper_end(gwi, "@implicit", NoOp))
// we'll only deal with auto fptr declaration
if (bin->rhs->exp_type != ae_exp_decl &&
bin->rhs->d.exp_decl.td->xid != insert_symbol("auto"))
- ERR_N(bin->lhs->pos, "invalid {G+}function{0} {+}@=>{0} {+G}function{0} assignment");
+ ERR_N(bin->lhs->pos, "invalid {G+}function{0} {+}:=>{0} {+G}function{0} assignment");
if (bin->lhs->exp_type == ae_exp_td)
ERR_N(bin->lhs->pos, "can't use {/}type decl expressions{0} in auto function pointer declarations");
if(!bin->lhs->type->info->func)
GWI_BB(gwi_oper_ini(gwi, "function", "funptr", NULL))
GWI_BB(gwi_oper_add(gwi, opck_fptr_assign))
GWI_BB(gwi_oper_emi(gwi, opem_fptr_assign))
- GWI_BB(gwi_oper_end(gwi, "@=>", NULL))
+ GWI_BB(gwi_oper_end(gwi, ":=>", NULL))
GWI_BB(gwi_oper_add(gwi, opck_fptr_impl))
GWI_BB(gwi_oper_emi(gwi, opem_fptr_impl))
GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
GWI_BB(gwi_oper_end(gwi, "$", NULL))
GWI_BB(gwi_oper_ini(gwi, "function", "function", NULL))
GWI_BB(gwi_oper_add(gwi, opck_auto_fptr))
- GWI_BB(gwi_oper_end(gwi, "@=>", int_r_assign))
+ GWI_BB(gwi_oper_end(gwi, ":=>", int_r_assign))
GWI_BB(gwi_oper_ini(gwi, "function", NULL, NULL))
GWI_BB(gwi_oper_add(gwi, opck_func_partial))
GWI_BB(gwi_oper_end(gwi, "@partial", NULL))
GWI_BB(gwi_oper_ini(gwi, "Object", "Object", NULL))
GWI_BB(gwi_oper_add(gwi, opck_object_at))
GWI_BB(gwi_oper_emi(gwi, opem_object_at))
- GWI_BB(gwi_oper_end(gwi, "=>", NULL))
+ GWI_BB(gwi_oper_end(gwi, ":=>", NULL))
GWI_BB(gwi_oper_ini(gwi, "Object", "Object", "bool"))
GWI_BB(gwi_oper_end(gwi, "==", EqObject))
GWI_BB(gwi_oper_end(gwi, "!=", NeqObject))
static GWION_IMPORT(int_r) {
GWI_BB(gwi_oper_ini(gwi, "int", "int", "int"))
- CHECK_OP("=>", rassign, r_assign)
+ CHECK_OP(":=>", rassign, r_assign)
CHECK_OP("+=>", rassign, r_plus)
CHECK_OP("-=>", rassign, r_minus)
CHECK_OP("*=>", rassign, r_mul)
GWI_BB(gwi_oper_end(gwi, "-", int_float_minus))
GWI_BB(gwi_oper_add(gwi, opck_int_float_div))
GWI_BB(gwi_oper_end(gwi, "/", int_float_div))
- CHECK_IF("=>", rassign, r_assign)
+ CHECK_IF(":=>", rassign, r_assign)
CHECK_IF("+=>", rassign, r_plus)
CHECK_IF("-=>", rassign, r_minus)
CHECK_IF("*=>", rassign, r_mul)
GWI_BB(gwi_oper_end(gwi, "*", float_int_mul))
GWI_BB(gwi_oper_add(gwi, opck_float_int_div))
GWI_BB(gwi_oper_end(gwi, "/", float_int_div))
- CHECK_FI("=>", rassign, r_assign)
+ CHECK_FI(":=>", rassign, r_assign)
CHECK_FI("+=>", rassign, r_plus)
CHECK_FI("-=>", rassign, r_minus)
CHECK_FI("*=>", rassign, r_mul)
static GWION_IMPORT(dur) {
GWI_BB(gwi_oper_cond(gwi, "dur", BranchEqFloat, BranchNeqFloat))
GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "dur"))
- CHECK_FF("=>", rassign, r_assign)
+ CHECK_FF(":=>", rassign, r_assign)
CHECK_FF("+=>", rassign, r_plus)
CHECK_FF("-=>", rassign, r_minus)
CHECK_FF("*=>", rassign, r_mul)
static GWION_IMPORT(time) {
GWI_BB(gwi_oper_cond(gwi, "time", BranchEqFloat, BranchNeqFloat))
GWI_BB(gwi_oper_ini(gwi, "time", "time", "time"))
- CHECK_FF("=>", rassign, r_assign)
+ CHECK_FF(":=>", rassign, r_assign)
GWI_BB(gwi_oper_ini(gwi, "time", "dur", "time"))
GWI_BB(gwi_oper_end(gwi, "+", float_add))
GWI_BB(gwi_oper_end(gwi, "*", float_mul))
CHECK_FF("*=>", rassign, r_mul)
CHECK_FF("/=>", rassign, r_div)
GWI_BB(gwi_oper_ini(gwi, "dur", "time", "time"))
- CHECK_FF("=>", rassign, r_assign)
+ CHECK_FF(":=>", rassign, r_assign)
GWI_BB(gwi_oper_end(gwi, "+", float_add))
GWI_BB(gwi_oper_ini(gwi, "dur", "@now", "time"))
_CHECK_OP("=>", now, Time_Advance)
IMPORT_BINARY_FLOAT(mul, *);
IMPORT_BINARY_FLOAT(div, /);
GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
- CHECK_FF("=>", rassign, r_assign)
+ CHECK_FF(":=>", rassign, r_assign)
CHECK_FF("+=>", rassign, r_plus)
CHECK_FF("-=>", rassign, r_minus)
CHECK_FF("*=>", rassign, r_mul)
GWI_BB(gwi_oper_ini(gwi, "Ptr", "Ptr", "Ptr"))
GWI_BB(gwi_oper_add(gwi, opck_ptr_ref))
// GWI_BB(gwi_oper_emi(gwi, opem_ptr_ref))
- GWI_BB(gwi_oper_end(gwi, "=>", int_r_assign))
+ GWI_BB(gwi_oper_end(gwi, "::=>", int_r_assign))
return GW_OK;
}
GWI_BB(gwi_oper_ini(gwi, "None", "None", "None"))
GWI_BB(gwi_oper_add(gwi, opck_none))
GWI_BB(gwi_oper_emi(gwi, opem_none))
- GWI_BB(gwi_oper_end(gwi, "=>", NoOp))
+ GWI_BB(gwi_oper_end(gwi, ":=>", NoOp))
const Type t_union = gwi_class_ini(gwi, "union", "Object");
gwi_class_xtor(gwi, NULL, UnionDtor);
exp->func->d.exp_dot.is_call = exp;
if (exp->func->exp_type == ae_exp_decl)
ERR_B(exp->func->pos, _("Can't call late function pointer at declaration "
- "site. did you meant to use `@=>`?"))
+ "site. did you meant to use `:=>`?"))
const Type t = actual_type(env->gwion, exp->func->type);
if (is_func(env->gwion, t) && exp->func->exp_type == ae_exp_dot && // is_callable
!t->info->value->from->owner_class) {
ANN static Type check_exp_binary(const Env env, const Exp_Binary *bin) {
CHECK_OO(check_exp(env, bin->lhs));
- const m_bool is_auto = (bin->op == insert_symbol("=>") || bin->op == insert_symbol("@=>")) &&
+ const m_bool is_auto = bin->op == insert_symbol(":=>") &&
bin->rhs->exp_type == ae_exp_decl &&
bin->rhs->d.exp_decl.type == env->gwion->type[et_auto];
if (is_auto) bin->rhs->d.exp_decl.type = bin->lhs->type;
i[0];
f[0];
- 2 => i[0];
- 5.7 => f[0];
+ 2 :=> i[0];
+ 5.7 :=> f[0];
i << 1;
f << 1.2;
do { <<< i-- >>>; }
while(i);
-6 => var float f;
+6 :=> var float f;
do { <<< 1 -=> f >>>; }
while(f);
-5 => var int i;
+5 :=> var int i;
do { <<< i-- >>>; } while(i);
-5 => var float f;
+5 :=> var float f;
do { <<< 1 -=> f >>>; } while(f > 0.0);
#! do { <<< 1 -=> f >>>; } while(f > 0);
-5 => f;
+5 :=> f;
do { <<< 1 -=> f >>>; } until(f == 0);
#!do { <<< 1 -=> f >>>; } until(f == 0.0);
-5 => i;
+5 :=> i;
do { <<< i-- >>>; } until(!i);
var Object o;
-"Object: " => var string s;
+"Object: " :=> var string s;
<<< s + (o + "") >>>;
-"lol" => var string s;
-"test" => s;
+"lol" :=> var string s;
+"test" :=> s;
<<< "testmem".replace(2, 3, "UKUH") >>>;
#! [contains] 42
-40 => var int a;
+40 :=> var int a;
{
\ : a : { <<< a + 2 >>>; }();
}
#! [contains] 42
-2 => var int i;
+2 :=> var int i;
fun int test() {
return i;
}
fun int test(int tmp) {
- return tmp => i;
+ return tmp :=> i;
}
<<< 40 +=> test >>>;
#! [contains] during rewriting operation
-2 => var int i;
+2 :=> var int i;
fun int test() {
return i;
}
fun int test(int tmp) {
- return tmp => i;
+ return tmp :=> i;
}
<<< me +=> test >>>;
#! [contains] new operator must be set inside class
var int i;
operator new(int arg) {
- arg => i;
+ arg :=> i;
}
class C {
var int i;
operator new(int arg) {
- arg => i;
+ arg :=> i;
}
operator new() {}
}
-new C() => var auto c;
-new C(2) => var auto d;
+new C() :=> var auto c;
+new C(2) :=> var auto d;
<<< "c:${c.i}, d:${d.i}" >>>;
<<< "the answer: ${(new C(42)).i}" >>>;
#! [contains] false
struct C {
- 12 => const int i;
+ 12 :=> const int i;
}
struct D {
- 42 => const int i;
+ 42 :=> const int i;
}
const C c;
#! [contains] no deep operation
struct C {
- 12 => const int i;
- 12 => const int j;
+ 12 :=> const int i;
+ 12 :=> const int j;
}
struct D {
- 42 => const int i;
+ 42 :=> const int i;
}
var C c;
#! [contains] true
struct C {
- 12 => const int i;
+ 12 :=> const int i;
}
struct D {
- 42 => const int i;
+ 42 :=> const int i;
}
var C c;
#! [contains] no deep operation
struct C {
- 12 => const int i;
- 12 => const int j;
+ 12 :=> const int i;
+ 12 :=> const int j;
}
struct D {
- 42 => const int i;
+ 42 :=> const int i;
}
var C c;
#! [contains] 0
const Dict:[string, int] d;
-0 => d["foo"];
-1 => d["bar"];
-2 => d["baz"];
+0 :=> d["foo"];
+1 :=> d["bar"];
+2 :=> d["baz"];
<<< d["foo"] >>>;
#! ensure no leaks
const Dict:[string, Event] d;
-new Object => d["foo"];
-new Object => d["bar"];
-new Object => d["baz"];
+new Object :=> d["foo"];
+new Object :=> d["bar"];
+new Object :=> d["baz"];
#! [contains] InvalidMapAccess
const Dict:[string, int] d;
-0 => d["foo"];
-1 => d["bar"];
-2 => d["baz"];
+0 :=> d["foo"];
+1 :=> d["bar"];
+2 :=> d["baz"];
#! could be "foo" ~~ d
<<< d.remove("foo") >>>;
perform Test;
}
-myfunc @=> const test_t t;
+myfunc :=> const test_t t;
t(2);
#! [contains] value of i at the end 42
-0 => var auto i;
+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" >>>;
+ <<< "set i to ${ 42 :=> i } and resume" >>>;
retry;
}
<<< "value of i at the end ${i}" >>>;
#! [contains] do not provide array
-[1,2,3,4] => var int[1] loop;
+[1,2,3,4] :=> var int[1] loop;
#! [contains] array depths do not match
-[1,2,3,4] => var int[1][1] k;
+[1,2,3,4] :=> var int[1][1] k;
#! [contains] non-mutable
-[1,2,3,4] => [1][1];
+[1,2,3,4] :=> [1][1];
#! [contains] array types do not match
-[1,2,3,4] => var Object[1] k;
+[1,2,3,4] :=> var Object[1] k;
#! [contains] right-side operand is non-mutable
fun void test(const int i) {
- 10 => i;
+ 10 :=> i;
}
test(2);
#! [contains] right-side operand is non-mutable
-10 => const int i;
-12 => i;
+10 :=> const int i;
+12 :=> i;
<<< i >>>;
#! [contains] right-side operand is non-mutable
const int i;
-12 => i;
+12 :=> i;
#! [contains] while defining
class C {
- 0 => var int i;
+ 0 :=> var int i;
}
operator int @implicit (C c) {
return c;
#! [contains] invalid array access expression
var int[2] j;
-j[1,2,3,4] => i;
+j[1,2,3,4] :=> i;
var C[1] c;
var C[2][4]d;
-c :=> d;
+c ~=> d;
funptr void Test();
var Test t;
-test @=> t;
+test :=> t;
#! [contains] right-side operand is non-mutable
- 2 => 1;
+2 :=> 1;
<<< __func__, " ", a>>>;
}
-test @=> iptr;
+test :=> iptr;
<<< iptr() >>>;
<<< iptr:[int]() >>>;
<<< iptr:[float]() >>>;
<<< __func__ >>>;
}
-test @=> var B b;
+test :=> var B b;
<<< b() >>>;
<<< b:[float]() >>>;
-fork { <<< __func__ >>>; minute => now; } => var Fork f;
+fork { <<< __func__ >>>; minute => now; } :=> var Fork f;
f.join();
class C {
fun void test(int i) { <<< "int arg" >>>; }
funptr static void PtrType(int i);
- test @=>
+ test :=>
var PtrType p;
p(1);
- test @=> p;
+ test :=> p;
p(1);
}
class C {
fun void test(int i) { <<< "int arg" >>>; }
funptr void PtrType(int i);
- test @=> var static PtrType p;
+ test :=> var static PtrType p;
p(1);
- test @=> p;
+ test :=> p;
p(1);
}
class C {
fun static void test(int i) { <<< "int arg" >>>; }
funptr static void PtrType(int i);
- test @=> var static PtrType p;
+ test :=> var static PtrType p;
p(1);
- test @=> p;
+ test :=> p;
p(1);
}
funptr void ptr_t();
-var ptr_t t @=> var ptr_t t2;
+var ptr_t t :=> var ptr_t t2;
#! [contains] Hello, generated function pointer!
fun void test() { <<< "Hello, generated function pointer!" >>>; }
-test @=> var auto p;
+test :=> var auto p;
p();
#!- this also
const float ii;
-123=> var float f;
+123 :=> var float f;
foreach(a : [12, 1, 2 ,3].compactMap:[int]( \a {
var int?i;
- 145 => i.val;
+ 145 :=> i.val;
if(maybe)
i.val++;
return i;
}
)) {
- <<< "mapped to => ${a}" >>>;
+ <<< "mapped to :=> ${a}" >>>;
}
fun int? t(int x) {
var int?i;
- 145 => i.val;
+ 145 :=> i.val;
if(maybe)
i.val++;
return i;
}
foreach(a : [12, 1, 2 ,3].compactMap:[int](t))
- <<< "mapped to => ${a}" >>>;
+ <<< "mapped to :=> ${a}" >>>;
<<< "test" >>>;
fun float t(float i) { return 2; }
foreach(a : [12., 1, 2 ,3].map:[float](t))
- <<< "mapped to => ${a}" >>>;
+ <<< "mapped to :=> ${a}" >>>;
#!foreach(a : [12, 1, 2 ,3].map:[int](t))
-#! <<< "mapped to => ${a}" >>>;
+#! <<< "mapped to :=> ${a}" >>>;
#!foreach(a : [12, 1, 2 ,3].map:[int](t))
-#! <<< "mapped to => ${a}" >>>;
+#! <<< "mapped to :=> ${a}" >>>;
#!foreach(a : [12, 1, 2 ,3].map:[int](t))
-#! <<< "mapped to => ${a}" >>>;
-#!foreach(a : [12, 1, 2 ,3].map:[int]( \a {145 => a;return 2;}))
-#! <<< "mapped to => ${a}" >>>;
-#!foreach(a : [12, 1, 2 ,3].map:[int]( \a {145 => a;return 2;}))
-#! <<< "mapped to => ${a}" >>>;
+#! <<< "mapped to :=> ${a}" >>>;
+#!foreach(a : [12, 1, 2 ,3].map:[int]( \a {145 :=> a;return 2;}))
+#! <<< "mapped to :=> ${a}" >>>;
+#!foreach(a : [12, 1, 2 ,3].map:[int]( \a {145 :=> a;return 2;}))
+#! <<< "mapped to :=> ${a}" >>>;
#! [skip] Do to a window bug
#! was #! [contains] 1
class C {
- 10 => var int i;
+ 10 :=> var int i;
}
operator int @conditional (C c) {
#! [contains] 12
class C {
- 12 => var int i;
+ 12 :=> var int i;
}
operator int @implicit (C c) {
#! [skip] due to a window bug
#! was #! [contains] 1
class C {
- 10 => var int i;
+ 10 :=> var int i;
}
operator int @unconditional (C c) {
#! [contains] Hello, interpolation! 1
-1 => var int my;
+1 :=> var int my;
<<< "Hello, interpolation! ${ my }" >>>;
#! [contains] 1 Hello, interpolation!
-1 => var int my;
+1 :=> var int my;
<<< "${my} Hello, interpolation!" >>>;
#! [contains] Hello, interpolation! 1
-1 => var int my;
-"Hello, interpolation! ${ my }" => var string s;
+1 :=> var int my;
+"Hello, interpolation! ${ my }" :=> var string s;
<<< s >>>;
class C {
funptr void ptr_t(int i,int j);
- \a b c { <<< "${a} ${b} ${c}" >>>; } @=> var ptr_t ptr;
+ \a b c { <<< "${a} ${b} ${c}" >>>; } :=> var ptr_t ptr;
fun void test(int i, int j) { <<< this, " ", i, " ", j >>>; }
}
var C c;
<<< c >>>;
-c.test @=> c.ptr;
+c.test :=> c.ptr;
c.ptr(1, 2);
class C {
funptr void ptr_t(int i);
- \a b { <<< "${a} ${b}" >>>; } @=> var ptr_t ptr;
+ \a b { <<< "${a} ${b}" >>>; } :=> var ptr_t ptr;
fun void t1(int i) { <<< this, " t1 ", i >>>; }
fun void test(ptr_t p) {
<<< this >>>;
p(1);
}
- t1 @=> var ptr_t t1p;
+ t1 :=> var ptr_t t1p;
test(t1p);
}
<<< var C c >>>;
-12 => var int i;
+12 :=> var int i;
\a b { <<< "i: ", i, " ", a, " ", b >>>; }(1,2);
#! [contains] argument number does not match for lambda
funptr void ptr_t(int i);
-\a b { <<< a, " ", b >>>; } @=> var ptr_t ptr;
+\a b { <<< a, " ", b >>>; } :=> var ptr_t ptr;
ptr(2);
#! [contains] argument number does not match for lambda
funptr void ptr_t(int i);
-\a b { <<< a, " ", b >>>; } @=> var ptr_t ptr;
+\a b { <<< a, " ", b >>>; } :=> var ptr_t ptr;
fun void test(ptr_t p) {
p(2);
}
funptr void t_fptr1(int i);
fun void test() { <<< this , " ", __func__ >>>;}
fun void test(int i) { <<< __func__, " ", i >>>;}
- test @=> var t_fptr0 ptr0;
- test @=> var t_fptr1 ptr1;
+ test :=> var t_fptr0 ptr0;
+ test :=> var t_fptr1 ptr1;
<<<ptr0>>>;
spork ptr0();
me.yield();
class C {
- 1 => var float f;
+ 1 :=> var float f;
}
var C c;
<<< c.f >>>;
-123 => var global int global_func_i;
+123 :=> var global int global_func_i;
class global GlobalFuncClass {
- 13 => var int i;
+ 13 :=> var int i;
}
<<< global_func_i >>>;
var global GlobalFuncClass g_c;
-<<< g_c, "->i => ", g_c.i >>>;
+<<< 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" >>>; }
<<< g_test >>>;
class C {
funptr void t_fptr(int i);
fun void test(int i) { <<< this , " ", __func__, " ", i >>>;}
- test @=> var t_fptr ptr;
+ test :=> var t_fptr ptr;
}
funptr void t_fptr(int i);
fun void test(int i) { <<< __func__, " ", i >>>;}
-test @=> var t_fptr ptr;
+test :=> var t_fptr ptr;
<<< ptr >>>;
spork ptr(2);
me.yield();
funptr void t_fptr(int i, int);
fun void test(int i, int j) { <<< this ,
" ", __func__, " ", i, " " , j >>>;}
- test @=> var t_fptr ptr;
+ test :=> var t_fptr ptr;
<<< this, ptr >>>;
spork ptr(1,2);
second => now;
class Parent:[A] {
class C:[B] {
- 12 => var A a;
- 13 => var B B;
+ 12 :=> var A a;
+ 13 :=> var B B;
}
}
var Parent:[int].C:[int] c;
<<< this, " ", __func__ >>>;
}
- test @=> iptr;
+ test :=> iptr;
<<< iptr() >>>;
<<< iptr() >>>;
}
<<< this, " ", __func__ >>>;
}
- test @=> iptr;
+ test :=> iptr;
<<< iptr() >>>;
<<< iptr() >>>;
}
<<< __func__ >>>;
}
- test @=> iptr;
+ test :=> iptr;
<<< iptr() >>>;
<<< iptr() >>>;
}
<<< __func_ >>>;
}
-test @=> ptr;
+test :=> ptr;
ptr:[int]();
<<< Coverage.sc_i >>>;
<<< Coverage.sc_f >>>;
-<<< 1 => Coverage.s_i >>>;
-<<< 1.2 => Coverage.s_f >>>;
+<<< 1 :=> Coverage.s_i >>>;
+<<< 1.2 :=> Coverage.s_f >>>;
<<< c.test_array[0][0] >>>;
fun void test(){ <<< "test" >>>; }
var PtrType ptr;
test();
-test @=> ptr;
+test :=> ptr;
ptr();
FuncTypedef.test_func();
-<<< FuncTypedef.test_func @=> FuncTypedef.ptr >>>;
+<<< FuncTypedef.test_func :=> FuncTypedef.ptr >>>;
var FuncTypedef.PtrType _ptr;
<<< FuncTypedef.ptr >>>;
FuncTypedef.ptr();
#import global_var
<<< i >>>;
-<<< "other test" => i >>>;
-<<< 12 => f >>>;
+<<< "other test" :=> i >>>;
+<<< 12 :=> f >>>;
<<< Coverage.sc_i >>>;
<<< Coverage.sc_f >>>;
-<<< 1 => Coverage.s_i >>>;
-<<< 1.2 => Coverage.s_f >>>;
+<<< 1 :=> Coverage.s_i >>>;
+<<< 1.2 :=> Coverage.s_f >>>;
<<< c.test_array[0][0] >>>;
#import typedef
var Typedef t;
#!fun int test(int i) { <<< i >>>; }
-#!test @=> t;
+#!test :=> t;
<<< t >>>;
#import union
var Union u;
<<< u.i >>>;
-<<< 12 => u.f >>>;
-<<< 1 => u.i >>>;
+<<< 12 :=> u.f >>>;
+<<< 1 :=> u.i >>>;
<<< u.i >>>;
<<< u.f >>>;
-<<< 0 => u.i >>>;
-<<< null => u.o >>>;
+<<< 0 :=> u.i >>>;
+<<< null :=> u.o >>>;
<<< a >>>;
}
-12 => var int i;
+12 :=> var int i;
i => inc;
<<< i >>>;
-<<< [1,2,3] => var auto i >>>;
+<<< [1,2,3] :=> var auto i >>>;
<<< i[1:2] >>>;
<<< i[:2] >>>;
<<< i[2: -1] >>>;
-"test" => var string s0;
-"_test" => var string s1;
+"test" :=> var string s0;
+"_test" :=> var string s1;
<<< s0 == s0 >>>;
<<< s0 == s1 >>>;
-"test test" => var string s;
+"test test" :=> var string s;
s.erase(-1, 0);
s.erase(0, -1);
#! [contains] tezt
-"test" => var string t;
+"test" :=> var string t;
<<< t[2] >>>;
-'z' => t[2];
+'z' :=> t[2];
<<< t >>>;
class C {
- 1 => test;
+ 1 :=> test;
fun int test(int i) {
- 13 => var int j;
+ 13 :=> var int j;
return j;
}
}
+
struct S {
- 13 => var int i;
+ 13 :=> var int i;
operator void @gack () { <<< "test", i >>>; }
<<< this >>>;
}
struct S {
var string s;
var float a;
- 11 => var int i;
- 13 => var float f;
+ 11 :=> var int i;
+ 13 :=> var float f;
}
var S s;
<<< "after ctor" >>>;
struct S {
- 4 => var int i;
- 12 => var int j;
+ 4 :=> var int i;
+ 12 :=> var int j;
fun int test() { <<< "test", i >>>; }
test();
}
}
var S s;
-12.3 => s.f;
+12.3 :=> s.f;
s.test();
fun S test() {
var S s;
- 12 => s.i;
- 12 => s.f;
+ 12 :=> s.i;
+ 12 :=> s.f;
return s;
}
class C {
struct S {
- 12 => var int i;
- "testing::" => var string s;
- 13 => var float f;
+ 12 :=> var int i;
+ "testing::" :=> var string s;
+ 13 :=> var float f;
<<< __func__ >>>;
}
var static S s;
struct S {
var int i;
var int j;
- 12 => var static int si;
+ 12 :=> var static int si;
fun static void test() { <<< __func__, si >>>; }
test();
}
var S s;
<<< s.i >>>;
-<<< 12 => s.i >>>;
+<<< 12 :=> s.i >>>;
<<< s.i >>>;
}
var int i[5][3];
-1 => i[2][0];
+1 :=> i[2][0];
<<< i.size() >>>;
<<< i.depth() >>>;
}
var C c;
-c.func @=> c.test;
+c.func :=> c.test;
var int i[4];
foreach(a : i)
- <<< 1 => a >>>;
+ <<< 1 :=> a >>>;
foreach(a : i)
<<< a >>>;
-1 => var int i;
+1 :=> var int i;
<<< "ok" >>>;
while(f)
<<< "not ok" >>>;
-1 => f;
+1 :=> f;
do { <<< "test" >>>; }
until(f);
#! [contains] a
-'a' => var char c;
+'a' :=> var char c;
<<< c >>>;
class C {
- 1 => var int i;
+ 1 :=> var int i;
}
minute;
5::samp;
var float f;
- 2.4 => f;
+ 2.4 :=> f;
f ::samp => now;
}
class C {
var int i;
- now + 1.0::samp => var time t;
+ now + 1.0::samp :=> var time t;
until(now >= t) {
i++;
if(i == 3)
class C {
var int i;
- now + 3::samp => var time t;
+ now + 3::samp :=> var time t;
while(now < t) {
i++;
samp => now;
-10 => const int i;
+10 :=> const int i;
<<< i >>>;
minute;
5::samp;
var float f;
-2.4 => f;
+2.4 :=> f;
f ::samp => now;
-second => var dur d;
+second :=> var dur d;
2.3::d;
<<< "test" >>>;
<<< 2.3 $ int >>>;
-1 => var float f;
+1 :=> var float f;
fun void test(float _f){}
1 => test;
class C {
fun void test(int i) { <<< "int arg" >>>; }
funptr void ptr_t(int i);
- test @=> var ptr_t p;
+ test :=> var ptr_t p;
p(1);
- test @=> p;
+ test :=> p;
p(1);
}
new Object;
-new Object => var Object refref;
+new Object :=> var Object refref;
new Event;
var Event ev;
-ev => var Event e;
-new Event => e;
-ev => e;
+ev :=> var Event e;
+new Event :=> e;
+ev :=> e;
var C c;
<<< c.i >>>;
#!<<< ++c.i >>>;
-#!1 => c.i;
+#!1 :=> c.i;
2 +=> c.i;
funptr void Test();
fun void t(){<<< "lol" >>>;}
-t @=> var Test test;
+t :=> var Test test;
test();
funptr void Test();
fun void t0(){}
-t0 @=> var Test test;
+t0 :=> var Test test;
test();
#! define a funs that returns 1 if 'i' is non zero, and 0 othervise.
fun int test() { return i ? 1 : 0; }
<<< test() >>>;
-1 => i;
+1 :=> i;
<<< test() >>>;
-2 => i;
+2 :=> i;
<<< test() >>>;
var Event e;
spork { e => now; };
spork { samp => now; 4::samp => now;};
-spork { 5::samp => now;} => var Shred s;
-spork { samp => now; 4::samp => now; } => var Shred t;
+spork { 5::samp => now;} :=> var Shred s;
+spork { samp => now; 4::samp => now; } :=> var Shred t;
spork { 2::samp => now; me.exit(); };
spork { new Object; <<< "garbage collect me" >>>; 3::samp => now; };
2::samp => now;
-12 => var int i;
+12 :=> var int i;
<<< i >>>;
<<<ptr>>>;
fun int test:[A](A a) { <<< a >>>; }
-test @=> ptr;
+test :=> ptr;
<<< ptr >>>;
ptr:[int](2);
ptr:[float](2.3);
<<<a>>>;
fun void test(int i) { <<< __func__ , " ", i>>>; }
-test @=> a;
+test :=> a;
a(1);
<<<a>>>;
fun void test() { <<< __func__ >>>; }
-test @=> a;
+test :=> a;
a();
a();
a();
<<< __func__ >>>;
}
-test @=> iptr;
-test @=> fptr;
+test :=> iptr;
+test :=> fptr;
<<< iptr() >>>;
<<< iptr() >>>;
typedef t_ptr:[int] B;
var B b;
<<< b >>>;
-test @=> b;
+test :=> b;
<<< b >>>;
<<< b() >>>;
<<< b() >>>;
typedef t_ptr:[float] C;
var C c;
<<< c >>>;
-test @=> c;
+test :=> c;
<<< c >>>;
<<< c() >>>;
<<< c() >>>;
<<< this, " ", __func__ >>>;
}
- test @=> iptr;
+ test :=> iptr;
<<< iptr() >>>;
#! <<< iptr() >>>;
}
var int i;
-now + 1.0::samp => var time t;
+now + 1.0::samp :=> var time t;
until(now >= t) {
i++;
if(i == 3)
var string name;
class ChildClass extends ParentClass {
- "Gotcha!" => name;
+ "Gotcha!" :=> name;
}
}
var int i;
-now + 3::samp => var time t;
+now + 3::samp :=> var time t;
while(now < t) {
i++;
samp => now;
#! [contains] right-side operand is non-mutable
-None => None;
+None :=> None;
#! [contains] 12
var int? i;
-<<< 12 => i.val >>>;
+<<< 12 :=> i.val >>>;
<<< i.val >>>;
#! [contains] val: 12
var int? i;
-12 => i.val;
+12 :=> i.val;
if(i.is(val))
<<< "val: ${i.val}" >>>;
float f;
}
-new U(i, 1) => var U u;
+new U(i, 1) :=> var U u;
<<< u.i >>>;
-2.4 => u.f;
+2.4 :=> u.f;
<<< u.f >>>;