mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
cleanup
This commit is contained in:
parent
bd93b322d0
commit
ef4157fb5f
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user