diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-18 18:39:21 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-18 18:39:25 -0700 |
| commit | 7f98262dfa92072fbfac785617a6dd364cc0146b (patch) | |
| tree | 6e28eb365858deb7ee04b56fe8a608153004253b /core/control_flow.nom | |
| parent | f83cc3ad8afaa122867270a9b1255295e902c422 (diff) | |
Minor cleanups
Diffstat (limited to 'core/control_flow.nom')
| -rw-r--r-- | core/control_flow.nom | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/core/control_flow.nom b/core/control_flow.nom index 5a96d3e..4a007df 100644 --- a/core/control_flow.nom +++ b/core/control_flow.nom @@ -188,7 +188,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::continue_\(%var as lua identifier)::") to %lua write "\nend --foreach-loop" if %body has subtree % where @@ -221,14 +221,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::continue_\(%key as lua identifier)::") 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::continue_\(%value as lua identifier)::") to %lua write "\nend --foreach-loop" %stop_labels <- (Lua "") @@ -250,8 +250,7 @@ compile [..] %lua <- Lua ".." do -- scope for stopping for % = % loop - \%lua - \%stop_labels + \%lua\%stop_labels end return %lua @@ -378,11 +377,4 @@ compile [do %action then always %final_action] to # Inline thunk: compile [result of %body] to - %body <- (%body as lua statements) - declare locals in %body - return - Lua value ".." - (function() - \%body - end)() - + Lua value "(\(compile as: [] -> %body))()" |
