diff --git a/moonscript/compile.lua b/moonscript/compile.lua index 075b473..f9b1b81 100644 --- a/moonscript/compile.lua +++ b/moonscript/compile.lua @@ -17,7 +17,7 @@ do ntype = _table_0.ntype end local concat, insert = table.concat, table.insert -local pos_to_line, get_line, get_closest_line, trim = util.pos_to_line, util.get_line, util.get_closest_line, util.trim +local pos_to_line, get_closest_line, trim = util.pos_to_line, util.get_closest_line, util.trim local mtype = util.moon.type local Line, Lines Lines = (function() @@ -254,7 +254,6 @@ Line = (function() return _class_0 end)() Block = (function() - local block_iterator local _parent_0 = nil local _base_0 = { header = "do", @@ -477,7 +476,6 @@ Block = (function() return end node = self.transform.statement(node) - local before = #self._lines local result do local fn = line_compile[ntype(node)] @@ -577,18 +575,6 @@ Block = (function() end }) _base_0.__class = _class_0 - local self = _class_0 - block_iterator = function(list) - return coroutine.wrap(function() - local _list_0 = list - for _index_0 = 1, #_list_0 do - local item = _list_0[_index_0] - if Block == mtype(item) then - coroutine.yield(item) - end - end - end) - end if _parent_0 and _parent_0.__inherited then _parent_0.__inherited(_parent_0, _class_0) end diff --git a/moonscript/compile.moon b/moonscript/compile.moon index 6538c97..70d3df4 100644 --- a/moonscript/compile.moon +++ b/moonscript/compile.moon @@ -14,7 +14,7 @@ import Set from require "moonscript.data" import ntype from require "moonscript.types" import concat, insert from table -import pos_to_line, get_line, get_closest_line, trim from util +import pos_to_line, get_closest_line, trim from util mtype = util.moon.type @@ -82,7 +82,6 @@ class Lines else t - -- copy with only array elements "Lines<#{util.dump(strip @)\sub 1, -2}>" -- Buffer for building up a line @@ -255,8 +254,6 @@ class Block buffer\add @header buffer\mark_pos @pos - -- print "Header:", util.dump(@header), mtype(@header).__name - if @next buffer\add @_lines @next\render buffer @@ -312,19 +309,10 @@ class Block with Line! \append_list [@value v for v in *values], delim - - block_iterator = (list) -> - coroutine.wrap -> - for item in *list - if Block == mtype item - coroutine.yield item - stm: (node, ...) => return if not node -- skip blank statements node = @transform.statement node - before = #@_lines - result = if fn = line_compile[ntype(node)] fn self, node, ... else