Advertisement
PXshadow

Untitled

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