Advertisement
PXshadow

Untitled

Aug 31st, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.27 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 = _G.string.lower(_G.io.read(0));
  401. if (_g) == "" then
  402. elseif (_g) == "update" then
  403. self:update();else
  404. __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;
  405. self:sleep(2);
  406. self:task();
  407. end
  408. Script.prototype.update = function(self)
  409. __haxe_Log.trace("updater, pastebin code:", _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/Main.hx",lineNumber=35,className="Script",methodName="update"}));
  410. end
  411. Script.prototype.sleep = function(self,time)
  412. __lua__(Std.string(Std.string("sleep(") .. Std.string(time)) .. Std.string(")"));
  413. end
  414.  
  415. Math.new = {}
  416. Math.isNaN = function(f)
  417. do return f ~= f end;
  418. end
  419. Math.isFinite = function(f)
  420. if (f > -_G.math.huge) then
  421. do return f < _G.math.huge end;
  422. else
  423. do return false end;
  424. end;
  425. end
  426. Math.min = function(a,b)
  427. if (Math.isNaN(a) or Math.isNaN(b)) then
  428. do return (0/0) end;
  429. else
  430. do return _G.math.min(a, b) end;
  431. end;
  432. end
  433.  
  434. String.new = function(string)
  435. local self = _hx_new(String.prototype)
  436. String.super(self,string)
  437. self = string
  438. return self
  439. end
  440. String.super = function(self,string)
  441. end
  442. String.__index = function(s,k)
  443. if (k == "length") then
  444. do return _G.string.len(s) end;
  445. else
  446. local o = String.prototype;
  447. local field = k;
  448. if ((function()
  449. local _hx_1
  450. if ((_G.type(o) == "string") and ((String.prototype[field] ~= nil) or (field == "length"))) then
  451. _hx_1 = true; elseif (o.__fields__ ~= nil) then
  452. _hx_1 = o.__fields__[field] ~= nil; else
  453. _hx_1 = o[field] ~= nil; end
  454. return _hx_1
  455. end )()) then
  456. do return String.prototype[k] end;
  457. else
  458. if (String.__oldindex ~= nil) then
  459. if (_G.type(String.__oldindex) == "function") then
  460. do return String.__oldindex(s, k) end;
  461. else
  462. if (_G.type(String.__oldindex) == "table") then
  463. do return String.__oldindex[k] end;
  464. end;
  465. end;
  466. do return nil end;
  467. else
  468. do return nil end;
  469. end;
  470. end;
  471. end;
  472. end
  473. String.fromCharCode = function(code)
  474. do return _G.string.char(code) end;
  475. end
  476. String.prototype = _hx_a();
  477. String.prototype.toUpperCase = function(self)
  478. do return _G.string.upper(self) end
  479. end
  480. String.prototype.toLowerCase = function(self)
  481. do return _G.string.lower(self) end
  482. end
  483. String.prototype.indexOf = function(self,str,startIndex)
  484. if (startIndex == nil) then
  485. startIndex = 1;
  486. else
  487. startIndex = startIndex + 1;
  488. end;
  489. local r = _G.string.find(self, str, startIndex, true);
  490. if ((r ~= nil) and (r > 0)) then
  491. do return r - 1 end;
  492. else
  493. do return -1 end;
  494. end;
  495. end
  496. String.prototype.lastIndexOf = function(self,str,startIndex)
  497. local i = 0;
  498. local ret = -1;
  499. if (startIndex == nil) then
  500. startIndex = #self;
  501. end;
  502. while (true) do
  503. local startIndex1 = ret + 1;
  504. if (startIndex1 == nil) then
  505. startIndex1 = 1;
  506. else
  507. startIndex1 = startIndex1 + 1;
  508. end;
  509. local r = _G.string.find(self, str, startIndex1, true);
  510. local p = (function()
  511. local _hx_1
  512. if ((r ~= nil) and (r > 0)) then
  513. _hx_1 = r - 1; else
  514. _hx_1 = -1; end
  515. return _hx_1
  516. end )();
  517. if ((p == -1) or (p > startIndex)) then
  518. break;
  519. end;
  520. ret = p;
  521. end;
  522. do return ret end
  523. end
  524. String.prototype.split = function(self,delimiter)
  525. local idx = 1;
  526. local ret = _hx_tab_array({}, 0);
  527. local delim_offset = (function()
  528. local _hx_1
  529. if (#delimiter > 0) then
  530. _hx_1 = #delimiter; else
  531. _hx_1 = 1; end
  532. return _hx_1
  533. end )();
  534. while (idx ~= nil) do
  535. local newidx = 0;
  536. if (#delimiter > 0) then
  537. newidx = _G.string.find(self, delimiter, idx, true);
  538. else
  539. if (idx >= #self) then
  540. newidx = nil;
  541. else
  542. newidx = idx + 1;
  543. end;
  544. end;
  545. if (newidx ~= nil) then
  546. local match = _G.string.sub(self, idx, newidx - 1);
  547. ret:push(match);
  548. idx = newidx + #delimiter;
  549. else
  550. ret:push(_G.string.sub(self, idx, #self));
  551. idx = nil;
  552. end;
  553. end;
  554. do return ret end
  555. end
  556. String.prototype.toString = function(self)
  557. do return self end
  558. end
  559. String.prototype.substring = function(self,startIndex,endIndex)
  560. if (endIndex == nil) then
  561. endIndex = #self;
  562. end;
  563. if (endIndex < 0) then
  564. endIndex = 0;
  565. end;
  566. if (startIndex < 0) then
  567. startIndex = 0;
  568. end;
  569. if (endIndex < startIndex) then
  570. do return _G.string.sub(self, endIndex + 1, startIndex) end;
  571. else
  572. do return _G.string.sub(self, startIndex + 1, endIndex) end;
  573. end;
  574. end
  575. String.prototype.charAt = function(self,index)
  576. do return _G.string.sub(self, index + 1, index + 1) end
  577. end
  578. String.prototype.charCodeAt = function(self,index)
  579. do return _G.string.byte(self, index + 1) end
  580. end
  581. String.prototype.substr = function(self,pos,len)
  582. if ((len == nil) or (len > (pos + #self))) then
  583. len = #self;
  584. else
  585. if (len < 0) then
  586. len = #self + len;
  587. end;
  588. end;
  589. if (pos < 0) then
  590. pos = #self + pos;
  591. end;
  592. if (pos < 0) then
  593. pos = 0;
  594. end;
  595. do return _G.string.sub(self, pos + 1, pos + len) end
  596. end
  597.  
  598. Std.new = {}
  599. Std.string = function(s)
  600. do return __lua_Boot.__string_rec(s) end;
  601. end
  602. Std.int = function(x)
  603. if (not Math.isFinite(x) or Math.isNaN(x)) then
  604. do return 0 end;
  605. else
  606. do return _hx_bit_clamp(x) end;
  607. end;
  608. end
  609.  
  610. __haxe_Log.new = {}
  611. __haxe_Log.formatOutput = function(v,infos)
  612. local str = Std.string(v);
  613. if (infos == nil) then
  614. do return str end;
  615. end;
  616. local pstr = Std.string(Std.string(infos.fileName) .. Std.string(":")) .. Std.string(infos.lineNumber);
  617. if (infos.customParams ~= nil) then
  618. local _g = 0;
  619. local _g1 = infos.customParams;
  620. while (_g < _g1.length) do
  621. local v1 = _g1[_g];
  622. _g = _g + 1;
  623. str = Std.string(str) .. Std.string((Std.string(", ") .. Std.string(Std.string(v1))));
  624. end;
  625. end;
  626. do return Std.string(Std.string(pstr) .. Std.string(": ")) .. Std.string(str) end;
  627. end
  628. __haxe_Log.trace = function(v,infos)
  629. local str = __haxe_Log.formatOutput(v, infos);
  630. _hx_print(str);
  631. end
  632.  
  633. __lua_Boot.new = {}
  634. __lua_Boot.isArray = function(o)
  635. if (_G.type(o) == "table") then
  636. if ((o.__enum__ == nil) and (_G.getmetatable(o) ~= nil)) then
  637. do return _G.getmetatable(o).__index == Array.prototype end;
  638. else
  639. do return false end;
  640. end;
  641. else
  642. do return false end;
  643. end;
  644. end
  645. __lua_Boot.printEnum = function(o,s)
  646. if (o.length == 2) then
  647. do return o[0] end;
  648. else
  649. local str = Std.string(Std.string(o[0])) .. Std.string("(");
  650. s = Std.string(s) .. Std.string("\t");
  651. local _g = 2;
  652. local _g1 = o.length;
  653. while (_g < _g1) do
  654. _g = _g + 1;
  655. local i = _g - 1;
  656. if (i ~= 2) then
  657. str = Std.string(str) .. Std.string((Std.string(",") .. Std.string(__lua_Boot.__string_rec(o[i], s))));
  658. else
  659. str = Std.string(str) .. Std.string(__lua_Boot.__string_rec(o[i], s));
  660. end;
  661. end;
  662. do return Std.string(str) .. Std.string(")") end;
  663. end;
  664. end
  665. __lua_Boot.printClassRec = function(c,result,s)
  666. if (result == nil) then
  667. result = "";
  668. end;
  669. local f = __lua_Boot.__string_rec;
  670. for k,v in pairs(c) do if result ~= '' then result = result .. ', ' end result = result .. k .. ':' .. f(v, s.. ' ') end;
  671. do return result end;
  672. end
  673. __lua_Boot.__string_rec = function(o,s)
  674. if (s == nil) then
  675. s = "";
  676. end;
  677. if (#s >= 5) then
  678. do return "<...>" end;
  679. end;
  680. local _g = type(o);
  681. if (_g) == "boolean" then
  682. do return tostring(o) end;
  683. elseif (_g) == "function" then
  684. do return "<function>" end;
  685. elseif (_g) == "nil" then
  686. do return "null" end;
  687. elseif (_g) == "number" then
  688. if (o == _G.math.huge) then
  689. do return "Infinity" end;
  690. else
  691. if (o == -_G.math.huge) then
  692. do return "-Infinity" end;
  693. else
  694. if (o == 0) then
  695. do return "0" end;
  696. else
  697. if (o ~= o) then
  698. do return "NaN" end;
  699. else
  700. do return tostring(o) end;
  701. end;
  702. end;
  703. end;
  704. end;
  705. elseif (_g) == "string" then
  706. do return o end;
  707. elseif (_g) == "table" then
  708. if (o.__enum__ ~= nil) then
  709. do return __lua_Boot.printEnum(o, s) end;
  710. else
  711. if ((_hx_wrap_if_string_field(o,'toString') ~= nil) and not __lua_Boot.isArray(o)) then
  712. do return _hx_wrap_if_string_field(o,'toString')(o) end;
  713. else
  714. if (__lua_Boot.isArray(o)) then
  715. local o2 = o;
  716. if (#s > 5) then
  717. do return "[...]" end;
  718. else
  719. local _g1 = _hx_tab_array({}, 0);
  720. local _g11 = 0;
  721. while (_g11 < o2.length) do
  722. local i = o2[_g11];
  723. _g11 = _g11 + 1;
  724. _g1:push(__lua_Boot.__string_rec(i, Std.string(s) .. Std.string(1)));
  725. end;
  726. do return Std.string(Std.string("[") .. Std.string(_g1:join(","))) .. Std.string("]") end;
  727. end;
  728. else
  729. if (o.__class__ ~= nil) then
  730. do return Std.string(Std.string("{") .. Std.string(__lua_Boot.printClassRec(o, "", Std.string(s) .. Std.string("\t")))) .. Std.string("}") end;
  731. else
  732. local fields = __lua_Boot.fieldIterator(o);
  733. local buffer = ({});
  734. local first = true;
  735. _G.table.insert(buffer, "{ ");
  736. local f = fields;
  737. while (f:hasNext()) do
  738. local f1 = f:next();
  739. if (first) then
  740. first = false;
  741. else
  742. _G.table.insert(buffer, ", ");
  743. end;
  744. _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"))));
  745. end;
  746. _G.table.insert(buffer, " }");
  747. do return _G.table.concat(buffer, "") end;
  748. end;
  749. end;
  750. end;
  751. end;
  752. elseif (_g) == "thread" then
  753. do return "<thread>" end;
  754. elseif (_g) == "userdata" then
  755. local mt = _G.getmetatable(o);
  756. if ((mt ~= nil) and (mt.__tostring ~= nil)) then
  757. do return _G.tostring(o) end;
  758. else
  759. do return "<userdata>" end;
  760. end;else
  761. _G.error("Unknown Lua type",0); end;
  762. end
  763. __lua_Boot.fieldIterator = function(o)
  764. if (_G.type(o) ~= "table") then
  765. do return _hx_o({__fields__={next=true,hasNext=true},next=function(self)
  766. do return nil end;
  767. end,hasNext=function(self)
  768. do return false end;
  769. end}) end;
  770. end;
  771. local tbl = (function()
  772. local _hx_1
  773. if (o.__fields__ ~= nil) then
  774. _hx_1 = o.__fields__; else
  775. _hx_1 = o; end
  776. return _hx_1
  777. end )();
  778. local cur = _G.pairs(tbl);
  779. local next_valid = function(tbl1,val)
  780. while (__lua_Boot.hiddenFields[val] ~= nil) do
  781. val = cur(tbl1, val);
  782. end;
  783. do return val end;
  784. end;
  785. local cur_val = next_valid(tbl, cur(tbl, nil));
  786. do return _hx_o({__fields__={next=true,hasNext=true},next=function(self)
  787. local ret = cur_val;
  788. cur_val = next_valid(tbl, cur(tbl, cur_val));
  789. do return ret end;
  790. end,hasNext=function(self)
  791. do return cur_val ~= nil end;
  792. end}) end;
  793. end
  794. _hx_bit_clamp = function(v)
  795. if v <= 2147483647 and v >= -2147483648 then
  796. if v > 0 then return _G.math.floor(v)
  797. else return _G.math.ceil(v)
  798. end
  799. end
  800. if v > 2251798999999999 then v = v*2 end;
  801. if (v ~= v or math.abs(v) == _G.math.huge) then return nil end
  802. return _hx_bit.band(v, 2147483647 ) - math.abs(_hx_bit.band(v, 2147483648))
  803. end
  804.  
  805. -- require this for lua 5.1
  806. pcall(require, 'bit')
  807. if bit then
  808. _hx_bit = bit
  809. else
  810. local _hx_bit_raw = _G.require('bit32')
  811. _hx_bit = setmetatable({}, { __index = _hx_bit_raw });
  812. -- lua 5.2 weirdness
  813. _hx_bit.bnot = function(...) return _hx_bit_clamp(_hx_bit_raw.bnot(...)) end;
  814. _hx_bit.bxor = function(...) return _hx_bit_clamp(_hx_bit_raw.bxor(...)) end;
  815. end
  816.  
  817. _hx_array_mt.__index = Array.prototype
  818.  
  819. local _hx_static_init = function()
  820. __lua_Boot.hiddenFields = {__id__=true, hx__closures=true, super=true, prototype=true, __fields__=true, __ifields__=true, __class__=true, __properties__=true}
  821.  
  822. end
  823.  
  824. _hx_print = print or (function() end)
  825.  
  826. _hx_wrap_if_string_field = function(o, fld)
  827. if _G.type(o) == 'string' then
  828. if fld == 'length' then
  829. return _G.string.len(o)
  830. else
  831. return String.prototype[fld]
  832. end
  833. else
  834. return o[fld]
  835. end
  836. end
  837.  
  838. _hx_static_init();
  839. Main.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement