rufus-lua-moon 0.2.3.2 → 0.2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rufus/lua/moon/version.rb +1 -1
- data/vendor/lua/moon/all.moon +5 -7
- data/vendor/lua/moon/init.moon +6 -8
- data/vendor/lua/moonscript/base.lua +2 -0
- data/vendor/lua/moonscript/compile/statement.lua +25 -26
- data/vendor/lua/moonscript/compile/value.lua +43 -36
- data/vendor/lua/moonscript/compile.lua +69 -128
- data/vendor/lua/moonscript/data.lua +9 -21
- data/vendor/lua/moonscript/dump.lua +6 -6
- data/vendor/lua/moonscript/errors.lua +18 -12
- data/vendor/lua/moonscript/init.lua +15 -13
- data/vendor/lua/moonscript/parse.lua +5 -5
- data/vendor/lua/moonscript/transform/destructure.lua +44 -39
- data/vendor/lua/moonscript/transform/names.lua +12 -41
- data/vendor/lua/moonscript/transform.lua +298 -322
- data/vendor/lua/moonscript/types.lua +18 -11
- data/vendor/lua/moonscript/util.lua +26 -22
- data/vendor/lua/moonscript/version.lua +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c432105ec4dd74d5e144bda27c32f6ef821b6182
|
4
|
+
data.tar.gz: f31a4a954e0f48ab813568b16063d26e2cc27258
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2969e129ef6740d431a6b971a371c5502e8920f20fd37e2278def0ca087c25bb03ecee884a990a21d9b52ffac5d07320537261e79a404fd1da7e1e9b3dd8db35
|
7
|
+
data.tar.gz: 3a9333b3cbacb4ee8f95d10abf195ed80775f6bd8fe45b6304e0a39367a088344b419656ba1f553cd42ad3883602bf75bdb36a565b1dfcb44f88df5531c3a5a4
|
@@ -5,7 +5,7 @@ module Rufus
|
|
5
5
|
subV=File.read(File.expand_path '.subversion', root).strip rescue ''
|
6
6
|
subV="."+subV.gsub(/\W+/, '.') if subV.length>0
|
7
7
|
Path=File.expand_path 'vendor/lua', root
|
8
|
-
m=/(["'])(\d+(\.\d+){1,3}(-(?!0)[\da-z]))\1/i.match File.read File.expand_path 'moonscript/version.lua', Path
|
8
|
+
m=/(["'])(\d+(\.\d+){1,3}(-(?!0)[\da-z])*)\1/i.match File.read File.expand_path 'moonscript/version.lua', Path
|
9
9
|
VERSION = m ? m[2].gsub('-', '.')+subV : '0.0.?'
|
10
10
|
end
|
11
11
|
end
|
data/vendor/lua/moon/all.moon
CHANGED
data/vendor/lua/moon/init.moon
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
|
2
|
-
if not moon or not moon.inject
|
3
|
-
module "moon", package.seeall
|
4
|
-
|
5
2
|
util = require "moonscript.util"
|
6
|
-
|
7
3
|
lua = { :debug, :type }
|
8
4
|
|
9
|
-
|
5
|
+
local *
|
10
6
|
|
11
7
|
dump = util.dump
|
12
8
|
|
@@ -104,8 +100,7 @@ copy = =>
|
|
104
100
|
|
105
101
|
-- mixin class properties into self, call new
|
106
102
|
mixin = (cls, ...) =>
|
107
|
-
|
108
|
-
for key, val in pairs meta.__index
|
103
|
+
for key, val in pairs cls.__base
|
109
104
|
self[key] = val if not key\match"^__"
|
110
105
|
cls.__init self, ...
|
111
106
|
|
@@ -134,4 +129,7 @@ fold = (items, fn)->
|
|
134
129
|
else
|
135
130
|
items[1]
|
136
131
|
|
137
|
-
|
132
|
+
{
|
133
|
+
:dump, :p, :is_object, :type, :debug, :run_with_scope, :bind_methods,
|
134
|
+
:defaultbl, :extend, :copy, :mixin, :mixin_object, :mixin_table, :fold
|
135
|
+
}
|
@@ -1,12 +1,17 @@
|
|
1
1
|
local util = require("moonscript.util")
|
2
2
|
local data = require("moonscript.data")
|
3
|
-
local reversed, unpack
|
3
|
+
local reversed, unpack
|
4
|
+
reversed, unpack = util.reversed, util.unpack
|
4
5
|
local ntype
|
5
6
|
do
|
6
|
-
local
|
7
|
-
ntype =
|
7
|
+
local _obj_0 = require("moonscript.types")
|
8
|
+
ntype = _obj_0.ntype
|
9
|
+
end
|
10
|
+
local concat, insert
|
11
|
+
do
|
12
|
+
local _obj_0 = table
|
13
|
+
concat, insert = _obj_0.concat, _obj_0.insert
|
8
14
|
end
|
9
|
-
local concat, insert = table.concat, table.insert
|
10
15
|
local statement_compilers = {
|
11
16
|
raw = function(self, node)
|
12
17
|
return self:add(node[2])
|
@@ -27,9 +32,8 @@ local statement_compilers = {
|
|
27
32
|
_with_0:append_list((function()
|
28
33
|
local _accum_0 = { }
|
29
34
|
local _len_0 = 1
|
30
|
-
|
31
|
-
|
32
|
-
local name = _list_0[_index_0]
|
35
|
+
for _index_0 = 1, #undeclared do
|
36
|
+
local name = undeclared[_index_0]
|
33
37
|
_accum_0[_len_0] = self:name(name)
|
34
38
|
_len_0 = _len_0 + 1
|
35
39
|
end
|
@@ -47,9 +51,8 @@ local statement_compilers = {
|
|
47
51
|
_with_0:append_list((function()
|
48
52
|
local _accum_0 = { }
|
49
53
|
local _len_0 = 1
|
50
|
-
|
51
|
-
|
52
|
-
local name = _list_0[_index_0]
|
54
|
+
for _index_0 = 1, #names do
|
55
|
+
local name = names[_index_0]
|
53
56
|
_accum_0[_len_0] = self:name(name)
|
54
57
|
_len_0 = _len_0 + 1
|
55
58
|
end
|
@@ -81,9 +84,8 @@ local statement_compilers = {
|
|
81
84
|
_with_0:append_list((function()
|
82
85
|
local _accum_0 = { }
|
83
86
|
local _len_0 = 1
|
84
|
-
|
85
|
-
|
86
|
-
local name = _list_0[_index_0]
|
87
|
+
for _index_0 = 1, #names do
|
88
|
+
local name = names[_index_0]
|
87
89
|
_accum_0[_len_0] = self:value(name)
|
88
90
|
_len_0 = _len_0 + 1
|
89
91
|
end
|
@@ -94,9 +96,8 @@ local statement_compilers = {
|
|
94
96
|
_with_0:append_list((function()
|
95
97
|
local _accum_0 = { }
|
96
98
|
local _len_0 = 1
|
97
|
-
|
98
|
-
|
99
|
-
local v = _list_0[_index_0]
|
99
|
+
for _index_0 = 1, #values do
|
100
|
+
local v = values[_index_0]
|
100
101
|
_accum_0[_len_0] = self:value(v)
|
101
102
|
_len_0 = _len_0 + 1
|
102
103
|
end
|
@@ -139,9 +140,8 @@ local statement_compilers = {
|
|
139
140
|
current.next = next
|
140
141
|
current = next
|
141
142
|
end
|
142
|
-
|
143
|
-
|
144
|
-
cond = _list_0[_index_0]
|
143
|
+
for _index_0 = 4, #node do
|
144
|
+
cond = node[_index_0]
|
145
145
|
add_clause(cond)
|
146
146
|
end
|
147
147
|
return root
|
@@ -190,9 +190,8 @@ local statement_compilers = {
|
|
190
190
|
loop:append_list((function()
|
191
191
|
local _accum_0 = { }
|
192
192
|
local _len_0 = 1
|
193
|
-
|
194
|
-
|
195
|
-
local name = _list_0[_index_0]
|
193
|
+
for _index_0 = 1, #names do
|
194
|
+
local name = names[_index_0]
|
196
195
|
_accum_0[_len_0] = _with_0:name(name, false)
|
197
196
|
_len_0 = _len_0 + 1
|
198
197
|
end
|
@@ -202,9 +201,8 @@ local statement_compilers = {
|
|
202
201
|
loop:append_list((function()
|
203
202
|
local _accum_0 = { }
|
204
203
|
local _len_0 = 1
|
205
|
-
|
206
|
-
|
207
|
-
local exp = _list_0[_index_0]
|
204
|
+
for _index_0 = 1, #exps do
|
205
|
+
local exp = exps[_index_0]
|
208
206
|
_accum_0[_len_0] = self:value(exp)
|
209
207
|
_len_0 = _len_0 + 1
|
210
208
|
end
|
@@ -242,7 +240,8 @@ local statement_compilers = {
|
|
242
240
|
_with_0:stms(node[2])
|
243
241
|
return _with_0
|
244
242
|
end
|
245
|
-
end
|
243
|
+
end,
|
244
|
+
noop = function(self) end
|
246
245
|
}
|
247
246
|
return {
|
248
247
|
statement_compilers = statement_compilers
|
@@ -2,17 +2,26 @@ local util = require("moonscript.util")
|
|
2
2
|
local data = require("moonscript.data")
|
3
3
|
local ntype
|
4
4
|
do
|
5
|
-
local
|
6
|
-
ntype =
|
5
|
+
local _obj_0 = require("moonscript.types")
|
6
|
+
ntype = _obj_0.ntype
|
7
7
|
end
|
8
8
|
local user_error
|
9
9
|
do
|
10
|
-
local
|
11
|
-
user_error =
|
10
|
+
local _obj_0 = require("moonscript.errors")
|
11
|
+
user_error = _obj_0.user_error
|
12
12
|
end
|
13
|
-
local concat, insert
|
14
|
-
|
13
|
+
local concat, insert
|
14
|
+
do
|
15
|
+
local _obj_0 = table
|
16
|
+
concat, insert = _obj_0.concat, _obj_0.insert
|
17
|
+
end
|
18
|
+
local unpack
|
19
|
+
unpack = util.unpack
|
15
20
|
local table_delim = ","
|
21
|
+
local string_chars = {
|
22
|
+
["\r"] = "\\r",
|
23
|
+
["\n"] = "\\n"
|
24
|
+
}
|
16
25
|
local value_compilers = {
|
17
26
|
exp = function(self, node)
|
18
27
|
local _comp
|
@@ -44,9 +53,8 @@ local value_compilers = {
|
|
44
53
|
_with_0:append_list((function()
|
45
54
|
local _accum_0 = { }
|
46
55
|
local _len_0 = 1
|
47
|
-
|
48
|
-
|
49
|
-
local v = _list_0[_index_0]
|
56
|
+
for _index_0 = 2, #node do
|
57
|
+
local v = node[_index_0]
|
50
58
|
_accum_0[_len_0] = self:value(v)
|
51
59
|
_len_0 = _len_0 + 1
|
52
60
|
end
|
@@ -61,6 +69,9 @@ local value_compilers = {
|
|
61
69
|
string = function(self, node)
|
62
70
|
local _, delim, inner = unpack(node)
|
63
71
|
local end_delim = delim:gsub("%[", "]")
|
72
|
+
if delim == "'" or delim == '"' then
|
73
|
+
inner = inner:gsub("[\r\n]", string_chars)
|
74
|
+
end
|
64
75
|
return delim .. inner .. end_delim
|
65
76
|
end,
|
66
77
|
chain = function(self, node)
|
@@ -103,9 +114,8 @@ local value_compilers = {
|
|
103
114
|
local actions
|
104
115
|
do
|
105
116
|
local _with_0 = self:line()
|
106
|
-
|
107
|
-
|
108
|
-
local action = _list_0[_index_0]
|
117
|
+
for _index_0 = 3, #node do
|
118
|
+
local action = node[_index_0]
|
109
119
|
_with_0:append(chain_item(action))
|
110
120
|
end
|
111
121
|
actions = _with_0
|
@@ -116,12 +126,12 @@ local value_compilers = {
|
|
116
126
|
local _, args, whitelist, arrow, block = unpack(node)
|
117
127
|
local default_args = { }
|
118
128
|
local self_args = { }
|
119
|
-
local arg_names
|
129
|
+
local arg_names
|
130
|
+
do
|
120
131
|
local _accum_0 = { }
|
121
132
|
local _len_0 = 1
|
122
|
-
|
123
|
-
|
124
|
-
local arg = _list_0[_index_0]
|
133
|
+
for _index_0 = 1, #args do
|
134
|
+
local arg = args[_index_0]
|
125
135
|
local name, default_value = unpack(arg)
|
126
136
|
if type(name) == "string" then
|
127
137
|
name = name
|
@@ -138,8 +148,8 @@ local value_compilers = {
|
|
138
148
|
_accum_0[_len_0] = _value_0
|
139
149
|
_len_0 = _len_0 + 1
|
140
150
|
end
|
141
|
-
|
142
|
-
end
|
151
|
+
arg_names = _accum_0
|
152
|
+
end
|
143
153
|
if arrow == "fat" then
|
144
154
|
insert(arg_names, 1, "self")
|
145
155
|
end
|
@@ -148,14 +158,12 @@ local value_compilers = {
|
|
148
158
|
if #whitelist > 0 then
|
149
159
|
_with_0:whitelist_names(whitelist)
|
150
160
|
end
|
151
|
-
|
152
|
-
|
153
|
-
local name = _list_0[_index_0]
|
161
|
+
for _index_0 = 1, #arg_names do
|
162
|
+
local name = arg_names[_index_0]
|
154
163
|
_with_0:put_name(name)
|
155
164
|
end
|
156
|
-
|
157
|
-
|
158
|
-
local default = _list_1[_index_0]
|
165
|
+
for _index_0 = 1, #default_args do
|
166
|
+
local default = default_args[_index_0]
|
159
167
|
local name, value = unpack(default)
|
160
168
|
if type(name) == "table" then
|
161
169
|
name = name[2]
|
@@ -181,17 +189,17 @@ local value_compilers = {
|
|
181
189
|
}
|
182
190
|
})
|
183
191
|
end
|
184
|
-
local self_arg_values
|
192
|
+
local self_arg_values
|
193
|
+
do
|
185
194
|
local _accum_0 = { }
|
186
195
|
local _len_0 = 1
|
187
|
-
|
188
|
-
|
189
|
-
local arg = _list_2[_index_0]
|
196
|
+
for _index_0 = 1, #self_args do
|
197
|
+
local arg = self_args[_index_0]
|
190
198
|
_accum_0[_len_0] = arg[2]
|
191
199
|
_len_0 = _len_0 + 1
|
192
200
|
end
|
193
|
-
|
194
|
-
end
|
201
|
+
self_arg_values = _accum_0
|
202
|
+
end
|
195
203
|
if #self_args > 0 then
|
196
204
|
_with_0:stm({
|
197
205
|
"assign",
|
@@ -201,17 +209,16 @@ local value_compilers = {
|
|
201
209
|
end
|
202
210
|
_with_0:stms(block)
|
203
211
|
if #args > #arg_names then
|
204
|
-
|
212
|
+
do
|
205
213
|
local _accum_0 = { }
|
206
214
|
local _len_0 = 1
|
207
|
-
|
208
|
-
|
209
|
-
local arg = _list_2[_index_0]
|
215
|
+
for _index_0 = 1, #args do
|
216
|
+
local arg = args[_index_0]
|
210
217
|
_accum_0[_len_0] = arg[1]
|
211
218
|
_len_0 = _len_0 + 1
|
212
219
|
end
|
213
|
-
|
214
|
-
end
|
220
|
+
arg_names = _accum_0
|
221
|
+
end
|
215
222
|
end
|
216
223
|
_with_0.header = "function(" .. concat(arg_names, ", ") .. ")"
|
217
224
|
return _with_0
|