diff options
Diffstat (limited to 'core/control_flow.nom')
| -rw-r--r-- | core/control_flow.nom | 13 |
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 |
