From 1553420b704feabb1052647a6d85498f0ccde2bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 16 Dec 2020 19:54:59 +0100 Subject: [PATCH] :art: Update syntax --- docs/Overview/declaration.mdr | 2 +- docs/Reference/ControlFlow/ForLoop.mdr | 8 ++++---- docs/Reference/ControlFlow/Repeat.mdr | 2 +- docs/Reference/Types/Unions.mdr | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) 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; -- 2.43.0