diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-18 17:41:40 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-18 17:41:57 -0700 |
| commit | dcb380f1f6ec67c52364b1246546f1f6b2c168d3 (patch) | |
| tree | 753fb10223e5b7cc4222106bc33d3f1fe2eb3e07 /core/operators.nom | |
| parent | ec17442090e3a193c95d5fd53ef0016ecb53b230 (diff) | |
More cleanup, slowly working through operators/control_flow
Diffstat (limited to 'core/operators.nom')
| -rw-r--r-- | core/operators.nom | 9 |
1 files changed, 5 insertions, 4 deletions
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(", "); |
