From 6cf980ea713906621d28baf847ce7dbdd0d003f9 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 20:07:09 -0400 Subject: Add `continue` and `break` as aliases for `skip`/`stop`, also improve keyword detection using a binary search --- examples/learnxiny.tm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') 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} -- cgit v1.2.3