diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-21 21:15:37 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-09-21 21:15:37 -0700 |
| commit | 0489456a4efa512677dd7d27f1ca5b90b19c6a68 (patch) | |
| tree | 5b0ddaf83978cadfd935f2758f41552da977ea40 /nomsu.lua | |
| parent | 26d72ce56ed1e9066edfbb3fedd8f5570d0cb5f4 (diff) | |
Fixed lua block vars.
Diffstat (limited to 'nomsu.lua')
| -rw-r--r-- | nomsu.lua | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -754,19 +754,21 @@ do end local inner_vars = setmetatable({ }, { __index = function(_, key) - return error("vars[" .. tostring(repr(key)) .. "]") + return "vars[" .. tostring(repr(key)) .. "]" end }) - return "do\n" .. self:tree_to_value(vars.lua_code, inner_vars) .. "\nend", true + local lua = self:tree_to_value(vars.lua_code, inner_vars) + return "do\n" .. tostring(lua) .. "\nend", true end) self:defmacro("lua expr %lua_code", function(self, vars, kind) local lua_code = vars.lua_code.value local inner_vars = setmetatable({ }, { __index = function(_, key) - return error("vars[" .. tostring(repr(key)) .. "]") + return "vars[" .. tostring(repr(key)) .. "]" end }) - return self:tree_to_value(vars.lua_code, inner_vars) + local lua = self:tree_to_value(vars.lua_code, inner_vars) + return lua end) self:def("require %filename", function(self, vars) if not self.loaded_files[vars.filename] then |
