6
Jump Keyword
Maxwell edited this page 2026-01-22 21:27:07 +11:00

Keyword: jump

Syntax: jump %line

Average Time Complexity: O(1)

Worst Case Time Complexity: O(n), where n is the number of labels created

Overview

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

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.

@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.