aboutsummaryrefslogtreecommitdiff
path: root/lib/control_flow.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-01-11 15:32:54 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-01-11 15:32:54 -0800
commit7251f750876fd7839e1d4c4a31e1448ec6ad2acb (patch)
tree36f6d569b5e8c662d711d9aa39cd30813829b03d /lib/control_flow.nom
parent1e0dc6e4775168c2610774ea29ed512c5451afe6 (diff)
Added "local %" macro as a stopgap for locals.
Diffstat (limited to 'lib/control_flow.nom')
-rw-r--r--lib/control_flow.nom10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/control_flow.nom b/lib/control_flow.nom
index 05fb62d..fbc373f 100644
--- a/lib/control_flow.nom
+++ b/lib/control_flow.nom
@@ -84,7 +84,7 @@ immediately:
for %var from %start to %stop by %step %body
for %var from %start to %stop via %step %body
..to code:
- lua> "local \%continue_labels, \%code, \%stop_labels"
+ local [%continue_labels, %code, %stop_labels]
set %continue_labels = ""
if (tree %body has function call \(do next for-loop)):
%continue_labels join= "\n::continue_for::;"
@@ -120,7 +120,7 @@ immediately:
immediately:
compile [for %var in %iterable %body] to code:
- lua> "local \%continue_labels, \%stop_labels, \%code, \%stop_labels"
+ local [%continue_labels, %code, %stop_labels]
set %continue_labels = ""
if (tree %body has function call \(do next for-loop)):
%continue_labels join= "\n::continue_for::;"
@@ -150,7 +150,7 @@ immediately:
compile [..]
repeat %n times %body, repeat %n x %body
..to code:
- lua> "local \%continue_labels, \%code, \%stop_labels"
+ local [%continue_labels, %code, %stop_labels]
set %continue_labels = ""
if (tree %body has function call \(do next repeat-loop)):
%continue_labels join= "\n::continue_repeat::;"
@@ -206,12 +206,12 @@ immediately:
# Switch statement/multi-branch if
immediately:
compile [when %body] to code:
- lua> "local \%result, \%fallthroughs, \%first"
+ local [%result, %fallthroughs, %first]
set %result = ""
set %fallthroughs = []
set %first = (yes)
for %func_call in (%body's "value"):
- lua> "local \%tokens, \%star, \%condition, \%action"
+ local [%tokens, %star, %condition, %action]
assume ((%func_call's "type") == "FunctionCall") or barf ".."
Invalid format for 'when' statement. Only '*' blocks are allowed.
set %tokens = (%func_call's "value")