don't reference global unpack

This commit is contained in:
leaf corcoran 2013-01-02 17:55:43 -08:00
parent 35bcdc729b
commit 0ba4c773e1
17 changed files with 28 additions and 7 deletions

View File

@ -6,6 +6,8 @@ local moonscript = require "moonscript"
local util = require "moonscript.util" local util = require "moonscript.util"
local errors = require "moonscript.errors" local errors = require "moonscript.errors"
local unpack = util.unpack
-- moonloader and repl -- moonloader and repl
local opts, ind = alt_getopt.get_opts(arg, "cvhd", { version = "v", help = "h" }) local opts, ind = alt_getopt.get_opts(arg, "cvhd", { version = "v", help = "h" })

View File

@ -27,7 +27,7 @@ do
value_compilers = _table_0.value_compilers value_compilers = _table_0.value_compilers
end end
local concat, insert = table.concat, table.insert 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 mtype = util.moon.type
local indent_char = " " local indent_char = " "
local Line, Lines, Block, RootBlock local Line, Lines, Block, RootBlock

View File

@ -11,7 +11,7 @@ import statement_compilers from require "moonscript.compile.statement"
import value_compilers from require "moonscript.compile.value" import value_compilers from require "moonscript.compile.value"
import concat, insert from table 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 mtype = util.moon.type

View File

@ -1,7 +1,7 @@
local reversed local reversed, unpack
do do
local _table_0 = require("moonscript.util") local _table_0 = require("moonscript.util")
reversed = _table_0.reversed reversed, unpack = _table_0.reversed, _table_0.unpack
end end
local ntype local ntype
do do

View File

@ -1,5 +1,5 @@
import reversed from require "moonscript.util" import reversed, unpack from require "moonscript.util"
import ntype from require "moonscript.types" import ntype from require "moonscript.types"
import concat, insert from table import concat, insert from table

View File

@ -11,6 +11,7 @@ do
user_error = _table_0.user_error user_error = _table_0.user_error
end end
local concat, insert = table.concat, table.insert local concat, insert = table.concat, table.insert
local unpack = util.unpack
local table_delim = "," local table_delim = ","
local value_compilers = { local value_compilers = {
exp = function(self, node) exp = function(self, node)

View File

@ -5,6 +5,7 @@ data = require "moonscript.data"
import ntype from require "moonscript.types" import ntype from require "moonscript.types"
import user_error from require "moonscript.errors" import user_error from require "moonscript.errors"
import concat, insert from table import concat, insert from table
import unpack from util
table_delim = "," table_delim = ","

View File

@ -15,6 +15,7 @@ local trim = util.trim
local getfenv = util.getfenv local getfenv = util.getfenv
local setfenv = util.setfenv local setfenv = util.setfenv
local unpack = util.unpack
local Stack = data.Stack local Stack = data.Stack

View File

@ -1,7 +1,7 @@
local types = require("moonscript.types") local types = require("moonscript.types")
local util = require("moonscript.util") local util = require("moonscript.util")
local data = require("moonscript.data") 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 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 insert = table.insert
local NameProxy, LocalName local NameProxy, LocalName

View File

@ -3,7 +3,7 @@ types = require "moonscript.types"
util = require "moonscript.util" util = require "moonscript.util"
data = require "moonscript.data" 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 ntype, mtype, build, smart_node, is_slice, value_is_singular from types
import insert from table import insert from table
import NameProxy, LocalName from require "moonscript.transform.names" import NameProxy, LocalName from require "moonscript.transform.names"

View File

@ -9,6 +9,11 @@ do
NameProxy = _table_0.NameProxy NameProxy = _table_0.NameProxy
end end
local insert = table.insert local insert = table.insert
local unpack
do
local _table_0 = require("moonscript.util")
unpack = _table_0.unpack
end
local user_error local user_error
do do
local _table_0 = require("moonscript.errors") local _table_0 = require("moonscript.errors")

View File

@ -2,6 +2,7 @@
import ntype, mtype, build from require "moonscript.types" import ntype, mtype, build from require "moonscript.types"
import NameProxy from require "moonscript.transform.names" import NameProxy from require "moonscript.transform.names"
import insert from table import insert from table
import unpack from require "moonscript.util"
import user_error from require "moonscript.errors" import user_error from require "moonscript.errors"

View File

@ -3,6 +3,11 @@ do
local _table_0 = require("moonscript.types") local _table_0 = require("moonscript.types")
build = _table_0.build build = _table_0.build
end end
local unpack
do
local _table_0 = require("moonscript.util")
unpack = _table_0.unpack
end
local LocalName local LocalName
do do
local _parent_0 = nil local _parent_0 = nil

View File

@ -1,5 +1,6 @@
import build from require "moonscript.types" import build from require "moonscript.types"
import unpack from require "moonscript.util"
-- always declares as local -- always declares as local
class LocalName class LocalName

View File

@ -1,6 +1,7 @@
local util = require("moonscript.util") local util = require("moonscript.util")
local data = require("moonscript.data") local data = require("moonscript.data")
local insert = table.insert local insert = table.insert
local unpack = util.unpack
local manual_return = data.Set({ local manual_return = data.Set({
"foreach", "foreach",
"for", "for",

View File

@ -3,6 +3,7 @@ util = require "moonscript.util"
data = require "moonscript.data" data = require "moonscript.data"
import insert from table import insert from table
import unpack from util
-- implicit return does not work on these statements -- implicit return does not work on these statements
manual_return = data.Set{"foreach", "for", "while", "return"} manual_return = data.Set{"foreach", "for", "while", "return"}

View File

@ -8,6 +8,8 @@ util = require "moonscript.util"
pattern = ... pattern = ...
import unpack from util
options = { options = {
in_dir: "tests/inputs", in_dir: "tests/inputs",
out_dir: "tests/outputs", out_dir: "tests/outputs",