From: Jérémie Astor Date: Wed, 16 Dec 2020 18:54:59 +0000 (+0100) Subject: :art: Update syntax X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1553420b704feabb1052647a6d85498f0ccde2bb;p=gwion.git :art: Update syntax --- diff --git a/docs/Overview/declaration.mdr b/docs/Overview/declaration.mdr index f006b58a..5afac3e5 100644 --- a/docs/Overview/declaration.mdr +++ b/docs/Overview/declaration.mdr @@ -13,7 +13,7 @@ var Object o; ## Declaring a reference @``` decl1.gw -ref Object object_ref; +late Object object_ref; <<< "Reference points to no object yet: ", object_ref >>>; new Object @=> object_ref; <<< "But now it does: ", object_ref >>>; diff --git a/docs/Reference/ControlFlow/ForLoop.mdr b/docs/Reference/ControlFlow/ForLoop.mdr index ffc385d1..bb7311b5 100644 --- a/docs/Reference/ControlFlow/ForLoop.mdr +++ b/docs/Reference/ControlFlow/ForLoop.mdr @@ -51,12 +51,12 @@ If you want to change it the value in the array, you need a pointer var int array[2][3]; var int i; foreach(a: array) { - foreach(ref b: a) - <<< ++i => *b >>>; + foreach(b: a) + <<< ++i => b >>>; } foreach(a: array) { - foreach(ref b: a) - <<< *b >>>; + foreach(b: a) + <<< b >>>; } @``` @hide make -s forloop5.test diff --git a/docs/Reference/ControlFlow/Repeat.mdr b/docs/Reference/ControlFlow/Repeat.mdr index a15625a4..bde84acb 100644 --- a/docs/Reference/ControlFlow/Repeat.mdr +++ b/docs/Reference/ControlFlow/Repeat.mdr @@ -17,7 +17,7 @@ of course this also works with a block code. @``` repeat2.gw repeat(3) { - maybe ? "You" : "Me" => var string s; + maybe ? "You" : "Me" @=> var string s; <<< "Hello, ", s, "!" >>>; } @``` diff --git a/docs/Reference/Types/Unions.mdr b/docs/Reference/Types/Unions.mdr index e171f881..128c6257 100644 --- a/docs/Reference/Types/Unions.mdr +++ b/docs/Reference/Types/Unions.mdr @@ -4,7 +4,7 @@ Union store their component in the same memory space. For more infomations, see [here](https://en.wikipedia.org/wiki/Union_type). @``` base_union -union { +union U { int a; float f; Object o;