Advertisement
PXshadow

Untitled

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