Advertisement
PXshadow

Untitled

Aug 31st, 2019
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.68 KB | None | 0 0
  1. -- Generated by Haxe 4.0.0-rc.3+e3df7a448
  2. local _hx_array_mt = {
  3. __newindex = function(t,k,v)
  4. local len = t.length
  5. t.length = k >= len and (k + 1) or len
  6. rawset(t,k,v)
  7. end
  8. }
  9.  
  10. local function _hx_tab_array(tab,length)
  11. tab.length = length
  12. return setmetatable(tab, _hx_array_mt)
  13. end
  14.  
  15. local function _hx_anon_newindex(t,k,v) t.__fields__[k] = true; rawset(t,k,v); end
  16. local _hx_anon_mt = {__newindex=_hx_anon_newindex}
  17. local function _hx_a(...)
  18. local __fields__ = {};
  19. local ret = {__fields__ = __fields__};
  20. local max = select('#',...);
  21. local tab = {...};
  22. local cur = 1;
  23. while cur < max do
  24. local v = tab[cur];
  25. __fields__[v] = true;
  26. ret[v] = tab[cur+1];
  27. cur = cur + 2
  28. end
  29. return setmetatable(ret, _hx_anon_mt)
  30. end
  31.  
  32. local function _hx_e()
  33. return setmetatable({__fields__ = {}}, _hx_anon_mt)
  34. end
  35.  
  36. local function _hx_o(obj)
  37. return setmetatable(obj, _hx_anon_mt)
  38. end
  39.  
  40. local function _hx_new(prototype)
  41. return setmetatable({__fields__ = {}}, {__newindex=_hx_anon_newindex, __index=prototype})
  42. end
  43.  
  44. local _hxClasses = {}
  45. local Int = _hx_e();
  46. local Dynamic = _hx_e();
  47. local Float = _hx_e();
  48. local Bool = _hx_e();
  49. local Class = _hx_e();
  50. local Enum = _hx_e();
  51.  
  52. local Array = _hx_e()
  53. local Main = _hx_e()
  54. local Script = _hx_e()
  55. local Math = _hx_e()
  56. local String = _hx_e()
  57. local Std = _hx_e()
  58. __haxe_Log = _hx_e()
  59. __lua_Boot = _hx_e()
  60.  
  61. local _hx_bind, _hx_bit, _hx_staticToInstance, _hx_funcToField, _hx_maxn, _hx_print, _hx_apply_self, _hx_box_mr, _hx_bit_clamp, _hx_table, _hx_bit_raw
  62. local _hx_pcall_default = {};
  63. local _hx_pcall_break = {};
  64.  
  65. Array.new = function()
  66. local self = _hx_new(Array.prototype)
  67. Array.super(self)
  68. return self
  69. end
  70. Array.super = function(self)
  71. _hx_tab_array(self, 0);
  72. end
  73. Array.prototype = _hx_a();
  74. Array.prototype.concat = function(self,a)
  75. local _g = _hx_tab_array({}, 0);
  76. local _g1 = 0;
  77. local _g2 = self;
  78. while (_g1 < _g2.length) do
  79. local i = _g2[_g1];
  80. _g1 = _g1 + 1;
  81. _g:push(i);
  82. end;
  83. local ret = _g;
  84. local _g3 = 0;
  85. while (_g3 < a.length) do
  86. local i1 = a[_g3];
  87. _g3 = _g3 + 1;
  88. ret:push(i1);
  89. end;
  90. do return ret end
  91. end
  92. Array.prototype.join = function(self,sep)
  93. local tbl = ({});
  94. local _gthis = self;
  95. local cur_length = 0;
  96. local i = _hx_o({__fields__={hasNext=true,next=true},hasNext=function(self)
  97. do return cur_length < _gthis.length end;
  98. end,next=function(self)
  99. cur_length = cur_length + 1;
  100. do return _gthis[cur_length - 1] end;
  101. end});
  102. while (i:hasNext()) do
  103. local i1 = i:next();
  104. _G.table.insert(tbl, Std.string(i1));
  105. end;
  106. do return _G.table.concat(tbl, sep) end
  107. end
  108. Array.prototype.pop = function(self)
  109. if (self.length == 0) then
  110. do return nil end;
  111. end;
  112. local ret = self[self.length - 1];
  113. self[self.length - 1] = nil;
  114. self.length = self.length - 1;
  115. do return ret end
  116. end
  117. Array.prototype.push = function(self,x)
  118. self[self.length] = x;
  119. do return self.length end
  120. end
  121. Array.prototype.reverse = function(self)
  122. local tmp;
  123. local i = 0;
  124. while (i < Std.int(self.length / 2)) do
  125. tmp = self[i];
  126. self[i] = self[(self.length - i) - 1];
  127. self[(self.length - i) - 1] = tmp;
  128. i = i + 1;
  129. end;
  130. end
  131. Array.prototype.shift = function(self)
  132. if (self.length == 0) then
  133. do return nil end;
  134. end;
  135. local ret = self[0];
  136. if (self.length == 1) then
  137. self[0] = nil;
  138. else
  139. if (self.length > 1) then
  140. self[0] = self[1];
  141. _G.table.remove(self, 1);
  142. end;
  143. end;
  144. local tmp = self;
  145. tmp.length = tmp.length - 1;
  146. do return ret end
  147. end
  148. Array.prototype.slice = function(self,pos,_end)
  149. if ((_end == nil) or (_end > self.length)) then
  150. _end = self.length;
  151. else
  152. if (_end < 0) then
  153. _end = _G.math.fmod((self.length - (_G.math.fmod(-_end, self.length))), self.length);
  154. end;
  155. end;
  156. if (pos < 0) then
  157. pos = _G.math.fmod((self.length - (_G.math.fmod(-pos, self.length))), self.length);
  158. end;
  159. if ((pos > _end) or (pos > self.length)) then
  160. do return _hx_tab_array({}, 0) end;
  161. end;
  162. local ret = _hx_tab_array({}, 0);
  163. local _g = pos;
  164. local _g1 = _end;
  165. while (_g < _g1) do
  166. _g = _g + 1;
  167. local i = _g - 1;
  168. ret:push(self[i]);
  169. end;
  170. do return ret end
  171. end
  172. Array.prototype.sort = function(self,f)
  173. local i = 0;
  174. local l = self.length;
  175. while (i < l) do
  176. local swap = false;
  177. local j = 0;
  178. local max = (l - i) - 1;
  179. while (j < max) do
  180. if (f(self[j], self[j + 1]) > 0) then
  181. local tmp = self[j + 1];
  182. self[j + 1] = self[j];
  183. self[j] = tmp;
  184. swap = true;
  185. end;
  186. j = j + 1;
  187. end;
  188. if (not swap) then
  189. break;
  190. end;
  191. i = i + 1;
  192. end;
  193. end
  194. Array.prototype.splice = function(self,pos,len)
  195. if ((len < 0) or (pos > self.length)) then
  196. do return _hx_tab_array({}, 0) end;
  197. else
  198. if (pos < 0) then
  199. pos = self.length - (_G.math.fmod(-pos, self.length));
  200. end;
  201. end;
  202. len = Math.min(len, self.length - pos);
  203. local ret = _hx_tab_array({}, 0);
  204. local _g = pos;
  205. local _g1 = pos + len;
  206. while (_g < _g1) do
  207. _g = _g + 1;
  208. local i = _g - 1;
  209. ret:push(self[i]);
  210. self[i] = self[i + len];
  211. end;
  212. local _g2 = pos + len;
  213. local _g3 = self.length;
  214. while (_g2 < _g3) do
  215. _g2 = _g2 + 1;
  216. local i1 = _g2 - 1;
  217. self[i1] = self[i1 + len];
  218. end;
  219. local tmp = self;
  220. tmp.length = tmp.length - len;
  221. do return ret end
  222. end
  223. Array.prototype.toString = function(self)
  224. local tbl = ({});
  225. _G.table.insert(tbl, "[");
  226. _G.table.insert(tbl, self:join(","));
  227. _G.table.insert(tbl, "]");
  228. do return _G.table.concat(tbl, "") end
  229. end
  230. Array.prototype.unshift = function(self,x)
  231. local len = self.length;
  232. local _g = 0;
  233. local _g1 = len;
  234. while (_g < _g1) do
  235. _g = _g + 1;
  236. local i = _g - 1;
  237. self[len - i] = self[(len - i) - 1];
  238. end;
  239. self[0] = x;
  240. end
  241. Array.prototype.insert = function(self,pos,x)
  242. if (pos > self.length) then
  243. pos = self.length;
  244. end;
  245. if (pos < 0) then
  246. pos = self.length + pos;
  247. if (pos < 0) then
  248. pos = 0;
  249. end;
  250. end;
  251. local cur_len = self.length;
  252. while (cur_len > pos) do
  253. self[cur_len] = self[cur_len - 1];
  254. cur_len = cur_len - 1;
  255. end;
  256. self[pos] = x;
  257. end
  258. Array.prototype.remove = function(self,x)
  259. local _g = 0;
  260. local _g1 = self.length;
  261. while (_g < _g1) do
  262. _g = _g + 1;
  263. local i = _g - 1;
  264. if (self[i] == x) then
  265. local _g2 = i;
  266. local _g11 = self.length - 1;
  267. while (_g2 < _g11) do
  268. _g2 = _g2 + 1;
  269. local j = _g2 - 1;
  270. self[j] = self[j + 1];
  271. end;
  272. self[self.length - 1] = nil;
  273. self.length = self.length - 1;
  274. do return true end;
  275. end;
  276. end;
  277. do return false end
  278. end
  279. Array.prototype.indexOf = function(self,x,fromIndex)
  280. local _end = self.length;
  281. if (fromIndex == nil) then
  282. fromIndex = 0;
  283. else
  284. if (fromIndex < 0) then
  285. fromIndex = self.length + fromIndex;
  286. if (fromIndex < 0) then
  287. fromIndex = 0;
  288. end;
  289. end;
  290. end;
  291. local _g = fromIndex;
  292. local _g1 = _end;
  293. while (_g < _g1) do
  294. _g = _g + 1;
  295. local i = _g - 1;
  296. if (x == self[i]) then
  297. do return i end;
  298. end;
  299. end;
  300. do return -1 end
  301. end
  302. Array.prototype.lastIndexOf = function(self,x,fromIndex)
  303. if ((fromIndex == nil) or (fromIndex >= self.length)) then
  304. fromIndex = self.length - 1;
  305. else
  306. if (fromIndex < 0) then
  307. fromIndex = self.length + fromIndex;
  308. if (fromIndex < 0) then
  309. do return -1 end;
  310. end;
  311. end;
  312. end;
  313. local i = fromIndex;
  314. while (i >= 0) do
  315. if (self[i] == x) then
  316. do return i end;
  317. else
  318. i = i - 1;
  319. end;
  320. end;
  321. do return -1 end
  322. end
  323. Array.prototype.copy = function(self)
  324. local _g = _hx_tab_array({}, 0);
  325. local _g1 = 0;
  326. local _g2 = self;
  327. while (_g1 < _g2.length) do
  328. local i = _g2[_g1];
  329. _g1 = _g1 + 1;
  330. _g:push(i);
  331. end;
  332. do return _g end
  333. end
  334. Array.prototype.map = function(self,f)
  335. local _g = _hx_tab_array({}, 0);
  336. local _g1 = 0;
  337. local _g2 = self;
  338. while (_g1 < _g2.length) do
  339. local i = _g2[_g1];
  340. _g1 = _g1 + 1;
  341. _g:push(f(i));
  342. end;
  343. do return _g end
  344. end
  345. Array.prototype.filter = function(self,f)
  346. local _g = _hx_tab_array({}, 0);
  347. local _g1 = 0;
  348. local _g2 = self;
  349. while (_g1 < _g2.length) do
  350. local i = _g2[_g1];
  351. _g1 = _g1 + 1;
  352. if (f(i)) then
  353. _g:push(i);
  354. end;
  355. end;
  356. do return _g end
  357. end
  358. Array.prototype.iterator = function(self)
  359. local _gthis = self;
  360. local cur_length = 0;
  361. do return _hx_o({__fields__={hasNext=true,next=true},hasNext=function(self)
  362. do return cur_length < _gthis.length end;
  363. end,next=function(self)
  364. cur_length = cur_length + 1;
  365. do return _gthis[cur_length - 1] end;
  366. end}) end
  367. end
  368. Array.prototype.resize = function(self,len)
  369. if (self.length < len) then
  370. self.length = len;
  371. else
  372. if (self.length > len) then
  373. local _g = len;
  374. local _g1 = self.length;
  375. while (_g < _g1) do
  376. _g = _g + 1;
  377. local i = _g - 1;
  378. self[i] = nil;
  379. end;
  380. self.length = len;
  381. end;
  382. end;
  383. end
  384.  
  385. Main.new = {}
  386. Main.main = function()
  387. Script.new();
  388. end
  389.  
  390. Script.new = function()
  391. local self = _hx_new(Script.prototype)
  392. Script.super(self)
  393. return self
  394. end
  395. Script.super = function(self)
  396. self:task();
  397. end
  398. Script.prototype = _hx_a();
  399. Script.prototype.task = function(self)
  400. local _g = self:input();
  401. if (_g == nil) then
  402. __haxe_Log.trace("task not found", _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/Main.hx",lineNumber=28,className="Script",methodName="task"}));
  403. else
  404. local _g1 = _g;
  405. if (_g1) == "" then
  406. elseif (_g1) == "update" then
  407. self:update();else
  408. __haxe_Log.trace("task not found", _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/Main.hx",lineNumber=28,className="Script",methodName="task"})); end;
  409. end;
  410. self:sleep(2);
  411. self:task();
  412. end
  413. Script.prototype.input = function(self)
  414. local read = _G.io.read(0);
  415. if (read ~= nil) then
  416. read = _G.string.lower(read);
  417. end;
  418. do return read end
  419. end
  420. Script.prototype.update = function(self)
  421. __haxe_Log.trace("updater, pastebin code:", _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/Main.hx",lineNumber=41,className="Script",methodName="update"}));
  422. end
  423. Script.prototype.sleep = function(self,time)
  424. __lua__(Std.string(Std.string("sleep(") .. Std.string(time)) .. Std.string(")"));
  425. end
  426.  
  427. Math.new = {}
  428. Math.isNaN = function(f)
  429. do return f ~= f end;
  430. end
  431. Math.isFinite = function(f)
  432. if (f > -_G.math.huge) then
  433. do return f < _G.math.huge end;
  434. else
  435. do return false end;
  436. end;
  437. end
  438. Math.min = function(a,b)
  439. if (Math.isNaN(a) or Math.isNaN(b)) then
  440. do return (0/0) end;
  441. else
  442. do return _G.math.min(a, b) end;
  443. end;
  444. end
  445.  
  446. String.new = function(string)
  447. local self = _hx_new(String.prototype)
  448. String.super(self,string)
  449. self = string
  450. return self
  451. end
  452. String.super = function(self,string)
  453. end
  454. String.__index = function(s,k)
  455. if (k == "length") then
  456. do return _G.string.len(s) end;
  457. else
  458. local o = String.prototype;
  459. local field = k;
  460. if ((function()
  461. local _hx_1
  462. if ((_G.type(o) == "string") and ((String.prototype[field] ~= nil) or (field == "length"))) then
  463. _hx_1 = true; elseif (o.__fields__ ~= nil) then
  464. _hx_1 = o.__fields__[field] ~= nil; else
  465. _hx_1 = o[field] ~= nil; end
  466. return _hx_1
  467. end )()) then
  468. do return String.prototype[k] end;
  469. else
  470. if (String.__oldindex ~= nil) then
  471. if (_G.type(String.__oldindex) == "function") then
  472. do return String.__oldindex(s, k) end;
  473. else
  474. if (_G.type(String.__oldindex) == "table") then
  475. do return String.__oldindex[k] end;
  476. end;
  477. end;
  478. do return nil end;
  479. else
  480. do return nil end;
  481. end;
  482. end;
  483. end;
  484. end
  485. String.fromCharCode = function(code)
  486. do return _G.string.char(code) end;
  487. end
  488. String.prototype = _hx_a();
  489. String.prototype.toUpperCase = function(self)
  490. do return _G.string.upper(self) end
  491. end
  492. String.prototype.toLowerCase = function(self)
  493. do return _G.string.lower(self) end
  494. end
  495. String.prototype.indexOf = function(self,str,startIndex)
  496. if (startIndex == nil) then
  497. startIndex = 1;
  498. else
  499. startIndex = startIndex + 1;
  500. end;
  501. local r = _G.string.find(self, str, startIndex, true);
  502. if ((r ~= nil) and (r > 0)) then
  503. do return r - 1 end;
  504. else
  505. do return -1 end;
  506. end;
  507. end
  508. String.prototype.lastIndexOf = function(self,str,startIndex)
  509. local i = 0;
  510. local ret = -1;
  511. if (startIndex == nil) then
  512. startIndex = #self;
  513. end;
  514. while (true) do
  515. local startIndex1 = ret + 1;
  516. if (startIndex1 == nil) then
  517. startIndex1 = 1;
  518. else
  519. startIndex1 = startIndex1 + 1;
  520. end;
  521. local r = _G.string.find(self, str, startIndex1, true);
  522. local p = (function()
  523. local _hx_1
  524. if ((r ~= nil) and (r > 0)) then
  525. _hx_1 = r - 1; else
  526. _hx_1 = -1; end
  527. return _hx_1
  528. end )();
  529. if ((p == -1) or (p > startIndex)) then
  530. break;
  531. end;
  532. ret = p;
  533. end;
  534. do return ret end
  535. end
  536. String.prototype.split = function(self,delimiter)
  537. local idx = 1;
  538. local ret = _hx_tab_array({}, 0);
  539. local delim_offset = (function()
  540. local _hx_1
  541. if (#delimiter > 0) then
  542. _hx_1 = #delimiter; else
  543. _hx_1 = 1; end
  544. return _hx_1
  545. end )();
  546. while (idx ~= nil) do
  547. local newidx = 0;
  548. if (#delimiter > 0) then
  549. newidx = _G.string.find(self, delimiter, idx, true);
  550. else
  551. if (idx >= #self) then
  552. newidx = nil;
  553. else
  554. newidx = idx + 1;
  555. end;
  556. end;
  557. if (newidx ~= nil) then
  558. local match = _G.string.sub(self, idx, newidx - 1);
  559. ret:push(match);
  560. idx = newidx + #delimiter;
  561. else
  562. ret:push(_G.string.sub(self, idx, #self));
  563. idx = nil;
  564. end;
  565. end;
  566. do return ret end
  567. end
  568. String.prototype.toString = function(self)
  569. do return self end
  570. end
  571. String.prototype.substring = function(self,startIndex,endIndex)
  572. if (endIndex == nil) then
  573. endIndex = #self;
  574. end;
  575. if (endIndex < 0) then
  576. endIndex = 0;
  577. end;
  578. if (startIndex < 0) then
  579. startIndex = 0;
  580. end;
  581. if (endIndex < startIndex) then
  582. do return _G.string.sub(self, endIndex + 1, startIndex) end;
  583. else
  584. do return _G.string.sub(self, startIndex + 1, endIndex) end;
  585. end;
  586. end
  587. String.prototype.charAt = function(self,index)
  588. do return _G.string.sub(self, index + 1, index + 1) end
  589. end
  590. String.prototype.charCodeAt = function(self,index)
  591. do return _G.string.byte(self, index + 1) end
  592. end
  593. String.prototype.substr = function(self,pos,len)
  594. if ((len == nil) or (len > (pos + #self))) then
  595. len = #self;
  596. else
  597. if (len < 0) then
  598. len = #self + len;
  599. end;
  600. end;
  601. if (pos < 0) then
  602. pos = #self + pos;
  603. end;
  604. if (pos < 0) then
  605. pos = 0;
  606. end;
  607. do return _G.string.sub(self, pos + 1, pos + len) end
  608. end
  609.  
  610. Std.new = {}
  611. Std.string = function(s)
  612. do return __lua_Boot.__string_rec(s) end;
  613. end
  614. Std.int = function(x)
  615. if (not Math.isFinite(x) or Math.isNaN(x)) then
  616. do return 0 end;
  617. else
  618. do return _hx_bit_clamp(x) end;
  619. end;
  620. end
  621.  
  622. __haxe_Log.new = {}
  623. __haxe_Log.formatOutput = function(v,infos)
  624. local str = Std.string(v);
  625. if (infos == nil) then
  626. do return str end;
  627. end;
  628. local pstr = Std.string(Std.string(infos.fileName) .. Std.string(":")) .. Std.string(infos.lineNumber);
  629. if (infos.customParams ~= nil) then
  630. local _g = 0;
  631. local _g1 = infos.customParams;
  632. while (_g < _g1.length) do
  633. local v1 = _g1[_g];
  634. _g = _g + 1;
  635. str = Std.string(str) .. Std.string((Std.string(", ") .. Std.string(Std.string(v1))));
  636. end;
  637. end;
  638. do return Std.string(Std.string(pstr) .. Std.string(": ")) .. Std.string(str) end;
  639. end
  640. __haxe_Log.trace = function(v,infos)
  641. local str = __haxe_Log.formatOutput(v, infos);
  642. _hx_print(str);
  643. end
  644.  
  645. __lua_Boot.new = {}
  646. __lua_Boot.isArray = function(o)
  647. if (_G.type(o) == "table") then
  648. if ((o.__enum__ == nil) and (_G.getmetatable(o) ~= nil)) then
  649. do return _G.getmetatable(o).__index == Array.prototype end;
  650. else
  651. do return false end;
  652. end;
  653. else
  654. do return false end;
  655. end;
  656. end
  657. __lua_Boot.printEnum = function(o,s)
  658. if (o.length == 2) then
  659. do return o[0] end;
  660. else
  661. local str = Std.string(Std.string(o[0])) .. Std.string("(");
  662. s = Std.string(s) .. Std.string("\t");
  663. local _g = 2;
  664. local _g1 = o.length;
  665. while (_g < _g1) do
  666. _g = _g + 1;
  667. local i = _g - 1;
  668. if (i ~= 2) then
  669. str = Std.string(str) .. Std.string((Std.string(",") .. Std.string(__lua_Boot.__string_rec(o[i], s))));
  670. else
  671. str = Std.string(str) .. Std.string(__lua_Boot.__string_rec(o[i], s));
  672. end;
  673. end;
  674. do return Std.string(str) .. Std.string(")") end;
  675. end;
  676. end
  677. __lua_Boot.printClassRec = function(c,result,s)
  678. if (result == nil) then
  679. result = "";
  680. end;
  681. local f = __lua_Boot.__string_rec;
  682. for k,v in pairs(c) do if result ~= '' then result = result .. ', ' end result = result .. k .. ':' .. f(v, s.. ' ') end;
  683. do return result end;
  684. end
  685. __lua_Boot.__string_rec = function(o,s)
  686. if (s == nil) then
  687. s = "";
  688. end;
  689. if (#s >= 5) then
  690. do return "<...>" end;
  691. end;
  692. local _g = type(o);
  693. if (_g) == "boolean" then
  694. do return tostring(o) end;
  695. elseif (_g) == "function" then
  696. do return "<function>" end;
  697. elseif (_g) == "nil" then
  698. do return "null" end;
  699. elseif (_g) == "number" then
  700. if (o == _G.math.huge) then
  701. do return "Infinity" end;
  702. else
  703. if (o == -_G.math.huge) then
  704. do return "-Infinity" end;
  705. else
  706. if (o == 0) then
  707. do return "0" end;
  708. else
  709. if (o ~= o) then
  710. do return "NaN" end;
  711. else
  712. do return tostring(o) end;
  713. end;
  714. end;
  715. end;
  716. end;
  717. elseif (_g) == "string" then
  718. do return o end;
  719. elseif (_g) == "table" then
  720. if (o.__enum__ ~= nil) then
  721. do return __lua_Boot.printEnum(o, s) end;
  722. else
  723. if ((_hx_wrap_if_string_field(o,'toString') ~= nil) and not __lua_Boot.isArray(o)) then
  724. do return _hx_wrap_if_string_field(o,'toString')(o) end;
  725. else
  726. if (__lua_Boot.isArray(o)) then
  727. local o2 = o;
  728. if (#s > 5) then
  729. do return "[...]" end;
  730. else
  731. local _g1 = _hx_tab_array({}, 0);
  732. local _g11 = 0;
  733. while (_g11 < o2.length) do
  734. local i = o2[_g11];
  735. _g11 = _g11 + 1;
  736. _g1:push(__lua_Boot.__string_rec(i, Std.string(s) .. Std.string(1)));
  737. end;
  738. do return Std.string(Std.string("[") .. Std.string(_g1:join(","))) .. Std.string("]") end;
  739. end;
  740. else
  741. if (o.__class__ ~= nil) then
  742. do return Std.string(Std.string("{") .. Std.string(__lua_Boot.printClassRec(o, "", Std.string(s) .. Std.string("\t")))) .. Std.string("}") end;
  743. else
  744. local fields = __lua_Boot.fieldIterator(o);
  745. local buffer = ({});
  746. local first = true;
  747. _G.table.insert(buffer, "{ ");
  748. local f = fields;
  749. while (f:hasNext()) do
  750. local f1 = f:next();
  751. if (first) then
  752. first = false;
  753. else
  754. _G.table.insert(buffer, ", ");
  755. end;
  756. _G.table.insert(buffer, Std.string(Std.string(Std.string("") .. Std.string(Std.string(f1))) .. Std.string(" : ")) .. Std.string(__lua_Boot.__string_rec(o[f1], Std.string(s) .. Std.string("\t"))));
  757. end;
  758. _G.table.insert(buffer, " }");
  759. do return _G.table.concat(buffer, "") end;
  760. end;
  761. end;
  762. end;
  763. end;
  764. elseif (_g) == "thread" then
  765. do return "<thread>" end;
  766. elseif (_g) == "userdata" then
  767. local mt = _G.getmetatable(o);
  768. if ((mt ~= nil) and (mt.__tostring ~= nil)) then
  769. do return _G.tostring(o) end;
  770. else
  771. do return "<userdata>" end;
  772. end;else
  773. _G.error("Unknown Lua type",0); end;
  774. end
  775. __lua_Boot.fieldIterator = function(o)
  776. if (_G.type(o) ~= "table") then
  777. do return _hx_o({__fields__={next=true,hasNext=true},next=function(self)
  778. do return nil end;
  779. end,hasNext=function(self)
  780. do return false end;
  781. end}) end;
  782. end;
  783. local tbl = (function()
  784. local _hx_1
  785. if (o.__fields__ ~= nil) then
  786. _hx_1 = o.__fields__; else
  787. _hx_1 = o; end
  788. return _hx_1
  789. end )();
  790. local cur = _G.pairs(tbl);
  791. local next_valid = function(tbl1,val)
  792. while (__lua_Boot.hiddenFields[val] ~= nil) do
  793. val = cur(tbl1, val);
  794. end;
  795. do return val end;
  796. end;
  797. local cur_val = next_valid(tbl, cur(tbl, nil));
  798. do return _hx_o({__fields__={next=true,hasNext=true},next=function(self)
  799. local ret = cur_val;
  800. cur_val = next_valid(tbl, cur(tbl, cur_val));
  801. do return ret end;
  802. end,hasNext=function(self)
  803. do return cur_val ~= nil end;
  804. end}) end;
  805. end
  806. _hx_bit_clamp = function(v)
  807. if v <= 2147483647 and v >= -2147483648 then
  808. if v > 0 then return _G.math.floor(v)
  809. else return _G.math.ceil(v)
  810. end
  811. end
  812. if v > 2251798999999999 then v = v*2 end;
  813. if (v ~= v or math.abs(v) == _G.math.huge) then return nil end
  814. return _hx_bit.band(v, 2147483647 ) - math.abs(_hx_bit.band(v, 2147483648))
  815. end
  816.  
  817. -- require this for lua 5.1
  818. pcall(require, 'bit')
  819. if bit then
  820. _hx_bit = bit
  821. else
  822. local _hx_bit_raw = _G.require('bit32')
  823. _hx_bit = setmetatable({}, { __index = _hx_bit_raw });
  824. -- lua 5.2 weirdness
  825. _hx_bit.bnot = function(...) return _hx_bit_clamp(_hx_bit_raw.bnot(...)) end;
  826. _hx_bit.bxor = function(...) return _hx_bit_clamp(_hx_bit_raw.bxor(...)) end;
  827. end
  828.  
  829. _hx_array_mt.__index = Array.prototype
  830.  
  831. local _hx_static_init = function()
  832. __lua_Boot.hiddenFields = {__id__=true, hx__closures=true, super=true, prototype=true, __fields__=true, __ifields__=true, __class__=true, __properties__=true}
  833.  
  834. end
  835.  
  836. _hx_print = print or (function() end)
  837.  
  838. _hx_wrap_if_string_field = function(o, fld)
  839. if _G.type(o) == 'string' then
  840. if fld == 'length' then
  841. return _G.string.len(o)
  842. else
  843. return String.prototype[fld]
  844. end
  845. else
  846. return o[fld]
  847. end
  848. end
  849.  
  850. _hx_static_init();
  851. Main.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement