aboutsummaryrefslogtreecommitdiff
path: root/code_obj.lua
diff options
context:
space:
mode:
Diffstat (limited to 'code_obj.lua')
-rw-r--r--code_obj.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/code_obj.lua b/code_obj.lua
index 4c9eac0..2e1ce5e 100644
--- a/code_obj.lua
+++ b/code_obj.lua
@@ -262,7 +262,7 @@ do
end
self.__str = nil
end,
- convert_to_statements = function(self, prefix, suffix)
+ as_statements = function(self, prefix, suffix)
if prefix == nil then
prefix = ""
end
@@ -270,14 +270,17 @@ do
suffix = ";"
end
if not (self.is_value) then
- return
+ return self
end
+ local statements = Lua(self.source)
if prefix ~= "" then
- self:prepend(prefix)
+ statements:append(prefix)
end
+ statements:append(self)
if suffix ~= "" then
- return self:append(suffix)
+ statements:append(suffix)
end
+ return statements
end,
declare_locals = function(self, to_declare)
if to_declare == nil then