Recompiled.
This commit is contained in:
parent
ab9af11ec3
commit
0f0dcaac37
@ -467,10 +467,12 @@ do
|
|||||||
self:writeln(tostring(colored.bright("WITH ARGS:")) .. " " .. tostring(colored.dim(repr(args))))
|
self:writeln(tostring(colored.bright("WITH ARGS:")) .. " " .. tostring(colored.dim(repr(args))))
|
||||||
end
|
end
|
||||||
insert(self.callstack, "#macro")
|
insert(self.callstack, "#macro")
|
||||||
|
insert(self.macrostack, tree)
|
||||||
local old_tree
|
local old_tree
|
||||||
old_tree, self.defs["#macro_tree"] = self.defs["#macro_tree"], tree
|
old_tree, self.defs["#macro_tree"] = self.defs["#macro_tree"], tree
|
||||||
local expr, statement = self:call(tree.stub, tree.line_no, unpack(args))
|
local expr, statement = self:call(tree.stub, tree.line_no, unpack(args))
|
||||||
self.defs["#macro_tree"] = old_tree
|
self.defs["#macro_tree"] = old_tree
|
||||||
|
remove(self.macrostack)
|
||||||
remove(self.callstack)
|
remove(self.callstack)
|
||||||
return expr, statement
|
return expr, statement
|
||||||
end,
|
end,
|
||||||
@ -1255,8 +1257,6 @@ end)]]):format(concat(lua_bits, "\n"))
|
|||||||
local bit = _list_0[_index_0]
|
local bit = _list_0[_index_0]
|
||||||
if type(bit) == "string" then
|
if type(bit) == "string" then
|
||||||
insert(concat_parts, bit)
|
insert(concat_parts, bit)
|
||||||
elseif bit.src == '__src__' then
|
|
||||||
insert(concat_parts, repr(self:dedent(self.defs["#macro_tree"].src)))
|
|
||||||
else
|
else
|
||||||
local expr, statement = self:tree_to_lua(bit, filename)
|
local expr, statement = self:tree_to_lua(bit, filename)
|
||||||
if statement then
|
if statement then
|
||||||
@ -1279,6 +1279,9 @@ end)]]):format(concat(lua_bits, "\n"))
|
|||||||
return lua, nil
|
return lua, nil
|
||||||
end
|
end
|
||||||
self:defmacro("=lua %code", lua_value)
|
self:defmacro("=lua %code", lua_value)
|
||||||
|
self:defmacro("__src__", function(self)
|
||||||
|
return self:repr(self:dedent(self.macrostack[#self.macrostack - 1].src))
|
||||||
|
end)
|
||||||
local run_file
|
local run_file
|
||||||
run_file = function(self, vars)
|
run_file = function(self, vars)
|
||||||
if vars.filename:match(".*%.lua") then
|
if vars.filename:match(".*%.lua") then
|
||||||
@ -1343,6 +1346,7 @@ end)]]):format(concat(lua_bits, "\n"))
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
self.callstack = { }
|
self.callstack = { }
|
||||||
|
self.macrostack = { }
|
||||||
self.debug = false
|
self.debug = false
|
||||||
self.utils = utils
|
self.utils = utils
|
||||||
self.repr = function(self, ...)
|
self.repr = function(self, ...)
|
||||||
|
Loading…
Reference in New Issue
Block a user