The loop statement executes its statement list for ever. You must include Break or Exit procedure calls for terminating iteration.
The loop statement syntax allows to include a list of semicolon separated statements without grouping them inside a block:
loop
    statement-list...
end;
By default, this is an never ending loop. You must use one from these special statements in order to alter the default control flow:
| Statement | Purpose | 
|---|---|
| Break | Interrupts the loop and resumes execution immediately after the loop's end. | 
| Continue | Skip remaining statements and jumps to the beginning of loop. | 
| Exit | Interrupts the loop and exits the current method. | 
| goto label | Jumps to an arbitrary point inside the method. | 
The Freya Programming Language
Statements
goto statements
repeat statements
while statements
for statements