You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/SPECIFICATION.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -255,7 +255,7 @@
255
255
256
256
Loops are provided via `WHILE`, `FOR`, and `PARFOR`. A `WHILE` loop has the form `WHILE(condition){ block }`. On each iteration, the condition is evaluated; if it is non-zero, the block executes and control returns to the start of the loop to evaluate the condition again. If the condition evaluates to zero, the loop terminates and execution continues with the next statement.
257
257
258
-
The `FOR` construct has the form `FOR(counter,target){ block }`, where `counter` is an identifier and `target` is an expression. At loop entry, `target` is evaluated once to a value `T` (must be `INT`), and `counter` is initialized to the `INT` value `0`, creating it as an `INT` if necessary. The loop then repeats: if the current value of `counter` is greater than or equal to `T`, the loop exits; otherwise, the block executes and `counter` is incremented by `1` before the next iteration.
258
+
The `FOR` construct has the form `FOR(counter,target){ block }`, where `counter` is an identifier and `target` is an expression. At loop entry, `target` is evaluated once to a value `T` (must be `INT`), and `counter` is initialized to the `INT` value `1`, creating it as an `INT` if necessary. The loop then repeats: if the current value of `counter` is greater than `T`, the loop exits; otherwise, the block executes and `counter` is incremented by `1` before the next iteration.
259
259
260
260
Note on scoping: the loop `counter` is loop-local and does not persist in the enclosing environment after the `FOR` completes (any prior binding with the same name is restored). Any other identifiers that are declared (first assigned with a `TYPE:` declaration) inside the `FOR` body are bound in the enclosing environment (that is, they persist after the loop finishes).
261
261
@@ -627,7 +627,7 @@
627
627
628
628
-`SHR(INT: a, INT: b):INT`;shiftright
629
629
630
-
-`SLICE(INT|STR: a, INT: hi, INT: lo):INT|STR`;`INT`target->bit-slice[hi:lo];`STR`target->inclusivechar-slicecountingfromtheright(index0=lastchar). `TNS` are not accepted.
630
+
-`SLICE(INT|STR: a, INT: start, INT: end):INT|STR`;`INT`target->bit-slice[start:end];`STR`target->inclusivechar-slicecountingfromtheleft(index1=firstchar).
0 commit comments