From: fennecdjay Date: Fri, 5 Jul 2019 19:17:45 +0000 (+0200) Subject: :art: Update '<<<' X-Git-Tag: nightly~2348^2~39 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ce05279dd84fb95f6ea90d8d0209a3dbd24dea8a;p=gwion.git :art: Update '<<<' --- diff --git a/README.md b/README.md index f8898c4e..230ccbb7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It aims to be simple, small, ```cpp // print hello world -<<<"Hello World">>>; +<<< "Hello World" >>>; ``` to run this, do diff --git a/ast b/ast index 879a632e..6860cd22 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 879a632ed9372315428c562077f2b8a811ec74dc +Subproject commit 6860cd22ad558e5efa3bb183fa71bf3c10bc80a7 diff --git a/docs/01_Overview/declaration.mdr b/docs/01_Overview/declaration.mdr index 9afb021c..07e6d07b 100644 --- a/docs/01_Overview/declaration.mdr +++ b/docs/01_Overview/declaration.mdr @@ -6,7 +6,7 @@ Declaring a primitive or an object is quite straight forward: @``` decl0.gw int i; Object o; -<<>>; +<<< i, " ", o >>>; @``` @exec gwion decl0.gw 2>&1 @@ -14,10 +14,10 @@ Object o; However ... @``` decl1.gw Object @ref; -<<<"Reference points to no object yet: ", ref>>>; +<<< "Reference points to no object yet: ", ref >>>; //Object o @=> ref; new Object @=> ref; -<<<"But now it does: ", ref>>>; +<<< "But now it does: ", ref >>>; @``` @exec make decl1.test @@ -27,8 +27,8 @@ new Object @=> ref; @``` decl2.gw int ref[]; -<<>>; +<<< ref >>>; new int[2] @=> ref; -<<>>; +<<< ref >>>; @``` @exec make decl2.test diff --git a/docs/02_Reference/01_Functions/Lambdas.mdr b/docs/02_Reference/01_Functions/Lambdas.mdr index 132fbf32..ce03cd8a 100644 --- a/docs/02_Reference/01_Functions/Lambdas.mdr +++ b/docs/02_Reference/01_Functions/Lambdas.mdr @@ -11,7 +11,7 @@ The syntax to create them is simple: You can even use it to ### Call a function just once @``` lambda_call0.gw -\ i { <<<"passed '", i, "'">>>; }(3); +\ i { <<< "passed '", i, "'" >>>; }(3); @``` @exec make -s CONTAINS="passed '3'" lambda_call0.test @@ -21,7 +21,7 @@ You can even use it to ### Passing to a function pointer @``` lambda_fptr0.gw typedef void fptr_t(int); -\ i { <<<"passed '", i, "'">>>; } @=> fptr_t fptr; +\ i { <<< "passed '", i, "'" >>>; } @=> fptr_t fptr; fptr(4); @``` @exec make -s CONTAINS="passed '4'" lambda_fptr0.test @@ -32,6 +32,6 @@ typedef void fptr_t(int); fun void test(fptr_t fptr) { fptr(5); } -test(\ i { <<<"passed '", i, "'">>>; }); +test(\ i { <<< "passed '", i, "'" >>>; }); @``` @exec make -s CONTAINS="passed '5'" lambda_args0.test diff --git a/docs/02_Reference/01_Functions/Variadic.mdr b/docs/02_Reference/01_Functions/Variadic.mdr index 23a75196..bd0a0442 100644 --- a/docs/02_Reference/01_Functions/Variadic.mdr +++ b/docs/02_Reference/01_Functions/Variadic.mdr @@ -7,9 +7,9 @@ Well, a function that takes a fixed number of arguments, and additionnal ones. ## a simple example @``` variadic.gw fun void variadic_test(int i, ...) { - <<< "first argument is ", i >>>; + <<< "first argument is ", i >>>; vararg.start; - <<< "\tadditionnal argument", vararg.i >>>; + <<< "\tadditionnal argument", vararg.i >>>; vararg.end; } variadic_test(1); diff --git a/docs/02_Reference/01_Functions/function.mdr b/docs/02_Reference/01_Functions/function.mdr index f92a174f..e2a26cfa 100644 --- a/docs/02_Reference/01_Functions/function.mdr +++ b/docs/02_Reference/01_Functions/function.mdr @@ -12,8 +12,8 @@ fun int test_function(int arg) { } // now call the function (and debug print the result) -<<>>; +<<< test_function(0) >>>; // or use alternate syntax -<<<1 => test_function>>>; +<<< 1 => test_function >>>; @``` @exec make -s function0.test diff --git a/docs/02_Reference/ControlFlow/Repeat.mdr b/docs/02_Reference/ControlFlow/Repeat.mdr index bbfea851..37124bb6 100644 --- a/docs/02_Reference/ControlFlow/Repeat.mdr +++ b/docs/02_Reference/ControlFlow/Repeat.mdr @@ -5,7 +5,7 @@ The easiest way to do an action repeatidly in Gwion is, ... the **repeat** keywo ## Very basic example @``` repeat.gw repeat(3) - <<<"Hello, world!">>>; + <<< "Hello, world!" >>>; @``` @exec make -s CONTAINS="Hello" repeat.test @@ -15,7 +15,7 @@ of course this also works with a block code. @``` repeat2.gw repeat(3) { maybe ? "You" : "Me" => string s; - <<<"Hello, ", s, "!">>>; + <<< "Hello, ", s, "!" >>>; } @``` @exec make -s CONTAINS="Hello" repeat2.test diff --git a/docs/02_Reference/ControlFlow/forloop.mdr b/docs/02_Reference/ControlFlow/forloop.mdr index 5d01609f..52597f18 100644 --- a/docs/02_Reference/ControlFlow/forloop.mdr +++ b/docs/02_Reference/ControlFlow/forloop.mdr @@ -4,7 +4,7 @@ ## basic loops @``` forloop0.gw for(int i; i < 3; ++i) - <<>>; + <<< i >>>; @``` @exec make -s forloop0.test @@ -14,7 +14,7 @@ Of course, it also works with a block of code. for(int i; i < 3; ++i) { i/2 => float f1; i/2. => float f2; - <<>>; + <<< i, " " , f1, " ", f2 >>>; } @``` @exec make -s forloop2.test @@ -25,7 +25,7 @@ int array[3][4]; for(int i; i < 3; ++i) { for(int j; j < 4; ++j) { - <<>>; + <<< array[i][j] >>>; } } @``` @@ -37,9 +37,9 @@ for(int i; i < 3; ++i) { @``` forloop4.gw int array[2][3]; for(auto a: array) { - <<>>; + <<< a >>>; for(auto b: a) - <<>>; + <<< b >>>; } @``` @exec make -s forloop4.test @@ -53,11 +53,11 @@ int array[2][3]; int i; for(auto a: array) { for(auto @b: a) - <<<++i => *b>>>; + <<< ++i => *b >>>; } for(auto a: array) { for(auto @b: a) - <<<*b>>>; + <<< *b >>>; } @``` @exec make -s forloop5.test diff --git a/docs/02_Reference/ControlFlow/whileuntil.mdr b/docs/02_Reference/ControlFlow/whileuntil.mdr index 798b0334..04bf9c36 100644 --- a/docs/02_Reference/ControlFlow/whileuntil.mdr +++ b/docs/02_Reference/ControlFlow/whileuntil.mdr @@ -4,7 +4,7 @@ while(true) { if(maybe) break; - <<<"running...">>>; + <<< "running..." >>>; } @``` @exec make -s while0.test @@ -13,11 +13,11 @@ well this may output nothing... lets try @``` while1.gw -<<>>; +<<< maybe >>>; do{ if(maybe) break; - <<<"running...">>>; + <<< "running..." >>>; } while(true); @``` @exec make -s while1.test diff --git a/docs/index.mdr b/docs/index.mdr index caa209e8..89efdfb4 100644 --- a/docs/index.mdr +++ b/docs/index.mdr @@ -8,7 +8,7 @@ So, as it is mandatory, here is the piece of code you're waiting for: @``` helloworld.gw -<<<"Hello, World!", "">>>; +<<< "Hello, World!", "" >>>; @``` @exec make -s CONTAINS="Hello, World!" helloworld.test