Update Jump Keyword

2026-01-09 08:07:25 +11:00
parent 74af728f8e
commit 68a7d70dc8

@@ -9,3 +9,18 @@ Time Complexity:
The `jump` keyword allows you to modify the order in which commands are executed by jumping directly to a certain line of the program. The `jump` keyword allows you to modify the order in which commands are executed by jumping directly to a certain line of the program.
## Example usage ## Example usage
```grnd
jump %end # jump to @end
println "Hello!" # this appends 'Hello\n' to stdout
@end
```
This program immediately jumps to @end, completely skipping the `println "Hello!"` statement. As a result, this program does nothing to stdout.
We can also jump backwards and make an infinite loop.
```grnd
@loop
# ...
jump %loop
```
This program will run the code inserted at `# ...`, then jump back to the start of the loop. This makes the code inserted at `# ...` be repeated forever.