diff --git a/docs/concepts/control-flow.md b/docs/concepts/control-flow.md index 7a4a306..369c5cc 100644 --- a/docs/concepts/control-flow.md +++ b/docs/concepts/control-flow.md @@ -113,7 +113,7 @@ fn main() { while index < 5 { println("the value is: " + a[index]) - index = index + 1 + index += 1 } } ``` diff --git a/examples/bubblesort.sb b/examples/bubblesort.sb index f800bf9..902b893 100644 --- a/examples/bubblesort.sb +++ b/examples/bubblesort.sb @@ -14,10 +14,10 @@ fn main() { arr[d+1] = swap } - d = d + 1 + d += 1 } - c = c + 1 + c += 1 } println(arr) diff --git a/lib/stdio.sb b/lib/stdio.sb index cf46fd5..e5cb55f 100644 --- a/lib/stdio.sb +++ b/lib/stdio.sb @@ -13,7 +13,7 @@ fn println(msg: string) { fn len(arr: int[]): int { let c: int = 0 while arr[c] { - c = c + 1 + c += 1 } return c diff --git a/src/parser/tests.rs b/src/parser/tests.rs index 210b96b..5159f84 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -463,7 +463,7 @@ fn test_array_access_in_loop() { while i < 5 { println(x[i]) - i = i + 1 + i += 1 } } ";