1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-21 09:16:34 +00:00

Dijkstra wept

This commit is contained in:
Karol Stasiak
2019-07-15 02:06:23 +02:00
parent af58b16e66
commit f3dcfc78ba
10 changed files with 164 additions and 1 deletions
+2
View File
@@ -39,4 +39,6 @@ Currently, such functions may be evaluated either once or twice. This might be f
* when using modifying operators: calling functions on the right-hand-side index expression than modify any of the variables used on the left hand side
* jumping across the scope of for loop that uses a fixed list or across functions
The above list is not exhaustive.
+26
View File
@@ -328,6 +328,7 @@ for <variable> : [ <comma separated expressions> ] {
* `<comma separated expressions>` traverse every value in the list, in the given order.
Values do not have to be constant.
If a value is not a constant and its value changes while executing the loop, the behaviour is undefined.
Jumps using `goto` across the scope of this kind of loop are disallowed.
### `break` and `continue` statements
@@ -345,6 +346,31 @@ continue while
continue do
continue <variable>
```
### `goto` and `label`
Syntax:
```
goto <expression>
label <name>
```
The `label` statement defines a constant pointer that refers to the current position in the code.
Such labels are only visible in the scope of the local function.
The `goto` expression jumps to the pointer value of the expression.
Jumping using `goto` across the scope of for loop that uses a fixed list or across functions is not allowed.
Computed gotos are supported:
```
pointer p
p = x
goto p
label x
```
### `asm` statements