From 0d88091f8d6cba8c552e2d3ffd3551819f8a4aed Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 13 Dec 2018 15:21:45 -0800 Subject: Cleanups and codegen improvements/fixes. --- core/control_flow.nom | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/control_flow.nom') diff --git a/core/control_flow.nom b/core/control_flow.nom index ccf11de..eca92ce 100644 --- a/core/control_flow.nom +++ b/core/control_flow.nom @@ -174,13 +174,14 @@ test: if (%body has subtree \(do next %var)): %lua::add "\n " (\(---next %var ---) as lua) - %lua::add "\nend --numeric for-loop" + %lua::add "\nend -- numeric for " (%var as lua identifier) " loop" if (%body has subtree \(stop %var)): - %inner_lua = %lua - %lua = (Lua "do -- scope for stopping for-loop\n ") - %lua::add %inner_lua "\n " - %lua::add (\(---stop %var ---) as lua) - %lua::add "\nend -- end of scope for stopping for-loop" + %lua = (..) + Lua "\ + ..do -- scope for (stop \(%var as lua identifier)) + \%lua + \(\(---stop %var ---) as lua) + end -- scope for (stop \(%var as lua identifier))" return %lua ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3