aboutsummaryrefslogtreecommitdiff
path: root/core/control_flow.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-15 20:32:22 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-15 20:33:07 -0700
commit3ffeaf1f5dbf3e225dc536066d0fedda3f38ac70 (patch)
treeffd23e911254ad22593a9574b5c255d9bdf578ff /core/control_flow.nom
parent0a95a264e5829153eb19bde54882e5c135d6bdad (diff)
Removed "for all"-style iteration and changed "for % from 1 to 10"-style
to "for % in 1 to 10" for consistency.
Diffstat (limited to 'core/control_flow.nom')
-rw-r--r--core/control_flow.nom13
1 files changed, 3 insertions, 10 deletions
diff --git a/core/control_flow.nom b/core/control_flow.nom
index 3f20e10..8e7306d 100644
--- a/core/control_flow.nom
+++ b/core/control_flow.nom
@@ -140,8 +140,8 @@ immediately
# Numeric range for loops
immediately
compile [..]
- for %var from %start to %stop by %step %body
- for %var from %start to %stop via %step %body
+ for %var in %start to %stop by %step %body
+ for %var in %start to %stop via %step %body
..to
# This uses Lua's approach of only allowing loop-scoped variables in a loop
assume (%var.type is "Var") or barf "Loop expected variable, not: \(%var's source code)"
@@ -173,12 +173,7 @@ immediately
return %lua
immediately
- parse [for %var from %start to %stop %body] as: for %var from %start to %stop via 1 %body
- parse [..]
- for all %start to %stop by %step %body
- for all %start to %stop via %step %body
- ..as: for % from %start to %stop via %step %body
- parse [for all %start to %stop %body] as: for all %start to %stop via 1 %body
+ parse [for %var in %start to %stop %body] as: for %var in %start to %stop via 1 %body
# For-each loop (lua's "ipairs()")
immediately
@@ -210,8 +205,6 @@ immediately
end -- end of scope for stopping for-loop
return %lua
- parse [for all %iterable %body] as: for % in %iterable %body
-
# Dict iteration (lua's "pairs()")
immediately
compile [for %key = %value in %iterable %body] to