From: Jérémie Astor Date: Mon, 21 Sep 2020 21:10:53 +0000 (+0200) Subject: Change syntax and Use up-to-date benchmark module [skip ci] X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ce17ab367e844aff698556f63b8c8888f63dd1e6;p=gwion.git Change syntax and Use up-to-date benchmark module [skip ci] --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47d16068..a132f9c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,7 +78,10 @@ jobs: mdbook-version: 'latest' - name: Get becnhmarks - run: git submodule update --init gwion-benchmark + run: | + git submodule update --init gwion-benchmark + cd benchmark + git pull - name: Build book run: | diff --git a/docs/Overview/Keywords.mdr b/docs/Overview/Keywords.mdr index 0f8af7ce..6f3b33d7 100644 --- a/docs/Overview/Keywords.mdr +++ b/docs/Overview/Keywords.mdr @@ -1,6 +1,6 @@ # Keywords - * fun/function + * fun * operator * return * goto @@ -22,6 +22,7 @@ * typeof * typedef + * funcdef * class * dtor * extends diff --git a/docs/Overview/declaration.mdr b/docs/Overview/declaration.mdr index db9df039..f006b58a 100644 --- a/docs/Overview/declaration.mdr +++ b/docs/Overview/declaration.mdr @@ -4,8 +4,8 @@ Declaring a primitive or an object is quite straight forward: @``` decl0.gw -int i; -Object o; +var int i; +var Object o; <<< i, " ", o >>>; @``` @hide make -s decl0.test @@ -13,7 +13,7 @@ Object o; ## Declaring a reference @``` decl1.gw -Object ref object_ref; +ref Object object_ref; <<< "Reference points to no object yet: ", object_ref >>>; new Object @=> object_ref; <<< "But now it does: ", object_ref >>>; @@ -25,7 +25,7 @@ new Object @=> object_ref; ### array as refs @``` decl2.gw -int array_ref[]; +var int array_ref[]; <<< array_ref >>>; new int[2] @=> array_ref; <<< array_ref >>>; diff --git a/docs/Reference/ControlFlow/ForLoop.mdr b/docs/Reference/ControlFlow/ForLoop.mdr index f1433185..098fc3c4 100644 --- a/docs/Reference/ControlFlow/ForLoop.mdr +++ b/docs/Reference/ControlFlow/ForLoop.mdr @@ -3,7 +3,7 @@ ## basic loops @``` forloop0.gw -for(int i; i < 3; ++i) +for(var int i; i < 3; ++i) <<< i >>>; @``` @hide make -s forloop0.test @@ -11,7 +11,7 @@ for(int i; i < 3; ++i) It also works with a block of code. @``` forloop2.gw -for(int i; i < 3; ++i) { +for(var int i; i < 3; ++i) { i/2 => float f1; i/2. => float f2; <<< i, " " , f1, " ", f2 >>>; @@ -23,8 +23,8 @@ for(int i; i < 3; ++i) { @``` forloop3.gw int array[3][4]; -for(int i; i < 3; ++i) { - for(int j; j < 4; ++j) { +for(var int i; i < 3; ++i) { + for(var int j; j < 4; ++j) { <<< array[i][j] >>>; } } @@ -35,7 +35,7 @@ for(int i; i < 3; ++i) { #### Simple auto loop @``` forloop4.gw -int array[2][3]; +var int array[2][3]; foreach(a: array) { <<< a >>>; foreach(b: a) @@ -48,8 +48,8 @@ foreach(a: array) { If you want to change it the value in the array, you need a pointer @``` forloop5.gw -int array[2][3]; -int i; +var int array[2][3]; +var int i; foreach(a: array) { foreach(ref b: a) <<< ++i => *b >>>; diff --git a/docs/Reference/ControlFlow/Repeat.mdr b/docs/Reference/ControlFlow/Repeat.mdr index 4846ba4a..a15625a4 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" => string s; + maybe ? "You" : "Me" => var string s; <<< "Hello, ", s, "!" >>>; } @``` diff --git a/docs/Reference/Functions/Lambdas.mdr b/docs/Reference/Functions/Lambdas.mdr index fec5d215..59b00e32 100644 --- a/docs/Reference/Functions/Lambdas.mdr +++ b/docs/Reference/Functions/Lambdas.mdr @@ -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, "'" >>>; } @=> var fptr_t fptr; fptr(4); @``` @hide make -s CONTAINS="passed '4'" lambda_fptr0.test