diff --git a/Makefile b/Makefile index 45b90f8..88085f7 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ global: sudo luarocks make moonscript-dev-1.rockspec compile:: - bin/moonc moon/ moonscript/ + lua5.1 bin/moonc moon/ moonscript/ compile_global: diff --git a/moonscript/cmd/lint.lua b/moonscript/cmd/lint.lua index a8c0890..6dfa4c8 100644 --- a/moonscript/cmd/lint.lua +++ b/moonscript/cmd/lint.lua @@ -1,18 +1,9 @@ local insert -do - local _obj_0 = table - insert = _obj_0.insert -end +insert = table.insert local Set -do - local _obj_0 = require("moonscript.data") - Set = _obj_0.Set -end +Set = require("moonscript.data").Set local Block -do - local _obj_0 = require("moonscript.compile") - Block = _obj_0.Block -end +Block = require("moonscript.compile").Block local default_whitelist = Set({ '_G', '_VERSION', diff --git a/moonscript/cmd/moonc.lua b/moonscript/cmd/moonc.lua index dc53cd5..b64c9f1 100644 --- a/moonscript/cmd/moonc.lua +++ b/moonscript/cmd/moonc.lua @@ -1,9 +1,6 @@ local lfs = require("lfs") local split -do - local _obj_0 = require("moonscript.util") - split = _obj_0.split -end +split = require("moonscript.util").split local dirsep, dirsep_chars, mkdir, normalize_dir, parse_dir, parse_file, convert_path, format_time, gettime, compile_file_text, write_file, compile_and_write, is_abs_path, path_to_target dirsep = package.config:sub(1, 1) if dirsep == "\\" then @@ -93,10 +90,7 @@ compile_file_text = function(text, fname, opts) end if opts.show_posmap then local debug_posmap - do - local _obj_0 = require("moonscript.util") - debug_posmap = _obj_0.debug_posmap - end + debug_posmap = require("moonscript.util").debug_posmap print("Pos", "Lua", ">>", "Moon") print(debug_posmap(posmap_or_err, text, code)) return true diff --git a/moonscript/compile.lua b/moonscript/compile.lua index aaa42c2..52f3981 100644 --- a/moonscript/compile.lua +++ b/moonscript/compile.lua @@ -7,10 +7,7 @@ do NameProxy, LocalName = _obj_0.NameProxy, _obj_0.LocalName end local Set -do - local _obj_0 = require("moonscript.data") - Set = _obj_0.Set -end +Set = require("moonscript.data").Set local ntype, has_value do local _obj_0 = require("moonscript.types") diff --git a/moonscript/compile/statement.lua b/moonscript/compile/statement.lua index 2d2a80c..2026a88 100644 --- a/moonscript/compile/statement.lua +++ b/moonscript/compile/statement.lua @@ -2,10 +2,7 @@ local util = require("moonscript.util") local reversed, unpack reversed, unpack = util.reversed, util.unpack local ntype -do - local _obj_0 = require("moonscript.types") - ntype = _obj_0.ntype -end +ntype = require("moonscript.types").ntype local concat, insert do local _obj_0 = table diff --git a/moonscript/compile/value.lua b/moonscript/compile/value.lua index 560352b..8f8e8f2 100644 --- a/moonscript/compile/value.lua +++ b/moonscript/compile/value.lua @@ -1,15 +1,9 @@ local util = require("moonscript.util") local data = require("moonscript.data") local ntype -do - local _obj_0 = require("moonscript.types") - ntype = _obj_0.ntype -end +ntype = require("moonscript.types").ntype local user_error -do - local _obj_0 = require("moonscript.errors") - user_error = _obj_0.user_error -end +user_error = require("moonscript.errors").user_error local concat, insert do local _obj_0 = table diff --git a/moonscript/transform.lua b/moonscript/transform.lua index 803d5d7..c249929 100644 --- a/moonscript/transform.lua +++ b/moonscript/transform.lua @@ -6,10 +6,7 @@ reversed, unpack = util.reversed, util.unpack local ntype, mtype, build, smart_node, is_slice, value_is_singular ntype, mtype, build, smart_node, is_slice, value_is_singular = types.ntype, types.mtype, types.build, types.smart_node, types.is_slice, types.value_is_singular local insert -do - local _obj_0 = table - insert = _obj_0.insert -end +insert = table.insert local NameProxy, LocalName do local _obj_0 = require("moonscript.transform.names") diff --git a/moonscript/transform/destructure.lua b/moonscript/transform/destructure.lua index 38e9bc5..c054295 100644 --- a/moonscript/transform/destructure.lua +++ b/moonscript/transform/destructure.lua @@ -4,25 +4,13 @@ do ntype, mtype, build = _obj_0.ntype, _obj_0.mtype, _obj_0.build end local NameProxy -do - local _obj_0 = require("moonscript.transform.names") - NameProxy = _obj_0.NameProxy -end +NameProxy = require("moonscript.transform.names").NameProxy local insert -do - local _obj_0 = table - insert = _obj_0.insert -end +insert = table.insert local unpack -do - local _obj_0 = require("moonscript.util") - unpack = _obj_0.unpack -end +unpack = require("moonscript.util").unpack local user_error -do - local _obj_0 = require("moonscript.errors") - user_error = _obj_0.user_error -end +user_error = require("moonscript.errors").user_error local join join = function(...) do diff --git a/moonscript/transform/names.lua b/moonscript/transform/names.lua index a7584da..c74a377 100644 --- a/moonscript/transform/names.lua +++ b/moonscript/transform/names.lua @@ -1,13 +1,7 @@ local build -do - local _obj_0 = require("moonscript.types") - build = _obj_0.build -end +build = require("moonscript.types").build local unpack -do - local _obj_0 = require("moonscript.util") - unpack = _obj_0.unpack -end +unpack = require("moonscript.util").unpack local LocalName do local _base_0 = { diff --git a/moonscript/types.lua b/moonscript/types.lua index aae50c9..ccf1d53 100644 --- a/moonscript/types.lua +++ b/moonscript/types.lua @@ -1,14 +1,8 @@ local util = require("moonscript.util") local Set -do - local _obj_0 = require("moonscript.data") - Set = _obj_0.Set -end +Set = require("moonscript.data").Set local insert -do - local _obj_0 = table - insert = _obj_0.insert -end +insert = table.insert local unpack unpack = util.unpack local manual_return = Set({ diff --git a/moonscript/util.lua b/moonscript/util.lua index dfb4355..7eddae3 100644 --- a/moonscript/util.lua +++ b/moonscript/util.lua @@ -1,8 +1,5 @@ local concat -do - local _obj_0 = table - concat = _obj_0.concat -end +concat = table.concat local unpack = unpack or table.unpack local type = type local moon = {