From 9996fec406999434deca9f5321d7bceb5bb15ee4 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Mon, 18 Jul 2011 20:58:42 -0700 Subject: [PATCH] fix return issue --- moonscript/compile.lua | 8 ++++---- moonscript/compile.moon | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/moonscript/compile.lua b/moonscript/compile.lua index cf86a21..56b5675 100644 --- a/moonscript/compile.lua +++ b/moonscript/compile.lua @@ -200,17 +200,17 @@ Block_ = (function(_parent_0) add = function(self, line) local t = util.moon.type(line) if t == "string" then - return self:add_line_text(line) + self:add_line_text(line) elseif t == Block then - return self:add(self:line(line)) + self:add(self:line(line)) elseif t == Line then self:add_line_tables(line) self:add_line_text(line:render()) self.current_line = self.current_line + 1 - return self.current_line else - return error("Adding unknown item") + error("Adding unknown item") end + return nil end, push = function(self) self._names = setmetatable({ }, { diff --git a/moonscript/compile.moon b/moonscript/compile.moon index 2d4f1c6..5980363 100644 --- a/moonscript/compile.moon +++ b/moonscript/compile.moon @@ -146,6 +146,7 @@ class Block_ @current_line += 1 else error "Adding unknown item" + nil push: => @_names = setmetatable {}, { __index: @_names }