rufus-lua-moon 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,144 @@
1
+ local build
2
+ do
3
+ local _table_0 = require("moonscript.types")
4
+ build = _table_0.build
5
+ end
6
+ local unpack
7
+ do
8
+ local _table_0 = require("moonscript.util")
9
+ unpack = _table_0.unpack
10
+ end
11
+ local LocalName
12
+ do
13
+ local _parent_0 = nil
14
+ local _base_0 = {
15
+ get_name = function(self)
16
+ return self.name
17
+ end
18
+ }
19
+ _base_0.__index = _base_0
20
+ if _parent_0 then
21
+ setmetatable(_base_0, _parent_0.__base)
22
+ end
23
+ local _class_0 = setmetatable({
24
+ __init = function(self, name)
25
+ self.name = name
26
+ self[1] = "temp_name"
27
+ end,
28
+ __base = _base_0,
29
+ __name = "LocalName",
30
+ __parent = _parent_0
31
+ }, {
32
+ __index = function(cls, name)
33
+ local val = rawget(_base_0, name)
34
+ if val == nil and _parent_0 then
35
+ return _parent_0[name]
36
+ else
37
+ return val
38
+ end
39
+ end,
40
+ __call = function(cls, ...)
41
+ local _self_0 = setmetatable({}, _base_0)
42
+ cls.__init(_self_0, ...)
43
+ return _self_0
44
+ end
45
+ })
46
+ _base_0.__class = _class_0
47
+ if _parent_0 and _parent_0.__inherited then
48
+ _parent_0.__inherited(_parent_0, _class_0)
49
+ end
50
+ LocalName = _class_0
51
+ end
52
+ local NameProxy
53
+ do
54
+ local _parent_0 = nil
55
+ local _base_0 = {
56
+ get_name = function(self, scope, dont_put)
57
+ if dont_put == nil then
58
+ dont_put = true
59
+ end
60
+ if not self.name then
61
+ self.name = scope:free_name(self.prefix, dont_put)
62
+ end
63
+ return self.name
64
+ end,
65
+ chain = function(self, ...)
66
+ local items = (function(...)
67
+ local _accum_0 = { }
68
+ local _len_0 = 1
69
+ local _list_0 = {
70
+ ...
71
+ }
72
+ for _index_0 = 1, #_list_0 do
73
+ local i = _list_0[_index_0]
74
+ if type(i) == "string" then
75
+ _accum_0[_len_0] = {
76
+ "dot",
77
+ i
78
+ }
79
+ else
80
+ _accum_0[_len_0] = i
81
+ end
82
+ _len_0 = _len_0 + 1
83
+ end
84
+ return _accum_0
85
+ end)(...)
86
+ return build.chain({
87
+ base = self,
88
+ unpack(items)
89
+ })
90
+ end,
91
+ index = function(self, key)
92
+ return build.chain({
93
+ base = self,
94
+ {
95
+ "index",
96
+ key
97
+ }
98
+ })
99
+ end,
100
+ __tostring = function(self)
101
+ if self.name then
102
+ return ("name<%s>"):format(self.name)
103
+ else
104
+ return ("name<prefix(%s)>"):format(self.prefix)
105
+ end
106
+ end
107
+ }
108
+ _base_0.__index = _base_0
109
+ if _parent_0 then
110
+ setmetatable(_base_0, _parent_0.__base)
111
+ end
112
+ local _class_0 = setmetatable({
113
+ __init = function(self, prefix)
114
+ self.prefix = prefix
115
+ self[1] = "temp_name"
116
+ end,
117
+ __base = _base_0,
118
+ __name = "NameProxy",
119
+ __parent = _parent_0
120
+ }, {
121
+ __index = function(cls, name)
122
+ local val = rawget(_base_0, name)
123
+ if val == nil and _parent_0 then
124
+ return _parent_0[name]
125
+ else
126
+ return val
127
+ end
128
+ end,
129
+ __call = function(cls, ...)
130
+ local _self_0 = setmetatable({}, _base_0)
131
+ cls.__init(_self_0, ...)
132
+ return _self_0
133
+ end
134
+ })
135
+ _base_0.__class = _class_0
136
+ if _parent_0 and _parent_0.__inherited then
137
+ _parent_0.__inherited(_parent_0, _class_0)
138
+ end
139
+ NameProxy = _class_0
140
+ end
141
+ return {
142
+ NameProxy = NameProxy,
143
+ LocalName = LocalName
144
+ }