From dcb380f1f6ec67c52364b1246546f1f6b2c168d3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 18 Apr 2018 17:41:40 -0700 Subject: More cleanup, slowly working through operators/control_flow --- core/operators.nom | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/operators.nom') diff --git a/core/operators.nom b/core/operators.nom index a6d9977..63819da 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -52,11 +52,12 @@ immediately: lua> "local \%value_lua = nomsu:tree_to_lua(\%value);" assume %value_lua.is_value or barf "Invalid value for assignment: \(%value's source code)" lua> ".." - local \%lua = Lua(tree.source, \%var_lua, ' = ', \%value_lua, ';'); + local lua = Lua(tree.source, \%var_lua, ' = ', \%value_lua, ';'); if \%var.type == 'Var' then - \%lua:add_free_vars(nomsu:var_to_lua_identifier(\%var.value)); + print("Added var from assignment: "..tostring(\%var:as_lua(nomsu))); + lua:add_free_vars(\%var); end - return \%lua; + return lua; immediately: # Simultaneous mutli-assignments like: x,y,z = 1,x,3; @@ -72,7 +73,7 @@ immediately: local value_lua = nomsu:tree_to_lua(value); if not value_lua.is_value then error("Invalid value for assignment: "..value:get_src()); end if target.type == "Var" then - lhs:add_free_vars(nomsu:var_to_lua_identifier(target.value)); + lhs:add_free_vars(target); end if i > 1 then lhs:append(", "); -- cgit v1.2.3