diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
| commit | 60a979e224f26117f5be82bfca757a2483cef0fd (patch) | |
| tree | 7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/class.lua | |
| parent | a19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff) | |
| download | yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2 yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip | |
fix test.
Diffstat (limited to 'spec/outputs/class.lua')
| -rw-r--r-- | spec/outputs/class.lua | 1057 |
1 files changed, 1057 insertions, 0 deletions
diff --git a/spec/outputs/class.lua b/spec/outputs/class.lua new file mode 100644 index 0000000..20b18ea --- /dev/null +++ b/spec/outputs/class.lua | |||
| @@ -0,0 +1,1057 @@ | |||
| 1 | local Hello | ||
| 2 | do | ||
| 3 | local _class_0 | ||
| 4 | local _base_0 = { | ||
| 5 | hello = function(self) | ||
| 6 | return print(self.test, self.world) | ||
| 7 | end, | ||
| 8 | __tostring = function(self) | ||
| 9 | return "hello world" | ||
| 10 | end | ||
| 11 | } | ||
| 12 | _base_0.__index = _base_0 | ||
| 13 | _class_0 = setmetatable({ | ||
| 14 | __init = function(self, test, world) | ||
| 15 | self.test = test | ||
| 16 | self.world = world | ||
| 17 | return print("creating object..") | ||
| 18 | end, | ||
| 19 | __base = _base_0, | ||
| 20 | __name = "Hello" | ||
| 21 | }, { | ||
| 22 | __index = _base_0, | ||
| 23 | __call = function(cls, ...) | ||
| 24 | local _self_0 = setmetatable({ }, _base_0) | ||
| 25 | cls.__init(_self_0, ...) | ||
| 26 | return _self_0 | ||
| 27 | end | ||
| 28 | }) | ||
| 29 | _base_0.__class = _class_0 | ||
| 30 | Hello = _class_0 | ||
| 31 | end | ||
| 32 | local x = Hello(1, 2) | ||
| 33 | x:hello() | ||
| 34 | print(x) | ||
| 35 | local Simple | ||
| 36 | do | ||
| 37 | local _class_0 | ||
| 38 | local _base_0 = { | ||
| 39 | cool = function(self) | ||
| 40 | return print("cool") | ||
| 41 | end | ||
| 42 | } | ||
| 43 | _base_0.__index = _base_0 | ||
| 44 | _class_0 = setmetatable({ | ||
| 45 | __init = function() end, | ||
| 46 | __base = _base_0, | ||
| 47 | __name = "Simple" | ||
| 48 | }, { | ||
| 49 | __index = _base_0, | ||
| 50 | __call = function(cls, ...) | ||
| 51 | local _self_0 = setmetatable({ }, _base_0) | ||
| 52 | cls.__init(_self_0, ...) | ||
| 53 | return _self_0 | ||
| 54 | end | ||
| 55 | }) | ||
| 56 | _base_0.__class = _class_0 | ||
| 57 | Simple = _class_0 | ||
| 58 | end | ||
| 59 | local Yikes | ||
| 60 | do | ||
| 61 | local _class_0 | ||
| 62 | local _parent_0 = Simple | ||
| 63 | local _base_0 = { } | ||
| 64 | _base_0.__index = _base_0 | ||
| 65 | setmetatable(_base_0, _parent_0.__base) | ||
| 66 | _class_0 = setmetatable({ | ||
| 67 | __init = function(self) | ||
| 68 | return print("created hello") | ||
| 69 | end, | ||
| 70 | __base = _base_0, | ||
| 71 | __name = "Yikes", | ||
| 72 | __parent = _parent_0 | ||
| 73 | }, { | ||
| 74 | __index = function(cls, name) | ||
| 75 | local val = rawget(_base_0, name) | ||
| 76 | if val == nil then | ||
| 77 | local parent = rawget(cls, "__parent") | ||
| 78 | if parent then | ||
| 79 | return parent[name] | ||
| 80 | end | ||
| 81 | else | ||
| 82 | return val | ||
| 83 | end | ||
| 84 | end, | ||
| 85 | __call = function(cls, ...) | ||
| 86 | local _self_0 = setmetatable({ }, _base_0) | ||
| 87 | cls.__init(_self_0, ...) | ||
| 88 | return _self_0 | ||
| 89 | end | ||
| 90 | }) | ||
| 91 | _base_0.__class = _class_0 | ||
| 92 | if _parent_0.__inherited then | ||
| 93 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 94 | end | ||
| 95 | Yikes = _class_0 | ||
| 96 | end | ||
| 97 | x = Yikes() | ||
| 98 | x:cool() | ||
| 99 | local Hi | ||
| 100 | do | ||
| 101 | local _class_0 | ||
| 102 | local _base_0 = { | ||
| 103 | cool = function(self, num) | ||
| 104 | return print("num", num) | ||
| 105 | end | ||
| 106 | } | ||
| 107 | _base_0.__index = _base_0 | ||
| 108 | _class_0 = setmetatable({ | ||
| 109 | __init = function(self, arg) | ||
| 110 | return print("init arg", arg) | ||
| 111 | end, | ||
| 112 | __base = _base_0, | ||
| 113 | __name = "Hi" | ||
| 114 | }, { | ||
| 115 | __index = _base_0, | ||
| 116 | __call = function(cls, ...) | ||
| 117 | local _self_0 = setmetatable({ }, _base_0) | ||
| 118 | cls.__init(_self_0, ...) | ||
| 119 | return _self_0 | ||
| 120 | end | ||
| 121 | }) | ||
| 122 | _base_0.__class = _class_0 | ||
| 123 | Hi = _class_0 | ||
| 124 | end | ||
| 125 | do | ||
| 126 | local _class_0 | ||
| 127 | local _parent_0 = Hi | ||
| 128 | local _base_0 = { | ||
| 129 | cool = function(self) | ||
| 130 | return _class_0.__parent.__base.cool(self, 120302) | ||
| 131 | end | ||
| 132 | } | ||
| 133 | _base_0.__index = _base_0 | ||
| 134 | setmetatable(_base_0, _parent_0.__base) | ||
| 135 | _class_0 = setmetatable({ | ||
| 136 | __init = function(self) | ||
| 137 | return _class_0.__parent.__init(self, "man") | ||
| 138 | end, | ||
| 139 | __base = _base_0, | ||
| 140 | __name = "Simple", | ||
| 141 | __parent = _parent_0 | ||
| 142 | }, { | ||
| 143 | __index = function(cls, name) | ||
| 144 | local val = rawget(_base_0, name) | ||
| 145 | if val == nil then | ||
| 146 | local parent = rawget(cls, "__parent") | ||
| 147 | if parent then | ||
| 148 | return parent[name] | ||
| 149 | end | ||
| 150 | else | ||
| 151 | return val | ||
| 152 | end | ||
| 153 | end, | ||
| 154 | __call = function(cls, ...) | ||
| 155 | local _self_0 = setmetatable({ }, _base_0) | ||
| 156 | cls.__init(_self_0, ...) | ||
| 157 | return _self_0 | ||
| 158 | end | ||
| 159 | }) | ||
| 160 | _base_0.__class = _class_0 | ||
| 161 | if _parent_0.__inherited then | ||
| 162 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 163 | end | ||
| 164 | Simple = _class_0 | ||
| 165 | end | ||
| 166 | x = Simple() | ||
| 167 | x:cool() | ||
| 168 | print(x.__class == Simple) | ||
| 169 | local Okay | ||
| 170 | do | ||
| 171 | local _class_0 | ||
| 172 | local _base_0 = { | ||
| 173 | something = 20323 | ||
| 174 | } | ||
| 175 | _base_0.__index = _base_0 | ||
| 176 | _class_0 = setmetatable({ | ||
| 177 | __init = function() end, | ||
| 178 | __base = _base_0, | ||
| 179 | __name = "Okay" | ||
| 180 | }, { | ||
| 181 | __index = _base_0, | ||
| 182 | __call = function(cls, ...) | ||
| 183 | local _self_0 = setmetatable({ }, _base_0) | ||
| 184 | cls.__init(_self_0, ...) | ||
| 185 | return _self_0 | ||
| 186 | end | ||
| 187 | }) | ||
| 188 | _base_0.__class = _class_0 | ||
| 189 | Okay = _class_0 | ||
| 190 | end | ||
| 191 | local Biggie | ||
| 192 | do | ||
| 193 | local _class_0 | ||
| 194 | local _parent_0 = Okay | ||
| 195 | local _base_0 = { | ||
| 196 | something = function(self) | ||
| 197 | _class_0.__parent.__base.something(self, 1, 2, 3, 4) | ||
| 198 | _class_0.__parent.something(another_self, 1, 2, 3, 4) | ||
| 199 | return assert(_class_0.__parent == Okay) | ||
| 200 | end | ||
| 201 | } | ||
| 202 | _base_0.__index = _base_0 | ||
| 203 | setmetatable(_base_0, _parent_0.__base) | ||
| 204 | _class_0 = setmetatable({ | ||
| 205 | __init = function(self, ...) | ||
| 206 | return _class_0.__parent.__init(self, ...) | ||
| 207 | end, | ||
| 208 | __base = _base_0, | ||
| 209 | __name = "Biggie", | ||
| 210 | __parent = _parent_0 | ||
| 211 | }, { | ||
| 212 | __index = function(cls, name) | ||
| 213 | local val = rawget(_base_0, name) | ||
| 214 | if val == nil then | ||
| 215 | local parent = rawget(cls, "__parent") | ||
| 216 | if parent then | ||
| 217 | return parent[name] | ||
| 218 | end | ||
| 219 | else | ||
| 220 | return val | ||
| 221 | end | ||
| 222 | end, | ||
| 223 | __call = function(cls, ...) | ||
| 224 | local _self_0 = setmetatable({ }, _base_0) | ||
| 225 | cls.__init(_self_0, ...) | ||
| 226 | return _self_0 | ||
| 227 | end | ||
| 228 | }) | ||
| 229 | _base_0.__class = _class_0 | ||
| 230 | if _parent_0.__inherited then | ||
| 231 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 232 | end | ||
| 233 | Biggie = _class_0 | ||
| 234 | end | ||
| 235 | local Yeah | ||
| 236 | do | ||
| 237 | local _class_0 | ||
| 238 | local _base_0 = { | ||
| 239 | okay = function(self) | ||
| 240 | return _class_0.__parent.something(self, 1, 2, 3, 4) | ||
| 241 | end | ||
| 242 | } | ||
| 243 | _base_0.__index = _base_0 | ||
| 244 | _class_0 = setmetatable({ | ||
| 245 | __init = function() end, | ||
| 246 | __base = _base_0, | ||
| 247 | __name = "Yeah" | ||
| 248 | }, { | ||
| 249 | __index = _base_0, | ||
| 250 | __call = function(cls, ...) | ||
| 251 | local _self_0 = setmetatable({ }, _base_0) | ||
| 252 | cls.__init(_self_0, ...) | ||
| 253 | return _self_0 | ||
| 254 | end | ||
| 255 | }) | ||
| 256 | _base_0.__class = _class_0 | ||
| 257 | Yeah = _class_0 | ||
| 258 | end | ||
| 259 | local What | ||
| 260 | do | ||
| 261 | local _class_0 | ||
| 262 | local _base_0 = { | ||
| 263 | something = function(self) | ||
| 264 | return print("val:", self.val) | ||
| 265 | end | ||
| 266 | } | ||
| 267 | _base_0.__index = _base_0 | ||
| 268 | _class_0 = setmetatable({ | ||
| 269 | __init = function() end, | ||
| 270 | __base = _base_0, | ||
| 271 | __name = "What" | ||
| 272 | }, { | ||
| 273 | __index = _base_0, | ||
| 274 | __call = function(cls, ...) | ||
| 275 | local _self_0 = setmetatable({ }, _base_0) | ||
| 276 | cls.__init(_self_0, ...) | ||
| 277 | return _self_0 | ||
| 278 | end | ||
| 279 | }) | ||
| 280 | _base_0.__class = _class_0 | ||
| 281 | What = _class_0 | ||
| 282 | end | ||
| 283 | do | ||
| 284 | local _class_0 | ||
| 285 | local _parent_0 = What | ||
| 286 | local _base_0 = { | ||
| 287 | val = 2323, | ||
| 288 | something = function(self) | ||
| 289 | local _base_1 = _class_0.__parent | ||
| 290 | local _fn_0 = _base_1.something | ||
| 291 | return _fn_0 and function(...) | ||
| 292 | return _fn_0(_base_1, ...) | ||
| 293 | end | ||
| 294 | end | ||
| 295 | } | ||
| 296 | _base_0.__index = _base_0 | ||
| 297 | setmetatable(_base_0, _parent_0.__base) | ||
| 298 | _class_0 = setmetatable({ | ||
| 299 | __init = function(self, ...) | ||
| 300 | return _class_0.__parent.__init(self, ...) | ||
| 301 | end, | ||
| 302 | __base = _base_0, | ||
| 303 | __name = "Hello", | ||
| 304 | __parent = _parent_0 | ||
| 305 | }, { | ||
| 306 | __index = function(cls, name) | ||
| 307 | local val = rawget(_base_0, name) | ||
| 308 | if val == nil then | ||
| 309 | local parent = rawget(cls, "__parent") | ||
| 310 | if parent then | ||
| 311 | return parent[name] | ||
| 312 | end | ||
| 313 | else | ||
| 314 | return val | ||
| 315 | end | ||
| 316 | end, | ||
| 317 | __call = function(cls, ...) | ||
| 318 | local _self_0 = setmetatable({ }, _base_0) | ||
| 319 | cls.__init(_self_0, ...) | ||
| 320 | return _self_0 | ||
| 321 | end | ||
| 322 | }) | ||
| 323 | _base_0.__class = _class_0 | ||
| 324 | if _parent_0.__inherited then | ||
| 325 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 326 | end | ||
| 327 | Hello = _class_0 | ||
| 328 | end | ||
| 329 | do | ||
| 330 | local _with_0 = Hello() | ||
| 331 | x = _with_0:something() | ||
| 332 | print(x) | ||
| 333 | x() | ||
| 334 | end | ||
| 335 | local CoolSuper | ||
| 336 | do | ||
| 337 | local _class_0 | ||
| 338 | local _base_0 = { | ||
| 339 | hi = function(self) | ||
| 340 | _class_0.__parent.__base.hi(self, 1, 2, 3, 4)(1, 2, 3, 4) | ||
| 341 | _class_0.__parent.something(1, 2, 3, 4) | ||
| 342 | local _ = _class_0.__parent.something(1, 2, 3, 4).world | ||
| 343 | _class_0.__parent.yeah(self, "world").okay(hi, hi, hi) | ||
| 344 | _ = something.super | ||
| 345 | _ = _class_0.__parent.super.super.super | ||
| 346 | do | ||
| 347 | local _base_1 = _class_0.__parent | ||
| 348 | local _fn_0 = _base_1.hello | ||
| 349 | _ = _fn_0 and function(...) | ||
| 350 | return _fn_0(_base_1, ...) | ||
| 351 | end | ||
| 352 | end | ||
| 353 | return nil | ||
| 354 | end | ||
| 355 | } | ||
| 356 | _base_0.__index = _base_0 | ||
| 357 | _class_0 = setmetatable({ | ||
| 358 | __init = function() end, | ||
| 359 | __base = _base_0, | ||
| 360 | __name = "CoolSuper" | ||
| 361 | }, { | ||
| 362 | __index = _base_0, | ||
| 363 | __call = function(cls, ...) | ||
| 364 | local _self_0 = setmetatable({ }, _base_0) | ||
| 365 | cls.__init(_self_0, ...) | ||
| 366 | return _self_0 | ||
| 367 | end | ||
| 368 | }) | ||
| 369 | _base_0.__class = _class_0 | ||
| 370 | CoolSuper = _class_0 | ||
| 371 | end | ||
| 372 | x = self.hello | ||
| 373 | x = self.__class.hello | ||
| 374 | self:hello("world") | ||
| 375 | self.__class:hello("world") | ||
| 376 | self.__class:one(self.__class:two(4, 5)(self.three, self.four)) | ||
| 377 | local xx | ||
| 378 | xx = function(hello, world, cool) | ||
| 379 | self.hello = hello | ||
| 380 | self.__class.world = world | ||
| 381 | end | ||
| 382 | local ClassMan | ||
| 383 | do | ||
| 384 | local _class_0 | ||
| 385 | local _base_0 = { | ||
| 386 | blue = function(self) end, | ||
| 387 | green = function(self) end | ||
| 388 | } | ||
| 389 | _base_0.__index = _base_0 | ||
| 390 | _class_0 = setmetatable({ | ||
| 391 | __init = function() end, | ||
| 392 | __base = _base_0, | ||
| 393 | __name = "ClassMan" | ||
| 394 | }, { | ||
| 395 | __index = _base_0, | ||
| 396 | __call = function(cls, ...) | ||
| 397 | local _self_0 = setmetatable({ }, _base_0) | ||
| 398 | cls.__init(_self_0, ...) | ||
| 399 | return _self_0 | ||
| 400 | end | ||
| 401 | }) | ||
| 402 | _base_0.__class = _class_0 | ||
| 403 | local self = _class_0; | ||
| 404 | self.yeah = 343 | ||
| 405 | self.hello = 3434 | ||
| 406 | self.world = 23423 | ||
| 407 | self.red = function(self) end | ||
| 408 | ClassMan = _class_0 | ||
| 409 | end | ||
| 410 | x = self | ||
| 411 | local y = self.__class | ||
| 412 | self(something) | ||
| 413 | self.__class(something) | ||
| 414 | local self = self + self / self | ||
| 415 | self = 343 | ||
| 416 | self.hello(2, 3, 4) | ||
| 417 | local _ = hello[self].world | ||
| 418 | local Whacko | ||
| 419 | do | ||
| 420 | local _class_0 | ||
| 421 | local hello | ||
| 422 | local _base_0 = { } | ||
| 423 | _base_0.__index = _base_0 | ||
| 424 | _class_0 = setmetatable({ | ||
| 425 | __init = function() end, | ||
| 426 | __base = _base_0, | ||
| 427 | __name = "Whacko" | ||
| 428 | }, { | ||
| 429 | __index = _base_0, | ||
| 430 | __call = function(cls, ...) | ||
| 431 | local _self_0 = setmetatable({ }, _base_0) | ||
| 432 | cls.__init(_self_0, ...) | ||
| 433 | return _self_0 | ||
| 434 | end | ||
| 435 | }) | ||
| 436 | _base_0.__class = _class_0 | ||
| 437 | local self = _class_0; | ||
| 438 | _ = self.hello | ||
| 439 | if something then | ||
| 440 | print("hello world") | ||
| 441 | end | ||
| 442 | hello = "world" | ||
| 443 | self.another = "day" | ||
| 444 | if something then | ||
| 445 | print("yeah") | ||
| 446 | end | ||
| 447 | Whacko = _class_0 | ||
| 448 | end | ||
| 449 | print("hello") | ||
| 450 | local yyy | ||
| 451 | yyy = function() | ||
| 452 | local Cool | ||
| 453 | do | ||
| 454 | local _class_0 | ||
| 455 | local _base_0 = { } | ||
| 456 | _base_0.__index = _base_0 | ||
| 457 | _class_0 = setmetatable({ | ||
| 458 | __init = function() end, | ||
| 459 | __base = _base_0, | ||
| 460 | __name = "Cool" | ||
| 461 | }, { | ||
| 462 | __index = _base_0, | ||
| 463 | __call = function(cls, ...) | ||
| 464 | local _self_0 = setmetatable({ }, _base_0) | ||
| 465 | cls.__init(_self_0, ...) | ||
| 466 | return _self_0 | ||
| 467 | end | ||
| 468 | }) | ||
| 469 | _base_0.__class = _class_0 | ||
| 470 | local self = _class_0; | ||
| 471 | _ = nil | ||
| 472 | Cool = _class_0 | ||
| 473 | return _class_0 | ||
| 474 | end | ||
| 475 | end | ||
| 476 | do | ||
| 477 | local _class_0 | ||
| 478 | local _base_0 = { } | ||
| 479 | _base_0.__index = _base_0 | ||
| 480 | _class_0 = setmetatable({ | ||
| 481 | __init = function() end, | ||
| 482 | __base = _base_0, | ||
| 483 | __name = "D" | ||
| 484 | }, { | ||
| 485 | __index = _base_0, | ||
| 486 | __call = function(cls, ...) | ||
| 487 | local _self_0 = setmetatable({ }, _base_0) | ||
| 488 | cls.__init(_self_0, ...) | ||
| 489 | return _self_0 | ||
| 490 | end | ||
| 491 | }) | ||
| 492 | _base_0.__class = _class_0 | ||
| 493 | local self = _class_0; | ||
| 494 | _ = nil | ||
| 495 | a.b.c.D = _class_0 | ||
| 496 | end | ||
| 497 | do | ||
| 498 | local _class_0 | ||
| 499 | local _base_0 = { } | ||
| 500 | _base_0.__index = _base_0 | ||
| 501 | _class_0 = setmetatable({ | ||
| 502 | __init = function() end, | ||
| 503 | __base = _base_0, | ||
| 504 | __name = "hello" | ||
| 505 | }, { | ||
| 506 | __index = _base_0, | ||
| 507 | __call = function(cls, ...) | ||
| 508 | local _self_0 = setmetatable({ }, _base_0) | ||
| 509 | cls.__init(_self_0, ...) | ||
| 510 | return _self_0 | ||
| 511 | end | ||
| 512 | }) | ||
| 513 | _base_0.__class = _class_0 | ||
| 514 | local self = _class_0; | ||
| 515 | _ = nil | ||
| 516 | a.b["hello"] = _class_0 | ||
| 517 | end | ||
| 518 | do | ||
| 519 | local _class_0 | ||
| 520 | local _parent_0 = Hello.World | ||
| 521 | local _base_0 = { } | ||
| 522 | _base_0.__index = _base_0 | ||
| 523 | setmetatable(_base_0, _parent_0.__base) | ||
| 524 | _class_0 = setmetatable({ | ||
| 525 | __init = function(self, ...) | ||
| 526 | return _class_0.__parent.__init(self, ...) | ||
| 527 | end, | ||
| 528 | __base = _base_0, | ||
| 529 | __name = "Something", | ||
| 530 | __parent = _parent_0 | ||
| 531 | }, { | ||
| 532 | __index = function(cls, name) | ||
| 533 | local val = rawget(_base_0, name) | ||
| 534 | if val == nil then | ||
| 535 | local parent = rawget(cls, "__parent") | ||
| 536 | if parent then | ||
| 537 | return parent[name] | ||
| 538 | end | ||
| 539 | else | ||
| 540 | return val | ||
| 541 | end | ||
| 542 | end, | ||
| 543 | __call = function(cls, ...) | ||
| 544 | local _self_0 = setmetatable({ }, _base_0) | ||
| 545 | cls.__init(_self_0, ...) | ||
| 546 | return _self_0 | ||
| 547 | end | ||
| 548 | }) | ||
| 549 | _base_0.__class = _class_0 | ||
| 550 | local self = _class_0; | ||
| 551 | _ = nil | ||
| 552 | if _parent_0.__inherited then | ||
| 553 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 554 | end | ||
| 555 | (function() | ||
| 556 | return require("moon") | ||
| 557 | end)().Something = _class_0 | ||
| 558 | end | ||
| 559 | local a | ||
| 560 | do | ||
| 561 | local _class_0 | ||
| 562 | local _base_0 = { } | ||
| 563 | _base_0.__index = _base_0 | ||
| 564 | _class_0 = setmetatable({ | ||
| 565 | __init = function() end, | ||
| 566 | __base = _base_0, | ||
| 567 | __name = "a" | ||
| 568 | }, { | ||
| 569 | __index = _base_0, | ||
| 570 | __call = function(cls, ...) | ||
| 571 | local _self_0 = setmetatable({ }, _base_0) | ||
| 572 | cls.__init(_self_0, ...) | ||
| 573 | return _self_0 | ||
| 574 | end | ||
| 575 | }) | ||
| 576 | _base_0.__class = _class_0 | ||
| 577 | a = _class_0 | ||
| 578 | end | ||
| 579 | local b | ||
| 580 | local Something | ||
| 581 | do | ||
| 582 | local _class_0 | ||
| 583 | local _base_0 = { } | ||
| 584 | _base_0.__index = _base_0 | ||
| 585 | _class_0 = setmetatable({ | ||
| 586 | __init = function() end, | ||
| 587 | __base = _base_0, | ||
| 588 | __name = "Something" | ||
| 589 | }, { | ||
| 590 | __index = _base_0, | ||
| 591 | __call = function(cls, ...) | ||
| 592 | local _self_0 = setmetatable({ }, _base_0) | ||
| 593 | cls.__init(_self_0, ...) | ||
| 594 | return _self_0 | ||
| 595 | end | ||
| 596 | }) | ||
| 597 | _base_0.__class = _class_0 | ||
| 598 | Something = _class_0 | ||
| 599 | b = _class_0 | ||
| 600 | end | ||
| 601 | local c | ||
| 602 | do | ||
| 603 | local _class_0 | ||
| 604 | local _parent_0 = Hello | ||
| 605 | local _base_0 = { } | ||
| 606 | _base_0.__index = _base_0 | ||
| 607 | setmetatable(_base_0, _parent_0.__base) | ||
| 608 | _class_0 = setmetatable({ | ||
| 609 | __init = function(self, ...) | ||
| 610 | return _class_0.__parent.__init(self, ...) | ||
| 611 | end, | ||
| 612 | __base = _base_0, | ||
| 613 | __name = "Something", | ||
| 614 | __parent = _parent_0 | ||
| 615 | }, { | ||
| 616 | __index = function(cls, name) | ||
| 617 | local val = rawget(_base_0, name) | ||
| 618 | if val == nil then | ||
| 619 | local parent = rawget(cls, "__parent") | ||
| 620 | if parent then | ||
| 621 | return parent[name] | ||
| 622 | end | ||
| 623 | else | ||
| 624 | return val | ||
| 625 | end | ||
| 626 | end, | ||
| 627 | __call = function(cls, ...) | ||
| 628 | local _self_0 = setmetatable({ }, _base_0) | ||
| 629 | cls.__init(_self_0, ...) | ||
| 630 | return _self_0 | ||
| 631 | end | ||
| 632 | }) | ||
| 633 | _base_0.__class = _class_0 | ||
| 634 | if _parent_0.__inherited then | ||
| 635 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 636 | end | ||
| 637 | Something = _class_0 | ||
| 638 | c = _class_0 | ||
| 639 | end | ||
| 640 | local d | ||
| 641 | do | ||
| 642 | local _class_0 | ||
| 643 | local _parent_0 = World | ||
| 644 | local _base_0 = { } | ||
| 645 | _base_0.__index = _base_0 | ||
| 646 | setmetatable(_base_0, _parent_0.__base) | ||
| 647 | _class_0 = setmetatable({ | ||
| 648 | __init = function(self, ...) | ||
| 649 | return _class_0.__parent.__init(self, ...) | ||
| 650 | end, | ||
| 651 | __base = _base_0, | ||
| 652 | __name = "d", | ||
| 653 | __parent = _parent_0 | ||
| 654 | }, { | ||
| 655 | __index = function(cls, name) | ||
| 656 | local val = rawget(_base_0, name) | ||
| 657 | if val == nil then | ||
| 658 | local parent = rawget(cls, "__parent") | ||
| 659 | if parent then | ||
| 660 | return parent[name] | ||
| 661 | end | ||
| 662 | else | ||
| 663 | return val | ||
| 664 | end | ||
| 665 | end, | ||
| 666 | __call = function(cls, ...) | ||
| 667 | local _self_0 = setmetatable({ }, _base_0) | ||
| 668 | cls.__init(_self_0, ...) | ||
| 669 | return _self_0 | ||
| 670 | end | ||
| 671 | }) | ||
| 672 | _base_0.__class = _class_0 | ||
| 673 | if _parent_0.__inherited then | ||
| 674 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 675 | end | ||
| 676 | d = _class_0 | ||
| 677 | end | ||
| 678 | print(((function() | ||
| 679 | local WhatsUp | ||
| 680 | do | ||
| 681 | local _class_0 | ||
| 682 | local _base_0 = { } | ||
| 683 | _base_0.__index = _base_0 | ||
| 684 | _class_0 = setmetatable({ | ||
| 685 | __init = function() end, | ||
| 686 | __base = _base_0, | ||
| 687 | __name = "WhatsUp" | ||
| 688 | }, { | ||
| 689 | __index = _base_0, | ||
| 690 | __call = function(cls, ...) | ||
| 691 | local _self_0 = setmetatable({ }, _base_0) | ||
| 692 | cls.__init(_self_0, ...) | ||
| 693 | return _self_0 | ||
| 694 | end | ||
| 695 | }) | ||
| 696 | _base_0.__class = _class_0 | ||
| 697 | WhatsUp = _class_0 | ||
| 698 | return _class_0 | ||
| 699 | end | ||
| 700 | end)()).__name) | ||
| 701 | do | ||
| 702 | local _class_0 | ||
| 703 | local _base_0 = { } | ||
| 704 | _base_0.__index = _base_0 | ||
| 705 | _class_0 = setmetatable({ | ||
| 706 | __init = function() end, | ||
| 707 | __base = _base_0, | ||
| 708 | __name = "Something" | ||
| 709 | }, { | ||
| 710 | __index = _base_0, | ||
| 711 | __call = function(cls, ...) | ||
| 712 | local _self_0 = setmetatable({ }, _base_0) | ||
| 713 | cls.__init(_self_0, ...) | ||
| 714 | return _self_0 | ||
| 715 | end | ||
| 716 | }) | ||
| 717 | _base_0.__class = _class_0 | ||
| 718 | local self = _class_0; | ||
| 719 | _ = nil | ||
| 720 | Something = _class_0 | ||
| 721 | end | ||
| 722 | do | ||
| 723 | local _class_0 | ||
| 724 | local val, insert | ||
| 725 | local _base_0 = { } | ||
| 726 | _base_0.__index = _base_0 | ||
| 727 | _class_0 = setmetatable({ | ||
| 728 | __init = function(self) | ||
| 729 | return print(insert, val) | ||
| 730 | end, | ||
| 731 | __base = _base_0, | ||
| 732 | __name = "Something" | ||
| 733 | }, { | ||
| 734 | __index = _base_0, | ||
| 735 | __call = function(cls, ...) | ||
| 736 | local _self_0 = setmetatable({ }, _base_0) | ||
| 737 | cls.__init(_self_0, ...) | ||
| 738 | return _self_0 | ||
| 739 | end | ||
| 740 | }) | ||
| 741 | _base_0.__class = _class_0 | ||
| 742 | local self = _class_0; | ||
| 743 | val = 23 | ||
| 744 | insert = table.insert | ||
| 745 | Something = _class_0 | ||
| 746 | end | ||
| 747 | do | ||
| 748 | local _class_0 | ||
| 749 | local _base_0 = { } | ||
| 750 | _base_0.__index = _base_0 | ||
| 751 | _class_0 = setmetatable({ | ||
| 752 | __init = hi, | ||
| 753 | __base = _base_0, | ||
| 754 | __name = "X" | ||
| 755 | }, { | ||
| 756 | __index = _base_0, | ||
| 757 | __call = function(cls, ...) | ||
| 758 | local _self_0 = setmetatable({ }, _base_0) | ||
| 759 | cls.__init(_self_0, ...) | ||
| 760 | return _self_0 | ||
| 761 | end | ||
| 762 | }) | ||
| 763 | _base_0.__class = _class_0 | ||
| 764 | X = _class_0 | ||
| 765 | end | ||
| 766 | do | ||
| 767 | local _class_0 | ||
| 768 | local _parent_0 = Thing | ||
| 769 | local _base_0 = { | ||
| 770 | dang = function(self) | ||
| 771 | return { | ||
| 772 | hello = function() | ||
| 773 | return _class_0.__parent.__base.dang(self) | ||
| 774 | end, | ||
| 775 | world = function() | ||
| 776 | return _class_0.__parent.one | ||
| 777 | end | ||
| 778 | } | ||
| 779 | end | ||
| 780 | } | ||
| 781 | _base_0.__index = _base_0 | ||
| 782 | setmetatable(_base_0, _parent_0.__base) | ||
| 783 | _class_0 = setmetatable({ | ||
| 784 | __init = function(self, ...) | ||
| 785 | return _class_0.__parent.__init(self, ...) | ||
| 786 | end, | ||
| 787 | __base = _base_0, | ||
| 788 | __name = "Cool", | ||
| 789 | __parent = _parent_0 | ||
| 790 | }, { | ||
| 791 | __index = function(cls, name) | ||
| 792 | local val = rawget(_base_0, name) | ||
| 793 | if val == nil then | ||
| 794 | local parent = rawget(cls, "__parent") | ||
| 795 | if parent then | ||
| 796 | return parent[name] | ||
| 797 | end | ||
| 798 | else | ||
| 799 | return val | ||
| 800 | end | ||
| 801 | end, | ||
| 802 | __call = function(cls, ...) | ||
| 803 | local _self_0 = setmetatable({ }, _base_0) | ||
| 804 | cls.__init(_self_0, ...) | ||
| 805 | return _self_0 | ||
| 806 | end | ||
| 807 | }) | ||
| 808 | _base_0.__class = _class_0 | ||
| 809 | if _parent_0.__inherited then | ||
| 810 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 811 | end | ||
| 812 | Cool = _class_0 | ||
| 813 | end | ||
| 814 | do | ||
| 815 | local _class_0 | ||
| 816 | local _parent_0 = Thing | ||
| 817 | local _base_0 = { | ||
| 818 | dang = do_something(function(self) | ||
| 819 | return _class_0.__parent.__base.dang(self) | ||
| 820 | end) | ||
| 821 | } | ||
| 822 | _base_0.__index = _base_0 | ||
| 823 | setmetatable(_base_0, _parent_0.__base) | ||
| 824 | _class_0 = setmetatable({ | ||
| 825 | __init = function(self, ...) | ||
| 826 | return _class_0.__parent.__init(self, ...) | ||
| 827 | end, | ||
| 828 | __base = _base_0, | ||
| 829 | __name = "Whack", | ||
| 830 | __parent = _parent_0 | ||
| 831 | }, { | ||
| 832 | __index = function(cls, name) | ||
| 833 | local val = rawget(_base_0, name) | ||
| 834 | if val == nil then | ||
| 835 | local parent = rawget(cls, "__parent") | ||
| 836 | if parent then | ||
| 837 | return parent[name] | ||
| 838 | end | ||
| 839 | else | ||
| 840 | return val | ||
| 841 | end | ||
| 842 | end, | ||
| 843 | __call = function(cls, ...) | ||
| 844 | local _self_0 = setmetatable({ }, _base_0) | ||
| 845 | cls.__init(_self_0, ...) | ||
| 846 | return _self_0 | ||
| 847 | end | ||
| 848 | }) | ||
| 849 | _base_0.__class = _class_0 | ||
| 850 | if _parent_0.__inherited then | ||
| 851 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 852 | end | ||
| 853 | Whack = _class_0 | ||
| 854 | end | ||
| 855 | do | ||
| 856 | local _class_0 | ||
| 857 | local _parent_0 = Thing | ||
| 858 | local _base_0 = { } | ||
| 859 | _base_0.__index = _base_0 | ||
| 860 | setmetatable(_base_0, _parent_0.__base) | ||
| 861 | _class_0 = setmetatable({ | ||
| 862 | __init = function(self, ...) | ||
| 863 | return _class_0.__parent.__init(self, ...) | ||
| 864 | end, | ||
| 865 | __base = _base_0, | ||
| 866 | __name = "Wowha", | ||
| 867 | __parent = _parent_0 | ||
| 868 | }, { | ||
| 869 | __index = function(cls, name) | ||
| 870 | local val = rawget(_base_0, name) | ||
| 871 | if val == nil then | ||
| 872 | local parent = rawget(cls, "__parent") | ||
| 873 | if parent then | ||
| 874 | return parent[name] | ||
| 875 | end | ||
| 876 | else | ||
| 877 | return val | ||
| 878 | end | ||
| 879 | end, | ||
| 880 | __call = function(cls, ...) | ||
| 881 | local _self_0 = setmetatable({ }, _base_0) | ||
| 882 | cls.__init(_self_0, ...) | ||
| 883 | return _self_0 | ||
| 884 | end | ||
| 885 | }) | ||
| 886 | _base_0.__class = _class_0 | ||
| 887 | local self = _class_0; | ||
| 888 | self.butt = function() | ||
| 889 | _class_0.__parent.butt(self) | ||
| 890 | _ = _class_0.__parent.hello | ||
| 891 | _class_0.__parent.hello(self) | ||
| 892 | local _base_1 = _class_0.__parent | ||
| 893 | local _fn_0 = _base_1.hello | ||
| 894 | return _fn_0 and function(...) | ||
| 895 | return _fn_0(_base_1, ...) | ||
| 896 | end | ||
| 897 | end | ||
| 898 | self.zone = cool({ | ||
| 899 | function() | ||
| 900 | _class_0.__parent.zone(self) | ||
| 901 | _ = _class_0.__parent.hello | ||
| 902 | _class_0.__parent.hello(self) | ||
| 903 | local _base_1 = _class_0.__parent | ||
| 904 | local _fn_0 = _base_1.hello | ||
| 905 | return _fn_0 and function(...) | ||
| 906 | return _fn_0(_base_1, ...) | ||
| 907 | end | ||
| 908 | end | ||
| 909 | }) | ||
| 910 | if _parent_0.__inherited then | ||
| 911 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 912 | end | ||
| 913 | Wowha = _class_0 | ||
| 914 | end | ||
| 915 | do | ||
| 916 | local Test | ||
| 917 | do | ||
| 918 | local _class_0 | ||
| 919 | local _base_0 = { | ||
| 920 | test = function(self) | ||
| 921 | return self.__class["if"] and self.__class["do"](self.__class) | ||
| 922 | end | ||
| 923 | } | ||
| 924 | _base_0.__index = _base_0 | ||
| 925 | _class_0 = setmetatable({ | ||
| 926 | __init = function(self) | ||
| 927 | self.__class["if"] = true | ||
| 928 | end, | ||
| 929 | __base = _base_0, | ||
| 930 | __name = "Test" | ||
| 931 | }, { | ||
| 932 | __index = _base_0, | ||
| 933 | __call = function(cls, ...) | ||
| 934 | local _self_0 = setmetatable({ }, _base_0) | ||
| 935 | cls.__init(_self_0, ...) | ||
| 936 | return _self_0 | ||
| 937 | end | ||
| 938 | }) | ||
| 939 | _base_0.__class = _class_0 | ||
| 940 | local self = _class_0; | ||
| 941 | self["do"] = function(self) | ||
| 942 | return 1 | ||
| 943 | end | ||
| 944 | Test = _class_0 | ||
| 945 | end | ||
| 946 | local test = Test() | ||
| 947 | test:test() | ||
| 948 | end | ||
| 949 | do | ||
| 950 | local Test | ||
| 951 | do | ||
| 952 | local _class_0 | ||
| 953 | local _base_0 = { | ||
| 954 | ["do"] = function(self) | ||
| 955 | return 1 | ||
| 956 | end, | ||
| 957 | test = function(self) | ||
| 958 | return self["if"] and self["do"](self) | ||
| 959 | end | ||
| 960 | } | ||
| 961 | _base_0.__index = _base_0 | ||
| 962 | _class_0 = setmetatable({ | ||
| 963 | __init = function(self) | ||
| 964 | self["if"] = true | ||
| 965 | end, | ||
| 966 | __base = _base_0, | ||
| 967 | __name = "Test" | ||
| 968 | }, { | ||
| 969 | __index = _base_0, | ||
| 970 | __call = function(cls, ...) | ||
| 971 | local _self_0 = setmetatable({ }, _base_0) | ||
| 972 | cls.__init(_self_0, ...) | ||
| 973 | return _self_0 | ||
| 974 | end | ||
| 975 | }) | ||
| 976 | _base_0.__class = _class_0 | ||
| 977 | Test = _class_0 | ||
| 978 | end | ||
| 979 | local test = Test() | ||
| 980 | test:test() | ||
| 981 | end | ||
| 982 | do | ||
| 983 | local _class_0 | ||
| 984 | local _parent_0 = lapis.Application | ||
| 985 | local _base_0 = { | ||
| 986 | ["/"] = function(self) | ||
| 987 | return { | ||
| 988 | json = { | ||
| 989 | status = true | ||
| 990 | } | ||
| 991 | } | ||
| 992 | end | ||
| 993 | } | ||
| 994 | _base_0.__index = _base_0 | ||
| 995 | setmetatable(_base_0, _parent_0.__base) | ||
| 996 | _class_0 = setmetatable({ | ||
| 997 | __init = function(self, ...) | ||
| 998 | return _class_0.__parent.__init(self, ...) | ||
| 999 | end, | ||
| 1000 | __base = _base_0, | ||
| 1001 | __parent = _parent_0 | ||
| 1002 | }, { | ||
| 1003 | __index = function(cls, name) | ||
| 1004 | local val = rawget(_base_0, name) | ||
| 1005 | if val == nil then | ||
| 1006 | local parent = rawget(cls, "__parent") | ||
| 1007 | if parent then | ||
| 1008 | return parent[name] | ||
| 1009 | end | ||
| 1010 | else | ||
| 1011 | return val | ||
| 1012 | end | ||
| 1013 | end, | ||
| 1014 | __call = function(cls, ...) | ||
| 1015 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1016 | cls.__init(_self_0, ...) | ||
| 1017 | return _self_0 | ||
| 1018 | end | ||
| 1019 | }) | ||
| 1020 | _base_0.__class = _class_0 | ||
| 1021 | if _parent_0.__inherited then | ||
| 1022 | _parent_0.__inherited(_parent_0, _class_0) | ||
| 1023 | end | ||
| 1024 | end | ||
| 1025 | do | ||
| 1026 | local _class_0 | ||
| 1027 | local _base_0 = { } | ||
| 1028 | local _list_0 = { | ||
| 1029 | B, | ||
| 1030 | C, | ||
| 1031 | D | ||
| 1032 | } | ||
| 1033 | for _index_0 = 1, #_list_0 do | ||
| 1034 | local _mixin_0 = _list_0[_index_0] | ||
| 1035 | for _key_0, _val_0 in pairs(_mixin_0.__base) do | ||
| 1036 | if not _key_0:match("^__") then | ||
| 1037 | _base_0[_key_0] = _val_0 | ||
| 1038 | end | ||
| 1039 | end | ||
| 1040 | end | ||
| 1041 | _base_0.__index = _base_0 | ||
| 1042 | _class_0 = setmetatable({ | ||
| 1043 | __init = function() end, | ||
| 1044 | __base = _base_0, | ||
| 1045 | __name = "A" | ||
| 1046 | }, { | ||
| 1047 | __index = _base_0, | ||
| 1048 | __call = function(cls, ...) | ||
| 1049 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1050 | cls.__init(_self_0, ...) | ||
| 1051 | return _self_0 | ||
| 1052 | end | ||
| 1053 | }) | ||
| 1054 | _base_0.__class = _class_0 | ||
| 1055 | A = _class_0 | ||
| 1056 | end | ||
| 1057 | return nil | ||
