aboutsummaryrefslogtreecommitdiff
path: root/code_obj.lua
diff options
context:
space:
mode:
Diffstat (limited to 'code_obj.lua')
-rw-r--r--code_obj.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/code_obj.lua b/code_obj.lua
index de62c8f..e3f7b16 100644
--- a/code_obj.lua
+++ b/code_obj.lua
@@ -297,6 +297,12 @@ do
end
return statements
end,
+ as_expr = function(self)
+ if self.is_value then
+ return self
+ end
+ return error("Cannot convert to expression: " .. tostring(tostring(self)))
+ end,
__tostring = function(self)
if self.__str == nil then
local buff, indents = { }, self.indents