aboutsummaryrefslogtreecommitdiff
path: root/lua_obj.moon
diff options
context:
space:
mode:
Diffstat (limited to 'lua_obj.moon')
-rw-r--r--lua_obj.moon6
1 files changed, 6 insertions, 0 deletions
diff --git a/lua_obj.moon b/lua_obj.moon
index 2afe13d..9df218c 100644
--- a/lua_obj.moon
+++ b/lua_obj.moon
@@ -95,6 +95,7 @@ class Code
bits = @bits
for i=1,n
b = select(i, ...)
+ assert(b != self, "No recursion please.")
bits[#bits+1] = b
if type(b) == 'string'
if spaces = b\match("\n([ ]*)[^\n]*$")
@@ -112,6 +113,7 @@ class Code
bits[i] = select(i, ...)
@current_indent = 0
for i,b in ipairs(bits)
+ assert(b != self, "No recursion please.")
if type(b) == 'string'
if spaces = b\match("\n([ ]*)[^\n]*$")
@current_indent = #spaces
@@ -245,4 +247,8 @@ class Nomsu extends Code
__len: =>
#tostring(self)
+ parenthesize: =>
+ @prepend "("
+ @append ")"
+
return {:Code, :Nomsu, :Lua, :Source}