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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc204ab42004ec98bd7db42ccbb3d577d7e35355
4
- data.tar.gz: a365e10939e178caa3918cdaba2f385f2753350f
3
+ metadata.gz: c432105ec4dd74d5e144bda27c32f6ef821b6182
4
+ data.tar.gz: f31a4a954e0f48ab813568b16063d26e2cc27258
5
5
  SHA512:
6
- metadata.gz: b6ab5c2b6b3f0fc72cfe5cf91e16f3f25e10d739dafbe9f00d26c62178b6df06ed437171d19e94abb6844e5d9870569ef67b674efd31ab1b8152039bf09f176d
7
- data.tar.gz: 8af330b1958ea7e90d59e09240653674b82b8d930d6384a500c8d0b03bc31146d34187eb08024d7d43eed15e380704d2e0508cd7614fe388ac16d1d5f82c80cd
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
@@ -1,8 +1,6 @@
1
-
2
- -- insert all moon library functions into requiring scope
3
-
4
- export moon
5
- moon = moon or {}
6
- moon.inject = true
7
- require "moon.init"
1
+ -- install moon into global scope
2
+ moon = require "moon"
3
+ for k,v in pairs moon
4
+ _G[k] = v
5
+ moon
8
6
 
@@ -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
- export *
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
- meta = getmetatable cls
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
- nil
132
+ {
133
+ :dump, :p, :is_object, :type, :debug, :run_with_scope, :bind_methods,
134
+ :defaultbl, :extend, :copy, :mixin, :mixin_object, :mixin_table, :fold
135
+ }
@@ -0,0 +1,2 @@
1
+ _G.moon_no_loader = true
2
+ return require("moonscript")
@@ -1,12 +1,17 @@
1
1
  local util = require("moonscript.util")
2
2
  local data = require("moonscript.data")
3
- local reversed, unpack = util.reversed, util.unpack
3
+ local reversed, unpack
4
+ reversed, unpack = util.reversed, util.unpack
4
5
  local ntype
5
6
  do
6
- local _table_0 = require("moonscript.types")
7
- ntype = _table_0.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
- local _list_0 = undeclared
31
- for _index_0 = 1, #_list_0 do
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
- local _list_0 = names
51
- for _index_0 = 1, #_list_0 do
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
- local _list_0 = names
85
- for _index_0 = 1, #_list_0 do
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
- local _list_0 = values
98
- for _index_0 = 1, #_list_0 do
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
- local _list_0 = node
143
- for _index_0 = 4, #_list_0 do
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
- local _list_0 = names
194
- for _index_0 = 1, #_list_0 do
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
- local _list_0 = exps
206
- for _index_0 = 1, #_list_0 do
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 _table_0 = require("moonscript.types")
6
- ntype = _table_0.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 _table_0 = require("moonscript.errors")
11
- user_error = _table_0.user_error
10
+ local _obj_0 = require("moonscript.errors")
11
+ user_error = _obj_0.user_error
12
12
  end
13
- local concat, insert = table.concat, table.insert
14
- local unpack = util.unpack
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
- local _list_0 = node
48
- for _index_0 = 2, #_list_0 do
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
- local _list_0 = node
107
- for _index_0 = 3, #_list_0 do
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 = (function()
129
+ local arg_names
130
+ do
120
131
  local _accum_0 = { }
121
132
  local _len_0 = 1
122
- local _list_0 = args
123
- for _index_0 = 1, #_list_0 do
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
- return _accum_0
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
- local _list_0 = arg_names
152
- for _index_0 = 1, #_list_0 do
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
- local _list_1 = default_args
157
- for _index_0 = 1, #_list_1 do
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 = (function()
192
+ local self_arg_values
193
+ do
185
194
  local _accum_0 = { }
186
195
  local _len_0 = 1
187
- local _list_2 = self_args
188
- for _index_0 = 1, #_list_2 do
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
- return _accum_0
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
- arg_names = (function()
212
+ do
205
213
  local _accum_0 = { }
206
214
  local _len_0 = 1
207
- local _list_2 = args
208
- for _index_0 = 1, #_list_2 do
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
- return _accum_0
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