diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-09-28 22:15:06 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-09-28 22:15:19 -0700 |
| commit | 63d8b1cd3f34b15bf86210b99209e8b57e7019bb (patch) | |
| tree | cdaa28cbbe3e1fad493780a2f55a3f4f6075c1ea /core/operators.nom | |
| parent | 678344182b1f04e35063d7185ac1d74317b011ea (diff) | |
Fully working, I think? (with a lot of shims)
Diffstat (limited to 'core/operators.nom')
| -rw-r--r-- | core/operators.nom | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/operators.nom b/core/operators.nom index 3ae7c2f..960440e 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -34,7 +34,7 @@ compile [%var = %value] to: lua> "\ ..local lua = LuaCode(tree.source, \%var_lua, ' = ', \%value_lua, ';') if \%var.type == 'Var' then - lua:add_free_vars({tostring(nomsu:compile(\%var))}) + lua:add_free_vars({nomsu:compile(\%var):as_smext()}) end return lua" @@ -66,7 +66,7 @@ compile [set %assignments] to: %value as text ..) end if \%target.type == "Var" then - lhs:add_free_vars({tostring(target_lua)}) + lhs:add_free_vars({target_lua:as_smext()}) end if i > 1 then lhs:append(", ") @@ -107,7 +107,7 @@ test: compile [with external %externs %body] to: %body_lua = (%body as lua statements) lua> "\ - ..\%body_lua:remove_free_vars(table.map(\%externs, function(v) return tostring(nomsu:compile(v)) end))" + ..\%body_lua:remove_free_vars(table.map(\%externs, function(v) return nomsu:compile(v):as_smext() end))" return %body_lua test: @@ -141,7 +141,7 @@ compile [with %assignments %body] to: lhs:append(target_lua) rhs:append(value_lua) if \%target.type == "Var" then - vars[i] = tostring(target_lua) + vars[i] = target_lua:as_smext() end end \%lua:remove_free_vars(vars) |
