Advertisement
PXshadow

Untitled

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