aboutsummaryrefslogtreecommitdiff
path: root/core/control_flow.nom
diff options
context:
space:
mode:
Diffstat (limited to 'core/control_flow.nom')
-rw-r--r--core/control_flow.nom21
1 files changed, 13 insertions, 8 deletions
diff --git a/core/control_flow.nom b/core/control_flow.nom
index 4a007df..9aae937 100644
--- a/core/control_flow.nom
+++ b/core/control_flow.nom
@@ -135,6 +135,11 @@ compile [stop %var] to
compile [do next %var] to
Lua "goto continue_\(%var as lua identifier)"
+compile [=== stop %var ===, --- stop %var ---, *** stop %var ***] to
+ Lua "::stop_\(%var as lua identifier)::"
+compile [=== next %var ===, --- next %var ---, *** next %var ***] to
+ Lua "::continue_\(%var as lua identifier)::"
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Numeric range for loops
@@ -153,7 +158,7 @@ compile [..]
(%.type = "Action") and
(%.stub is "do next %") and
%.(3).1 = %var.1
- ..: to %lua write "\n ::continue_\(%var as lua identifier)::"
+ ..: to %lua write "\n \(compile as: === next %var ===)"
to %lua write "\nend --numeric for-loop"
if
@@ -166,7 +171,7 @@ compile [..]
Lua ".."
do -- scope for stopping for-loop
\%lua
- ::stop_\(%var as lua identifier)::
+ \(compile as: === stop %var ===)
end -- end of scope for stopping for-loop
return %lua
@@ -188,7 +193,7 @@ compile [for %var in %iterable %body] to
(%.type = "Action") and
(%.stub is "do next %") and
%.3.(1) = %var.(1)
- ..: to %lua write (Lua "\n::continue_\(%var as lua identifier)::")
+ ..: to %lua write (Lua "\n\(compile as: === next %var ===)")
to %lua write "\nend --foreach-loop"
if
%body has subtree % where
@@ -200,7 +205,7 @@ compile [for %var in %iterable %body] to
Lua ".."
do -- scope for stopping for-loop
\%lua
- ::stop_\(%var as lua identifier)::
+ \(compile as: === stop %var ===)
end -- end of scope for stopping for-loop
return %lua
@@ -221,14 +226,14 @@ compile [..]
(%.type = "Action") and
(%.stub is "do next %") and
%.3.(1) = %key.(1)
- ..: to %lua write (Lua "\n::continue_\(%key as lua identifier)::")
+ ..: to %lua write (Lua "\n\(compile as: === next %key ===)")
if
%body has subtree % where
(%.type = "Action") and
(%.stub is "do next %") and
%.3.(1) = %value.(1)
- ..: to %lua write (Lua "\n::continue_\(%value as lua identifier)::")
+ ..: to %lua write (Lua "\n\(compile as: === next %value ===)")
to %lua write "\nend --foreach-loop"
%stop_labels <- (Lua "")
@@ -237,14 +242,14 @@ compile [..]
(%.type = "Action") and
(%.stub is "stop %") and
%.2.(1) = %key.(1)
- ..: to %stop_labels write "\n::stop_\(%key as lua identifier)::"
+ ..: to %stop_labels write "\n\(compile as: === stop %key ===)"
if
%body has subtree % where
(%.type = "Action") and
(%.stub is "stop %") and
%.2.(1) = %value.(1)
- ..: to %stop_labels write "\n::stop_\(%value as lua identifier)::"
+ ..: to %stop_labels write "\n\(compile as: === stop %value ===)"
if: (length of "\%stop_labels") > 0
%lua <-