mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
don't reference global unpack
This commit is contained in:
parent
35bcdc729b
commit
0ba4c773e1
2
bin/moon
2
bin/moon
@ -6,6 +6,8 @@ local moonscript = require "moonscript"
|
||||
local util = require "moonscript.util"
|
||||
local errors = require "moonscript.errors"
|
||||
|
||||
local unpack = util.unpack
|
||||
|
||||
-- moonloader and repl
|
||||
local opts, ind = alt_getopt.get_opts(arg, "cvhd", { version = "v", help = "h" })
|
||||
|
||||
|
@ -27,7 +27,7 @@ do
|
||||
value_compilers = _table_0.value_compilers
|
||||
end
|
||||
local concat, insert = table.concat, table.insert
|
||||
local pos_to_line, get_closest_line, trim = util.pos_to_line, util.get_closest_line, util.trim
|
||||
local pos_to_line, get_closest_line, trim, unpack = util.pos_to_line, util.get_closest_line, util.trim, util.unpack
|
||||
local mtype = util.moon.type
|
||||
local indent_char = " "
|
||||
local Line, Lines, Block, RootBlock
|
||||
|
@ -11,7 +11,7 @@ import statement_compilers from require "moonscript.compile.statement"
|
||||
import value_compilers from require "moonscript.compile.value"
|
||||
|
||||
import concat, insert from table
|
||||
import pos_to_line, get_closest_line, trim from util
|
||||
import pos_to_line, get_closest_line, trim, unpack from util
|
||||
|
||||
mtype = util.moon.type
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
local reversed
|
||||
local reversed, unpack
|
||||
do
|
||||
local _table_0 = require("moonscript.util")
|
||||
reversed = _table_0.reversed
|
||||
reversed, unpack = _table_0.reversed, _table_0.unpack
|
||||
end
|
||||
local ntype
|
||||
do
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import reversed from require "moonscript.util"
|
||||
import reversed, unpack from require "moonscript.util"
|
||||
import ntype from require "moonscript.types"
|
||||
import concat, insert from table
|
||||
|
||||
|
@ -11,6 +11,7 @@ do
|
||||
user_error = _table_0.user_error
|
||||
end
|
||||
local concat, insert = table.concat, table.insert
|
||||
local unpack = util.unpack
|
||||
local table_delim = ","
|
||||
local value_compilers = {
|
||||
exp = function(self, node)
|
||||
|
@ -5,6 +5,7 @@ data = require "moonscript.data"
|
||||
import ntype from require "moonscript.types"
|
||||
import user_error from require "moonscript.errors"
|
||||
import concat, insert from table
|
||||
import unpack from util
|
||||
|
||||
table_delim = ","
|
||||
|
||||
|
@ -15,6 +15,7 @@ local trim = util.trim
|
||||
|
||||
local getfenv = util.getfenv
|
||||
local setfenv = util.setfenv
|
||||
local unpack = util.unpack
|
||||
|
||||
local Stack = data.Stack
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
local types = require("moonscript.types")
|
||||
local util = require("moonscript.util")
|
||||
local data = require("moonscript.data")
|
||||
local reversed = util.reversed
|
||||
local reversed, unpack = util.reversed, util.unpack
|
||||
local 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 = table.insert
|
||||
local NameProxy, LocalName
|
||||
|
@ -3,7 +3,7 @@ types = require "moonscript.types"
|
||||
util = require "moonscript.util"
|
||||
data = require "moonscript.data"
|
||||
|
||||
import reversed from util
|
||||
import reversed, unpack from util
|
||||
import ntype, mtype, build, smart_node, is_slice, value_is_singular from types
|
||||
import insert from table
|
||||
import NameProxy, LocalName from require "moonscript.transform.names"
|
||||
|
@ -9,6 +9,11 @@ do
|
||||
NameProxy = _table_0.NameProxy
|
||||
end
|
||||
local insert = table.insert
|
||||
local unpack
|
||||
do
|
||||
local _table_0 = require("moonscript.util")
|
||||
unpack = _table_0.unpack
|
||||
end
|
||||
local user_error
|
||||
do
|
||||
local _table_0 = require("moonscript.errors")
|
||||
|
@ -2,6 +2,7 @@
|
||||
import ntype, mtype, build from require "moonscript.types"
|
||||
import NameProxy from require "moonscript.transform.names"
|
||||
import insert from table
|
||||
import unpack from require "moonscript.util"
|
||||
|
||||
import user_error from require "moonscript.errors"
|
||||
|
||||
|
@ -3,6 +3,11 @@ do
|
||||
local _table_0 = require("moonscript.types")
|
||||
build = _table_0.build
|
||||
end
|
||||
local unpack
|
||||
do
|
||||
local _table_0 = require("moonscript.util")
|
||||
unpack = _table_0.unpack
|
||||
end
|
||||
local LocalName
|
||||
do
|
||||
local _parent_0 = nil
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
import build from require "moonscript.types"
|
||||
import unpack from require "moonscript.util"
|
||||
|
||||
-- always declares as local
|
||||
class LocalName
|
||||
|
@ -1,6 +1,7 @@
|
||||
local util = require("moonscript.util")
|
||||
local data = require("moonscript.data")
|
||||
local insert = table.insert
|
||||
local unpack = util.unpack
|
||||
local manual_return = data.Set({
|
||||
"foreach",
|
||||
"for",
|
||||
|
@ -3,6 +3,7 @@ util = require "moonscript.util"
|
||||
data = require "moonscript.data"
|
||||
|
||||
import insert from table
|
||||
import unpack from util
|
||||
|
||||
-- implicit return does not work on these statements
|
||||
manual_return = data.Set{"foreach", "for", "while", "return"}
|
||||
|
@ -8,6 +8,8 @@ util = require "moonscript.util"
|
||||
|
||||
pattern = ...
|
||||
|
||||
import unpack from util
|
||||
|
||||
options = {
|
||||
in_dir: "tests/inputs",
|
||||
out_dir: "tests/outputs",
|
||||
|
Loading…
Reference in New Issue
Block a user