Advertisement
PXshadow

Untitled

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