diff --git a/moonscript/compile.lua b/moonscript/compile.lua index 90d2bb9..c9af1fc 100644 --- a/moonscript/compile.lua +++ b/moonscript/compile.lua @@ -2,7 +2,7 @@ module("moonscript.compile", package.seeall) local util = require("moonscript.util") local dump = require("moonscript.dump") require("moonscript.compile.format") -require("moonscript.compile.line") +require("moonscript.compile.statement") require("moonscript.compile.value") local transform = require("moonscript.transform") local NameProxy = transform.NameProxy @@ -89,8 +89,7 @@ Line = (function() _base_0.__class = _class_0 return _class_0 end)() -local Block_ -Block_ = (function() +Block = (function() local _parent_0 = nil local _base_0 = { header = "do", @@ -425,7 +424,7 @@ Block_ = (function() end)() local RootBlock RootBlock = (function() - local _parent_0 = Block_ + local _parent_0 = Block local _base_0 = { render = function(self) self:_insert_breaks() @@ -453,7 +452,6 @@ RootBlock = (function() _base_0.__class = _class_0 return _class_0 end)() -Block = Block_ format_error = function(msg, pos, file_str) local line = pos_to_line(file_str, pos) local line_str diff --git a/moonscript/compile.moon b/moonscript/compile.moon index 0b64f77..2c876e4 100644 --- a/moonscript/compile.moon +++ b/moonscript/compile.moon @@ -4,7 +4,7 @@ util = require "moonscript.util" dump = require "moonscript.dump" require "moonscript.compile.format" -require "moonscript.compile.line" +require "moonscript.compile.statement" require "moonscript.compile.value" transform = require "moonscript.transform" @@ -48,7 +48,7 @@ class Line c concat buff -class Block_ +class Block header: "do" footer: "end" @@ -263,13 +263,11 @@ class Block_ @stm stm for stm in *stms nil -class RootBlock extends Block_ +class RootBlock extends Block render: => @_insert_breaks! concat @_lines, "\n" -Block = Block_ - format_error = (msg, pos, file_str) -> line = pos_to_line file_str, pos line_str, line = get_closest_line file_str, line diff --git a/moonscript/compile/line.lua b/moonscript/compile/statement.lua similarity index 100% rename from moonscript/compile/line.lua rename to moonscript/compile/statement.lua diff --git a/moonscript/compile/line.moon b/moonscript/compile/statement.moon similarity index 100% rename from moonscript/compile/line.moon rename to moonscript/compile/statement.moon