aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 20:07:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 20:07:09 -0400
commit6cf980ea713906621d28baf847ce7dbdd0d003f9 (patch)
tree7cb0fb5f55213d4a6594e1999ef37ea2b2c85ede /examples
parent1d2e55f53dfab5153dbfd0c03f28cd9daedb3b77 (diff)
Add `continue` and `break` as aliases for `skip`/`stop`, also improve
keyword detection using a binary search
Diffstat (limited to 'examples')
-rw-r--r--examples/learnxiny.tm4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/learnxiny.tm b/examples/learnxiny.tm
index 31d768eb..b8eaa77e 100644
--- a/examples/learnxiny.tm
+++ b/examples/learnxiny.tm
@@ -86,11 +86,12 @@ func main()
>> [x*10 for x in my_numbers if x != 20]
= [100, 300]
- # Loop control flow uses "skip" and "stop"
+ # Loop control flow uses "skip"/"continue" and "stop"/"break"
for x in my_numbers
for y in my_numbers
if x == y
skip
+ continue # This is the same as `skip`
# For readability, you can also use postfix conditionals:
skip if x == y
@@ -99,6 +100,7 @@ func main()
# Skip or stop can specify a loop variable if you want to
# affect an enclosing loop:
stop x
+ break x # This is the same as `stop x`
# Tables are efficient hash maps
table := {"one"=1, "two"=2}