Advertisement
Guest User

Untitled

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