From d73cbf0aa5c9081d965e06822f4958aa5c1871e6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Jun 2018 15:22:03 -0700 Subject: Cleanups. --- core/operators.nom | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/operators.nom') diff --git a/core/operators.nom b/core/operators.nom index 0756751..c81760d 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -130,6 +130,16 @@ compile [with %assignments %body] to \%lua end -- 'with' block +compile [local %var_or_vars] to + %lua <- (Lua "") + lua> ".." + if \%var_or_vars.type == "List" then + \%lua:add_free_vars(table.map(\%var_or_vars, function(v) return tostring(nomsu:compile(v)) end)) + else + \%lua:add_free_vars({tostring(nomsu:compile(\%var_or_vars))}) + end + return %lua + # Math Operators compile [%x wrapped around %y, %x mod %y] to: Lua value "(\(%x as lua expr) % \(%y as lua expr))" -- cgit v1.2.3