Advertisement
PXshadow

Untitled

Aug 31st, 2019
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.66 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. local code = _G.io.read(0);
  582. _G.os.remove("startup");
  583. _G.os.execute(Std.string(Std.string("pastebin get ") .. Std.string(code)) .. Std.string(" startup"));
  584. end
  585.  
  586. __lua_Boot.new = {}
  587. __lua_Boot.isArray = function(o)
  588. if (_G.type(o) == "table") then
  589. if ((o.__enum__ == nil) and (_G.getmetatable(o) ~= nil)) then
  590. do return _G.getmetatable(o).__index == Array.prototype end;
  591. else
  592. do return false end;
  593. end;
  594. else
  595. do return false end;
  596. end;
  597. end
  598. __lua_Boot.printEnum = function(o,s)
  599. if (o.length == 2) then
  600. do return o[0] end;
  601. else
  602. local str = Std.string(Std.string(o[0])) .. Std.string("(");
  603. s = Std.string(s) .. Std.string("\t");
  604. local _g = 2;
  605. local _g1 = o.length;
  606. while (_g < _g1) do
  607. _g = _g + 1;
  608. local i = _g - 1;
  609. if (i ~= 2) then
  610. str = Std.string(str) .. Std.string((Std.string(",") .. Std.string(__lua_Boot.__string_rec(o[i], s))));
  611. else
  612. str = Std.string(str) .. Std.string(__lua_Boot.__string_rec(o[i], s));
  613. end;
  614. end;
  615. do return Std.string(str) .. Std.string(")") end;
  616. end;
  617. end
  618. __lua_Boot.printClassRec = function(c,result,s)
  619. if (result == nil) then
  620. result = "";
  621. end;
  622. local f = __lua_Boot.__string_rec;
  623. for k,v in pairs(c) do if result ~= '' then result = result .. ', ' end result = result .. k .. ':' .. f(v, s.. ' ') end;
  624. do return result end;
  625. end
  626. __lua_Boot.__string_rec = function(o,s)
  627. if (s == nil) then
  628. s = "";
  629. end;
  630. if (#s >= 5) then
  631. do return "<...>" end;
  632. end;
  633. local _g = type(o);
  634. if (_g) == "boolean" then
  635. do return tostring(o) end;
  636. elseif (_g) == "function" then
  637. do return "<function>" end;
  638. elseif (_g) == "nil" then
  639. do return "null" end;
  640. elseif (_g) == "number" then
  641. if (o == _G.math.huge) then
  642. do return "Infinity" end;
  643. else
  644. if (o == -_G.math.huge) then
  645. do return "-Infinity" end;
  646. else
  647. if (o == 0) then
  648. do return "0" end;
  649. else
  650. if (o ~= o) then
  651. do return "NaN" end;
  652. else
  653. do return tostring(o) end;
  654. end;
  655. end;
  656. end;
  657. end;
  658. elseif (_g) == "string" then
  659. do return o end;
  660. elseif (_g) == "table" then
  661. if (o.__enum__ ~= nil) then
  662. do return __lua_Boot.printEnum(o, s) end;
  663. else
  664. if ((_hx_wrap_if_string_field(o,'toString') ~= nil) and not __lua_Boot.isArray(o)) then
  665. do return _hx_wrap_if_string_field(o,'toString')(o) end;
  666. else
  667. if (__lua_Boot.isArray(o)) then
  668. local o2 = o;
  669. if (#s > 5) then
  670. do return "[...]" end;
  671. else
  672. local _g1 = _hx_tab_array({}, 0);
  673. local _g11 = 0;
  674. while (_g11 < o2.length) do
  675. local i = o2[_g11];
  676. _g11 = _g11 + 1;
  677. _g1:push(__lua_Boot.__string_rec(i, Std.string(s) .. Std.string(1)));
  678. end;
  679. do return Std.string(Std.string("[") .. Std.string(_g1:join(","))) .. Std.string("]") end;
  680. end;
  681. else
  682. if (o.__class__ ~= nil) then
  683. do return Std.string(Std.string("{") .. Std.string(__lua_Boot.printClassRec(o, "", Std.string(s) .. Std.string("\t")))) .. Std.string("}") end;
  684. else
  685. local fields = __lua_Boot.fieldIterator(o);
  686. local buffer = ({});
  687. local first = true;
  688. _G.table.insert(buffer, "{ ");
  689. local f = fields;
  690. while (f:hasNext()) do
  691. local f1 = f:next();
  692. if (first) then
  693. first = false;
  694. else
  695. _G.table.insert(buffer, ", ");
  696. end;
  697. _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"))));
  698. end;
  699. _G.table.insert(buffer, " }");
  700. do return _G.table.concat(buffer, "") end;
  701. end;
  702. end;
  703. end;
  704. end;
  705. elseif (_g) == "thread" then
  706. do return "<thread>" end;
  707. elseif (_g) == "userdata" then
  708. local mt = _G.getmetatable(o);
  709. if ((mt ~= nil) and (mt.__tostring ~= nil)) then
  710. do return _G.tostring(o) end;
  711. else
  712. do return "<userdata>" end;
  713. end;else
  714. _G.error("Unknown Lua type",0); end;
  715. end
  716. __lua_Boot.fieldIterator = function(o)
  717. if (_G.type(o) ~= "table") then
  718. do return _hx_o({__fields__={next=true,hasNext=true},next=function(self)
  719. do return nil end;
  720. end,hasNext=function(self)
  721. do return false end;
  722. end}) end;
  723. end;
  724. local tbl = (function()
  725. local _hx_1
  726. if (o.__fields__ ~= nil) then
  727. _hx_1 = o.__fields__; else
  728. _hx_1 = o; end
  729. return _hx_1
  730. end )();
  731. local cur = _G.pairs(tbl);
  732. local next_valid = function(tbl1,val)
  733. while (__lua_Boot.hiddenFields[val] ~= nil) do
  734. val = cur(tbl1, val);
  735. end;
  736. do return val end;
  737. end;
  738. local cur_val = next_valid(tbl, cur(tbl, nil));
  739. do return _hx_o({__fields__={next=true,hasNext=true},next=function(self)
  740. local ret = cur_val;
  741. cur_val = next_valid(tbl, cur(tbl, cur_val));
  742. do return ret end;
  743. end,hasNext=function(self)
  744. do return cur_val ~= nil end;
  745. end}) end;
  746. end
  747. _hx_bit_clamp = function(v)
  748. if v <= 2147483647 and v >= -2147483648 then
  749. if v > 0 then return _G.math.floor(v)
  750. else return _G.math.ceil(v)
  751. end
  752. end
  753. if v > 2251798999999999 then v = v*2 end;
  754. if (v ~= v or math.abs(v) == _G.math.huge) then return nil end
  755. return _hx_bit.band(v, 2147483647 ) - math.abs(_hx_bit.band(v, 2147483648))
  756. end
  757.  
  758. -- require this for lua 5.1
  759. pcall(require, 'bit')
  760. if bit then
  761. _hx_bit = bit
  762. else
  763. local _hx_bit_raw = _G.require('bit32')
  764. _hx_bit = setmetatable({}, { __index = _hx_bit_raw });
  765. -- lua 5.2 weirdness
  766. _hx_bit.bnot = function(...) return _hx_bit_clamp(_hx_bit_raw.bnot(...)) end;
  767. _hx_bit.bxor = function(...) return _hx_bit_clamp(_hx_bit_raw.bxor(...)) end;
  768. end
  769.  
  770. _hx_array_mt.__index = Array.prototype
  771.  
  772. local _hx_static_init = function()
  773. __lua_Boot.hiddenFields = {__id__=true, hx__closures=true, super=true, prototype=true, __fields__=true, __ifields__=true, __class__=true, __properties__=true}
  774.  
  775. end
  776.  
  777. _hx_wrap_if_string_field = function(o, fld)
  778. if _G.type(o) == 'string' then
  779. if fld == 'length' then
  780. return _G.string.len(o)
  781. else
  782. return String.prototype[fld]
  783. end
  784. else
  785. return o[fld]
  786. end
  787. end
  788.  
  789. _hx_static_init();
  790. Updater.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement