Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Oct 30, 2012
1 parent bd93b32 commit ef4157f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
16 changes: 1 addition & 15 deletions moonscript/compile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -254,7 +254,6 @@ Line = (function()
return _class_0
end)()
Block = (function()
local block_iterator
local _parent_0 = nil
local _base_0 = {
header = "do",
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions moonscript/compile.moon
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ef4157f

Please sign in to comment.