From a6f21485e4d389e910d6f9e33c98119ba4fef4eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 7 Sep 2020 01:53:52 +0200 Subject: [PATCH] :art: Update syntax --- docs/Reference/ControlFlow/ForLoop.mdr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Reference/ControlFlow/ForLoop.mdr b/docs/Reference/ControlFlow/ForLoop.mdr index 345bdf71..f1433185 100644 --- a/docs/Reference/ControlFlow/ForLoop.mdr +++ b/docs/Reference/ControlFlow/ForLoop.mdr @@ -36,9 +36,9 @@ for(int i; i < 3; ++i) { #### Simple auto loop @``` forloop4.gw int array[2][3]; -for(auto a: array) { +foreach(a: array) { <<< a >>>; - for(auto b: a) + foreach(b: a) <<< b >>>; } @``` @@ -50,12 +50,12 @@ If you want to change it the value in the array, you need a pointer @``` forloop5.gw int array[2][3]; int i; -for(auto a: array) { - for(auto ref b: a) +foreach(a: array) { + foreach(ref b: a) <<< ++i => *b >>>; } -for(auto a: array) { - for(auto ref b: a) +foreach(a: array) { + foreach(ref b: a) <<< *b >>>; } @``` -- 2.43.0