Repository: fiatjaf/glua Branch: master Commit: 57b64f960779 Files: 7 Total size: 2.7 MB Directory structure: gitextract_kyacih07/ ├── .gitignore ├── Makefile ├── README.md ├── dist/ │ └── glua.js ├── main.go ├── package.json └── try.html ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ node_modules *.swo *.swp ================================================ FILE: Makefile ================================================ all: dist/glua.js dist/glua.min.js dist/glua.js: main.go gopherjs build -o dist/glua.js dist/glua.min.js: main.go gopherjs build -m -o dist/glua.min.js ================================================ FILE: README.md ================================================ ## glua [![npm badge](https://img.shields.io/npm/v/glua.svg)](https://www.npmjs.com/package/glua) `glua` is what happens when you compile https://github.com/J-J-J/goluajit, a Lua VM written in Go (based on https://github.com/yuin/gopher-lua), to Javascript. It works right now and you can use it for most awesomeness. You don't have to know Go or even click on the link above, just use this library in your favorite JS environment. ### example: ```js const glua = require('glua') glua.run(` print(12, 'lala', true) `) // will print these values var result glua.runWithGlobals({ diff: function (a, b) { return Math.abs(Math.abs(b) - Math.abs(a)) }, saveResult: function (value) { result = value } }, ` local a = 23 local b = 74 local difference = diff(a, b) saveResult(difference) `) console.log('the result is: ', result) glua.runWithModules({ fooprinter: ` local fooprinter = {} function fooprinter.print (foo) print('foo value is: ', foo) end return fooprinter ` }, { foo: 264857 }, ` local fooprinter = require('fooprinter') print('printing foo...') fooprinter.print(foo) `) ``` ### try it now Visit https://raw.githack.com/fiatjaf/glua/master/try.html and use your console. ## how do I 1. Return multiple values from a JavaScript function? Return the special object `{_glua_multi: []}` with an array of the multiple values you want your function to return. 2. Get values out from the Lua environment? Call `.runWithGlobals` passing a function that takes the parameters from Lua and saves them to a JavaScript variable. It works. ================================================ FILE: dist/glua.js ================================================ "use strict"; (function() { Error.stackTraceLimit = Infinity; var $global, $module; if (typeof window !== "undefined") { /* web page */ $global = window; } else if (typeof self !== "undefined") { /* web worker */ $global = self; } else if (typeof global !== "undefined") { /* Node.js */ $global = global; $global.require = require; } else { /* others (e.g. Nashorn) */ $global = this; } if ($global === undefined || $global.Array === undefined) { throw new Error("no global object found"); } if (typeof module !== "undefined") { $module = module; } var $packages = {}, $idCounter = 0; var $keys = function(m) { return m ? Object.keys(m) : []; }; var $flushConsole = function() {}; var $throwRuntimeError; /* set by package "runtime" */ var $throwNilPointerError = function() { $throwRuntimeError("invalid memory address or nil pointer dereference"); }; var $call = function(fn, rcvr, args) { return fn.apply(rcvr, args); }; var $makeFunc = function(fn) { return function() { return $externalize(fn(this, new ($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments, []))), $emptyInterface); }; }; var $unused = function(v) {}; var $mapArray = function(array, f) { var newArray = new array.constructor(array.length); for (var i = 0; i < array.length; i++) { newArray[i] = f(array[i]); } return newArray; }; var $methodVal = function(recv, name) { var vals = recv.$methodVals || {}; recv.$methodVals = vals; /* noop for primitives */ var f = vals[name]; if (f !== undefined) { return f; } var method = recv[name]; f = function() { $stackDepthOffset--; try { return method.apply(recv, arguments); } finally { $stackDepthOffset++; } }; vals[name] = f; return f; }; var $methodExpr = function(typ, name) { var method = typ.prototype[name]; if (method.$expr === undefined) { method.$expr = function() { $stackDepthOffset--; try { if (typ.wrapped) { arguments[0] = new typ(arguments[0]); } return Function.call.apply(method, arguments); } finally { $stackDepthOffset++; } }; } return method.$expr; }; var $ifaceMethodExprs = {}; var $ifaceMethodExpr = function(name) { var expr = $ifaceMethodExprs["$" + name]; if (expr === undefined) { expr = $ifaceMethodExprs["$" + name] = function() { $stackDepthOffset--; try { return Function.call.apply(arguments[0][name], arguments); } finally { $stackDepthOffset++; } }; } return expr; }; var $subslice = function(slice, low, high, max) { if (high === undefined) { high = slice.$length; } if (max === undefined) { max = slice.$capacity; } if (low < 0 || high < low || max < high || high > slice.$capacity || max > slice.$capacity) { $throwRuntimeError("slice bounds out of range"); } if (slice === slice.constructor.nil) { return slice; } var s = new slice.constructor(slice.$array); s.$offset = slice.$offset + low; s.$length = high - low; s.$capacity = max - low; return s; }; var $substring = function(str, low, high) { if (low < 0 || high < low || high > str.length) { $throwRuntimeError("slice bounds out of range"); } return str.substring(low, high); }; var $sliceToArray = function(slice) { if (slice.$array.constructor !== Array) { return slice.$array.subarray(slice.$offset, slice.$offset + slice.$length); } return slice.$array.slice(slice.$offset, slice.$offset + slice.$length); }; var $decodeRune = function(str, pos) { var c0 = str.charCodeAt(pos); if (c0 < 0x80) { return [c0, 1]; } if (c0 !== c0 || c0 < 0xC0) { return [0xFFFD, 1]; } var c1 = str.charCodeAt(pos + 1); if (c1 !== c1 || c1 < 0x80 || 0xC0 <= c1) { return [0xFFFD, 1]; } if (c0 < 0xE0) { var r = (c0 & 0x1F) << 6 | (c1 & 0x3F); if (r <= 0x7F) { return [0xFFFD, 1]; } return [r, 2]; } var c2 = str.charCodeAt(pos + 2); if (c2 !== c2 || c2 < 0x80 || 0xC0 <= c2) { return [0xFFFD, 1]; } if (c0 < 0xF0) { var r = (c0 & 0x0F) << 12 | (c1 & 0x3F) << 6 | (c2 & 0x3F); if (r <= 0x7FF) { return [0xFFFD, 1]; } if (0xD800 <= r && r <= 0xDFFF) { return [0xFFFD, 1]; } return [r, 3]; } var c3 = str.charCodeAt(pos + 3); if (c3 !== c3 || c3 < 0x80 || 0xC0 <= c3) { return [0xFFFD, 1]; } if (c0 < 0xF8) { var r = (c0 & 0x07) << 18 | (c1 & 0x3F) << 12 | (c2 & 0x3F) << 6 | (c3 & 0x3F); if (r <= 0xFFFF || 0x10FFFF < r) { return [0xFFFD, 1]; } return [r, 4]; } return [0xFFFD, 1]; }; var $encodeRune = function(r) { if (r < 0 || r > 0x10FFFF || (0xD800 <= r && r <= 0xDFFF)) { r = 0xFFFD; } if (r <= 0x7F) { return String.fromCharCode(r); } if (r <= 0x7FF) { return String.fromCharCode(0xC0 | r >> 6, 0x80 | (r & 0x3F)); } if (r <= 0xFFFF) { return String.fromCharCode(0xE0 | r >> 12, 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); } return String.fromCharCode(0xF0 | r >> 18, 0x80 | (r >> 12 & 0x3F), 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); }; var $stringToBytes = function(str) { var array = new Uint8Array(str.length); for (var i = 0; i < str.length; i++) { array[i] = str.charCodeAt(i); } return array; }; var $bytesToString = function(slice) { if (slice.$length === 0) { return ""; } var str = ""; for (var i = 0; i < slice.$length; i += 10000) { str += String.fromCharCode.apply(undefined, slice.$array.subarray(slice.$offset + i, slice.$offset + Math.min(slice.$length, i + 10000))); } return str; }; var $stringToRunes = function(str) { var array = new Int32Array(str.length); var rune, j = 0; for (var i = 0; i < str.length; i += rune[1], j++) { rune = $decodeRune(str, i); array[j] = rune[0]; } return array.subarray(0, j); }; var $runesToString = function(slice) { if (slice.$length === 0) { return ""; } var str = ""; for (var i = 0; i < slice.$length; i++) { str += $encodeRune(slice.$array[slice.$offset + i]); } return str; }; var $copyString = function(dst, src) { var n = Math.min(src.length, dst.$length); for (var i = 0; i < n; i++) { dst.$array[dst.$offset + i] = src.charCodeAt(i); } return n; }; var $copySlice = function(dst, src) { var n = Math.min(src.$length, dst.$length); $copyArray(dst.$array, src.$array, dst.$offset, src.$offset, n, dst.constructor.elem); return n; }; var $copyArray = function(dst, src, dstOffset, srcOffset, n, elem) { if (n === 0 || (dst === src && dstOffset === srcOffset)) { return; } if (src.subarray) { dst.set(src.subarray(srcOffset, srcOffset + n), dstOffset); return; } switch (elem.kind) { case $kindArray: case $kindStruct: if (dst === src && dstOffset > srcOffset) { for (var i = n - 1; i >= 0; i--) { elem.copy(dst[dstOffset + i], src[srcOffset + i]); } return; } for (var i = 0; i < n; i++) { elem.copy(dst[dstOffset + i], src[srcOffset + i]); } return; } if (dst === src && dstOffset > srcOffset) { for (var i = n - 1; i >= 0; i--) { dst[dstOffset + i] = src[srcOffset + i]; } return; } for (var i = 0; i < n; i++) { dst[dstOffset + i] = src[srcOffset + i]; } }; var $clone = function(src, type) { var clone = type.zero(); type.copy(clone, src); return clone; }; var $pointerOfStructConversion = function(obj, type) { if(obj.$proxies === undefined) { obj.$proxies = {}; obj.$proxies[obj.constructor.string] = obj; } var proxy = obj.$proxies[type.string]; if (proxy === undefined) { var properties = {}; for (var i = 0; i < type.elem.fields.length; i++) { (function(fieldProp) { properties[fieldProp] = { get: function() { return obj[fieldProp]; }, set: function(value) { obj[fieldProp] = value; } }; })(type.elem.fields[i].prop); } proxy = Object.create(type.prototype, properties); proxy.$val = proxy; obj.$proxies[type.string] = proxy; proxy.$proxies = obj.$proxies; } return proxy; }; var $append = function(slice) { return $internalAppend(slice, arguments, 1, arguments.length - 1); }; var $appendSlice = function(slice, toAppend) { if (toAppend.constructor === String) { var bytes = $stringToBytes(toAppend); return $internalAppend(slice, bytes, 0, bytes.length); } return $internalAppend(slice, toAppend.$array, toAppend.$offset, toAppend.$length); }; var $internalAppend = function(slice, array, offset, length) { if (length === 0) { return slice; } var newArray = slice.$array; var newOffset = slice.$offset; var newLength = slice.$length + length; var newCapacity = slice.$capacity; if (newLength > newCapacity) { newOffset = 0; newCapacity = Math.max(newLength, slice.$capacity < 1024 ? slice.$capacity * 2 : Math.floor(slice.$capacity * 5 / 4)); if (slice.$array.constructor === Array) { newArray = slice.$array.slice(slice.$offset, slice.$offset + slice.$length); newArray.length = newCapacity; var zero = slice.constructor.elem.zero; for (var i = slice.$length; i < newCapacity; i++) { newArray[i] = zero(); } } else { newArray = new slice.$array.constructor(newCapacity); newArray.set(slice.$array.subarray(slice.$offset, slice.$offset + slice.$length)); } } $copyArray(newArray, array, newOffset + slice.$length, offset, length, slice.constructor.elem); var newSlice = new slice.constructor(newArray); newSlice.$offset = newOffset; newSlice.$length = newLength; newSlice.$capacity = newCapacity; return newSlice; }; var $equal = function(a, b, type) { if (type === $jsObjectPtr) { return a === b; } switch (type.kind) { case $kindComplex64: case $kindComplex128: return a.$real === b.$real && a.$imag === b.$imag; case $kindInt64: case $kindUint64: return a.$high === b.$high && a.$low === b.$low; case $kindArray: if (a.length !== b.length) { return false; } for (var i = 0; i < a.length; i++) { if (!$equal(a[i], b[i], type.elem)) { return false; } } return true; case $kindStruct: for (var i = 0; i < type.fields.length; i++) { var f = type.fields[i]; if (!$equal(a[f.prop], b[f.prop], f.typ)) { return false; } } return true; case $kindInterface: return $interfaceIsEqual(a, b); default: return a === b; } }; var $interfaceIsEqual = function(a, b) { if (a === $ifaceNil || b === $ifaceNil) { return a === b; } if (a.constructor !== b.constructor) { return false; } if (a.constructor === $jsObjectPtr) { return a.object === b.object; } if (!a.constructor.comparable) { $throwRuntimeError("comparing uncomparable type " + a.constructor.string); } return $equal(a.$val, b.$val, a.constructor); }; var $min = Math.min; var $mod = function(x, y) { return x % y; }; var $parseInt = parseInt; var $parseFloat = function(f) { if (f !== undefined && f !== null && f.constructor === Number) { return f; } return parseFloat(f); }; var $froundBuf = new Float32Array(1); var $fround = Math.fround || function(f) { $froundBuf[0] = f; return $froundBuf[0]; }; var $imul = Math.imul || function(a, b) { var ah = (a >>> 16) & 0xffff; var al = a & 0xffff; var bh = (b >>> 16) & 0xffff; var bl = b & 0xffff; return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) >> 0); }; var $floatKey = function(f) { if (f !== f) { $idCounter++; return "NaN$" + $idCounter; } return String(f); }; var $flatten64 = function(x) { return x.$high * 4294967296 + x.$low; }; var $shiftLeft64 = function(x, y) { if (y === 0) { return x; } if (y < 32) { return new x.constructor(x.$high << y | x.$low >>> (32 - y), (x.$low << y) >>> 0); } if (y < 64) { return new x.constructor(x.$low << (y - 32), 0); } return new x.constructor(0, 0); }; var $shiftRightInt64 = function(x, y) { if (y === 0) { return x; } if (y < 32) { return new x.constructor(x.$high >> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); } if (y < 64) { return new x.constructor(x.$high >> 31, (x.$high >> (y - 32)) >>> 0); } if (x.$high < 0) { return new x.constructor(-1, 4294967295); } return new x.constructor(0, 0); }; var $shiftRightUint64 = function(x, y) { if (y === 0) { return x; } if (y < 32) { return new x.constructor(x.$high >>> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); } if (y < 64) { return new x.constructor(0, x.$high >>> (y - 32)); } return new x.constructor(0, 0); }; var $mul64 = function(x, y) { var high = 0, low = 0; if ((y.$low & 1) !== 0) { high = x.$high; low = x.$low; } for (var i = 1; i < 32; i++) { if ((y.$low & 1<>> (32 - i); low += (x.$low << i) >>> 0; } } for (var i = 0; i < 32; i++) { if ((y.$high & 1< yHigh) || (xHigh === yHigh && xLow > yLow))) { yHigh = (yHigh << 1 | yLow >>> 31) >>> 0; yLow = (yLow << 1) >>> 0; n++; } for (var i = 0; i <= n; i++) { high = high << 1 | low >>> 31; low = (low << 1) >>> 0; if ((xHigh > yHigh) || (xHigh === yHigh && xLow >= yLow)) { xHigh = xHigh - yHigh; xLow = xLow - yLow; if (xLow < 0) { xHigh--; xLow += 4294967296; } low++; if (low === 4294967296) { high++; low = 0; } } yLow = (yLow >>> 1 | yHigh << (32 - 1)) >>> 0; yHigh = yHigh >>> 1; } if (returnRemainder) { return new x.constructor(xHigh * rs, xLow * rs); } return new x.constructor(high * s, low * s); }; var $divComplex = function(n, d) { var ninf = n.$real === Infinity || n.$real === -Infinity || n.$imag === Infinity || n.$imag === -Infinity; var dinf = d.$real === Infinity || d.$real === -Infinity || d.$imag === Infinity || d.$imag === -Infinity; var nnan = !ninf && (n.$real !== n.$real || n.$imag !== n.$imag); var dnan = !dinf && (d.$real !== d.$real || d.$imag !== d.$imag); if(nnan || dnan) { return new n.constructor(NaN, NaN); } if (ninf && !dinf) { return new n.constructor(Infinity, Infinity); } if (!ninf && dinf) { return new n.constructor(0, 0); } if (d.$real === 0 && d.$imag === 0) { if (n.$real === 0 && n.$imag === 0) { return new n.constructor(NaN, NaN); } return new n.constructor(Infinity, Infinity); } var a = Math.abs(d.$real); var b = Math.abs(d.$imag); if (a <= b) { var ratio = d.$real / d.$imag; var denom = d.$real * ratio + d.$imag; return new n.constructor((n.$real * ratio + n.$imag) / denom, (n.$imag * ratio - n.$real) / denom); } var ratio = d.$imag / d.$real; var denom = d.$imag * ratio + d.$real; return new n.constructor((n.$imag * ratio + n.$real) / denom, (n.$imag - n.$real * ratio) / denom); }; var $kindBool = 1; var $kindInt = 2; var $kindInt8 = 3; var $kindInt16 = 4; var $kindInt32 = 5; var $kindInt64 = 6; var $kindUint = 7; var $kindUint8 = 8; var $kindUint16 = 9; var $kindUint32 = 10; var $kindUint64 = 11; var $kindUintptr = 12; var $kindFloat32 = 13; var $kindFloat64 = 14; var $kindComplex64 = 15; var $kindComplex128 = 16; var $kindArray = 17; var $kindChan = 18; var $kindFunc = 19; var $kindInterface = 20; var $kindMap = 21; var $kindPtr = 22; var $kindSlice = 23; var $kindString = 24; var $kindStruct = 25; var $kindUnsafePointer = 26; var $methodSynthesizers = []; var $addMethodSynthesizer = function(f) { if ($methodSynthesizers === null) { f(); return; } $methodSynthesizers.push(f); }; var $synthesizeMethods = function() { $methodSynthesizers.forEach(function(f) { f(); }); $methodSynthesizers = null; }; var $ifaceKeyFor = function(x) { if (x === $ifaceNil) { return 'nil'; } var c = x.constructor; return c.string + '$' + c.keyFor(x.$val); }; var $identity = function(x) { return x; }; var $typeIDCounter = 0; var $idKey = function(x) { if (x.$id === undefined) { $idCounter++; x.$id = $idCounter; } return String(x.$id); }; var $newType = function(size, kind, string, named, pkg, exported, constructor) { var typ; switch(kind) { case $kindBool: case $kindInt: case $kindInt8: case $kindInt16: case $kindInt32: case $kindUint: case $kindUint8: case $kindUint16: case $kindUint32: case $kindUintptr: case $kindUnsafePointer: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.keyFor = $identity; break; case $kindString: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.keyFor = function(x) { return "$" + x; }; break; case $kindFloat32: case $kindFloat64: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.keyFor = function(x) { return $floatKey(x); }; break; case $kindInt64: typ = function(high, low) { this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >> 0; this.$low = low >>> 0; this.$val = this; }; typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; break; case $kindUint64: typ = function(high, low) { this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >>> 0; this.$low = low >>> 0; this.$val = this; }; typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; break; case $kindComplex64: typ = function(real, imag) { this.$real = $fround(real); this.$imag = $fround(imag); this.$val = this; }; typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; break; case $kindComplex128: typ = function(real, imag) { this.$real = real; this.$imag = imag; this.$val = this; }; typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; break; case $kindArray: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.ptr = $newType(4, $kindPtr, "*" + string, false, "", false, function(array) { this.$get = function() { return array; }; this.$set = function(v) { typ.copy(this, v); }; this.$val = array; }); typ.init = function(elem, len) { typ.elem = elem; typ.len = len; typ.comparable = elem.comparable; typ.keyFor = function(x) { return Array.prototype.join.call($mapArray(x, function(e) { return String(elem.keyFor(e)).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); }), "$"); }; typ.copy = function(dst, src) { $copyArray(dst, src, 0, 0, src.length, elem); }; typ.ptr.init(typ); Object.defineProperty(typ.ptr.nil, "nilCheck", { get: $throwNilPointerError }); }; break; case $kindChan: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.keyFor = $idKey; typ.init = function(elem, sendOnly, recvOnly) { typ.elem = elem; typ.sendOnly = sendOnly; typ.recvOnly = recvOnly; }; break; case $kindFunc: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.init = function(params, results, variadic) { typ.params = params; typ.results = results; typ.variadic = variadic; typ.comparable = false; }; break; case $kindInterface: typ = { implementedBy: {}, missingMethodFor: {} }; typ.keyFor = $ifaceKeyFor; typ.init = function(methods) { typ.methods = methods; methods.forEach(function(m) { $ifaceNil[m.prop] = $throwNilPointerError; }); }; break; case $kindMap: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.init = function(key, elem) { typ.key = key; typ.elem = elem; typ.comparable = false; }; break; case $kindPtr: typ = constructor || function(getter, setter, target) { this.$get = getter; this.$set = setter; this.$target = target; this.$val = this; }; typ.keyFor = $idKey; typ.init = function(elem) { typ.elem = elem; typ.wrapped = (elem.kind === $kindArray); typ.nil = new typ($throwNilPointerError, $throwNilPointerError); }; break; case $kindSlice: typ = function(array) { if (array.constructor !== typ.nativeArray) { array = new typ.nativeArray(array); } this.$array = array; this.$offset = 0; this.$length = array.length; this.$capacity = array.length; this.$val = this; }; typ.init = function(elem) { typ.elem = elem; typ.comparable = false; typ.nativeArray = $nativeArray(elem.kind); typ.nil = new typ([]); }; break; case $kindStruct: typ = function(v) { this.$val = v; }; typ.wrapped = true; typ.ptr = $newType(4, $kindPtr, "*" + string, false, pkg, exported, constructor); typ.ptr.elem = typ; typ.ptr.prototype.$get = function() { return this; }; typ.ptr.prototype.$set = function(v) { typ.copy(this, v); }; typ.init = function(pkgPath, fields) { typ.pkgPath = pkgPath; typ.fields = fields; fields.forEach(function(f) { if (!f.typ.comparable) { typ.comparable = false; } }); typ.keyFor = function(x) { var val = x.$val; return $mapArray(fields, function(f) { return String(f.typ.keyFor(val[f.prop])).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); }).join("$"); }; typ.copy = function(dst, src) { for (var i = 0; i < fields.length; i++) { var f = fields[i]; switch (f.typ.kind) { case $kindArray: case $kindStruct: f.typ.copy(dst[f.prop], src[f.prop]); continue; default: dst[f.prop] = src[f.prop]; continue; } } }; /* nil value */ var properties = {}; fields.forEach(function(f) { properties[f.prop] = { get: $throwNilPointerError, set: $throwNilPointerError }; }); typ.ptr.nil = Object.create(constructor.prototype, properties); typ.ptr.nil.$val = typ.ptr.nil; /* methods for embedded fields */ $addMethodSynthesizer(function() { var synthesizeMethod = function(target, m, f) { if (target.prototype[m.prop] !== undefined) { return; } target.prototype[m.prop] = function() { var v = this.$val[f.prop]; if (f.typ === $jsObjectPtr) { v = new $jsObjectPtr(v); } if (v.$val === undefined) { v = new f.typ(v); } return v[m.prop].apply(v, arguments); }; }; fields.forEach(function(f) { if (f.embedded) { $methodSet(f.typ).forEach(function(m) { synthesizeMethod(typ, m, f); synthesizeMethod(typ.ptr, m, f); }); $methodSet($ptrType(f.typ)).forEach(function(m) { synthesizeMethod(typ.ptr, m, f); }); } }); }); }; break; default: $panic(new $String("invalid kind: " + kind)); } switch (kind) { case $kindBool: case $kindMap: typ.zero = function() { return false; }; break; case $kindInt: case $kindInt8: case $kindInt16: case $kindInt32: case $kindUint: case $kindUint8 : case $kindUint16: case $kindUint32: case $kindUintptr: case $kindUnsafePointer: case $kindFloat32: case $kindFloat64: typ.zero = function() { return 0; }; break; case $kindString: typ.zero = function() { return ""; }; break; case $kindInt64: case $kindUint64: case $kindComplex64: case $kindComplex128: var zero = new typ(0, 0); typ.zero = function() { return zero; }; break; case $kindPtr: case $kindSlice: typ.zero = function() { return typ.nil; }; break; case $kindChan: typ.zero = function() { return $chanNil; }; break; case $kindFunc: typ.zero = function() { return $throwNilPointerError; }; break; case $kindInterface: typ.zero = function() { return $ifaceNil; }; break; case $kindArray: typ.zero = function() { var arrayClass = $nativeArray(typ.elem.kind); if (arrayClass !== Array) { return new arrayClass(typ.len); } var array = new Array(typ.len); for (var i = 0; i < typ.len; i++) { array[i] = typ.elem.zero(); } return array; }; break; case $kindStruct: typ.zero = function() { return new typ.ptr(); }; break; default: $panic(new $String("invalid kind: " + kind)); } typ.id = $typeIDCounter; $typeIDCounter++; typ.size = size; typ.kind = kind; typ.string = string; typ.named = named; typ.pkg = pkg; typ.exported = exported; typ.methods = []; typ.methodSetCache = null; typ.comparable = true; return typ; }; var $methodSet = function(typ) { if (typ.methodSetCache !== null) { return typ.methodSetCache; } var base = {}; var isPtr = (typ.kind === $kindPtr); if (isPtr && typ.elem.kind === $kindInterface) { typ.methodSetCache = []; return []; } var current = [{typ: isPtr ? typ.elem : typ, indirect: isPtr}]; var seen = {}; while (current.length > 0) { var next = []; var mset = []; current.forEach(function(e) { if (seen[e.typ.string]) { return; } seen[e.typ.string] = true; if (e.typ.named) { mset = mset.concat(e.typ.methods); if (e.indirect) { mset = mset.concat($ptrType(e.typ).methods); } } switch (e.typ.kind) { case $kindStruct: e.typ.fields.forEach(function(f) { if (f.embedded) { var fTyp = f.typ; var fIsPtr = (fTyp.kind === $kindPtr); next.push({typ: fIsPtr ? fTyp.elem : fTyp, indirect: e.indirect || fIsPtr}); } }); break; case $kindInterface: mset = mset.concat(e.typ.methods); break; } }); mset.forEach(function(m) { if (base[m.name] === undefined) { base[m.name] = m; } }); current = next; } typ.methodSetCache = []; Object.keys(base).sort().forEach(function(name) { typ.methodSetCache.push(base[name]); }); return typ.methodSetCache; }; var $Bool = $newType( 1, $kindBool, "bool", true, "", false, null); var $Int = $newType( 4, $kindInt, "int", true, "", false, null); var $Int8 = $newType( 1, $kindInt8, "int8", true, "", false, null); var $Int16 = $newType( 2, $kindInt16, "int16", true, "", false, null); var $Int32 = $newType( 4, $kindInt32, "int32", true, "", false, null); var $Int64 = $newType( 8, $kindInt64, "int64", true, "", false, null); var $Uint = $newType( 4, $kindUint, "uint", true, "", false, null); var $Uint8 = $newType( 1, $kindUint8, "uint8", true, "", false, null); var $Uint16 = $newType( 2, $kindUint16, "uint16", true, "", false, null); var $Uint32 = $newType( 4, $kindUint32, "uint32", true, "", false, null); var $Uint64 = $newType( 8, $kindUint64, "uint64", true, "", false, null); var $Uintptr = $newType( 4, $kindUintptr, "uintptr", true, "", false, null); var $Float32 = $newType( 4, $kindFloat32, "float32", true, "", false, null); var $Float64 = $newType( 8, $kindFloat64, "float64", true, "", false, null); var $Complex64 = $newType( 8, $kindComplex64, "complex64", true, "", false, null); var $Complex128 = $newType(16, $kindComplex128, "complex128", true, "", false, null); var $String = $newType( 8, $kindString, "string", true, "", false, null); var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", true, "", false, null); var $nativeArray = function(elemKind) { switch (elemKind) { case $kindInt: return Int32Array; case $kindInt8: return Int8Array; case $kindInt16: return Int16Array; case $kindInt32: return Int32Array; case $kindUint: return Uint32Array; case $kindUint8: return Uint8Array; case $kindUint16: return Uint16Array; case $kindUint32: return Uint32Array; case $kindUintptr: return Uint32Array; case $kindFloat32: return Float32Array; case $kindFloat64: return Float64Array; default: return Array; } }; var $toNativeArray = function(elemKind, array) { var nativeArray = $nativeArray(elemKind); if (nativeArray === Array) { return array; } return new nativeArray(array); }; var $arrayTypes = {}; var $arrayType = function(elem, len) { var typeKey = elem.id + "$" + len; var typ = $arrayTypes[typeKey]; if (typ === undefined) { typ = $newType(12, $kindArray, "[" + len + "]" + elem.string, false, "", false, null); $arrayTypes[typeKey] = typ; typ.init(elem, len); } return typ; }; var $chanType = function(elem, sendOnly, recvOnly) { var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " ") + elem.string; var field = sendOnly ? "SendChan" : (recvOnly ? "RecvChan" : "Chan"); var typ = elem[field]; if (typ === undefined) { typ = $newType(4, $kindChan, string, false, "", false, null); elem[field] = typ; typ.init(elem, sendOnly, recvOnly); } return typ; }; var $Chan = function(elem, capacity) { if (capacity < 0 || capacity > 2147483647) { $throwRuntimeError("makechan: size out of range"); } this.$elem = elem; this.$capacity = capacity; this.$buffer = []; this.$sendQueue = []; this.$recvQueue = []; this.$closed = false; }; var $chanNil = new $Chan(null, 0); $chanNil.$sendQueue = $chanNil.$recvQueue = { length: 0, push: function() {}, shift: function() { return undefined; }, indexOf: function() { return -1; } }; var $funcTypes = {}; var $funcType = function(params, results, variadic) { var typeKey = $mapArray(params, function(p) { return p.id; }).join(",") + "$" + $mapArray(results, function(r) { return r.id; }).join(",") + "$" + variadic; var typ = $funcTypes[typeKey]; if (typ === undefined) { var paramTypes = $mapArray(params, function(p) { return p.string; }); if (variadic) { paramTypes[paramTypes.length - 1] = "..." + paramTypes[paramTypes.length - 1].substr(2); } var string = "func(" + paramTypes.join(", ") + ")"; if (results.length === 1) { string += " " + results[0].string; } else if (results.length > 1) { string += " (" + $mapArray(results, function(r) { return r.string; }).join(", ") + ")"; } typ = $newType(4, $kindFunc, string, false, "", false, null); $funcTypes[typeKey] = typ; typ.init(params, results, variadic); } return typ; }; var $interfaceTypes = {}; var $interfaceType = function(methods) { var typeKey = $mapArray(methods, function(m) { return m.pkg + "," + m.name + "," + m.typ.id; }).join("$"); var typ = $interfaceTypes[typeKey]; if (typ === undefined) { var string = "interface {}"; if (methods.length !== 0) { string = "interface { " + $mapArray(methods, function(m) { return (m.pkg !== "" ? m.pkg + "." : "") + m.name + m.typ.string.substr(4); }).join("; ") + " }"; } typ = $newType(8, $kindInterface, string, false, "", false, null); $interfaceTypes[typeKey] = typ; typ.init(methods); } return typ; }; var $emptyInterface = $interfaceType([]); var $ifaceNil = {}; var $error = $newType(8, $kindInterface, "error", true, "", false, null); $error.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]); var $mapTypes = {}; var $mapType = function(key, elem) { var typeKey = key.id + "$" + elem.id; var typ = $mapTypes[typeKey]; if (typ === undefined) { typ = $newType(4, $kindMap, "map[" + key.string + "]" + elem.string, false, "", false, null); $mapTypes[typeKey] = typ; typ.init(key, elem); } return typ; }; var $makeMap = function(keyForFunc, entries) { var m = {}; for (var i = 0; i < entries.length; i++) { var e = entries[i]; m[keyForFunc(e.k)] = e; } return m; }; var $ptrType = function(elem) { var typ = elem.ptr; if (typ === undefined) { typ = $newType(4, $kindPtr, "*" + elem.string, false, "", elem.exported, null); elem.ptr = typ; typ.init(elem); } return typ; }; var $newDataPointer = function(data, constructor) { if (constructor.elem.kind === $kindStruct) { return data; } return new constructor(function() { return data; }, function(v) { data = v; }); }; var $indexPtr = function(array, index, constructor) { array.$ptr = array.$ptr || {}; return array.$ptr[index] || (array.$ptr[index] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); }; var $sliceType = function(elem) { var typ = elem.slice; if (typ === undefined) { typ = $newType(12, $kindSlice, "[]" + elem.string, false, "", false, null); elem.slice = typ; typ.init(elem); } return typ; }; var $makeSlice = function(typ, length, capacity) { capacity = capacity || length; if (length < 0 || length > 2147483647) { $throwRuntimeError("makeslice: len out of range"); } if (capacity < 0 || capacity < length || capacity > 2147483647) { $throwRuntimeError("makeslice: cap out of range"); } var array = new typ.nativeArray(capacity); if (typ.nativeArray === Array) { for (var i = 0; i < capacity; i++) { array[i] = typ.elem.zero(); } } var slice = new typ(array); slice.$length = length; return slice; }; var $structTypes = {}; var $structType = function(pkgPath, fields) { var typeKey = $mapArray(fields, function(f) { return f.name + "," + f.typ.id + "," + f.tag; }).join("$"); var typ = $structTypes[typeKey]; if (typ === undefined) { var string = "struct { " + $mapArray(fields, function(f) { return f.name + " " + f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); }).join("; ") + " }"; if (fields.length === 0) { string = "struct {}"; } typ = $newType(0, $kindStruct, string, false, "", false, function() { this.$val = this; for (var i = 0; i < fields.length; i++) { var f = fields[i]; var arg = arguments[i]; this[f.prop] = arg !== undefined ? arg : f.typ.zero(); } }); $structTypes[typeKey] = typ; typ.init(pkgPath, fields); } return typ; }; var $assertType = function(value, type, returnTuple) { var isInterface = (type.kind === $kindInterface), ok, missingMethod = ""; if (value === $ifaceNil) { ok = false; } else if (!isInterface) { ok = value.constructor === type; } else { var valueTypeString = value.constructor.string; ok = type.implementedBy[valueTypeString]; if (ok === undefined) { ok = true; var valueMethodSet = $methodSet(value.constructor); var interfaceMethods = type.methods; for (var i = 0; i < interfaceMethods.length; i++) { var tm = interfaceMethods[i]; var found = false; for (var j = 0; j < valueMethodSet.length; j++) { var vm = valueMethodSet[j]; if (vm.name === tm.name && vm.pkg === tm.pkg && vm.typ === tm.typ) { found = true; break; } } if (!found) { ok = false; type.missingMethodFor[valueTypeString] = tm.name; break; } } type.implementedBy[valueTypeString] = ok; } if (!ok) { missingMethod = type.missingMethodFor[valueTypeString]; } } if (!ok) { if (returnTuple) { return [type.zero(), false]; } $panic(new $packages["runtime"].TypeAssertionError.ptr( $packages["runtime"]._type.ptr.nil, (value === $ifaceNil ? $packages["runtime"]._type.ptr.nil : new $packages["runtime"]._type.ptr(value.constructor.string)), new $packages["runtime"]._type.ptr(type.string), missingMethod)); } if (!isInterface) { value = value.$val; } if (type === $jsObjectPtr) { value = value.object; } return returnTuple ? [value, true] : value; }; var $stackDepthOffset = 0; var $getStackDepth = function() { var err = new Error(); if (err.stack === undefined) { return undefined; } return $stackDepthOffset + err.stack.split("\n").length; }; var $panicStackDepth = null, $panicValue; var $callDeferred = function(deferred, jsErr, fromPanic) { if (!fromPanic && deferred !== null && deferred.index >= $curGoroutine.deferStack.length) { throw jsErr; } if (jsErr !== null) { var newErr = null; try { $curGoroutine.deferStack.push(deferred); $panic(new $jsErrorPtr(jsErr)); } catch (err) { newErr = err; } $curGoroutine.deferStack.pop(); $callDeferred(deferred, newErr); return; } if ($curGoroutine.asleep) { return; } $stackDepthOffset--; var outerPanicStackDepth = $panicStackDepth; var outerPanicValue = $panicValue; var localPanicValue = $curGoroutine.panicStack.pop(); if (localPanicValue !== undefined) { $panicStackDepth = $getStackDepth(); $panicValue = localPanicValue; } try { while (true) { if (deferred === null) { deferred = $curGoroutine.deferStack[$curGoroutine.deferStack.length - 1]; if (deferred === undefined) { /* The panic reached the top of the stack. Clear it and throw it as a JavaScript error. */ $panicStackDepth = null; if (localPanicValue.Object instanceof Error) { throw localPanicValue.Object; } var msg; if (localPanicValue.constructor === $String) { msg = localPanicValue.$val; } else if (localPanicValue.Error !== undefined) { msg = localPanicValue.Error(); } else if (localPanicValue.String !== undefined) { msg = localPanicValue.String(); } else { msg = localPanicValue; } throw new Error(msg); } } var call = deferred.pop(); if (call === undefined) { $curGoroutine.deferStack.pop(); if (localPanicValue !== undefined) { deferred = null; continue; } return; } var r = call[0].apply(call[2], call[1]); if (r && r.$blk !== undefined) { deferred.push([r.$blk, [], r]); if (fromPanic) { throw null; } return; } if (localPanicValue !== undefined && $panicStackDepth === null) { throw null; /* error was recovered */ } } } finally { if (localPanicValue !== undefined) { if ($panicStackDepth !== null) { $curGoroutine.panicStack.push(localPanicValue); } $panicStackDepth = outerPanicStackDepth; $panicValue = outerPanicValue; } $stackDepthOffset++; } }; var $panic = function(value) { $curGoroutine.panicStack.push(value); $callDeferred(null, null, true); }; var $recover = function() { if ($panicStackDepth === null || ($panicStackDepth !== undefined && $panicStackDepth !== $getStackDepth() - 2)) { return $ifaceNil; } $panicStackDepth = null; return $panicValue; }; var $throw = function(err) { throw err; }; var $noGoroutine = { asleep: false, exit: false, deferStack: [], panicStack: [] }; var $curGoroutine = $noGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true; var $mainFinished = false; var $go = function(fun, args) { $totalGoroutines++; $awakeGoroutines++; var $goroutine = function() { try { $curGoroutine = $goroutine; var r = fun.apply(undefined, args); if (r && r.$blk !== undefined) { fun = function() { return r.$blk(); }; args = []; return; } $goroutine.exit = true; } catch (err) { if (!$goroutine.exit) { throw err; } } finally { $curGoroutine = $noGoroutine; if ($goroutine.exit) { /* also set by runtime.Goexit() */ $totalGoroutines--; $goroutine.asleep = true; } if ($goroutine.asleep) { $awakeGoroutines--; if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock) { console.error("fatal error: all goroutines are asleep - deadlock!"); if ($global.process !== undefined) { $global.process.exit(2); } } } } }; $goroutine.asleep = false; $goroutine.exit = false; $goroutine.deferStack = []; $goroutine.panicStack = []; $schedule($goroutine); }; var $scheduled = []; var $runScheduled = function() { try { var r; while ((r = $scheduled.shift()) !== undefined) { r(); } } finally { if ($scheduled.length > 0) { setTimeout($runScheduled, 0); } } }; var $schedule = function(goroutine) { if (goroutine.asleep) { goroutine.asleep = false; $awakeGoroutines++; } $scheduled.push(goroutine); if ($curGoroutine === $noGoroutine) { $runScheduled(); } }; var $setTimeout = function(f, t) { $awakeGoroutines++; return setTimeout(function() { $awakeGoroutines--; f(); }, t); }; var $block = function() { if ($curGoroutine === $noGoroutine) { $throwRuntimeError("cannot block in JavaScript callback, fix by wrapping code in goroutine"); } $curGoroutine.asleep = true; }; var $send = function(chan, value) { if (chan.$closed) { $throwRuntimeError("send on closed channel"); } var queuedRecv = chan.$recvQueue.shift(); if (queuedRecv !== undefined) { queuedRecv([value, true]); return; } if (chan.$buffer.length < chan.$capacity) { chan.$buffer.push(value); return; } var thisGoroutine = $curGoroutine; var closedDuringSend; chan.$sendQueue.push(function(closed) { closedDuringSend = closed; $schedule(thisGoroutine); return value; }); $block(); return { $blk: function() { if (closedDuringSend) { $throwRuntimeError("send on closed channel"); } } }; }; var $recv = function(chan) { var queuedSend = chan.$sendQueue.shift(); if (queuedSend !== undefined) { chan.$buffer.push(queuedSend(false)); } var bufferedValue = chan.$buffer.shift(); if (bufferedValue !== undefined) { return [bufferedValue, true]; } if (chan.$closed) { return [chan.$elem.zero(), false]; } var thisGoroutine = $curGoroutine; var f = { $blk: function() { return this.value; } }; var queueEntry = function(v) { f.value = v; $schedule(thisGoroutine); }; chan.$recvQueue.push(queueEntry); $block(); return f; }; var $close = function(chan) { if (chan.$closed) { $throwRuntimeError("close of closed channel"); } chan.$closed = true; while (true) { var queuedSend = chan.$sendQueue.shift(); if (queuedSend === undefined) { break; } queuedSend(true); /* will panic */ } while (true) { var queuedRecv = chan.$recvQueue.shift(); if (queuedRecv === undefined) { break; } queuedRecv([chan.$elem.zero(), false]); } }; var $select = function(comms) { var ready = []; var selection = -1; for (var i = 0; i < comms.length; i++) { var comm = comms[i]; var chan = comm[0]; switch (comm.length) { case 0: /* default */ selection = i; break; case 1: /* recv */ if (chan.$sendQueue.length !== 0 || chan.$buffer.length !== 0 || chan.$closed) { ready.push(i); } break; case 2: /* send */ if (chan.$closed) { $throwRuntimeError("send on closed channel"); } if (chan.$recvQueue.length !== 0 || chan.$buffer.length < chan.$capacity) { ready.push(i); } break; } } if (ready.length !== 0) { selection = ready[Math.floor(Math.random() * ready.length)]; } if (selection !== -1) { var comm = comms[selection]; switch (comm.length) { case 0: /* default */ return [selection]; case 1: /* recv */ return [selection, $recv(comm[0])]; case 2: /* send */ $send(comm[0], comm[1]); return [selection]; } } var entries = []; var thisGoroutine = $curGoroutine; var f = { $blk: function() { return this.selection; } }; var removeFromQueues = function() { for (var i = 0; i < entries.length; i++) { var entry = entries[i]; var queue = entry[0]; var index = queue.indexOf(entry[1]); if (index !== -1) { queue.splice(index, 1); } } }; for (var i = 0; i < comms.length; i++) { (function(i) { var comm = comms[i]; switch (comm.length) { case 1: /* recv */ var queueEntry = function(value) { f.selection = [i, value]; removeFromQueues(); $schedule(thisGoroutine); }; entries.push([comm[0].$recvQueue, queueEntry]); comm[0].$recvQueue.push(queueEntry); break; case 2: /* send */ var queueEntry = function() { if (comm[0].$closed) { $throwRuntimeError("send on closed channel"); } f.selection = [i]; removeFromQueues(); $schedule(thisGoroutine); return comm[1]; }; entries.push([comm[0].$sendQueue, queueEntry]); comm[0].$sendQueue.push(queueEntry); break; } })(i); } $block(); return f; }; var $jsObjectPtr, $jsErrorPtr; var $needsExternalization = function(t) { switch (t.kind) { case $kindBool: case $kindInt: case $kindInt8: case $kindInt16: case $kindInt32: case $kindUint: case $kindUint8: case $kindUint16: case $kindUint32: case $kindUintptr: case $kindFloat32: case $kindFloat64: return false; default: return t !== $jsObjectPtr; } }; var $externalize = function(v, t) { if (t === $jsObjectPtr) { return v; } switch (t.kind) { case $kindBool: case $kindInt: case $kindInt8: case $kindInt16: case $kindInt32: case $kindUint: case $kindUint8: case $kindUint16: case $kindUint32: case $kindUintptr: case $kindFloat32: case $kindFloat64: return v; case $kindInt64: case $kindUint64: return $flatten64(v); case $kindArray: if ($needsExternalization(t.elem)) { return $mapArray(v, function(e) { return $externalize(e, t.elem); }); } return v; case $kindFunc: return $externalizeFunction(v, t, false); case $kindInterface: if (v === $ifaceNil) { return null; } if (v.constructor === $jsObjectPtr) { return v.$val.object; } return $externalize(v.$val, v.constructor); case $kindMap: var m = {}; var keys = $keys(v); for (var i = 0; i < keys.length; i++) { var entry = v[keys[i]]; m[$externalize(entry.k, t.key)] = $externalize(entry.v, t.elem); } return m; case $kindPtr: if (v === t.nil) { return null; } return $externalize(v.$get(), t.elem); case $kindSlice: if ($needsExternalization(t.elem)) { return $mapArray($sliceToArray(v), function(e) { return $externalize(e, t.elem); }); } return $sliceToArray(v); case $kindString: if ($isASCII(v)) { return v; } var s = "", r; for (var i = 0; i < v.length; i += r[1]) { r = $decodeRune(v, i); var c = r[0]; if (c > 0xFFFF) { var h = Math.floor((c - 0x10000) / 0x400) + 0xD800; var l = (c - 0x10000) % 0x400 + 0xDC00; s += String.fromCharCode(h, l); continue; } s += String.fromCharCode(c); } return s; case $kindStruct: var timePkg = $packages["time"]; if (timePkg !== undefined && v.constructor === timePkg.Time.ptr) { var milli = $div64(v.UnixNano(), new $Int64(0, 1000000)); return new Date($flatten64(milli)); } var noJsObject = {}; var searchJsObject = function(v, t) { if (t === $jsObjectPtr) { return v; } switch (t.kind) { case $kindPtr: if (v === t.nil) { return noJsObject; } return searchJsObject(v.$get(), t.elem); case $kindStruct: var f = t.fields[0]; return searchJsObject(v[f.prop], f.typ); case $kindInterface: return searchJsObject(v.$val, v.constructor); default: return noJsObject; } }; var o = searchJsObject(v, t); if (o !== noJsObject) { return o; } o = {}; for (var i = 0; i < t.fields.length; i++) { var f = t.fields[i]; if (!f.exported) { continue; } o[f.name] = $externalize(v[f.prop], f.typ); } return o; } $throwRuntimeError("cannot externalize " + t.string); }; var $externalizeFunction = function(v, t, passThis) { if (v === $throwNilPointerError) { return null; } if (v.$externalizeWrapper === undefined) { $checkForDeadlock = false; v.$externalizeWrapper = function() { var args = []; for (var i = 0; i < t.params.length; i++) { if (t.variadic && i === t.params.length - 1) { var vt = t.params[i].elem, varargs = []; for (var j = i; j < arguments.length; j++) { varargs.push($internalize(arguments[j], vt)); } args.push(new (t.params[i])(varargs)); break; } args.push($internalize(arguments[i], t.params[i])); } var result = v.apply(passThis ? this : undefined, args); switch (t.results.length) { case 0: return; case 1: return $externalize(result, t.results[0]); default: for (var i = 0; i < t.results.length; i++) { result[i] = $externalize(result[i], t.results[i]); } return result; } }; } return v.$externalizeWrapper; }; var $internalize = function(v, t, recv) { if (t === $jsObjectPtr) { return v; } if (t === $jsObjectPtr.elem) { $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); } if (v && v.__internal_object__ !== undefined) { return $assertType(v.__internal_object__, t, false); } var timePkg = $packages["time"]; if (timePkg !== undefined && t === timePkg.Time) { if (!(v !== null && v !== undefined && v.constructor === Date)) { $throwRuntimeError("cannot internalize time.Time from " + typeof v + ", must be Date"); } return timePkg.Unix(new $Int64(0, 0), new $Int64(0, v.getTime() * 1000000)); } switch (t.kind) { case $kindBool: return !!v; case $kindInt: return parseInt(v); case $kindInt8: return parseInt(v) << 24 >> 24; case $kindInt16: return parseInt(v) << 16 >> 16; case $kindInt32: return parseInt(v) >> 0; case $kindUint: return parseInt(v); case $kindUint8: return parseInt(v) << 24 >>> 24; case $kindUint16: return parseInt(v) << 16 >>> 16; case $kindUint32: case $kindUintptr: return parseInt(v) >>> 0; case $kindInt64: case $kindUint64: return new t(0, v); case $kindFloat32: case $kindFloat64: return parseFloat(v); case $kindArray: if (v.length !== t.len) { $throwRuntimeError("got array with wrong size from JavaScript native"); } return $mapArray(v, function(e) { return $internalize(e, t.elem); }); case $kindFunc: return function() { var args = []; for (var i = 0; i < t.params.length; i++) { if (t.variadic && i === t.params.length - 1) { var vt = t.params[i].elem, varargs = arguments[i]; for (var j = 0; j < varargs.$length; j++) { args.push($externalize(varargs.$array[varargs.$offset + j], vt)); } break; } args.push($externalize(arguments[i], t.params[i])); } var result = v.apply(recv, args); switch (t.results.length) { case 0: return; case 1: return $internalize(result, t.results[0]); default: for (var i = 0; i < t.results.length; i++) { result[i] = $internalize(result[i], t.results[i]); } return result; } }; case $kindInterface: if (t.methods.length !== 0) { $throwRuntimeError("cannot internalize " + t.string); } if (v === null) { return $ifaceNil; } if (v === undefined) { return new $jsObjectPtr(undefined); } switch (v.constructor) { case Int8Array: return new ($sliceType($Int8))(v); case Int16Array: return new ($sliceType($Int16))(v); case Int32Array: return new ($sliceType($Int))(v); case Uint8Array: return new ($sliceType($Uint8))(v); case Uint16Array: return new ($sliceType($Uint16))(v); case Uint32Array: return new ($sliceType($Uint))(v); case Float32Array: return new ($sliceType($Float32))(v); case Float64Array: return new ($sliceType($Float64))(v); case Array: return $internalize(v, $sliceType($emptyInterface)); case Boolean: return new $Bool(!!v); case Date: if (timePkg === undefined) { /* time package is not present, internalize as &js.Object{Date} so it can be externalized into original Date. */ return new $jsObjectPtr(v); } return new timePkg.Time($internalize(v, timePkg.Time)); case Function: var funcType = $funcType([$sliceType($emptyInterface)], [$jsObjectPtr], true); return new funcType($internalize(v, funcType)); case Number: return new $Float64(parseFloat(v)); case String: return new $String($internalize(v, $String)); default: if ($global.Node && v instanceof $global.Node) { return new $jsObjectPtr(v); } var mapType = $mapType($String, $emptyInterface); return new mapType($internalize(v, mapType)); } case $kindMap: var m = {}; var keys = $keys(v); for (var i = 0; i < keys.length; i++) { var k = $internalize(keys[i], t.key); m[t.key.keyFor(k)] = { k: k, v: $internalize(v[keys[i]], t.elem) }; } return m; case $kindPtr: if (t.elem.kind === $kindStruct) { return $internalize(v, t.elem); } case $kindSlice: return new t($mapArray(v, function(e) { return $internalize(e, t.elem); })); case $kindString: v = String(v); if ($isASCII(v)) { return v; } var s = ""; var i = 0; while (i < v.length) { var h = v.charCodeAt(i); if (0xD800 <= h && h <= 0xDBFF) { var l = v.charCodeAt(i + 1); var c = (h - 0xD800) * 0x400 + l - 0xDC00 + 0x10000; s += $encodeRune(c); i += 2; continue; } s += $encodeRune(h); i++; } return s; case $kindStruct: var noJsObject = {}; var searchJsObject = function(t) { if (t === $jsObjectPtr) { return v; } if (t === $jsObjectPtr.elem) { $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); } switch (t.kind) { case $kindPtr: return searchJsObject(t.elem); case $kindStruct: var f = t.fields[0]; var o = searchJsObject(f.typ); if (o !== noJsObject) { var n = new t.ptr(); n[f.prop] = o; return n; } return noJsObject; default: return noJsObject; } }; var o = searchJsObject(t); if (o !== noJsObject) { return o; } } $throwRuntimeError("cannot internalize " + t.string); }; /* $isASCII reports whether string s contains only ASCII characters. */ var $isASCII = function(s) { for (var i = 0; i < s.length; i++) { if (s.charCodeAt(i) >= 128) { return false; } } return true; }; $packages["github.com/gopherjs/gopherjs/js"] = (function() { var $pkg = {}, $init, Object, Error, sliceType, ptrType, ptrType$1, MakeFunc, init; Object = $pkg.Object = $newType(0, $kindStruct, "js.Object", true, "github.com/gopherjs/gopherjs/js", true, function(object_) { this.$val = this; if (arguments.length === 0) { this.object = null; return; } this.object = object_; }); Error = $pkg.Error = $newType(0, $kindStruct, "js.Error", true, "github.com/gopherjs/gopherjs/js", true, function(Object_) { this.$val = this; if (arguments.length === 0) { this.Object = null; return; } this.Object = Object_; }); sliceType = $sliceType($emptyInterface); ptrType = $ptrType(Object); ptrType$1 = $ptrType(Error); Object.ptr.prototype.Get = function(key) { var key, o; o = this; return o.object[$externalize(key, $String)]; }; Object.prototype.Get = function(key) { return this.$val.Get(key); }; Object.ptr.prototype.Set = function(key, value) { var key, o, value; o = this; o.object[$externalize(key, $String)] = $externalize(value, $emptyInterface); }; Object.prototype.Set = function(key, value) { return this.$val.Set(key, value); }; Object.ptr.prototype.Delete = function(key) { var key, o; o = this; delete o.object[$externalize(key, $String)]; }; Object.prototype.Delete = function(key) { return this.$val.Delete(key); }; Object.ptr.prototype.Length = function() { var o; o = this; return $parseInt(o.object.length); }; Object.prototype.Length = function() { return this.$val.Length(); }; Object.ptr.prototype.Index = function(i) { var i, o; o = this; return o.object[i]; }; Object.prototype.Index = function(i) { return this.$val.Index(i); }; Object.ptr.prototype.SetIndex = function(i, value) { var i, o, value; o = this; o.object[i] = $externalize(value, $emptyInterface); }; Object.prototype.SetIndex = function(i, value) { return this.$val.SetIndex(i, value); }; Object.ptr.prototype.Call = function(name, args) { var args, name, o, obj; o = this; return (obj = o.object, obj[$externalize(name, $String)].apply(obj, $externalize(args, sliceType))); }; Object.prototype.Call = function(name, args) { return this.$val.Call(name, args); }; Object.ptr.prototype.Invoke = function(args) { var args, o; o = this; return o.object.apply(undefined, $externalize(args, sliceType)); }; Object.prototype.Invoke = function(args) { return this.$val.Invoke(args); }; Object.ptr.prototype.New = function(args) { var args, o; o = this; return new ($global.Function.prototype.bind.apply(o.object, [undefined].concat($externalize(args, sliceType)))); }; Object.prototype.New = function(args) { return this.$val.New(args); }; Object.ptr.prototype.Bool = function() { var o; o = this; return !!(o.object); }; Object.prototype.Bool = function() { return this.$val.Bool(); }; Object.ptr.prototype.String = function() { var o; o = this; return $internalize(o.object, $String); }; Object.prototype.String = function() { return this.$val.String(); }; Object.ptr.prototype.Int = function() { var o; o = this; return $parseInt(o.object) >> 0; }; Object.prototype.Int = function() { return this.$val.Int(); }; Object.ptr.prototype.Int64 = function() { var o; o = this; return $internalize(o.object, $Int64); }; Object.prototype.Int64 = function() { return this.$val.Int64(); }; Object.ptr.prototype.Uint64 = function() { var o; o = this; return $internalize(o.object, $Uint64); }; Object.prototype.Uint64 = function() { return this.$val.Uint64(); }; Object.ptr.prototype.Float = function() { var o; o = this; return $parseFloat(o.object); }; Object.prototype.Float = function() { return this.$val.Float(); }; Object.ptr.prototype.Interface = function() { var o; o = this; return $internalize(o.object, $emptyInterface); }; Object.prototype.Interface = function() { return this.$val.Interface(); }; Object.ptr.prototype.Unsafe = function() { var o; o = this; return o.object; }; Object.prototype.Unsafe = function() { return this.$val.Unsafe(); }; Error.ptr.prototype.Error = function() { var err; err = this; return "JavaScript error: " + $internalize(err.Object.message, $String); }; Error.prototype.Error = function() { return this.$val.Error(); }; Error.ptr.prototype.Stack = function() { var err; err = this; return $internalize(err.Object.stack, $String); }; Error.prototype.Stack = function() { return this.$val.Stack(); }; MakeFunc = function(fn) { var fn; return $makeFunc(fn); }; $pkg.MakeFunc = MakeFunc; init = function() { var e; e = new Error.ptr(null); $unused(e); }; ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [ptrType], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $emptyInterface], [], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Length", name: "Length", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [ptrType], false)}, {prop: "SetIndex", name: "SetIndex", pkg: "", typ: $funcType([$Int, $emptyInterface], [], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([$String, sliceType], [ptrType], true)}, {prop: "Invoke", name: "Invoke", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "New", name: "New", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Unsafe", name: "Unsafe", pkg: "", typ: $funcType([], [$Uintptr], false)}]; ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Stack", name: "Stack", pkg: "", typ: $funcType([], [$String], false)}]; Object.init("github.com/gopherjs/gopherjs/js", [{prop: "object", name: "object", embedded: false, exported: false, typ: ptrType, tag: ""}]); Error.init("", [{prop: "Object", name: "Object", embedded: true, exported: true, typ: ptrType, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/cpu"] = (function() { var $pkg = {}, $init; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/bytealg"] = (function() { var $pkg = {}, $init, cpu; cpu = $packages["internal/cpu"]; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = cpu.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["runtime/internal/sys"] = (function() { var $pkg = {}, $init; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["runtime"] = (function() { var $pkg = {}, $init, js, bytealg, sys, _type, MemStats, TypeAssertionError, errorString, ptrType, arrayType, structType$1, arrayType$1, ptrType$4, init, GOROOT, GC, Goexit, ReadMemStats, SetFinalizer, Stack, KeepAlive, throw$1; js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; sys = $packages["runtime/internal/sys"]; _type = $pkg._type = $newType(0, $kindStruct, "runtime._type", true, "runtime", false, function(str_) { this.$val = this; if (arguments.length === 0) { this.str = ""; return; } this.str = str_; }); MemStats = $pkg.MemStats = $newType(0, $kindStruct, "runtime.MemStats", true, "runtime", true, function(Alloc_, TotalAlloc_, Sys_, Lookups_, Mallocs_, Frees_, HeapAlloc_, HeapSys_, HeapIdle_, HeapInuse_, HeapReleased_, HeapObjects_, StackInuse_, StackSys_, MSpanInuse_, MSpanSys_, MCacheInuse_, MCacheSys_, BuckHashSys_, GCSys_, OtherSys_, NextGC_, LastGC_, PauseTotalNs_, PauseNs_, PauseEnd_, NumGC_, GCCPUFraction_, EnableGC_, DebugGC_, BySize_) { this.$val = this; if (arguments.length === 0) { this.Alloc = new $Uint64(0, 0); this.TotalAlloc = new $Uint64(0, 0); this.Sys = new $Uint64(0, 0); this.Lookups = new $Uint64(0, 0); this.Mallocs = new $Uint64(0, 0); this.Frees = new $Uint64(0, 0); this.HeapAlloc = new $Uint64(0, 0); this.HeapSys = new $Uint64(0, 0); this.HeapIdle = new $Uint64(0, 0); this.HeapInuse = new $Uint64(0, 0); this.HeapReleased = new $Uint64(0, 0); this.HeapObjects = new $Uint64(0, 0); this.StackInuse = new $Uint64(0, 0); this.StackSys = new $Uint64(0, 0); this.MSpanInuse = new $Uint64(0, 0); this.MSpanSys = new $Uint64(0, 0); this.MCacheInuse = new $Uint64(0, 0); this.MCacheSys = new $Uint64(0, 0); this.BuckHashSys = new $Uint64(0, 0); this.GCSys = new $Uint64(0, 0); this.OtherSys = new $Uint64(0, 0); this.NextGC = new $Uint64(0, 0); this.LastGC = new $Uint64(0, 0); this.PauseTotalNs = new $Uint64(0, 0); this.PauseNs = arrayType.zero(); this.PauseEnd = arrayType.zero(); this.NumGC = 0; this.GCCPUFraction = 0; this.EnableGC = false; this.DebugGC = false; this.BySize = arrayType$1.zero(); return; } this.Alloc = Alloc_; this.TotalAlloc = TotalAlloc_; this.Sys = Sys_; this.Lookups = Lookups_; this.Mallocs = Mallocs_; this.Frees = Frees_; this.HeapAlloc = HeapAlloc_; this.HeapSys = HeapSys_; this.HeapIdle = HeapIdle_; this.HeapInuse = HeapInuse_; this.HeapReleased = HeapReleased_; this.HeapObjects = HeapObjects_; this.StackInuse = StackInuse_; this.StackSys = StackSys_; this.MSpanInuse = MSpanInuse_; this.MSpanSys = MSpanSys_; this.MCacheInuse = MCacheInuse_; this.MCacheSys = MCacheSys_; this.BuckHashSys = BuckHashSys_; this.GCSys = GCSys_; this.OtherSys = OtherSys_; this.NextGC = NextGC_; this.LastGC = LastGC_; this.PauseTotalNs = PauseTotalNs_; this.PauseNs = PauseNs_; this.PauseEnd = PauseEnd_; this.NumGC = NumGC_; this.GCCPUFraction = GCCPUFraction_; this.EnableGC = EnableGC_; this.DebugGC = DebugGC_; this.BySize = BySize_; }); TypeAssertionError = $pkg.TypeAssertionError = $newType(0, $kindStruct, "runtime.TypeAssertionError", true, "runtime", true, function(_interface_, concrete_, asserted_, missingMethod_) { this.$val = this; if (arguments.length === 0) { this._interface = ptrType.nil; this.concrete = ptrType.nil; this.asserted = ptrType.nil; this.missingMethod = ""; return; } this._interface = _interface_; this.concrete = concrete_; this.asserted = asserted_; this.missingMethod = missingMethod_; }); errorString = $pkg.errorString = $newType(8, $kindString, "runtime.errorString", true, "runtime", false, null); ptrType = $ptrType(_type); arrayType = $arrayType($Uint64, 256); structType$1 = $structType("", [{prop: "Size", name: "Size", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Mallocs", name: "Mallocs", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Frees", name: "Frees", embedded: false, exported: true, typ: $Uint64, tag: ""}]); arrayType$1 = $arrayType(structType$1, 61); ptrType$4 = $ptrType(TypeAssertionError); _type.ptr.prototype.string = function() { var t; t = this; return t.str; }; _type.prototype.string = function() { return this.$val.string(); }; _type.ptr.prototype.pkgpath = function() { var t; t = this; return ""; }; _type.prototype.pkgpath = function() { return this.$val.pkgpath(); }; init = function() { var e, jsPkg; jsPkg = $packages[$externalize("github.com/gopherjs/gopherjs/js", $String)]; $jsObjectPtr = jsPkg.Object.ptr; $jsErrorPtr = jsPkg.Error.ptr; $throwRuntimeError = throw$1; e = $ifaceNil; e = new TypeAssertionError.ptr(ptrType.nil, ptrType.nil, ptrType.nil, ""); $unused(e); }; GOROOT = function() { var goroot, process; process = $global.process; if (process === undefined) { return "/"; } goroot = process.env.GOROOT; if (!(goroot === undefined)) { return $internalize(goroot, $String); } return "/usr/local/go"; }; $pkg.GOROOT = GOROOT; GC = function() { }; $pkg.GC = GC; Goexit = function() { $curGoroutine.exit = $externalize(true, $Bool); $throw(null); }; $pkg.Goexit = Goexit; ReadMemStats = function(m) { var m; }; $pkg.ReadMemStats = ReadMemStats; SetFinalizer = function(x, f) { var f, x; }; $pkg.SetFinalizer = SetFinalizer; Stack = function(buf, all) { var all, buf, s; s = new ($global.Error)().stack; if (s === undefined) { return 0; } return $copyString(buf, $internalize(s.substr(($parseInt(s.indexOf($externalize("\n", $String))) >> 0) + 1 >> 0), $String)); }; $pkg.Stack = Stack; KeepAlive = function(param) { var param; }; $pkg.KeepAlive = KeepAlive; throw$1 = function(s) { var s; $panic(new errorString((s))); }; TypeAssertionError.ptr.prototype.RuntimeError = function() { }; TypeAssertionError.prototype.RuntimeError = function() { return this.$val.RuntimeError(); }; TypeAssertionError.ptr.prototype.Error = function() { var as, cs, e, inter, msg; e = this; inter = "interface"; if (!(e._interface === ptrType.nil)) { inter = e._interface.string(); } as = e.asserted.string(); if (e.concrete === ptrType.nil) { return "interface conversion: " + inter + " is nil, not " + as; } cs = e.concrete.string(); if (e.missingMethod === "") { msg = "interface conversion: " + inter + " is " + cs + ", not " + as; if (cs === as) { if (!(e.concrete.pkgpath() === e.asserted.pkgpath())) { msg = msg + (" (types from different packages)"); } else { msg = msg + (" (types from different scopes)"); } } return msg; } return "interface conversion: " + cs + " is not " + as + ": missing method " + e.missingMethod; }; TypeAssertionError.prototype.Error = function() { return this.$val.Error(); }; errorString.prototype.RuntimeError = function() { var e; e = this.$val; }; $ptrType(errorString).prototype.RuntimeError = function() { return new errorString(this.$get()).RuntimeError(); }; errorString.prototype.Error = function() { var e; e = this.$val; return "runtime error: " + (e); }; $ptrType(errorString).prototype.Error = function() { return new errorString(this.$get()).Error(); }; ptrType.methods = [{prop: "string", name: "string", pkg: "runtime", typ: $funcType([], [$String], false)}, {prop: "pkgpath", name: "pkgpath", pkg: "runtime", typ: $funcType([], [$String], false)}]; ptrType$4.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; errorString.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; _type.init("runtime", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); MemStats.init("", [{prop: "Alloc", name: "Alloc", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "TotalAlloc", name: "TotalAlloc", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Sys", name: "Sys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Lookups", name: "Lookups", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Mallocs", name: "Mallocs", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Frees", name: "Frees", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "HeapAlloc", name: "HeapAlloc", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "HeapSys", name: "HeapSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "HeapIdle", name: "HeapIdle", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "HeapInuse", name: "HeapInuse", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "HeapReleased", name: "HeapReleased", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "HeapObjects", name: "HeapObjects", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "StackInuse", name: "StackInuse", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "StackSys", name: "StackSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "MSpanInuse", name: "MSpanInuse", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "MSpanSys", name: "MSpanSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "MCacheInuse", name: "MCacheInuse", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "MCacheSys", name: "MCacheSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "BuckHashSys", name: "BuckHashSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "GCSys", name: "GCSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "OtherSys", name: "OtherSys", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "NextGC", name: "NextGC", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "LastGC", name: "LastGC", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "PauseTotalNs", name: "PauseTotalNs", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "PauseNs", name: "PauseNs", embedded: false, exported: true, typ: arrayType, tag: ""}, {prop: "PauseEnd", name: "PauseEnd", embedded: false, exported: true, typ: arrayType, tag: ""}, {prop: "NumGC", name: "NumGC", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "GCCPUFraction", name: "GCCPUFraction", embedded: false, exported: true, typ: $Float64, tag: ""}, {prop: "EnableGC", name: "EnableGC", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "DebugGC", name: "DebugGC", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "BySize", name: "BySize", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); TypeAssertionError.init("runtime", [{prop: "_interface", name: "_interface", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "concrete", name: "concrete", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "asserted", name: "asserted", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "missingMethod", name: "missingMethod", embedded: false, exported: false, typ: $String, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytealg.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sys.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["errors"] = (function() { var $pkg = {}, $init, errorString, ptrType, New; errorString = $pkg.errorString = $newType(0, $kindStruct, "errors.errorString", true, "errors", false, function(s_) { this.$val = this; if (arguments.length === 0) { this.s = ""; return; } this.s = s_; }); ptrType = $ptrType(errorString); New = function(text) { var text; return new errorString.ptr(text); }; $pkg.New = New; errorString.ptr.prototype.Error = function() { var e; e = this; return e.s; }; errorString.prototype.Error = function() { return this.$val.Error(); }; ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; errorString.init("errors", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/race"] = (function() { var $pkg = {}, $init, Acquire, Release, ReleaseMerge, Disable, Enable, ReadRange, WriteRange; Acquire = function(addr) { var addr; }; $pkg.Acquire = Acquire; Release = function(addr) { var addr; }; $pkg.Release = Release; ReleaseMerge = function(addr) { var addr; }; $pkg.ReleaseMerge = ReleaseMerge; Disable = function() { }; $pkg.Disable = Disable; Enable = function() { }; $pkg.Enable = Enable; ReadRange = function(addr, len) { var addr, len; }; $pkg.ReadRange = ReadRange; WriteRange = function(addr, len) { var addr, len; }; $pkg.WriteRange = WriteRange; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["sync/atomic"] = (function() { var $pkg = {}, $init, js, Value, ptrType, CompareAndSwapInt32, CompareAndSwapUint64, AddInt32, LoadInt32, LoadUint32, LoadUint64, StoreInt32, StoreUint32; js = $packages["github.com/gopherjs/gopherjs/js"]; Value = $pkg.Value = $newType(0, $kindStruct, "atomic.Value", true, "sync/atomic", true, function(v_) { this.$val = this; if (arguments.length === 0) { this.v = $ifaceNil; return; } this.v = v_; }); ptrType = $ptrType(Value); CompareAndSwapInt32 = function(addr, old, new$1) { var addr, new$1, old; if (addr.$get() === old) { addr.$set(new$1); return true; } return false; }; $pkg.CompareAndSwapInt32 = CompareAndSwapInt32; CompareAndSwapUint64 = function(addr, old, new$1) { var addr, new$1, old, x; if ((x = addr.$get(), (x.$high === old.$high && x.$low === old.$low))) { addr.$set(new$1); return true; } return false; }; $pkg.CompareAndSwapUint64 = CompareAndSwapUint64; AddInt32 = function(addr, delta) { var addr, delta, new$1; new$1 = addr.$get() + delta >> 0; addr.$set(new$1); return new$1; }; $pkg.AddInt32 = AddInt32; LoadInt32 = function(addr) { var addr; return addr.$get(); }; $pkg.LoadInt32 = LoadInt32; LoadUint32 = function(addr) { var addr; return addr.$get(); }; $pkg.LoadUint32 = LoadUint32; LoadUint64 = function(addr) { var addr; return addr.$get(); }; $pkg.LoadUint64 = LoadUint64; StoreInt32 = function(addr, val) { var addr, val; addr.$set(val); }; $pkg.StoreInt32 = StoreInt32; StoreUint32 = function(addr, val) { var addr, val; addr.$set(val); }; $pkg.StoreUint32 = StoreUint32; Value.ptr.prototype.Load = function() { var v, x; x = $ifaceNil; v = this; x = v.v; return x; }; Value.prototype.Load = function() { return this.$val.Load(); }; Value.ptr.prototype.Store = function(x) { var v, x; v = this; if ($interfaceIsEqual(x, $ifaceNil)) { $panic(new $String("sync/atomic: store of nil value into Value")); } if (!($interfaceIsEqual(v.v, $ifaceNil)) && !(x.constructor === v.v.constructor)) { $panic(new $String("sync/atomic: store of inconsistently typed value into Value")); } v.v = x; }; Value.prototype.Store = function(x) { return this.$val.Store(x); }; ptrType.methods = [{prop: "Load", name: "Load", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Store", name: "Store", pkg: "", typ: $funcType([$emptyInterface], [], false)}]; Value.init("sync/atomic", [{prop: "v", name: "v", embedded: false, exported: false, typ: $emptyInterface, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["sync"] = (function() { var $pkg = {}, $init, js, race, runtime, atomic, Pool, Mutex, Locker, Once, poolLocalInternal, poolLocal, notifyList, RWMutex, rlocker, ptrType, sliceType, ptrType$1, chanType, sliceType$1, ptrType$6, ptrType$7, sliceType$4, ptrType$8, ptrType$9, funcType, ptrType$16, funcType$2, ptrType$17, arrayType$2, semWaiters, semAwoken, expunged, allPools, runtime_registerPoolCleanup, runtime_SemacquireMutex, runtime_Semrelease, runtime_notifyListCheck, runtime_canSpin, runtime_nanotime, throw$1, poolCleanup, init, indexLocal, init$1, runtime_doSpin; js = $packages["github.com/gopherjs/gopherjs/js"]; race = $packages["internal/race"]; runtime = $packages["runtime"]; atomic = $packages["sync/atomic"]; Pool = $pkg.Pool = $newType(0, $kindStruct, "sync.Pool", true, "sync", true, function(local_, localSize_, store_, New_) { this.$val = this; if (arguments.length === 0) { this.local = 0; this.localSize = 0; this.store = sliceType$4.nil; this.New = $throwNilPointerError; return; } this.local = local_; this.localSize = localSize_; this.store = store_; this.New = New_; }); Mutex = $pkg.Mutex = $newType(0, $kindStruct, "sync.Mutex", true, "sync", true, function(state_, sema_) { this.$val = this; if (arguments.length === 0) { this.state = 0; this.sema = 0; return; } this.state = state_; this.sema = sema_; }); Locker = $pkg.Locker = $newType(8, $kindInterface, "sync.Locker", true, "sync", true, null); Once = $pkg.Once = $newType(0, $kindStruct, "sync.Once", true, "sync", true, function(m_, done_) { this.$val = this; if (arguments.length === 0) { this.m = new Mutex.ptr(0, 0); this.done = 0; return; } this.m = m_; this.done = done_; }); poolLocalInternal = $pkg.poolLocalInternal = $newType(0, $kindStruct, "sync.poolLocalInternal", true, "sync", false, function(private$0_, shared_, Mutex_) { this.$val = this; if (arguments.length === 0) { this.private$0 = $ifaceNil; this.shared = sliceType$4.nil; this.Mutex = new Mutex.ptr(0, 0); return; } this.private$0 = private$0_; this.shared = shared_; this.Mutex = Mutex_; }); poolLocal = $pkg.poolLocal = $newType(0, $kindStruct, "sync.poolLocal", true, "sync", false, function(poolLocalInternal_, pad_) { this.$val = this; if (arguments.length === 0) { this.poolLocalInternal = new poolLocalInternal.ptr($ifaceNil, sliceType$4.nil, new Mutex.ptr(0, 0)); this.pad = arrayType$2.zero(); return; } this.poolLocalInternal = poolLocalInternal_; this.pad = pad_; }); notifyList = $pkg.notifyList = $newType(0, $kindStruct, "sync.notifyList", true, "sync", false, function(wait_, notify_, lock_, head_, tail_) { this.$val = this; if (arguments.length === 0) { this.wait = 0; this.notify = 0; this.lock = 0; this.head = 0; this.tail = 0; return; } this.wait = wait_; this.notify = notify_; this.lock = lock_; this.head = head_; this.tail = tail_; }); RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "sync.RWMutex", true, "sync", true, function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { this.$val = this; if (arguments.length === 0) { this.w = new Mutex.ptr(0, 0); this.writerSem = 0; this.readerSem = 0; this.readerCount = 0; this.readerWait = 0; return; } this.w = w_; this.writerSem = writerSem_; this.readerSem = readerSem_; this.readerCount = readerCount_; this.readerWait = readerWait_; }); rlocker = $pkg.rlocker = $newType(0, $kindStruct, "sync.rlocker", true, "sync", false, function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { this.$val = this; if (arguments.length === 0) { this.w = new Mutex.ptr(0, 0); this.writerSem = 0; this.readerSem = 0; this.readerCount = 0; this.readerWait = 0; return; } this.w = w_; this.writerSem = writerSem_; this.readerSem = readerSem_; this.readerCount = readerCount_; this.readerWait = readerWait_; }); ptrType = $ptrType(Pool); sliceType = $sliceType(ptrType); ptrType$1 = $ptrType($Uint32); chanType = $chanType($Bool, false, false); sliceType$1 = $sliceType(chanType); ptrType$6 = $ptrType($Int32); ptrType$7 = $ptrType(poolLocal); sliceType$4 = $sliceType($emptyInterface); ptrType$8 = $ptrType(rlocker); ptrType$9 = $ptrType(RWMutex); funcType = $funcType([], [$emptyInterface], false); ptrType$16 = $ptrType(Mutex); funcType$2 = $funcType([], [], false); ptrType$17 = $ptrType(Once); arrayType$2 = $arrayType($Uint8, 100); Pool.ptr.prototype.Get = function() { var _r, p, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; /* */ if (p.store.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (p.store.$length === 0) { */ case 1: /* */ if (!(p.New === $throwNilPointerError)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(p.New === $throwNilPointerError)) { */ case 3: _r = p.New(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 4: $s = -1; return $ifaceNil; /* } */ case 2: x$2 = (x = p.store, x$1 = p.store.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); $s = -1; return x$2; /* */ } return; } if ($f === undefined) { $f = { $blk: Pool.ptr.prototype.Get }; } $f._r = _r; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Pool.prototype.Get = function() { return this.$val.Get(); }; Pool.ptr.prototype.Put = function(x) { var p, x; p = this; if ($interfaceIsEqual(x, $ifaceNil)) { return; } p.store = $append(p.store, x); }; Pool.prototype.Put = function(x) { return this.$val.Put(x); }; runtime_registerPoolCleanup = function(cleanup) { var cleanup; }; runtime_SemacquireMutex = function(s, lifo) { var _entry, _entry$1, _entry$2, _entry$3, _entry$4, _key, _key$1, _key$2, _r, ch, lifo, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _entry$4 = $f._entry$4; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _r = $f._r; ch = $f.ch; lifo = $f.lifo; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (((s.$get() - (_entry = semAwoken[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (((s.$get() - (_entry = semAwoken[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : 0) >>> 0)) === 0) { */ case 1: ch = new $Chan($Bool, 0); if (lifo) { _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: $appendSlice(new sliceType$1([ch]), (_entry$1 = semWaiters[ptrType$1.keyFor(s)], _entry$1 !== undefined ? _entry$1.v : sliceType$1.nil)) }; } else { _key$1 = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$1)] = { k: _key$1, v: $append((_entry$2 = semWaiters[ptrType$1.keyFor(s)], _entry$2 !== undefined ? _entry$2.v : sliceType$1.nil), ch) }; } _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r[0]; _key$2 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$2)] = { k: _key$2, v: (_entry$3 = semAwoken[ptrType$1.keyFor(s)], _entry$3 !== undefined ? _entry$3.v : 0) - (1) >>> 0 }; if ((_entry$4 = semAwoken[ptrType$1.keyFor(s)], _entry$4 !== undefined ? _entry$4.v : 0) === 0) { delete semAwoken[ptrType$1.keyFor(s)]; } /* } */ case 2: s.$set(s.$get() - (1) >>> 0); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_SemacquireMutex }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._entry$4 = _entry$4; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._r = _r; $f.ch = ch; $f.lifo = lifo; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; runtime_Semrelease = function(s, handoff) { var _entry, _entry$1, _key, _key$1, ch, handoff, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _key = $f._key; _key$1 = $f._key$1; ch = $f.ch; handoff = $f.handoff; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s.$set(s.$get() + (1) >>> 0); w = (_entry = semWaiters[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$1.nil); if (w.$length === 0) { $s = -1; return; } ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : w.$array[w.$offset + 0]); w = $subslice(w, 1); _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: w }; if (w.$length === 0) { delete semWaiters[ptrType$1.keyFor(s)]; } _key$1 = s; (semAwoken || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key$1)] = { k: _key$1, v: (_entry$1 = semAwoken[ptrType$1.keyFor(s)], _entry$1 !== undefined ? _entry$1.v : 0) + (1) >>> 0 }; $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._key = _key; $f._key$1 = _key$1; $f.ch = ch; $f.handoff = handoff; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; runtime_notifyListCheck = function(size) { var size; }; runtime_canSpin = function(i) { var i; return false; }; runtime_nanotime = function() { return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); }; throw$1 = function(s) { var s; $throwRuntimeError($externalize(s, $String)); }; Mutex.ptr.prototype.Lock = function() { var awoke, delta, iter, m, new$1, old, queueLifo, starving, waitStartTime, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; awoke = $f.awoke; delta = $f.delta; iter = $f.iter; m = $f.m; new$1 = $f.new$1; old = $f.old; queueLifo = $f.queueLifo; starving = $f.starving; waitStartTime = $f.waitStartTime; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), 0, 1)) { if (false) { race.Acquire((m)); } $s = -1; return; } waitStartTime = new $Int64(0, 0); starving = false; awoke = false; iter = 0; old = m.state; /* while (true) { */ case 1: /* */ if (((old & 5) === 1) && runtime_canSpin(iter)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (((old & 5) === 1) && runtime_canSpin(iter)) { */ case 3: if (!awoke && ((old & 2) === 0) && !(((old >> 3 >> 0) === 0)) && atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 2)) { awoke = true; } runtime_doSpin(); iter = iter + (1) >> 0; old = m.state; /* continue; */ $s = 1; continue; /* } */ case 4: new$1 = old; if ((old & 4) === 0) { new$1 = new$1 | (1); } if (!(((old & 5) === 0))) { new$1 = new$1 + (8) >> 0; } if (starving && !(((old & 1) === 0))) { new$1 = new$1 | (4); } if (awoke) { if ((new$1 & 2) === 0) { throw$1("sync: inconsistent mutex state"); } new$1 = (new$1 & ~(2)) >> 0; } /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 5: if ((old & 5) === 0) { /* break; */ $s = 2; continue; } queueLifo = !((waitStartTime.$high === 0 && waitStartTime.$low === 0)); if ((waitStartTime.$high === 0 && waitStartTime.$low === 0)) { waitStartTime = runtime_nanotime(); } $r = runtime_SemacquireMutex((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), queueLifo); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } starving = starving || (x = (x$1 = runtime_nanotime(), new $Int64(x$1.$high - waitStartTime.$high, x$1.$low - waitStartTime.$low)), (x.$high > 0 || (x.$high === 0 && x.$low > 1000000))); old = m.state; if (!(((old & 4) === 0))) { if (!(((old & 3) === 0)) || ((old >> 3 >> 0) === 0)) { throw$1("sync: inconsistent mutex state"); } delta = -7; if (!starving || ((old >> 3 >> 0) === 1)) { delta = delta - (4) >> 0; } atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), delta); /* break; */ $s = 2; continue; } awoke = true; iter = 0; $s = 7; continue; /* } else { */ case 6: old = m.state; /* } */ case 7: /* } */ $s = 1; continue; case 2: if (false) { race.Acquire((m)); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Lock }; } $f.awoke = awoke; $f.delta = delta; $f.iter = iter; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.queueLifo = queueLifo; $f.starving = starving; $f.waitStartTime = waitStartTime; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Mutex.prototype.Lock = function() { return this.$val.Lock(); }; Mutex.ptr.prototype.Unlock = function() { var m, new$1, old, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; m = $f.m; new$1 = $f.new$1; old = $f.old; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = this; if (false) { $unused(m.state); race.Release((m)); } new$1 = atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), -1); if ((((new$1 + 1 >> 0)) & 1) === 0) { throw$1("sync: unlock of unlocked mutex"); } /* */ if ((new$1 & 4) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((new$1 & 4) === 0) { */ case 1: old = new$1; /* while (true) { */ case 4: if (((old >> 3 >> 0) === 0) || !(((old & 7) === 0))) { $s = -1; return; } new$1 = ((old - 8 >> 0)) | 2; /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$6(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 6: $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), false); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 7: old = m.state; /* } */ $s = 4; continue; case 5: $s = 3; continue; /* } else { */ case 2: $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m))), true); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Unlock }; } $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; }; Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; Once.ptr.prototype.Do = function(f) { var f, o, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); o = this; if (atomic.LoadUint32((o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o)))) === 1) { $s = -1; return; } $r = o.m.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(o.m, "Unlock"), []]); /* */ if (o.done === 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (o.done === 0) { */ case 2: $deferred.push([atomic.StoreUint32, [(o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o))), 1]]); $r = f(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Once.prototype.Do = function(f) { return this.$val.Do(f); }; poolCleanup = function() { var _i, _i$1, _ref, _ref$1, i, i$1, j, l, p, x; _ref = allPools; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; p = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= allPools.$length) ? ($throwRuntimeError("index out of range"), undefined) : allPools.$array[allPools.$offset + i] = ptrType.nil); i$1 = 0; while (true) { if (!(i$1 < ((p.localSize >> 0)))) { break; } l = indexLocal(p.local, i$1); l.poolLocalInternal.private$0 = $ifaceNil; _ref$1 = l.poolLocalInternal.shared; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } j = _i$1; (x = l.poolLocalInternal.shared, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j] = $ifaceNil)); _i$1++; } l.poolLocalInternal.shared = sliceType$4.nil; i$1 = i$1 + (1) >> 0; } p.local = 0; p.localSize = 0; _i++; } allPools = new sliceType([]); }; init = function() { runtime_registerPoolCleanup(poolCleanup); }; indexLocal = function(l, i) { var i, l, lp; lp = (((l) + ($imul(((i >>> 0)), 128) >>> 0) >>> 0)); return ($pointerOfStructConversion(lp, ptrType$7)); }; init$1 = function() { var n; n = new notifyList.ptr(0, 0, 0, 0, 0); runtime_notifyListCheck(20); }; runtime_doSpin = function() { $throwRuntimeError("native function not implemented: sync.runtime_doSpin"); }; RWMutex.ptr.prototype.RLock = function() { var rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); race.Disable(); } /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1: $r = runtime_SemacquireMutex((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: if (false) { race.Enable(); race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RLock }; } $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; RWMutex.ptr.prototype.RUnlock = function() { var r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); race.ReleaseMerge(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); race.Disable(); } r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1); /* */ if (r < 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r < 0) { */ case 1: if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) { race.Enable(); throw$1("sync: RUnlock of unlocked RWMutex"); } /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 3: $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: /* } */ case 2: if (false) { race.Enable(); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RUnlock }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; RWMutex.ptr.prototype.Lock = function() { var r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); race.Disable(); } $r = rw.w.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1073741824) + 1073741824 >> 0; /* */ if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$6(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2: $r = runtime_SemacquireMutex((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))), false); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: if (false) { race.Enable(); race.Acquire(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); race.Acquire(((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw))))); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Lock }; } $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; RWMutex.ptr.prototype.Unlock = function() { var i, r, rw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; i = $f.i; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rw = this; if (false) { $unused(rw.w.state); race.Release(((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))))); race.Disable(); } r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$6(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824); if (r >= 1073741824) { race.Enable(); throw$1("sync: Unlock of unlocked RWMutex"); } i = 0; /* while (true) { */ case 1: /* if (!(i < ((r >> 0)))) { break; } */ if(!(i < ((r >> 0)))) { $s = 2; continue; } $r = runtime_Semrelease((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw))), false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $r = rw.w.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (false) { race.Enable(); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Unlock }; } $f.i = i; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; }; RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; RWMutex.ptr.prototype.RLocker = function() { var rw; rw = this; return ($pointerOfStructConversion(rw, ptrType$8)); }; RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); }; rlocker.ptr.prototype.Lock = function() { var r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = ($pointerOfStructConversion(r, ptrType$9)).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Lock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; rlocker.prototype.Lock = function() { return this.$val.Lock(); }; rlocker.ptr.prototype.Unlock = function() { var r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; $r = ($pointerOfStructConversion(r, ptrType$9)).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Unlock }; } $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; rlocker.prototype.Unlock = function() { return this.$val.Unlock(); }; ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "getSlow", name: "getSlow", pkg: "sync", typ: $funcType([], [$emptyInterface], false)}, {prop: "pin", name: "pin", pkg: "sync", typ: $funcType([], [ptrType$7], false)}, {prop: "pinSlow", name: "pinSlow", pkg: "sync", typ: $funcType([], [ptrType$7], false)}]; ptrType$16.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; ptrType$17.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$2], [], false)}]; ptrType$9.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLocker", name: "RLocker", pkg: "", typ: $funcType([], [Locker], false)}]; ptrType$8.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; Pool.init("sync", [{prop: "local", name: "local", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "localSize", name: "localSize", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "store", name: "store", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: funcType, tag: ""}]); Mutex.init("sync", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "sema", name: "sema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]); Once.init("sync", [{prop: "m", name: "m", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Uint32, tag: ""}]); poolLocalInternal.init("sync", [{prop: "private$0", name: "private", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "shared", name: "shared", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: Mutex, tag: ""}]); poolLocal.init("sync", [{prop: "poolLocalInternal", name: "poolLocalInternal", embedded: true, exported: false, typ: poolLocalInternal, tag: ""}, {prop: "pad", name: "pad", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); notifyList.init("sync", [{prop: "wait", name: "wait", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "notify", name: "notify", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "lock", name: "lock", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "head", name: "head", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}]); RWMutex.init("sync", [{prop: "w", name: "w", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", embedded: false, exported: false, typ: $Int32, tag: ""}]); rlocker.init("sync", [{prop: "w", name: "w", embedded: false, exported: false, typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", embedded: false, exported: false, typ: $Int32, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = race.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } allPools = sliceType.nil; semWaiters = {}; semAwoken = {}; expunged = (new Uint8Array(8)); init(); init$1(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["io"] = (function() { var $pkg = {}, $init, errors, sync, atomic, Reader, Writer, Closer, ReadCloser, WriteCloser, ReaderFrom, WriterTo, RuneScanner, stringWriter, LimitedReader, sliceType, ptrType$1, errWhence, errOffset, WriteString, ReadAtLeast, ReadFull, Copy, copyBuffer; errors = $packages["errors"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; Reader = $pkg.Reader = $newType(8, $kindInterface, "io.Reader", true, "io", true, null); Writer = $pkg.Writer = $newType(8, $kindInterface, "io.Writer", true, "io", true, null); Closer = $pkg.Closer = $newType(8, $kindInterface, "io.Closer", true, "io", true, null); ReadCloser = $pkg.ReadCloser = $newType(8, $kindInterface, "io.ReadCloser", true, "io", true, null); WriteCloser = $pkg.WriteCloser = $newType(8, $kindInterface, "io.WriteCloser", true, "io", true, null); ReaderFrom = $pkg.ReaderFrom = $newType(8, $kindInterface, "io.ReaderFrom", true, "io", true, null); WriterTo = $pkg.WriterTo = $newType(8, $kindInterface, "io.WriterTo", true, "io", true, null); RuneScanner = $pkg.RuneScanner = $newType(8, $kindInterface, "io.RuneScanner", true, "io", true, null); stringWriter = $pkg.stringWriter = $newType(8, $kindInterface, "io.stringWriter", true, "io", false, null); LimitedReader = $pkg.LimitedReader = $newType(0, $kindStruct, "io.LimitedReader", true, "io", true, function(R_, N_) { this.$val = this; if (arguments.length === 0) { this.R = $ifaceNil; this.N = new $Int64(0, 0); return; } this.R = R_; this.N = N_; }); sliceType = $sliceType($Uint8); ptrType$1 = $ptrType(LimitedReader); WriteString = function(w, s) { var _r, _r$1, _tuple, _tuple$1, _tuple$2, err, n, ok, s, sw, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; n = $f.n; ok = $f.ok; s = $f.s; sw = $f.sw; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _tuple = $assertType(w, stringWriter, true); sw = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = sw.WriteString(s); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; n = _tuple$1[0]; err = _tuple$1[1]; $s = -1; return [n, err]; /* } */ case 2: _r$1 = w.Write((new sliceType($stringToBytes(s)))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; n = _tuple$2[0]; err = _tuple$2[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: WriteString }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.n = n; $f.ok = ok; $f.s = s; $f.sw = sw; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.WriteString = WriteString; ReadAtLeast = function(r, buf, min) { var _r, _tmp, _tmp$1, _tuple, buf, err, min, n, nn, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; buf = $f.buf; err = $f.err; min = $f.min; n = $f.n; nn = $f.nn; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; if (buf.$length < min) { _tmp = 0; _tmp$1 = $pkg.ErrShortBuffer; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* while (true) { */ case 1: /* if (!(n < min && $interfaceIsEqual(err, $ifaceNil))) { break; } */ if(!(n < min && $interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } nn = 0; _r = r.Read($subslice(buf, n)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; nn = _tuple[0]; err = _tuple[1]; n = n + (nn) >> 0; /* } */ $s = 1; continue; case 2: if (n >= min) { err = $ifaceNil; } else if (n > 0 && $interfaceIsEqual(err, $pkg.EOF)) { err = $pkg.ErrUnexpectedEOF; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAtLeast }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.min = min; $f.n = n; $f.nn = nn; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadAtLeast = ReadAtLeast; ReadFull = function(r, buf) { var _r, _tuple, buf, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = ReadAtLeast(r, buf, buf.$length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadFull }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadFull = ReadFull; Copy = function(dst, src) { var _r, _tuple, dst, err, src, written, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; dst = $f.dst; err = $f.err; src = $f.src; written = $f.written; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; _r = copyBuffer(dst, src, sliceType.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; written = _tuple[0]; err = _tuple[1]; $s = -1; return [written, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Copy }; } $f._r = _r; $f._tuple = _tuple; $f.dst = dst; $f.err = err; $f.src = src; $f.written = written; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Copy = Copy; copyBuffer = function(dst, src, buf) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, buf, dst, er, err, ew, l, nr, nw, ok, ok$1, ok$2, rt, size, src, written, wt, x, x$1, x$2, x$3, x$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; buf = $f.buf; dst = $f.dst; er = $f.er; err = $f.err; ew = $f.ew; l = $f.l; nr = $f.nr; nw = $f.nw; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; rt = $f.rt; size = $f.size; src = $f.src; written = $f.written; wt = $f.wt; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: written = new $Int64(0, 0); err = $ifaceNil; _tuple = $assertType(src, WriterTo, true); wt = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = wt.WriteTo(dst); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; written = _tuple$1[0]; err = _tuple$1[1]; $s = -1; return [written, err]; /* } */ case 2: _tuple$2 = $assertType(dst, ReaderFrom, true); rt = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (ok$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok$1) { */ case 4: _r$1 = rt.ReadFrom(src); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$3 = _r$1; written = _tuple$3[0]; err = _tuple$3[1]; $s = -1; return [written, err]; /* } */ case 5: if (buf === sliceType.nil) { size = 32768; _tuple$4 = $assertType(src, ptrType$1, true); l = _tuple$4[0]; ok$2 = _tuple$4[1]; if (ok$2 && (x = (new $Int64(0, size)), x$1 = l.N, (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low)))) { if ((x$2 = l.N, (x$2.$high < 0 || (x$2.$high === 0 && x$2.$low < 1)))) { size = 1; } else { size = (((x$3 = l.N, x$3.$low + ((x$3.$high >> 31) * 4294967296)) >> 0)); } } buf = $makeSlice(sliceType, size); } /* while (true) { */ case 7: _r$2 = src.Read(buf); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$5 = _r$2; nr = _tuple$5[0]; er = _tuple$5[1]; /* */ if (nr > 0) { $s = 10; continue; } /* */ $s = 11; continue; /* if (nr > 0) { */ case 10: _r$3 = dst.Write($subslice(buf, 0, nr)); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$6 = _r$3; nw = _tuple$6[0]; ew = _tuple$6[1]; if (nw > 0) { written = (x$4 = (new $Int64(0, nw)), new $Int64(written.$high + x$4.$high, written.$low + x$4.$low)); } if (!($interfaceIsEqual(ew, $ifaceNil))) { err = ew; /* break; */ $s = 8; continue; } if (!((nr === nw))) { err = $pkg.ErrShortWrite; /* break; */ $s = 8; continue; } /* } */ case 11: if (!($interfaceIsEqual(er, $ifaceNil))) { if (!($interfaceIsEqual(er, $pkg.EOF))) { err = er; } /* break; */ $s = 8; continue; } /* } */ $s = 7; continue; case 8: _tmp = written; _tmp$1 = err; written = _tmp; err = _tmp$1; $s = -1; return [written, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: copyBuffer }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f.buf = buf; $f.dst = dst; $f.er = er; $f.err = err; $f.ew = ew; $f.l = l; $f.nr = nr; $f.nw = nw; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.rt = rt; $f.size = size; $f.src = src; $f.written = written; $f.wt = wt; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; }; LimitedReader.ptr.prototype.Read = function(p) { var _r, _tmp, _tmp$1, _tuple, err, l, n, p, x, x$1, x$2, x$3, x$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; l = $f.l; n = $f.n; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; l = this; if ((x = l.N, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { _tmp = 0; _tmp$1 = $pkg.EOF; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if ((x$1 = (new $Int64(0, p.$length)), x$2 = l.N, (x$1.$high > x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { p = $subslice(p, 0, $flatten64(l.N)); } _r = l.R.Read(p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; l.N = (x$3 = l.N, x$4 = (new $Int64(0, n)), new $Int64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: LimitedReader.ptr.prototype.Read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.l = l; $f.n = n; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; }; LimitedReader.prototype.Read = function(p) { return this.$val.Read(p); }; ptrType$1.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); Writer.init([{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); Closer.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]); ReadCloser.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); WriteCloser.init([{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); ReaderFrom.init([{prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([Reader], [$Int64, $error], false)}]); WriterTo.init([{prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([Writer], [$Int64, $error], false)}]); RuneScanner.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]); stringWriter.init([{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]); LimitedReader.init("", [{prop: "R", name: "R", embedded: false, exported: true, typ: Reader, tag: ""}, {prop: "N", name: "N", embedded: false, exported: true, typ: $Int64, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrShortWrite = errors.New("short write"); $pkg.ErrShortBuffer = errors.New("short buffer"); $pkg.EOF = errors.New("EOF"); $pkg.ErrUnexpectedEOF = errors.New("unexpected EOF"); $pkg.ErrNoProgress = errors.New("multiple Read calls return no data or error"); errWhence = errors.New("Seek: invalid whence"); errOffset = errors.New("Seek: invalid offset"); $pkg.ErrClosedPipe = errors.New("io: read/write on closed pipe"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["unicode"] = (function() { var $pkg = {}, $init, RangeTable, Range16, Range32, CaseRange, d, arrayType, sliceType, sliceType$1, sliceType$3, _White_Space, _CaseRanges, to, IsSpace, is16, is32, isExcludingLatin, To, ToUpper, ToLower; RangeTable = $pkg.RangeTable = $newType(0, $kindStruct, "unicode.RangeTable", true, "unicode", true, function(R16_, R32_, LatinOffset_) { this.$val = this; if (arguments.length === 0) { this.R16 = sliceType.nil; this.R32 = sliceType$1.nil; this.LatinOffset = 0; return; } this.R16 = R16_; this.R32 = R32_; this.LatinOffset = LatinOffset_; }); Range16 = $pkg.Range16 = $newType(0, $kindStruct, "unicode.Range16", true, "unicode", true, function(Lo_, Hi_, Stride_) { this.$val = this; if (arguments.length === 0) { this.Lo = 0; this.Hi = 0; this.Stride = 0; return; } this.Lo = Lo_; this.Hi = Hi_; this.Stride = Stride_; }); Range32 = $pkg.Range32 = $newType(0, $kindStruct, "unicode.Range32", true, "unicode", true, function(Lo_, Hi_, Stride_) { this.$val = this; if (arguments.length === 0) { this.Lo = 0; this.Hi = 0; this.Stride = 0; return; } this.Lo = Lo_; this.Hi = Hi_; this.Stride = Stride_; }); CaseRange = $pkg.CaseRange = $newType(0, $kindStruct, "unicode.CaseRange", true, "unicode", true, function(Lo_, Hi_, Delta_) { this.$val = this; if (arguments.length === 0) { this.Lo = 0; this.Hi = 0; this.Delta = arrayType.zero(); return; } this.Lo = Lo_; this.Hi = Hi_; this.Delta = Delta_; }); d = $pkg.d = $newType(12, $kindArray, "unicode.d", true, "unicode", false, null); arrayType = $arrayType($Int32, 3); sliceType = $sliceType(Range16); sliceType$1 = $sliceType(Range32); sliceType$3 = $sliceType(CaseRange); to = function(_case, r, caseRange) { var _case, _q, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, caseRange, cr, delta, foundMapping, hi, lo, m, mappedRune, r, x; mappedRune = 0; foundMapping = false; if (_case < 0 || 3 <= _case) { _tmp = 65533; _tmp$1 = false; mappedRune = _tmp; foundMapping = _tmp$1; return [mappedRune, foundMapping]; } lo = 0; hi = caseRange.$length; while (true) { if (!(lo < hi)) { break; } m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; cr = ((m < 0 || m >= caseRange.$length) ? ($throwRuntimeError("index out of range"), undefined) : caseRange.$array[caseRange.$offset + m]); if (((cr.Lo >> 0)) <= r && r <= ((cr.Hi >> 0))) { delta = ((x = cr.Delta, ((_case < 0 || _case >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[_case]))); if (delta > 1114111) { _tmp$2 = ((cr.Lo >> 0)) + ((((((r - ((cr.Lo >> 0)) >> 0)) & ~1) >> 0) | (((_case & 1) >> 0)))) >> 0; _tmp$3 = true; mappedRune = _tmp$2; foundMapping = _tmp$3; return [mappedRune, foundMapping]; } _tmp$4 = r + delta >> 0; _tmp$5 = true; mappedRune = _tmp$4; foundMapping = _tmp$5; return [mappedRune, foundMapping]; } if (r < ((cr.Lo >> 0))) { hi = m; } else { lo = m + 1 >> 0; } } _tmp$6 = r; _tmp$7 = false; mappedRune = _tmp$6; foundMapping = _tmp$7; return [mappedRune, foundMapping]; }; IsSpace = function(r) { var _1, r; if (((r >>> 0)) <= 255) { _1 = r; if ((_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12)) || (_1 === (13)) || (_1 === (32)) || (_1 === (133)) || (_1 === (160))) { return true; } return false; } return isExcludingLatin($pkg.White_Space, r); }; $pkg.IsSpace = IsSpace; is16 = function(ranges, r) { var _i, _q, _r, _r$1, _ref, hi, i, lo, m, r, range_, range_$1, ranges; if (ranges.$length <= 18 || r <= 255) { _ref = ranges; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; range_ = ((i < 0 || i >= ranges.$length) ? ($throwRuntimeError("index out of range"), undefined) : ranges.$array[ranges.$offset + i]); if (r < range_.Lo) { return false; } if (r <= range_.Hi) { return (range_.Stride === 1) || ((_r = ((r - range_.Lo << 16 >>> 16)) % range_.Stride, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0); } _i++; } return false; } lo = 0; hi = ranges.$length; while (true) { if (!(lo < hi)) { break; } m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; range_$1 = ((m < 0 || m >= ranges.$length) ? ($throwRuntimeError("index out of range"), undefined) : ranges.$array[ranges.$offset + m]); if (range_$1.Lo <= r && r <= range_$1.Hi) { return (range_$1.Stride === 1) || ((_r$1 = ((r - range_$1.Lo << 16 >>> 16)) % range_$1.Stride, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0); } if (r < range_$1.Lo) { hi = m; } else { lo = m + 1 >> 0; } } return false; }; is32 = function(ranges, r) { var _i, _q, _r, _r$1, _ref, hi, i, lo, m, r, range_, range_$1, ranges; if (ranges.$length <= 18) { _ref = ranges; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; range_ = ((i < 0 || i >= ranges.$length) ? ($throwRuntimeError("index out of range"), undefined) : ranges.$array[ranges.$offset + i]); if (r < range_.Lo) { return false; } if (r <= range_.Hi) { return (range_.Stride === 1) || ((_r = ((r - range_.Lo >>> 0)) % range_.Stride, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0); } _i++; } return false; } lo = 0; hi = ranges.$length; while (true) { if (!(lo < hi)) { break; } m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; range_$1 = $clone(((m < 0 || m >= ranges.$length) ? ($throwRuntimeError("index out of range"), undefined) : ranges.$array[ranges.$offset + m]), Range32); if (range_$1.Lo <= r && r <= range_$1.Hi) { return (range_$1.Stride === 1) || ((_r$1 = ((r - range_$1.Lo >>> 0)) % range_$1.Stride, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0); } if (r < range_$1.Lo) { hi = m; } else { lo = m + 1 >> 0; } } return false; }; isExcludingLatin = function(rangeTab, r) { var off, r, r16, r32, rangeTab, x; r16 = rangeTab.R16; off = rangeTab.LatinOffset; if (r16.$length > off && r <= (((x = r16.$length - 1 >> 0, ((x < 0 || x >= r16.$length) ? ($throwRuntimeError("index out of range"), undefined) : r16.$array[r16.$offset + x])).Hi >> 0))) { return is16($subslice(r16, off), ((r << 16 >>> 16))); } r32 = rangeTab.R32; if (r32.$length > 0 && r >= (((0 >= r32.$length ? ($throwRuntimeError("index out of range"), undefined) : r32.$array[r32.$offset + 0]).Lo >> 0))) { return is32(r32, ((r >>> 0))); } return false; }; To = function(_case, r) { var _case, _tuple, r; _tuple = to(_case, r, $pkg.CaseRanges); r = _tuple[0]; return r; }; $pkg.To = To; ToUpper = function(r) { var r; if (r <= 127) { if (97 <= r && r <= 122) { r = r - (32) >> 0; } return r; } return To(0, r); }; $pkg.ToUpper = ToUpper; ToLower = function(r) { var r; if (r <= 127) { if (65 <= r && r <= 90) { r = r + (32) >> 0; } return r; } return To(1, r); }; $pkg.ToLower = ToLower; RangeTable.init("", [{prop: "R16", name: "R16", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "R32", name: "R32", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "LatinOffset", name: "LatinOffset", embedded: false, exported: true, typ: $Int, tag: ""}]); Range16.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Stride", name: "Stride", embedded: false, exported: true, typ: $Uint16, tag: ""}]); Range32.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Stride", name: "Stride", embedded: false, exported: true, typ: $Uint32, tag: ""}]); CaseRange.init("", [{prop: "Lo", name: "Lo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Delta", name: "Delta", embedded: false, exported: true, typ: d, tag: ""}]); d.init($Int32, 3); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _White_Space = new RangeTable.ptr(new sliceType([new Range16.ptr(9, 13, 1), new Range16.ptr(32, 32, 1), new Range16.ptr(133, 133, 1), new Range16.ptr(160, 160, 1), new Range16.ptr(5760, 5760, 1), new Range16.ptr(8192, 8202, 1), new Range16.ptr(8232, 8233, 1), new Range16.ptr(8239, 8239, 1), new Range16.ptr(8287, 8287, 1), new Range16.ptr(12288, 12288, 1)]), sliceType$1.nil, 4); $pkg.White_Space = _White_Space; _CaseRanges = new sliceType$3([new CaseRange.ptr(65, 90, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(97, 122, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(181, 181, $toNativeArray($kindInt32, [743, 0, 743])), new CaseRange.ptr(192, 214, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(216, 222, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(224, 246, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(248, 254, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(255, 255, $toNativeArray($kindInt32, [121, 0, 121])), new CaseRange.ptr(256, 303, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(304, 304, $toNativeArray($kindInt32, [0, -199, 0])), new CaseRange.ptr(305, 305, $toNativeArray($kindInt32, [-232, 0, -232])), new CaseRange.ptr(306, 311, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(313, 328, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(330, 375, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(376, 376, $toNativeArray($kindInt32, [0, -121, 0])), new CaseRange.ptr(377, 382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(383, 383, $toNativeArray($kindInt32, [-300, 0, -300])), new CaseRange.ptr(384, 384, $toNativeArray($kindInt32, [195, 0, 195])), new CaseRange.ptr(385, 385, $toNativeArray($kindInt32, [0, 210, 0])), new CaseRange.ptr(386, 389, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(390, 390, $toNativeArray($kindInt32, [0, 206, 0])), new CaseRange.ptr(391, 392, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(393, 394, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(395, 396, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(398, 398, $toNativeArray($kindInt32, [0, 79, 0])), new CaseRange.ptr(399, 399, $toNativeArray($kindInt32, [0, 202, 0])), new CaseRange.ptr(400, 400, $toNativeArray($kindInt32, [0, 203, 0])), new CaseRange.ptr(401, 402, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(403, 403, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(404, 404, $toNativeArray($kindInt32, [0, 207, 0])), new CaseRange.ptr(405, 405, $toNativeArray($kindInt32, [97, 0, 97])), new CaseRange.ptr(406, 406, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(407, 407, $toNativeArray($kindInt32, [0, 209, 0])), new CaseRange.ptr(408, 409, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(410, 410, $toNativeArray($kindInt32, [163, 0, 163])), new CaseRange.ptr(412, 412, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(413, 413, $toNativeArray($kindInt32, [0, 213, 0])), new CaseRange.ptr(414, 414, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(415, 415, $toNativeArray($kindInt32, [0, 214, 0])), new CaseRange.ptr(416, 421, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(422, 422, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(423, 424, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(425, 425, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(428, 429, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(430, 430, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(431, 432, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(433, 434, $toNativeArray($kindInt32, [0, 217, 0])), new CaseRange.ptr(435, 438, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(439, 439, $toNativeArray($kindInt32, [0, 219, 0])), new CaseRange.ptr(440, 441, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(444, 445, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(447, 447, $toNativeArray($kindInt32, [56, 0, 56])), new CaseRange.ptr(452, 452, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(453, 453, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(454, 454, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(455, 455, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(456, 456, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(457, 457, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(458, 458, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(459, 459, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(460, 460, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(461, 476, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(477, 477, $toNativeArray($kindInt32, [-79, 0, -79])), new CaseRange.ptr(478, 495, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(497, 497, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(498, 498, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(499, 499, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(500, 501, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(502, 502, $toNativeArray($kindInt32, [0, -97, 0])), new CaseRange.ptr(503, 503, $toNativeArray($kindInt32, [0, -56, 0])), new CaseRange.ptr(504, 543, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(544, 544, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(546, 563, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(570, 570, $toNativeArray($kindInt32, [0, 10795, 0])), new CaseRange.ptr(571, 572, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(573, 573, $toNativeArray($kindInt32, [0, -163, 0])), new CaseRange.ptr(574, 574, $toNativeArray($kindInt32, [0, 10792, 0])), new CaseRange.ptr(575, 576, $toNativeArray($kindInt32, [10815, 0, 10815])), new CaseRange.ptr(577, 578, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(579, 579, $toNativeArray($kindInt32, [0, -195, 0])), new CaseRange.ptr(580, 580, $toNativeArray($kindInt32, [0, 69, 0])), new CaseRange.ptr(581, 581, $toNativeArray($kindInt32, [0, 71, 0])), new CaseRange.ptr(582, 591, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(592, 592, $toNativeArray($kindInt32, [10783, 0, 10783])), new CaseRange.ptr(593, 593, $toNativeArray($kindInt32, [10780, 0, 10780])), new CaseRange.ptr(594, 594, $toNativeArray($kindInt32, [10782, 0, 10782])), new CaseRange.ptr(595, 595, $toNativeArray($kindInt32, [-210, 0, -210])), new CaseRange.ptr(596, 596, $toNativeArray($kindInt32, [-206, 0, -206])), new CaseRange.ptr(598, 599, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(601, 601, $toNativeArray($kindInt32, [-202, 0, -202])), new CaseRange.ptr(603, 603, $toNativeArray($kindInt32, [-203, 0, -203])), new CaseRange.ptr(604, 604, $toNativeArray($kindInt32, [42319, 0, 42319])), new CaseRange.ptr(608, 608, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(609, 609, $toNativeArray($kindInt32, [42315, 0, 42315])), new CaseRange.ptr(611, 611, $toNativeArray($kindInt32, [-207, 0, -207])), new CaseRange.ptr(613, 613, $toNativeArray($kindInt32, [42280, 0, 42280])), new CaseRange.ptr(614, 614, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(616, 616, $toNativeArray($kindInt32, [-209, 0, -209])), new CaseRange.ptr(617, 617, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(618, 618, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(619, 619, $toNativeArray($kindInt32, [10743, 0, 10743])), new CaseRange.ptr(620, 620, $toNativeArray($kindInt32, [42305, 0, 42305])), new CaseRange.ptr(623, 623, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(625, 625, $toNativeArray($kindInt32, [10749, 0, 10749])), new CaseRange.ptr(626, 626, $toNativeArray($kindInt32, [-213, 0, -213])), new CaseRange.ptr(629, 629, $toNativeArray($kindInt32, [-214, 0, -214])), new CaseRange.ptr(637, 637, $toNativeArray($kindInt32, [10727, 0, 10727])), new CaseRange.ptr(640, 640, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(643, 643, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(647, 647, $toNativeArray($kindInt32, [42282, 0, 42282])), new CaseRange.ptr(648, 648, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(649, 649, $toNativeArray($kindInt32, [-69, 0, -69])), new CaseRange.ptr(650, 651, $toNativeArray($kindInt32, [-217, 0, -217])), new CaseRange.ptr(652, 652, $toNativeArray($kindInt32, [-71, 0, -71])), new CaseRange.ptr(658, 658, $toNativeArray($kindInt32, [-219, 0, -219])), new CaseRange.ptr(669, 669, $toNativeArray($kindInt32, [42261, 0, 42261])), new CaseRange.ptr(670, 670, $toNativeArray($kindInt32, [42258, 0, 42258])), new CaseRange.ptr(837, 837, $toNativeArray($kindInt32, [84, 0, 84])), new CaseRange.ptr(880, 883, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(886, 887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(891, 893, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(895, 895, $toNativeArray($kindInt32, [0, 116, 0])), new CaseRange.ptr(902, 902, $toNativeArray($kindInt32, [0, 38, 0])), new CaseRange.ptr(904, 906, $toNativeArray($kindInt32, [0, 37, 0])), new CaseRange.ptr(908, 908, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(910, 911, $toNativeArray($kindInt32, [0, 63, 0])), new CaseRange.ptr(913, 929, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(931, 939, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(940, 940, $toNativeArray($kindInt32, [-38, 0, -38])), new CaseRange.ptr(941, 943, $toNativeArray($kindInt32, [-37, 0, -37])), new CaseRange.ptr(945, 961, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(962, 962, $toNativeArray($kindInt32, [-31, 0, -31])), new CaseRange.ptr(963, 971, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(972, 972, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(973, 974, $toNativeArray($kindInt32, [-63, 0, -63])), new CaseRange.ptr(975, 975, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(976, 976, $toNativeArray($kindInt32, [-62, 0, -62])), new CaseRange.ptr(977, 977, $toNativeArray($kindInt32, [-57, 0, -57])), new CaseRange.ptr(981, 981, $toNativeArray($kindInt32, [-47, 0, -47])), new CaseRange.ptr(982, 982, $toNativeArray($kindInt32, [-54, 0, -54])), new CaseRange.ptr(983, 983, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(984, 1007, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1008, 1008, $toNativeArray($kindInt32, [-86, 0, -86])), new CaseRange.ptr(1009, 1009, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1010, 1010, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(1011, 1011, $toNativeArray($kindInt32, [-116, 0, -116])), new CaseRange.ptr(1012, 1012, $toNativeArray($kindInt32, [0, -60, 0])), new CaseRange.ptr(1013, 1013, $toNativeArray($kindInt32, [-96, 0, -96])), new CaseRange.ptr(1015, 1016, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1017, 1017, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(1018, 1019, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1021, 1023, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(1024, 1039, $toNativeArray($kindInt32, [0, 80, 0])), new CaseRange.ptr(1040, 1071, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(1072, 1103, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(1104, 1119, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1120, 1153, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1162, 1215, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1216, 1216, $toNativeArray($kindInt32, [0, 15, 0])), new CaseRange.ptr(1217, 1230, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1231, 1231, $toNativeArray($kindInt32, [-15, 0, -15])), new CaseRange.ptr(1232, 1327, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1329, 1366, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(1377, 1414, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(4256, 4293, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4295, 4295, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4301, 4301, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(5024, 5103, $toNativeArray($kindInt32, [0, 38864, 0])), new CaseRange.ptr(5104, 5109, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(5112, 5117, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(7296, 7296, $toNativeArray($kindInt32, [-6254, 0, -6254])), new CaseRange.ptr(7297, 7297, $toNativeArray($kindInt32, [-6253, 0, -6253])), new CaseRange.ptr(7298, 7298, $toNativeArray($kindInt32, [-6244, 0, -6244])), new CaseRange.ptr(7299, 7300, $toNativeArray($kindInt32, [-6242, 0, -6242])), new CaseRange.ptr(7301, 7301, $toNativeArray($kindInt32, [-6243, 0, -6243])), new CaseRange.ptr(7302, 7302, $toNativeArray($kindInt32, [-6236, 0, -6236])), new CaseRange.ptr(7303, 7303, $toNativeArray($kindInt32, [-6181, 0, -6181])), new CaseRange.ptr(7304, 7304, $toNativeArray($kindInt32, [35266, 0, 35266])), new CaseRange.ptr(7545, 7545, $toNativeArray($kindInt32, [35332, 0, 35332])), new CaseRange.ptr(7549, 7549, $toNativeArray($kindInt32, [3814, 0, 3814])), new CaseRange.ptr(7680, 7829, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7835, 7835, $toNativeArray($kindInt32, [-59, 0, -59])), new CaseRange.ptr(7838, 7838, $toNativeArray($kindInt32, [0, -7615, 0])), new CaseRange.ptr(7840, 7935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7936, 7943, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7944, 7951, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7952, 7957, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7960, 7965, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7968, 7975, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7976, 7983, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7984, 7991, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7992, 7999, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8000, 8005, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8008, 8013, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8017, 8017, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8019, 8019, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8021, 8021, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8023, 8023, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8025, 8025, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8027, 8027, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8029, 8029, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8031, 8031, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8032, 8039, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8040, 8047, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8048, 8049, $toNativeArray($kindInt32, [74, 0, 74])), new CaseRange.ptr(8050, 8053, $toNativeArray($kindInt32, [86, 0, 86])), new CaseRange.ptr(8054, 8055, $toNativeArray($kindInt32, [100, 0, 100])), new CaseRange.ptr(8056, 8057, $toNativeArray($kindInt32, [128, 0, 128])), new CaseRange.ptr(8058, 8059, $toNativeArray($kindInt32, [112, 0, 112])), new CaseRange.ptr(8060, 8061, $toNativeArray($kindInt32, [126, 0, 126])), new CaseRange.ptr(8064, 8071, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8072, 8079, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8080, 8087, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8088, 8095, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8096, 8103, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8104, 8111, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8112, 8113, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8115, 8115, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8120, 8121, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8122, 8123, $toNativeArray($kindInt32, [0, -74, 0])), new CaseRange.ptr(8124, 8124, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8126, 8126, $toNativeArray($kindInt32, [-7205, 0, -7205])), new CaseRange.ptr(8131, 8131, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8136, 8139, $toNativeArray($kindInt32, [0, -86, 0])), new CaseRange.ptr(8140, 8140, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8144, 8145, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8152, 8153, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8154, 8155, $toNativeArray($kindInt32, [0, -100, 0])), new CaseRange.ptr(8160, 8161, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8165, 8165, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(8168, 8169, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8170, 8171, $toNativeArray($kindInt32, [0, -112, 0])), new CaseRange.ptr(8172, 8172, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(8179, 8179, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8184, 8185, $toNativeArray($kindInt32, [0, -128, 0])), new CaseRange.ptr(8186, 8187, $toNativeArray($kindInt32, [0, -126, 0])), new CaseRange.ptr(8188, 8188, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8486, 8486, $toNativeArray($kindInt32, [0, -7517, 0])), new CaseRange.ptr(8490, 8490, $toNativeArray($kindInt32, [0, -8383, 0])), new CaseRange.ptr(8491, 8491, $toNativeArray($kindInt32, [0, -8262, 0])), new CaseRange.ptr(8498, 8498, $toNativeArray($kindInt32, [0, 28, 0])), new CaseRange.ptr(8526, 8526, $toNativeArray($kindInt32, [-28, 0, -28])), new CaseRange.ptr(8544, 8559, $toNativeArray($kindInt32, [0, 16, 0])), new CaseRange.ptr(8560, 8575, $toNativeArray($kindInt32, [-16, 0, -16])), new CaseRange.ptr(8579, 8580, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(9398, 9423, $toNativeArray($kindInt32, [0, 26, 0])), new CaseRange.ptr(9424, 9449, $toNativeArray($kindInt32, [-26, 0, -26])), new CaseRange.ptr(11264, 11310, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(11312, 11358, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(11360, 11361, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11362, 11362, $toNativeArray($kindInt32, [0, -10743, 0])), new CaseRange.ptr(11363, 11363, $toNativeArray($kindInt32, [0, -3814, 0])), new CaseRange.ptr(11364, 11364, $toNativeArray($kindInt32, [0, -10727, 0])), new CaseRange.ptr(11365, 11365, $toNativeArray($kindInt32, [-10795, 0, -10795])), new CaseRange.ptr(11366, 11366, $toNativeArray($kindInt32, [-10792, 0, -10792])), new CaseRange.ptr(11367, 11372, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11373, 11373, $toNativeArray($kindInt32, [0, -10780, 0])), new CaseRange.ptr(11374, 11374, $toNativeArray($kindInt32, [0, -10749, 0])), new CaseRange.ptr(11375, 11375, $toNativeArray($kindInt32, [0, -10783, 0])), new CaseRange.ptr(11376, 11376, $toNativeArray($kindInt32, [0, -10782, 0])), new CaseRange.ptr(11378, 11379, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11381, 11382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11390, 11391, $toNativeArray($kindInt32, [0, -10815, 0])), new CaseRange.ptr(11392, 11491, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11499, 11502, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11506, 11507, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11520, 11557, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11559, 11559, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11565, 11565, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(42560, 42605, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42624, 42651, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42786, 42799, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42802, 42863, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42873, 42876, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42877, 42877, $toNativeArray($kindInt32, [0, -35332, 0])), new CaseRange.ptr(42878, 42887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42891, 42892, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42893, 42893, $toNativeArray($kindInt32, [0, -42280, 0])), new CaseRange.ptr(42896, 42899, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42902, 42921, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42922, 42922, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42923, 42923, $toNativeArray($kindInt32, [0, -42319, 0])), new CaseRange.ptr(42924, 42924, $toNativeArray($kindInt32, [0, -42315, 0])), new CaseRange.ptr(42925, 42925, $toNativeArray($kindInt32, [0, -42305, 0])), new CaseRange.ptr(42926, 42926, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42928, 42928, $toNativeArray($kindInt32, [0, -42258, 0])), new CaseRange.ptr(42929, 42929, $toNativeArray($kindInt32, [0, -42282, 0])), new CaseRange.ptr(42930, 42930, $toNativeArray($kindInt32, [0, -42261, 0])), new CaseRange.ptr(42931, 42931, $toNativeArray($kindInt32, [0, 928, 0])), new CaseRange.ptr(42932, 42935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(43859, 43859, $toNativeArray($kindInt32, [-928, 0, -928])), new CaseRange.ptr(43888, 43967, $toNativeArray($kindInt32, [-38864, 0, -38864])), new CaseRange.ptr(65313, 65338, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(65345, 65370, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(66560, 66599, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66600, 66639, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(66736, 66771, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66776, 66811, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(68736, 68786, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(68800, 68850, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(71840, 71871, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(71872, 71903, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(125184, 125217, $toNativeArray($kindInt32, [0, 34, 0])), new CaseRange.ptr(125218, 125251, $toNativeArray($kindInt32, [-34, 0, -34]))]); $pkg.CaseRanges = _CaseRanges; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["unicode/utf8"] = (function() { var $pkg = {}, $init, acceptRange, first, acceptRanges, FullRune, DecodeRune, DecodeRuneInString, DecodeLastRuneInString, RuneLen, EncodeRune, RuneCount, RuneCountInString, RuneStart, ValidString, ValidRune; acceptRange = $pkg.acceptRange = $newType(0, $kindStruct, "utf8.acceptRange", true, "unicode/utf8", false, function(lo_, hi_) { this.$val = this; if (arguments.length === 0) { this.lo = 0; this.hi = 0; return; } this.lo = lo_; this.hi = hi_; }); FullRune = function(p) { var accept, n, p, x, x$1, x$2; n = p.$length; if (n === 0) { return false; } x$1 = (x = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]), ((x < 0 || x >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[x])); if (n >= ((((x$1 & 7) >>> 0) >> 0))) { return true; } accept = $clone((x$2 = x$1 >>> 4 << 24 >>> 24, ((x$2 < 0 || x$2 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$2])), acceptRange); if (n > 1 && ((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]) < accept.lo || accept.hi < (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]))) { return true; } else if (n > 2 && ((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]) < 128 || 191 < (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]))) { return true; } return false; }; $pkg.FullRune = FullRune; DecodeRune = function(p) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, b1, b2, b3, mask, n, p, p0, r, size, sz, x, x$1; r = 0; size = 0; n = p.$length; if (n < 1) { _tmp = 65533; _tmp$1 = 0; r = _tmp; size = _tmp$1; return [r, size]; } p0 = (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]); x = ((p0 < 0 || p0 >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[p0]); if (x >= 240) { mask = (((x >> 0)) << 31 >> 0) >> 31 >> 0; _tmp$2 = (((((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]) >> 0)) & ~mask) >> 0) | (65533 & mask); _tmp$3 = 1; r = _tmp$2; size = _tmp$3; return [r, size]; } sz = (x & 7) >>> 0; accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); if (n < ((sz >> 0))) { _tmp$4 = 65533; _tmp$5 = 1; r = _tmp$4; size = _tmp$5; return [r, size]; } b1 = (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]); if (b1 < accept.lo || accept.hi < b1) { _tmp$6 = 65533; _tmp$7 = 1; r = _tmp$6; size = _tmp$7; return [r, size]; } if (sz === 2) { _tmp$8 = (((((p0 & 31) >>> 0) >> 0)) << 6 >> 0) | ((((b1 & 63) >>> 0) >> 0)); _tmp$9 = 2; r = _tmp$8; size = _tmp$9; return [r, size]; } b2 = (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2]); if (b2 < 128 || 191 < b2) { _tmp$10 = 65533; _tmp$11 = 1; r = _tmp$10; size = _tmp$11; return [r, size]; } if (sz === 3) { _tmp$12 = ((((((p0 & 15) >>> 0) >> 0)) << 12 >> 0) | (((((b1 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((b2 & 63) >>> 0) >> 0)); _tmp$13 = 3; r = _tmp$12; size = _tmp$13; return [r, size]; } b3 = (3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3]); if (b3 < 128 || 191 < b3) { _tmp$14 = 65533; _tmp$15 = 1; r = _tmp$14; size = _tmp$15; return [r, size]; } _tmp$16 = (((((((p0 & 7) >>> 0) >> 0)) << 18 >> 0) | (((((b1 & 63) >>> 0) >> 0)) << 12 >> 0)) | (((((b2 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((b3 & 63) >>> 0) >> 0)); _tmp$17 = 4; r = _tmp$16; size = _tmp$17; return [r, size]; }; $pkg.DecodeRune = DecodeRune; DecodeRuneInString = function(s) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, mask, n, r, s, s0, s1, s2, s3, size, sz, x, x$1; r = 0; size = 0; n = s.length; if (n < 1) { _tmp = 65533; _tmp$1 = 0; r = _tmp; size = _tmp$1; return [r, size]; } s0 = s.charCodeAt(0); x = ((s0 < 0 || s0 >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[s0]); if (x >= 240) { mask = (((x >> 0)) << 31 >> 0) >> 31 >> 0; _tmp$2 = ((((s.charCodeAt(0) >> 0)) & ~mask) >> 0) | (65533 & mask); _tmp$3 = 1; r = _tmp$2; size = _tmp$3; return [r, size]; } sz = (x & 7) >>> 0; accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); if (n < ((sz >> 0))) { _tmp$4 = 65533; _tmp$5 = 1; r = _tmp$4; size = _tmp$5; return [r, size]; } s1 = s.charCodeAt(1); if (s1 < accept.lo || accept.hi < s1) { _tmp$6 = 65533; _tmp$7 = 1; r = _tmp$6; size = _tmp$7; return [r, size]; } if (sz === 2) { _tmp$8 = (((((s0 & 31) >>> 0) >> 0)) << 6 >> 0) | ((((s1 & 63) >>> 0) >> 0)); _tmp$9 = 2; r = _tmp$8; size = _tmp$9; return [r, size]; } s2 = s.charCodeAt(2); if (s2 < 128 || 191 < s2) { _tmp$10 = 65533; _tmp$11 = 1; r = _tmp$10; size = _tmp$11; return [r, size]; } if (sz === 3) { _tmp$12 = ((((((s0 & 15) >>> 0) >> 0)) << 12 >> 0) | (((((s1 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((s2 & 63) >>> 0) >> 0)); _tmp$13 = 3; r = _tmp$12; size = _tmp$13; return [r, size]; } s3 = s.charCodeAt(3); if (s3 < 128 || 191 < s3) { _tmp$14 = 65533; _tmp$15 = 1; r = _tmp$14; size = _tmp$15; return [r, size]; } _tmp$16 = (((((((s0 & 7) >>> 0) >> 0)) << 18 >> 0) | (((((s1 & 63) >>> 0) >> 0)) << 12 >> 0)) | (((((s2 & 63) >>> 0) >> 0)) << 6 >> 0)) | ((((s3 & 63) >>> 0) >> 0)); _tmp$17 = 4; r = _tmp$16; size = _tmp$17; return [r, size]; }; $pkg.DecodeRuneInString = DecodeRuneInString; DecodeLastRuneInString = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, end, lim, r, s, size, start; r = 0; size = 0; end = s.length; if (end === 0) { _tmp = 65533; _tmp$1 = 0; r = _tmp; size = _tmp$1; return [r, size]; } start = end - 1 >> 0; r = ((s.charCodeAt(start) >> 0)); if (r < 128) { _tmp$2 = r; _tmp$3 = 1; r = _tmp$2; size = _tmp$3; return [r, size]; } lim = end - 4 >> 0; if (lim < 0) { lim = 0; } start = start - (1) >> 0; while (true) { if (!(start >= lim)) { break; } if (RuneStart(s.charCodeAt(start))) { break; } start = start - (1) >> 0; } if (start < 0) { start = 0; } _tuple = DecodeRuneInString($substring(s, start, end)); r = _tuple[0]; size = _tuple[1]; if (!(((start + size >> 0) === end))) { _tmp$4 = 65533; _tmp$5 = 1; r = _tmp$4; size = _tmp$5; return [r, size]; } _tmp$6 = r; _tmp$7 = size; r = _tmp$6; size = _tmp$7; return [r, size]; }; $pkg.DecodeLastRuneInString = DecodeLastRuneInString; RuneLen = function(r) { var r; if (r < 0) { return -1; } else if (r <= 127) { return 1; } else if (r <= 2047) { return 2; } else if (55296 <= r && r <= 57343) { return -1; } else if (r <= 65535) { return 3; } else if (r <= 1114111) { return 4; } return -1; }; $pkg.RuneLen = RuneLen; EncodeRune = function(p, r) { var i, p, r; i = ((r >>> 0)); if (i <= 127) { (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((r << 24 >>> 24))); return 1; } else if (i <= 2047) { $unused((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((192 | (((r >> 6 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 2; } else if ((i > 1114111) || (55296 <= i && i <= 57343)) { r = 65533; $unused((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((224 | (((r >> 12 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | (((((r >> 6 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 3; } else if (i <= 65535) { $unused((2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((224 | (((r >> 12 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | (((((r >> 6 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 3; } else { $unused((3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3])); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((240 | (((r >> 18 >> 0) << 24 >>> 24))) >>> 0)); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((128 | (((((r >> 12 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (2 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 2] = ((128 | (((((r >> 6 >> 0) << 24 >>> 24)) & 63) >>> 0)) >>> 0)); (3 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 3] = ((128 | ((((r << 24 >>> 24)) & 63) >>> 0)) >>> 0)); return 4; } }; $pkg.EncodeRune = EncodeRune; RuneCount = function(p) { var accept, c, c$1, c$2, c$3, i, n, np, p, size, x, x$1, x$2, x$3, x$4; np = p.$length; n = 0; i = 0; while (true) { if (!(i < np)) { break; } n = n + (1) >> 0; c = ((i < 0 || i >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + i]); if (c < 128) { i = i + (1) >> 0; continue; } x = ((c < 0 || c >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[c]); if (x === 241) { i = i + (1) >> 0; continue; } size = ((((x & 7) >>> 0) >> 0)); if ((i + size >> 0) > np) { i = i + (1) >> 0; continue; } accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); c$1 = (x$2 = i + 1 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$2])); if (c$1 < accept.lo || accept.hi < c$1) { size = 1; } else if (size === 2) { } else { c$2 = (x$3 = i + 2 >> 0, ((x$3 < 0 || x$3 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$3])); if (c$2 < 128 || 191 < c$2) { size = 1; } else if (size === 3) { } else { c$3 = (x$4 = i + 3 >> 0, ((x$4 < 0 || x$4 >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x$4])); if (c$3 < 128 || 191 < c$3) { size = 1; } } } i = i + (size) >> 0; } return n; }; $pkg.RuneCount = RuneCount; RuneCountInString = function(s) { var accept, c, c$1, c$2, c$3, i, n, ns, s, size, x, x$1; n = 0; ns = s.length; i = 0; while (true) { if (!(i < ns)) { break; } c = s.charCodeAt(i); if (c < 128) { i = i + (1) >> 0; n = n + (1) >> 0; continue; } x = ((c < 0 || c >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[c]); if (x === 241) { i = i + (1) >> 0; n = n + (1) >> 0; continue; } size = ((((x & 7) >>> 0) >> 0)); if ((i + size >> 0) > ns) { i = i + (1) >> 0; n = n + (1) >> 0; continue; } accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); c$1 = s.charCodeAt((i + 1 >> 0)); if (c$1 < accept.lo || accept.hi < c$1) { size = 1; } else if (size === 2) { } else { c$2 = s.charCodeAt((i + 2 >> 0)); if (c$2 < 128 || 191 < c$2) { size = 1; } else if (size === 3) { } else { c$3 = s.charCodeAt((i + 3 >> 0)); if (c$3 < 128 || 191 < c$3) { size = 1; } } } i = i + (size) >> 0; n = n + (1) >> 0; } n = n; return n; }; $pkg.RuneCountInString = RuneCountInString; RuneStart = function(b) { var b; return !((((b & 192) >>> 0) === 128)); }; $pkg.RuneStart = RuneStart; ValidString = function(s) { var accept, c, c$1, c$2, i, n, s, si, size, x, x$1; n = s.length; i = 0; while (true) { if (!(i < n)) { break; } si = s.charCodeAt(i); if (si < 128) { i = i + (1) >> 0; continue; } x = ((si < 0 || si >= first.length) ? ($throwRuntimeError("index out of range"), undefined) : first[si]); if (x === 241) { return false; } size = ((((x & 7) >>> 0) >> 0)); if ((i + size >> 0) > n) { return false; } accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? ($throwRuntimeError("index out of range"), undefined) : acceptRanges[x$1])), acceptRange); c = s.charCodeAt((i + 1 >> 0)); if (c < accept.lo || accept.hi < c) { return false; } else if (size === 2) { } else { c$1 = s.charCodeAt((i + 2 >> 0)); if (c$1 < 128 || 191 < c$1) { return false; } else if (size === 3) { } else { c$2 = s.charCodeAt((i + 3 >> 0)); if (c$2 < 128 || 191 < c$2) { return false; } } } i = i + (size) >> 0; } return true; }; $pkg.ValidString = ValidString; ValidRune = function(r) { var r; if (0 <= r && r < 55296) { return true; } else if (57343 < r && r <= 1114111) { return true; } return false; }; $pkg.ValidRune = ValidRune; acceptRange.init("unicode/utf8", [{prop: "lo", name: "lo", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "hi", name: "hi", embedded: false, exported: false, typ: $Uint8, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: first = $toNativeArray($kindUint8, [240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 19, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 35, 3, 3, 52, 4, 4, 4, 68, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241]); acceptRanges = $toNativeArray($kindStruct, [new acceptRange.ptr(128, 191), new acceptRange.ptr(160, 191), new acceptRange.ptr(128, 159), new acceptRange.ptr(144, 191), new acceptRange.ptr(128, 143)]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["bytes"] = (function() { var $pkg = {}, $init, errors, bytealg, io, unicode, utf8, Buffer, readOp, ptrType, sliceType, arrayType, errNegativeRead, IndexByte, makeSlice; errors = $packages["errors"]; bytealg = $packages["internal/bytealg"]; io = $packages["io"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; Buffer = $pkg.Buffer = $newType(0, $kindStruct, "bytes.Buffer", true, "bytes", true, function(buf_, off_, bootstrap_, lastRead_) { this.$val = this; if (arguments.length === 0) { this.buf = sliceType.nil; this.off = 0; this.bootstrap = arrayType.zero(); this.lastRead = 0; return; } this.buf = buf_; this.off = off_; this.bootstrap = bootstrap_; this.lastRead = lastRead_; }); readOp = $pkg.readOp = $newType(1, $kindInt8, "bytes.readOp", true, "bytes", false, null); ptrType = $ptrType(Buffer); sliceType = $sliceType($Uint8); arrayType = $arrayType($Uint8, 64); IndexByte = function(s, c) { var _i, _ref, b, c, i, s; _ref = s; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (b === c) { return i; } _i++; } return -1; }; $pkg.IndexByte = IndexByte; Buffer.ptr.prototype.Bytes = function() { var b; b = this; return $subslice(b.buf, b.off); }; Buffer.prototype.Bytes = function() { return this.$val.Bytes(); }; Buffer.ptr.prototype.String = function() { var b; b = this; if (b === ptrType.nil) { return ""; } return ($bytesToString($subslice(b.buf, b.off))); }; Buffer.prototype.String = function() { return this.$val.String(); }; Buffer.ptr.prototype.empty = function() { var b; b = this; return b.buf.$length <= b.off; }; Buffer.prototype.empty = function() { return this.$val.empty(); }; Buffer.ptr.prototype.Len = function() { var b; b = this; return b.buf.$length - b.off >> 0; }; Buffer.prototype.Len = function() { return this.$val.Len(); }; Buffer.ptr.prototype.Cap = function() { var b; b = this; return b.buf.$capacity; }; Buffer.prototype.Cap = function() { return this.$val.Cap(); }; Buffer.ptr.prototype.Truncate = function(n) { var b, n; b = this; if (n === 0) { b.Reset(); return; } b.lastRead = 0; if (n < 0 || n > b.Len()) { $panic(new $String("bytes.Buffer: truncation out of range")); } b.buf = $subslice(b.buf, 0, (b.off + n >> 0)); }; Buffer.prototype.Truncate = function(n) { return this.$val.Truncate(n); }; Buffer.ptr.prototype.Reset = function() { var b; b = this; b.buf = $subslice(b.buf, 0, 0); b.off = 0; b.lastRead = 0; }; Buffer.prototype.Reset = function() { return this.$val.Reset(); }; Buffer.ptr.prototype.tryGrowByReslice = function(n) { var b, l, n; b = this; l = b.buf.$length; if (n <= (b.buf.$capacity - l >> 0)) { b.buf = $subslice(b.buf, 0, (l + n >> 0)); return [l, true]; } return [0, false]; }; Buffer.prototype.tryGrowByReslice = function(n) { return this.$val.tryGrowByReslice(n); }; Buffer.ptr.prototype.grow = function(n) { var _q, _tuple, b, buf, c, i, m, n, ok; b = this; m = b.Len(); if ((m === 0) && !((b.off === 0))) { b.Reset(); } _tuple = b.tryGrowByReslice(n); i = _tuple[0]; ok = _tuple[1]; if (ok) { return i; } if (b.buf === sliceType.nil && n <= 64) { b.buf = $subslice(new sliceType(b.bootstrap), 0, n); return 0; } c = b.buf.$capacity; if (n <= ((_q = c / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - m >> 0)) { $copySlice(b.buf, $subslice(b.buf, b.off)); } else if (c > ((2147483647 - c >> 0) - n >> 0)) { $panic($pkg.ErrTooLarge); } else { buf = makeSlice(($imul(2, c)) + n >> 0); $copySlice(buf, $subslice(b.buf, b.off)); b.buf = buf; } b.off = 0; b.buf = $subslice(b.buf, 0, (m + n >> 0)); return m; }; Buffer.prototype.grow = function(n) { return this.$val.grow(n); }; Buffer.ptr.prototype.Grow = function(n) { var b, m, n; b = this; if (n < 0) { $panic(new $String("bytes.Buffer.Grow: negative count")); } m = b.grow(n); b.buf = $subslice(b.buf, 0, m); }; Buffer.prototype.Grow = function(n) { return this.$val.Grow(n); }; Buffer.ptr.prototype.Write = function(p) { var _tmp, _tmp$1, _tuple, b, err, m, n, ok, p; n = 0; err = $ifaceNil; b = this; b.lastRead = 0; _tuple = b.tryGrowByReslice(p.$length); m = _tuple[0]; ok = _tuple[1]; if (!ok) { m = b.grow(p.$length); } _tmp = $copySlice($subslice(b.buf, m), p); _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; }; Buffer.prototype.Write = function(p) { return this.$val.Write(p); }; Buffer.ptr.prototype.WriteString = function(s) { var _tmp, _tmp$1, _tuple, b, err, m, n, ok, s; n = 0; err = $ifaceNil; b = this; b.lastRead = 0; _tuple = b.tryGrowByReslice(s.length); m = _tuple[0]; ok = _tuple[1]; if (!ok) { m = b.grow(s.length); } _tmp = $copyString($subslice(b.buf, m), s); _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; }; Buffer.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Buffer.ptr.prototype.ReadFrom = function(r) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, i, m, n, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; i = $f.i; m = $f.m; n = $f.n; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; b = this; b.lastRead = 0; /* while (true) { */ case 1: i = b.grow(512); b.buf = $subslice(b.buf, 0, i); _r = r.Read($subslice(b.buf, i, b.buf.$capacity)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = _tuple[0]; e = _tuple[1]; if (m < 0) { $panic(errNegativeRead); } b.buf = $subslice(b.buf, 0, (i + m >> 0)); n = (x = (new $Int64(0, m)), new $Int64(n.$high + x.$high, n.$low + x.$low)); if ($interfaceIsEqual(e, io.EOF)) { _tmp = n; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp$2 = n; _tmp$3 = e; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* } */ $s = 1; continue; case 2: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.ReadFrom }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.i = i; $f.m = m; $f.n = n; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; makeSlice = function(n) { var n, $deferred; /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); $deferred.push([(function() { if (!($interfaceIsEqual($recover(), $ifaceNil))) { $panic($pkg.ErrTooLarge); } }), []]); return $makeSlice(sliceType, n); /* */ } catch(err) { $err = err; return sliceType.nil; } finally { $callDeferred($deferred, $err); } }; Buffer.ptr.prototype.WriteTo = function(w) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, e, err, m, n, nBytes, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; n = $f.n; nBytes = $f.nBytes; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; b = this; b.lastRead = 0; nBytes = b.Len(); /* */ if (nBytes > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (nBytes > 0) { */ case 1: _r = w.Write($subslice(b.buf, b.off)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = _tuple[0]; e = _tuple[1]; if (m > nBytes) { $panic(new $String("bytes.Buffer.WriteTo: invalid Write count")); } b.off = b.off + (m) >> 0; n = (new $Int64(0, m)); if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp = n; _tmp$1 = e; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if (!((m === nBytes))) { _tmp$2 = n; _tmp$3 = io.ErrShortWrite; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* } */ case 2: b.Reset(); _tmp$4 = n; _tmp$5 = $ifaceNil; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteTo }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.n = n; $f.nBytes = nBytes; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Buffer.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; Buffer.ptr.prototype.WriteByte = function(c) { var _tuple, b, c, m, ok, x; b = this; b.lastRead = 0; _tuple = b.tryGrowByReslice(1); m = _tuple[0]; ok = _tuple[1]; if (!ok) { m = b.grow(1); } (x = b.buf, ((m < 0 || m >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + m] = c)); return $ifaceNil; }; Buffer.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; Buffer.ptr.prototype.WriteRune = function(r) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, err, m, n, ok, r; n = 0; err = $ifaceNil; b = this; if (r < 128) { b.WriteByte(((r << 24 >>> 24))); _tmp = 1; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; } b.lastRead = 0; _tuple = b.tryGrowByReslice(4); m = _tuple[0]; ok = _tuple[1]; if (!ok) { m = b.grow(4); } n = utf8.EncodeRune($subslice(b.buf, m, (m + 4 >> 0)), r); b.buf = $subslice(b.buf, 0, (m + n >> 0)); _tmp$2 = n; _tmp$3 = $ifaceNil; n = _tmp$2; err = _tmp$3; return [n, err]; }; Buffer.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; Buffer.ptr.prototype.Read = function(p) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, err, n, p; n = 0; err = $ifaceNil; b = this; b.lastRead = 0; if (b.empty()) { b.Reset(); if (p.$length === 0) { _tmp = 0; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; } _tmp$2 = 0; _tmp$3 = io.EOF; n = _tmp$2; err = _tmp$3; return [n, err]; } n = $copySlice(p, $subslice(b.buf, b.off)); b.off = b.off + (n) >> 0; if (n > 0) { b.lastRead = -1; } _tmp$4 = n; _tmp$5 = $ifaceNil; n = _tmp$4; err = _tmp$5; return [n, err]; }; Buffer.prototype.Read = function(p) { return this.$val.Read(p); }; Buffer.ptr.prototype.Next = function(n) { var b, data, m, n; b = this; b.lastRead = 0; m = b.Len(); if (n > m) { n = m; } data = $subslice(b.buf, b.off, (b.off + n >> 0)); b.off = b.off + (n) >> 0; if (n > 0) { b.lastRead = -1; } return data; }; Buffer.prototype.Next = function(n) { return this.$val.Next(n); }; Buffer.ptr.prototype.ReadByte = function() { var b, c, x, x$1; b = this; if (b.empty()) { b.Reset(); return [0, io.EOF]; } c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); b.off = b.off + (1) >> 0; b.lastRead = -1; return [c, $ifaceNil]; }; Buffer.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Buffer.ptr.prototype.ReadRune = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, b, c, err, n, r, size, x, x$1; r = 0; size = 0; err = $ifaceNil; b = this; if (b.empty()) { b.Reset(); _tmp = 0; _tmp$1 = 0; _tmp$2 = io.EOF; r = _tmp; size = _tmp$1; err = _tmp$2; return [r, size, err]; } c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); if (c < 128) { b.off = b.off + (1) >> 0; b.lastRead = 1; _tmp$3 = ((c >> 0)); _tmp$4 = 1; _tmp$5 = $ifaceNil; r = _tmp$3; size = _tmp$4; err = _tmp$5; return [r, size, err]; } _tuple = utf8.DecodeRune($subslice(b.buf, b.off)); r = _tuple[0]; n = _tuple[1]; b.off = b.off + (n) >> 0; b.lastRead = ((n << 24 >> 24)); _tmp$6 = r; _tmp$7 = n; _tmp$8 = $ifaceNil; r = _tmp$6; size = _tmp$7; err = _tmp$8; return [r, size, err]; }; Buffer.prototype.ReadRune = function() { return this.$val.ReadRune(); }; Buffer.ptr.prototype.UnreadRune = function() { var b; b = this; if (b.lastRead <= 0) { return errors.New("bytes.Buffer: UnreadRune: previous operation was not a successful ReadRune"); } if (b.off >= ((b.lastRead >> 0))) { b.off = b.off - (((b.lastRead >> 0))) >> 0; } b.lastRead = 0; return $ifaceNil; }; Buffer.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; Buffer.ptr.prototype.UnreadByte = function() { var b; b = this; if (b.lastRead === 0) { return errors.New("bytes.Buffer: UnreadByte: previous operation was not a successful read"); } b.lastRead = 0; if (b.off > 0) { b.off = b.off - (1) >> 0; } return $ifaceNil; }; Buffer.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; Buffer.ptr.prototype.ReadBytes = function(delim) { var _tmp, _tmp$1, _tuple, b, delim, err, line, slice; line = sliceType.nil; err = $ifaceNil; b = this; _tuple = b.readSlice(delim); slice = _tuple[0]; err = _tuple[1]; line = $appendSlice(line, slice); _tmp = line; _tmp$1 = err; line = _tmp; err = _tmp$1; return [line, err]; }; Buffer.prototype.ReadBytes = function(delim) { return this.$val.ReadBytes(delim); }; Buffer.ptr.prototype.readSlice = function(delim) { var _tmp, _tmp$1, b, delim, end, err, i, line; line = sliceType.nil; err = $ifaceNil; b = this; i = IndexByte($subslice(b.buf, b.off), delim); end = (b.off + i >> 0) + 1 >> 0; if (i < 0) { end = b.buf.$length; err = io.EOF; } line = $subslice(b.buf, b.off, end); b.off = end; b.lastRead = -1; _tmp = line; _tmp$1 = err; line = _tmp; err = _tmp$1; return [line, err]; }; Buffer.prototype.readSlice = function(delim) { return this.$val.readSlice(delim); }; Buffer.ptr.prototype.ReadString = function(delim) { var _tmp, _tmp$1, _tuple, b, delim, err, line, slice; line = ""; err = $ifaceNil; b = this; _tuple = b.readSlice(delim); slice = _tuple[0]; err = _tuple[1]; _tmp = ($bytesToString(slice)); _tmp$1 = err; line = _tmp; err = _tmp$1; return [line, err]; }; Buffer.prototype.ReadString = function(delim) { return this.$val.ReadString(delim); }; ptrType.methods = [{prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "empty", name: "empty", pkg: "bytes", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "tryGrowByReslice", name: "tryGrowByReslice", pkg: "bytes", typ: $funcType([$Int], [$Int, $Bool], false)}, {prop: "grow", name: "grow", pkg: "bytes", typ: $funcType([$Int], [$Int], false)}, {prop: "Grow", name: "Grow", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadBytes", name: "ReadBytes", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "readSlice", name: "readSlice", pkg: "bytes", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadString", name: "ReadString", pkg: "", typ: $funcType([$Uint8], [$String, $error], false)}]; Buffer.init("bytes", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "off", name: "off", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bootstrap", name: "bootstrap", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "lastRead", name: "lastRead", embedded: false, exported: false, typ: readOp, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytealg.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrTooLarge = errors.New("bytes.Buffer: too large"); errNegativeRead = errors.New("bytes.Buffer: reader returned negative count from Read"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["bufio"] = (function() { var $pkg = {}, $init, bytes, errors, io, utf8, Reader, Writer, sliceType, ptrType, sliceType$1, ptrType$1, errNegativeRead, errNegativeWrite, NewReaderSize, NewReader, NewWriterSize; bytes = $packages["bytes"]; errors = $packages["errors"]; io = $packages["io"]; utf8 = $packages["unicode/utf8"]; Reader = $pkg.Reader = $newType(0, $kindStruct, "bufio.Reader", true, "bufio", true, function(buf_, rd_, r_, w_, err_, lastByte_, lastRuneSize_) { this.$val = this; if (arguments.length === 0) { this.buf = sliceType.nil; this.rd = $ifaceNil; this.r = 0; this.w = 0; this.err = $ifaceNil; this.lastByte = 0; this.lastRuneSize = 0; return; } this.buf = buf_; this.rd = rd_; this.r = r_; this.w = w_; this.err = err_; this.lastByte = lastByte_; this.lastRuneSize = lastRuneSize_; }); Writer = $pkg.Writer = $newType(0, $kindStruct, "bufio.Writer", true, "bufio", true, function(err_, buf_, n_, wr_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; this.buf = sliceType.nil; this.n = 0; this.wr = $ifaceNil; return; } this.err = err_; this.buf = buf_; this.n = n_; this.wr = wr_; }); sliceType = $sliceType($Uint8); ptrType = $ptrType(Reader); sliceType$1 = $sliceType(sliceType); ptrType$1 = $ptrType(Writer); NewReaderSize = function(rd, size) { var _tuple, b, ok, r, rd, size; _tuple = $assertType(rd, ptrType, true); b = _tuple[0]; ok = _tuple[1]; if (ok && b.buf.$length >= size) { return b; } if (size < 16) { size = 16; } r = new Reader.ptr(sliceType.nil, $ifaceNil, 0, 0, $ifaceNil, 0, 0); r.reset($makeSlice(sliceType, size), rd); return r; }; $pkg.NewReaderSize = NewReaderSize; NewReader = function(rd) { var rd; return NewReaderSize(rd, 4096); }; $pkg.NewReader = NewReader; Reader.ptr.prototype.Size = function() { var r; r = this; return r.buf.$length; }; Reader.prototype.Size = function() { return this.$val.Size(); }; Reader.ptr.prototype.Reset = function(r) { var b, r; b = this; b.reset(b.buf, r); }; Reader.prototype.Reset = function(r) { return this.$val.Reset(r); }; Reader.ptr.prototype.reset = function(buf, r) { var b, buf, r; b = this; Reader.copy(b, new Reader.ptr(buf, r, 0, 0, $ifaceNil, -1, -1)); }; Reader.prototype.reset = function(buf, r) { return this.$val.reset(buf, r); }; Reader.ptr.prototype.fill = function() { var _r, _tuple, b, err, i, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; i = $f.i; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (b.r > 0) { $copySlice(b.buf, $subslice(b.buf, b.r, b.w)); b.w = b.w - (b.r) >> 0; b.r = 0; } if (b.w >= b.buf.$length) { $panic(new $String("bufio: tried to fill full buffer")); } i = 100; /* while (true) { */ case 1: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 2; continue; } _r = b.rd.Read($subslice(b.buf, b.w)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (n < 0) { $panic(errNegativeRead); } b.w = b.w + (n) >> 0; if (!($interfaceIsEqual(err, $ifaceNil))) { b.err = err; $s = -1; return; } if (n > 0) { $s = -1; return; } i = i - (1) >> 0; /* } */ $s = 1; continue; case 2: b.err = io.ErrNoProgress; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.fill }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.i = i; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.fill = function() { return this.$val.fill(); }; Reader.ptr.prototype.readErr = function() { var b, err; b = this; err = b.err; b.err = $ifaceNil; return err; }; Reader.prototype.readErr = function() { return this.$val.readErr(); }; Reader.ptr.prototype.Peek = function(n) { var avail, b, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; avail = $f.avail; b = $f.b; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (n < 0) { $s = -1; return [sliceType.nil, $pkg.ErrNegativeCount]; } /* while (true) { */ case 1: /* if (!((b.w - b.r >> 0) < n && (b.w - b.r >> 0) < b.buf.$length && $interfaceIsEqual(b.err, $ifaceNil))) { break; } */ if(!((b.w - b.r >> 0) < n && (b.w - b.r >> 0) < b.buf.$length && $interfaceIsEqual(b.err, $ifaceNil))) { $s = 2; continue; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: if (n > b.buf.$length) { $s = -1; return [$subslice(b.buf, b.r, b.w), $pkg.ErrBufferFull]; } err = $ifaceNil; avail = b.w - b.r >> 0; if (avail < n) { n = avail; err = b.readErr(); if ($interfaceIsEqual(err, $ifaceNil)) { err = $pkg.ErrBufferFull; } } $s = -1; return [$subslice(b.buf, b.r, (b.r + n >> 0)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Peek }; } $f.avail = avail; $f.b = b; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Peek = function(n) { return this.$val.Peek(n); }; Reader.ptr.prototype.Discard = function(n) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, discarded, err, n, remain, skip, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; b = $f.b; discarded = $f.discarded; err = $f.err; n = $f.n; remain = $f.remain; skip = $f.skip; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: discarded = 0; err = $ifaceNil; b = this; if (n < 0) { _tmp = 0; _tmp$1 = $pkg.ErrNegativeCount; discarded = _tmp; err = _tmp$1; $s = -1; return [discarded, err]; } if (n === 0) { $s = -1; return [discarded, err]; } remain = n; /* while (true) { */ case 1: skip = b.Buffered(); /* */ if (skip === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (skip === 0) { */ case 3: $r = b.fill(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } skip = b.Buffered(); /* } */ case 4: if (skip > remain) { skip = remain; } b.r = b.r + (skip) >> 0; remain = remain - (skip) >> 0; if (remain === 0) { _tmp$2 = n; _tmp$3 = $ifaceNil; discarded = _tmp$2; err = _tmp$3; $s = -1; return [discarded, err]; } if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$4 = n - remain >> 0; _tmp$5 = b.readErr(); discarded = _tmp$4; err = _tmp$5; $s = -1; return [discarded, err]; } /* } */ $s = 1; continue; case 2: $s = -1; return [discarded, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Discard }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f.b = b; $f.discarded = discarded; $f.err = err; $f.n = n; $f.remain = remain; $f.skip = skip; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Discard = function(n) { return this.$val.Discard(n); }; Reader.ptr.prototype.Read = function(p) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, b, err, n, p, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; err = $f.err; n = $f.n; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; b = this; n = p.$length; if (n === 0) { _tmp = 0; _tmp$1 = b.readErr(); n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* */ if (b.r === b.w) { $s = 1; continue; } /* */ $s = 2; continue; /* if (b.r === b.w) { */ case 1: if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$2 = 0; _tmp$3 = b.readErr(); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* */ if (p.$length >= b.buf.$length) { $s = 3; continue; } /* */ $s = 4; continue; /* if (p.$length >= b.buf.$length) { */ case 3: _r = b.rd.Read(p); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; b.err = _tuple[1]; if (n < 0) { $panic(errNegativeRead); } if (n > 0) { b.lastByte = (((x = n - 1 >> 0, ((x < 0 || x >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + x])) >> 0)); b.lastRuneSize = -1; } _tmp$4 = n; _tmp$5 = b.readErr(); n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* } */ case 4: b.r = 0; b.w = 0; _r$1 = b.rd.Read(b.buf); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; b.err = _tuple$1[1]; if (n < 0) { $panic(errNegativeRead); } if (n === 0) { _tmp$6 = 0; _tmp$7 = b.readErr(); n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; } b.w = b.w + (n) >> 0; /* } */ case 2: n = $copySlice(p, $subslice(b.buf, b.r, b.w)); b.r = b.r + (n) >> 0; b.lastByte = (((x$1 = b.buf, x$2 = b.r - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])) >> 0)); b.lastRuneSize = -1; _tmp$8 = n; _tmp$9 = $ifaceNil; n = _tmp$8; err = _tmp$9; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.err = err; $f.n = n; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.Read = function(p) { return this.$val.Read(p); }; Reader.ptr.prototype.ReadByte = function() { var b, c, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; c = $f.c; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; b.lastRuneSize = -1; /* while (true) { */ case 1: /* if (!(b.r === b.w)) { break; } */ if(!(b.r === b.w)) { $s = 2; continue; } if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return [0, b.readErr()]; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: c = (x = b.buf, x$1 = b.r, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); b.r = b.r + (1) >> 0; b.lastByte = ((c >> 0)); $s = -1; return [c, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadByte }; } $f.b = b; $f.c = c; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Reader.ptr.prototype.UnreadByte = function() { var b, x, x$1; b = this; if (b.lastByte < 0 || (b.r === 0) && b.w > 0) { return $pkg.ErrInvalidUnreadByte; } if (b.r > 0) { b.r = b.r - (1) >> 0; } else { b.w = 1; } (x = b.buf, x$1 = b.r, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = ((b.lastByte << 24 >>> 24)))); b.lastByte = -1; b.lastRuneSize = -1; return $ifaceNil; }; Reader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; Reader.ptr.prototype.ReadRune = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, b, err, r, size, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; b = $f.b; err = $f.err; r = $f.r; size = $f.size; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = 0; size = 0; err = $ifaceNil; b = this; /* while (true) { */ case 1: /* if (!((b.r + 4 >> 0) > b.w && !utf8.FullRune($subslice(b.buf, b.r, b.w)) && $interfaceIsEqual(b.err, $ifaceNil) && (b.w - b.r >> 0) < b.buf.$length)) { break; } */ if(!((b.r + 4 >> 0) > b.w && !utf8.FullRune($subslice(b.buf, b.r, b.w)) && $interfaceIsEqual(b.err, $ifaceNil) && (b.w - b.r >> 0) < b.buf.$length)) { $s = 2; continue; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: b.lastRuneSize = -1; if (b.r === b.w) { _tmp = 0; _tmp$1 = 0; _tmp$2 = b.readErr(); r = _tmp; size = _tmp$1; err = _tmp$2; $s = -1; return [r, size, err]; } _tmp$3 = (((x = b.buf, x$1 = b.r, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >> 0)); _tmp$4 = 1; r = _tmp$3; size = _tmp$4; if (r >= 128) { _tuple = utf8.DecodeRune($subslice(b.buf, b.r, b.w)); r = _tuple[0]; size = _tuple[1]; } b.r = b.r + (size) >> 0; b.lastByte = (((x$2 = b.buf, x$3 = b.r - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])) >> 0)); b.lastRuneSize = size; _tmp$5 = r; _tmp$6 = size; _tmp$7 = $ifaceNil; r = _tmp$5; size = _tmp$6; err = _tmp$7; $s = -1; return [r, size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadRune }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.r = r; $f.size = size; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadRune = function() { return this.$val.ReadRune(); }; Reader.ptr.prototype.UnreadRune = function() { var b; b = this; if (b.lastRuneSize < 0 || b.r < b.lastRuneSize) { return $pkg.ErrInvalidUnreadRune; } b.r = b.r - (b.lastRuneSize) >> 0; b.lastByte = -1; b.lastRuneSize = -1; return $ifaceNil; }; Reader.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; Reader.ptr.prototype.Buffered = function() { var b; b = this; return b.w - b.r >> 0; }; Reader.prototype.Buffered = function() { return this.$val.Buffered(); }; Reader.ptr.prototype.ReadSlice = function(delim) { var b, delim, err, i, i$1, line, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; b = $f.b; delim = $f.delim; err = $f.err; i = $f.i; i$1 = $f.i$1; line = $f.line; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: line = sliceType.nil; err = $ifaceNil; b = this; /* while (true) { */ case 1: i = bytes.IndexByte($subslice(b.buf, b.r, b.w), delim); if (i >= 0) { line = $subslice(b.buf, b.r, ((b.r + i >> 0) + 1 >> 0)); b.r = b.r + ((i + 1 >> 0)) >> 0; /* break; */ $s = 2; continue; } if (!($interfaceIsEqual(b.err, $ifaceNil))) { line = $subslice(b.buf, b.r, b.w); b.r = b.w; err = b.readErr(); /* break; */ $s = 2; continue; } if (b.Buffered() >= b.buf.$length) { b.r = b.w; line = b.buf; err = $pkg.ErrBufferFull; /* break; */ $s = 2; continue; } $r = b.fill(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: i$1 = line.$length - 1 >> 0; if (i$1 >= 0) { b.lastByte = ((((i$1 < 0 || i$1 >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + i$1]) >> 0)); b.lastRuneSize = -1; } $s = -1; return [line, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadSlice }; } $f.b = b; $f.delim = delim; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.line = line; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadSlice = function(delim) { return this.$val.ReadSlice(delim); }; Reader.ptr.prototype.ReadLine = function() { var _r, _tmp, _tmp$1, _tmp$2, _tuple, b, drop, err, isPrefix, line, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; b = $f.b; drop = $f.drop; err = $f.err; isPrefix = $f.isPrefix; line = $f.line; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: line = sliceType.nil; isPrefix = false; err = $ifaceNil; b = this; _r = b.ReadSlice(10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; line = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $pkg.ErrBufferFull)) { if (line.$length > 0 && ((x = line.$length - 1 >> 0, ((x < 0 || x >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + x])) === 13)) { if (b.r === 0) { $panic(new $String("bufio: tried to rewind past start of buffer")); } b.r = b.r - (1) >> 0; line = $subslice(line, 0, (line.$length - 1 >> 0)); } _tmp = line; _tmp$1 = true; _tmp$2 = $ifaceNil; line = _tmp; isPrefix = _tmp$1; err = _tmp$2; $s = -1; return [line, isPrefix, err]; } if (line.$length === 0) { if (!($interfaceIsEqual(err, $ifaceNil))) { line = sliceType.nil; } $s = -1; return [line, isPrefix, err]; } err = $ifaceNil; if ((x$1 = line.$length - 1 >> 0, ((x$1 < 0 || x$1 >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + x$1])) === 10) { drop = 1; if (line.$length > 1 && ((x$2 = line.$length - 2 >> 0, ((x$2 < 0 || x$2 >= line.$length) ? ($throwRuntimeError("index out of range"), undefined) : line.$array[line.$offset + x$2])) === 13)) { drop = 2; } line = $subslice(line, 0, (line.$length - drop >> 0)); } $s = -1; return [line, isPrefix, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadLine }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.b = b; $f.drop = drop; $f.err = err; $f.isPrefix = isPrefix; $f.line = line; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadLine = function() { return this.$val.ReadLine(); }; Reader.ptr.prototype.ReadBytes = function(delim) { var _i, _i$1, _r, _ref, _ref$1, _tuple, b, buf, buf$1, delim, e, err, frag, full, i, i$1, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; b = $f.b; buf = $f.buf; buf$1 = $f.buf$1; delim = $f.delim; e = $f.e; err = $f.err; frag = $f.frag; full = $f.full; i = $f.i; i$1 = $f.i$1; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; frag = sliceType.nil; full = sliceType$1.nil; err = $ifaceNil; /* while (true) { */ case 1: e = $ifaceNil; _r = b.ReadSlice(delim); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; frag = _tuple[0]; e = _tuple[1]; if ($interfaceIsEqual(e, $ifaceNil)) { /* break; */ $s = 2; continue; } if (!($interfaceIsEqual(e, $pkg.ErrBufferFull))) { err = e; /* break; */ $s = 2; continue; } buf = $makeSlice(sliceType, frag.$length); $copySlice(buf, frag); full = $append(full, buf); /* } */ $s = 1; continue; case 2: n = 0; _ref = full; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; n = n + (((i < 0 || i >= full.$length) ? ($throwRuntimeError("index out of range"), undefined) : full.$array[full.$offset + i]).$length) >> 0; _i++; } n = n + (frag.$length) >> 0; buf$1 = $makeSlice(sliceType, n); n = 0; _ref$1 = full; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; n = n + ($copySlice($subslice(buf$1, n), ((i$1 < 0 || i$1 >= full.$length) ? ($throwRuntimeError("index out of range"), undefined) : full.$array[full.$offset + i$1]))) >> 0; _i$1++; } $copySlice($subslice(buf$1, n), frag); $s = -1; return [buf$1, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadBytes }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.b = b; $f.buf = buf; $f.buf$1 = buf$1; $f.delim = delim; $f.e = e; $f.err = err; $f.frag = frag; $f.full = full; $f.i = i; $f.i$1 = i$1; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadBytes = function(delim) { return this.$val.ReadBytes(delim); }; Reader.ptr.prototype.ReadString = function(delim) { var _r, _tuple, b, bytes$1, delim, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; bytes$1 = $f.bytes$1; delim = $f.delim; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r = b.ReadBytes(delim); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; bytes$1 = _tuple[0]; err = _tuple[1]; $s = -1; return [($bytesToString(bytes$1)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.ReadString }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.bytes$1 = bytes$1; $f.delim = delim; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.ReadString = function(delim) { return this.$val.ReadString(delim); }; Reader.ptr.prototype.WriteTo = function(w) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, b, err, err$1, err$2, err$3, m, m$1, m$2, n, ok, ok$1, r, w, w$1, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; b = $f.b; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; m = $f.m; m$1 = $f.m$1; m$2 = $f.m$2; n = $f.n; ok = $f.ok; ok$1 = $f.ok$1; r = $f.r; w = $f.w; w$1 = $f.w$1; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; b = this; _r = b.writeBuf(w); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [n, err]; } _tuple$1 = $assertType(b.rd, io.WriterTo, true); r = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = r.WriteTo(w); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; m = _tuple$2[0]; err$1 = _tuple$2[1]; n = (x = m, new $Int64(n.$high + x.$high, n.$low + x.$low)); _tmp = n; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* } */ case 3: _tuple$3 = $assertType(w, io.ReaderFrom, true); w$1 = _tuple$3[0]; ok$1 = _tuple$3[1]; /* */ if (ok$1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok$1) { */ case 5: _r$2 = w$1.ReadFrom(b.rd); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$4 = _r$2; m$1 = _tuple$4[0]; err$2 = _tuple$4[1]; n = (x$1 = m$1, new $Int64(n.$high + x$1.$high, n.$low + x$1.$low)); _tmp$2 = n; _tmp$3 = err$2; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* } */ case 6: /* */ if ((b.w - b.r >> 0) < b.buf.$length) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((b.w - b.r >> 0) < b.buf.$length) { */ case 8: $r = b.fill(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: /* while (true) { */ case 11: /* if (!(b.r < b.w)) { break; } */ if(!(b.r < b.w)) { $s = 12; continue; } _r$3 = b.writeBuf(w); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$5 = _r$3; m$2 = _tuple$5[0]; err$3 = _tuple$5[1]; n = (x$2 = m$2, new $Int64(n.$high + x$2.$high, n.$low + x$2.$low)); if (!($interfaceIsEqual(err$3, $ifaceNil))) { _tmp$4 = n; _tmp$5 = err$3; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } $r = b.fill(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 11; continue; case 12: if ($interfaceIsEqual(b.err, io.EOF)) { b.err = $ifaceNil; } _tmp$6 = n; _tmp$7 = b.readErr(); n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.b = b; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.m = m; $f.m$1 = m$1; $f.m$2 = m$2; $f.n = n; $f.ok = ok; $f.ok$1 = ok$1; $f.r = r; $f.w = w; $f.w$1 = w$1; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; Reader.ptr.prototype.writeBuf = function(w) { var _r, _tuple, b, err, n, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; _r = w.Write($subslice(b.buf, b.r, b.w)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (n < 0) { $panic(errNegativeWrite); } b.r = b.r + (n) >> 0; $s = -1; return [(new $Int64(0, n)), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.writeBuf }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.writeBuf = function(w) { return this.$val.writeBuf(w); }; NewWriterSize = function(w, size) { var _tuple, b, ok, size, w; _tuple = $assertType(w, ptrType$1, true); b = _tuple[0]; ok = _tuple[1]; if (ok && b.buf.$length >= size) { return b; } if (size <= 0) { size = 4096; } return new Writer.ptr($ifaceNil, $makeSlice(sliceType, size), 0, w); }; $pkg.NewWriterSize = NewWriterSize; Writer.ptr.prototype.Size = function() { var b; b = this; return b.buf.$length; }; Writer.prototype.Size = function() { return this.$val.Size(); }; Writer.ptr.prototype.Reset = function(w) { var b, w; b = this; b.err = $ifaceNil; b.n = 0; b.wr = w; }; Writer.prototype.Reset = function(w) { return this.$val.Reset(w); }; Writer.ptr.prototype.Flush = function() { var _r, _tuple, b, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return b.err; } if (b.n === 0) { $s = -1; return $ifaceNil; } _r = b.wr.Write($subslice(b.buf, 0, b.n)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (n < b.n && $interfaceIsEqual(err, $ifaceNil)) { err = io.ErrShortWrite; } if (!($interfaceIsEqual(err, $ifaceNil))) { if (n > 0 && n < b.n) { $copySlice($subslice(b.buf, 0, (b.n - n >> 0)), $subslice(b.buf, n, b.n)); } b.n = b.n - (n) >> 0; b.err = err; $s = -1; return err; } b.n = 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.Flush }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.Flush = function() { return this.$val.Flush(); }; Writer.ptr.prototype.Available = function() { var b; b = this; return b.buf.$length - b.n >> 0; }; Writer.prototype.Available = function() { return this.$val.Available(); }; Writer.ptr.prototype.Buffered = function() { var b; b = this; return b.n; }; Writer.prototype.Buffered = function() { return this.$val.Buffered(); }; Writer.ptr.prototype.Write = function(p) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, err, n, n$1, nn, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; n$1 = $f.n$1; nn = $f.nn; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: nn = 0; err = $ifaceNil; b = this; /* while (true) { */ case 1: /* if (!(p.$length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { break; } */ if(!(p.$length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { $s = 2; continue; } n = 0; /* */ if (b.Buffered() === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (b.Buffered() === 0) { */ case 3: _r = b.wr.Write(p); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; b.err = _tuple[1]; $s = 5; continue; /* } else { */ case 4: n = $copySlice($subslice(b.buf, b.n), p); b.n = b.n + (n) >> 0; _r$1 = b.Flush(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 5: nn = nn + (n) >> 0; p = $subslice(p, n); /* } */ $s = 1; continue; case 2: if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp = nn; _tmp$1 = b.err; nn = _tmp; err = _tmp$1; $s = -1; return [nn, err]; } n$1 = $copySlice($subslice(b.buf, b.n), p); b.n = b.n + (n$1) >> 0; nn = nn + (n$1) >> 0; _tmp$2 = nn; _tmp$3 = $ifaceNil; nn = _tmp$2; err = _tmp$3; $s = -1; return [nn, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.Write }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.Write = function(p) { return this.$val.Write(p); }; Writer.ptr.prototype.WriteByte = function(c) { var _r, _v, b, c, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _v = $f._v; b = $f.b; c = $f.c; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return b.err; } if (!(b.Available() <= 0)) { _v = false; $s = 3; continue s; } _r = b.Flush(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = !($interfaceIsEqual(_r, $ifaceNil)); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return b.err; /* } */ case 2: (x = b.buf, x$1 = b.n, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = c)); b.n = b.n + (1) >> 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.WriteByte }; } $f._r = _r; $f._v = _v; $f.b = b; $f.c = c; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; Writer.ptr.prototype.WriteRune = function(r) { var _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, b, err, n, r, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; r = $f.r; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: size = 0; err = $ifaceNil; b = this; /* */ if (r < 128) { $s = 1; continue; } /* */ $s = 2; continue; /* if (r < 128) { */ case 1: _r = b.WriteByte(((r << 24 >>> 24))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = 0; _tmp$1 = err; size = _tmp; err = _tmp$1; $s = -1; return [size, err]; } _tmp$2 = 1; _tmp$3 = $ifaceNil; size = _tmp$2; err = _tmp$3; $s = -1; return [size, err]; /* } */ case 2: if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = b.err; size = _tmp$4; err = _tmp$5; $s = -1; return [size, err]; } n = b.Available(); /* */ if (n < 4) { $s = 4; continue; } /* */ $s = 5; continue; /* if (n < 4) { */ case 4: _r$1 = b.Flush(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; if (!($interfaceIsEqual(b.err, $ifaceNil))) { _tmp$6 = 0; _tmp$7 = b.err; size = _tmp$6; err = _tmp$7; $s = -1; return [size, err]; } n = b.Available(); /* */ if (n < 4) { $s = 7; continue; } /* */ $s = 8; continue; /* if (n < 4) { */ case 7: _r$2 = b.WriteString(($encodeRune(r))); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; size = _tuple[0]; err = _tuple[1]; $s = -1; return [size, err]; /* } */ case 8: /* } */ case 5: size = utf8.EncodeRune($subslice(b.buf, b.n), r); b.n = b.n + (size) >> 0; _tmp$8 = size; _tmp$9 = $ifaceNil; size = _tmp$8; err = _tmp$9; $s = -1; return [size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.WriteRune }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.r = r; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; Writer.ptr.prototype.WriteString = function(s) { var _r, b, n, n$1, nn, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; n = $f.n; n$1 = $f.n$1; nn = $f.nn; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = this; nn = 0; /* while (true) { */ case 1: /* if (!(s.length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { break; } */ if(!(s.length > b.Available() && $interfaceIsEqual(b.err, $ifaceNil))) { $s = 2; continue; } n = $copyString($subslice(b.buf, b.n), s); b.n = b.n + (n) >> 0; nn = nn + (n) >> 0; s = $substring(s, n); _r = b.Flush(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ $s = 1; continue; case 2: if (!($interfaceIsEqual(b.err, $ifaceNil))) { $s = -1; return [nn, b.err]; } n$1 = $copyString($subslice(b.buf, b.n), s); b.n = b.n + (n$1) >> 0; nn = nn + (n$1) >> 0; $s = -1; return [nn, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.WriteString }; } $f._r = _r; $f.b = b; $f.n = n; $f.n$1 = n$1; $f.nn = nn; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Writer.ptr.prototype.ReadFrom = function(r) { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, b, err, err1, m, n, nr, ok, r, w, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; b = $f.b; err = $f.err; err1 = $f.err1; m = $f.m; n = $f.n; nr = $f.nr; ok = $f.ok; r = $f.r; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; b = this; /* */ if (b.Buffered() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (b.Buffered() === 0) { */ case 1: _tuple = $assertType(b.wr, io.ReaderFrom, true); w = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r = w.ReadFrom(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; n = _tuple$1[0]; err = _tuple$1[1]; $s = -1; return [n, err]; /* } */ case 4: /* } */ case 2: m = 0; /* while (true) { */ case 6: /* */ if (b.Available() === 0) { $s = 8; continue; } /* */ $s = 9; continue; /* if (b.Available() === 0) { */ case 8: _r$1 = b.Flush(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err1 = _r$1; if (!($interfaceIsEqual(err1, $ifaceNil))) { _tmp = n; _tmp$1 = err1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* } */ case 9: nr = 0; /* while (true) { */ case 11: /* if (!(nr < 100)) { break; } */ if(!(nr < 100)) { $s = 12; continue; } _r$2 = r.Read($subslice(b.buf, b.n)); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; m = _tuple$2[0]; err = _tuple$2[1]; if (!((m === 0)) || !($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 12; continue; } nr = nr + (1) >> 0; /* } */ $s = 11; continue; case 12: if (nr === 100) { _tmp$2 = n; _tmp$3 = io.ErrNoProgress; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } b.n = b.n + (m) >> 0; n = (x = (new $Int64(0, m)), new $Int64(n.$high + x.$high, n.$low + x.$low)); if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 7; continue; } /* } */ $s = 6; continue; case 7: /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 14: /* */ if (b.Available() === 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if (b.Available() === 0) { */ case 16: _r$3 = b.Flush(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; $s = 18; continue; /* } else { */ case 17: err = $ifaceNil; /* } */ case 18: /* } */ case 15: _tmp$4 = n; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Writer.ptr.prototype.ReadFrom }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.b = b; $f.err = err; $f.err1 = err1; $f.m = m; $f.n = n; $f.nr = nr; $f.ok = ok; $f.r = r; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Writer.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; ptrType.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Reader], [], false)}, {prop: "reset", name: "reset", pkg: "bufio", typ: $funcType([sliceType, io.Reader], [], false)}, {prop: "fill", name: "fill", pkg: "bufio", typ: $funcType([], [], false)}, {prop: "readErr", name: "readErr", pkg: "bufio", typ: $funcType([], [$error], false)}, {prop: "Peek", name: "Peek", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Discard", name: "Discard", pkg: "", typ: $funcType([$Int], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Buffered", name: "Buffered", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ReadSlice", name: "ReadSlice", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadLine", name: "ReadLine", pkg: "", typ: $funcType([], [sliceType, $Bool, $error], false)}, {prop: "ReadBytes", name: "ReadBytes", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadString", name: "ReadString", pkg: "", typ: $funcType([$Uint8], [$String, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "writeBuf", name: "writeBuf", pkg: "bufio", typ: $funcType([io.Writer], [$Int64, $error], false)}]; ptrType$1.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([io.Writer], [], false)}, {prop: "Flush", name: "Flush", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Available", name: "Available", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Buffered", name: "Buffered", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}]; Reader.init("bufio", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "rd", name: "rd", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "lastByte", name: "lastByte", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "lastRuneSize", name: "lastRuneSize", embedded: false, exported: false, typ: $Int, tag: ""}]); Writer.init("bufio", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "n", name: "n", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "wr", name: "wr", embedded: false, exported: false, typ: io.Writer, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte"); $pkg.ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune"); $pkg.ErrBufferFull = errors.New("bufio: buffer full"); $pkg.ErrNegativeCount = errors.New("bufio: negative count"); errNegativeRead = errors.New("bufio: reader returned negative count from Read"); errNegativeWrite = errors.New("bufio: writer returned negative count from Write"); $pkg.ErrTooLong = errors.New("bufio.Scanner: token too long"); $pkg.ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count"); $pkg.ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input"); $pkg.ErrFinalToken = errors.New("final token"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["math"] = (function() { var $pkg = {}, $init, js, arrayType, arrayType$1, arrayType$2, structType, math, zero, posInf, negInf, nan, buf, Acos, Asin, Atan, Atan2, Ceil, Copysign, Cos, Cosh, Exp, Floor, Frexp, Inf, IsInf, IsNaN, Ldexp, Log, Log10, Mod, Modf, NaN, Pow, Sin, Sinh, Sqrt, Tan, Tanh, init, Float32bits, Float32frombits, Float64bits, Float64frombits, Abs, normalize, frexp, ldexp, log10; js = $packages["github.com/gopherjs/gopherjs/js"]; arrayType = $arrayType($Uint32, 2); arrayType$1 = $arrayType($Float32, 2); arrayType$2 = $arrayType($Float64, 1); structType = $structType("math", [{prop: "uint32array", name: "uint32array", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", embedded: false, exported: false, typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", embedded: false, exported: false, typ: arrayType$2, tag: ""}]); Acos = function(x) { var x; return $parseFloat(math.acos(x)); }; $pkg.Acos = Acos; Asin = function(x) { var x; return $parseFloat(math.asin(x)); }; $pkg.Asin = Asin; Atan = function(x) { var x; return $parseFloat(math.atan(x)); }; $pkg.Atan = Atan; Atan2 = function(y, x) { var x, y; return $parseFloat(math.atan2(y, x)); }; $pkg.Atan2 = Atan2; Ceil = function(x) { var x; return $parseFloat(math.ceil(x)); }; $pkg.Ceil = Ceil; Copysign = function(x, y) { var x, y; if (!((x < 0 || (1 / x === negInf)) === (y < 0 || (1 / y === negInf)))) { return -x; } return x; }; $pkg.Copysign = Copysign; Cos = function(x) { var x; return $parseFloat(math.cos(x)); }; $pkg.Cos = Cos; Cosh = function(x) { var x; return $parseFloat(math.cosh(x)); }; $pkg.Cosh = Cosh; Exp = function(x) { var x; return $parseFloat(math.exp(x)); }; $pkg.Exp = Exp; Floor = function(x) { var x; return $parseFloat(math.floor(x)); }; $pkg.Floor = Floor; Frexp = function(f) { var _tuple, exp$1, f, frac; frac = 0; exp$1 = 0; _tuple = frexp(f); frac = _tuple[0]; exp$1 = _tuple[1]; return [frac, exp$1]; }; $pkg.Frexp = Frexp; Inf = function(sign) { var sign; if (sign >= 0) { return posInf; } else { return negInf; } }; $pkg.Inf = Inf; IsInf = function(f, sign) { var f, sign; if (f === posInf) { return sign >= 0; } if (f === negInf) { return sign <= 0; } return false; }; $pkg.IsInf = IsInf; IsNaN = function(f) { var f, is; is = false; is = !((f === f)); return is; }; $pkg.IsNaN = IsNaN; Ldexp = function(frac, exp$1) { var exp$1, frac; if (-1024 < exp$1 && exp$1 < 1024) { if (frac === 0) { return frac; } return frac * $parseFloat(math.pow(2, exp$1)); } return ldexp(frac, exp$1); }; $pkg.Ldexp = Ldexp; Log = function(x) { var x; if (!((x === x))) { return nan; } return $parseFloat(math.log(x)); }; $pkg.Log = Log; Log10 = function(x) { var x; return log10(x); }; $pkg.Log10 = Log10; Mod = function(x, y) { var x, y; return $parseFloat($mod(x, y)); }; $pkg.Mod = Mod; Modf = function(f) { var f, frac; if ((f === posInf) || (f === negInf)) { return [f, nan]; } if (1 / f === negInf) { return [f, f]; } frac = Mod(f, 1); return [f - frac, frac]; }; $pkg.Modf = Modf; NaN = function() { return nan; }; $pkg.NaN = NaN; Pow = function(x, y) { var x, y; if ((x === 1) || ((x === -1) && ((y === posInf) || (y === negInf)))) { return 1; } return $parseFloat(math.pow(x, y)); }; $pkg.Pow = Pow; Sin = function(x) { var x; return $parseFloat(math.sin(x)); }; $pkg.Sin = Sin; Sinh = function(x) { var x; return $parseFloat(math.sinh(x)); }; $pkg.Sinh = Sinh; Sqrt = function(x) { var x; return $parseFloat(math.sqrt(x)); }; $pkg.Sqrt = Sqrt; Tan = function(x) { var x; return $parseFloat(math.tan(x)); }; $pkg.Tan = Tan; Tanh = function(x) { var x; return $parseFloat(math.tanh(x)); }; $pkg.Tanh = Tanh; init = function() { var ab; ab = new ($global.ArrayBuffer)(8); buf.uint32array = new ($global.Uint32Array)(ab); buf.float32array = new ($global.Float32Array)(ab); buf.float64array = new ($global.Float64Array)(ab); }; Float32bits = function(f) { var f; buf.float32array[0] = f; return buf.uint32array[0]; }; $pkg.Float32bits = Float32bits; Float32frombits = function(b) { var b; buf.uint32array[0] = b; return buf.float32array[0]; }; $pkg.Float32frombits = Float32frombits; Float64bits = function(f) { var f, x, x$1; buf.float64array[0] = f; return (x = $shiftLeft64((new $Uint64(0, buf.uint32array[1])), 32), x$1 = (new $Uint64(0, buf.uint32array[0])), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); }; $pkg.Float64bits = Float64bits; Float64frombits = function(b) { var b; buf.uint32array[0] = ((b.$low >>> 0)); buf.uint32array[1] = (($shiftRightUint64(b, 32).$low >>> 0)); return buf.float64array[0]; }; $pkg.Float64frombits = Float64frombits; Abs = function(x) { var x, x$1; return Float64frombits((x$1 = Float64bits(x), new $Uint64(x$1.$high & ~2147483648, (x$1.$low & ~0) >>> 0))); }; $pkg.Abs = Abs; normalize = function(x) { var _tmp, _tmp$1, _tmp$2, _tmp$3, exp$1, x, y; y = 0; exp$1 = 0; if (Abs(x) < 2.2250738585072014e-308) { _tmp = x * 4.503599627370496e+15; _tmp$1 = -52; y = _tmp; exp$1 = _tmp$1; return [y, exp$1]; } _tmp$2 = x; _tmp$3 = 0; y = _tmp$2; exp$1 = _tmp$3; return [y, exp$1]; }; frexp = function(f) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, exp$1, f, frac, x, x$1, x$2, x$3; frac = 0; exp$1 = 0; if ((f === 0)) { _tmp = f; _tmp$1 = 0; frac = _tmp; exp$1 = _tmp$1; return [frac, exp$1]; } else if (IsInf(f, 0) || IsNaN(f)) { _tmp$2 = f; _tmp$3 = 0; frac = _tmp$2; exp$1 = _tmp$3; return [frac, exp$1]; } _tuple = normalize(f); f = _tuple[0]; exp$1 = _tuple[1]; x = Float64bits(f); exp$1 = exp$1 + ((((((x$1 = $shiftRightUint64(x, 52), new $Uint64(x$1.$high & 0, (x$1.$low & 2047) >>> 0)).$low >> 0)) - 1023 >> 0) + 1 >> 0)) >> 0; x = (x$2 = new $Uint64(2146435072, 0), new $Uint64(x.$high & ~x$2.$high, (x.$low & ~x$2.$low) >>> 0)); x = (x$3 = new $Uint64(1071644672, 0), new $Uint64(x.$high | x$3.$high, (x.$low | x$3.$low) >>> 0)); frac = Float64frombits(x); return [frac, exp$1]; }; ldexp = function(frac, exp$1) { var _tuple, e, exp$1, frac, m, x, x$1, x$2; if ((frac === 0)) { return frac; } else if (IsInf(frac, 0) || IsNaN(frac)) { return frac; } _tuple = normalize(frac); frac = _tuple[0]; e = _tuple[1]; exp$1 = exp$1 + (e) >> 0; x = Float64bits(frac); exp$1 = exp$1 + ((((($shiftRightUint64(x, 52).$low >> 0)) & 2047) - 1023 >> 0)) >> 0; if (exp$1 < -1075) { return Copysign(0, frac); } if (exp$1 > 1023) { if (frac < 0) { return Inf(-1); } return Inf(1); } m = 1; if (exp$1 < -1022) { exp$1 = exp$1 + (53) >> 0; m = 1.1102230246251565e-16; } x = (x$1 = new $Uint64(2146435072, 0), new $Uint64(x.$high & ~x$1.$high, (x.$low & ~x$1.$low) >>> 0)); x = (x$2 = $shiftLeft64((new $Uint64(0, (exp$1 + 1023 >> 0))), 52), new $Uint64(x.$high | x$2.$high, (x.$low | x$2.$low) >>> 0)); return m * Float64frombits(x); }; log10 = function(x) { var x; return Log(x) * 0.4342944819032518; }; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } buf = new structType.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$2.zero()); math = $global.Math; zero = 0; posInf = 1 / zero; negInf = -1 / zero; nan = 0 / zero; init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["syscall"] = (function() { var $pkg = {}, $init, js, race, runtime, sync, SysProcIDMap, SysProcAttr, Credential, ProcAttr, WaitStatus, SockaddrLinklayer, SockaddrNetlink, mmapper, Errno, Signal, Sockaddr, SockaddrInet4, SockaddrInet6, SockaddrUnix, _C_int, Timespec, Timeval, Rusage, Stat_t, RawSockaddrInet4, RawSockaddrInet6, RawSockaddrUnix, RawSockaddrLinklayer, RawSockaddrNetlink, RawSockaddr, RawSockaddrAny, _Socklen, Linger, Iovec, IPMreq, IPMreqn, IPv6Mreq, Msghdr, sliceType, sliceType$1, sliceType$2, ptrType, ptrType$1, sliceType$3, ptrType$2, arrayType, ptrType$3, sliceType$4, ptrType$4, sliceType$5, ptrType$5, ptrType$6, ptrType$7, arrayType$1, ptrType$8, arrayType$2, ptrType$11, arrayType$4, arrayType$5, arrayType$7, ptrType$17, arrayType$8, arrayType$9, arrayType$10, arrayType$11, ptrType$18, ptrType$19, arrayType$13, structType, ptrType$22, sliceType$10, ptrType$24, ptrType$25, mapType, funcType$2, funcType$3, ptrType$26, ptrType$27, ptrType$28, ptrType$29, ptrType$30, ptrType$31, warningPrinted, lineBuffer, syscallModule, alreadyTriedToLoad, minusOne, envOnce, envLock, env, envs, none, slash, zeroProcAttr, zeroProcAttr$24ptr, zeroSysProcAttr, zeroSysProcAttr$24ptr, mapper, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, errors, signals, init, printWarning, printToConsole, Exit, indexByte, runtime_envs, setenv_c, syscall, Syscall, Syscall6, RawSyscall, rawSyscallNoError, RawSyscall6, BytePtrFromString, readInt, readIntBE, readIntLE, ParseDirent, copyenv, Getenv, Setenv, Environ, runtime_BeforeFork, runtime_AfterFork, runtime_AfterForkInChild, forkAndExecInChild, forkAndExecInChild1, forkExecPipe, writeIDMappings, writeSetgroups, writeUidGidMappings, SlicePtrFromStrings, CloseOnExec, SetNonblock, forkExec, StartProcess, msanRead, msanWrite, itoa, uitoa, ByteSliceFromString, Chmod, Fchmodat, Open, Rename, Rmdir, Unlink, Getwd, Wait4, anyToSockaddr, Accept, Accept4, SetsockoptIPMreqn, Recvmsg, SendmsgN, ReadDirent, direntIno, direntReclen, direntNamlen, Stat, Pipe, Pipe2, rawVforkSyscall, errnoErr, Read, Write, GetsockoptInt, Recvfrom, Sendto, SetsockoptByte, SetsockoptInt, SetsockoptInet4Addr, SetsockoptIPMreq, SetsockoptIPv6Mreq, SetsockoptLinger, fchmodat, openat, unlinkat, Getcwd, wait4, Close, Dup, Fchdir, Fchmod, fcntl, Fsync, Getdents, Getpid, Kill, read, Renameat, write, readlen, munmap, Fchown, Fstat, Ftruncate, Lstat, Pread, Pwrite, Seek, Shutdown, accept, accept4, fstatat, getsockopt, setsockopt, recvfrom, sendto, recvmsg, sendmsg, mmap, pipe, pipe2; js = $packages["github.com/gopherjs/gopherjs/js"]; race = $packages["internal/race"]; runtime = $packages["runtime"]; sync = $packages["sync"]; SysProcIDMap = $pkg.SysProcIDMap = $newType(0, $kindStruct, "syscall.SysProcIDMap", true, "syscall", true, function(ContainerID_, HostID_, Size_) { this.$val = this; if (arguments.length === 0) { this.ContainerID = 0; this.HostID = 0; this.Size = 0; return; } this.ContainerID = ContainerID_; this.HostID = HostID_; this.Size = Size_; }); SysProcAttr = $pkg.SysProcAttr = $newType(0, $kindStruct, "syscall.SysProcAttr", true, "syscall", true, function(Chroot_, Credential_, Ptrace_, Setsid_, Setpgid_, Setctty_, Noctty_, Ctty_, Foreground_, Pgid_, Pdeathsig_, Cloneflags_, Unshareflags_, UidMappings_, GidMappings_, GidMappingsEnableSetgroups_, AmbientCaps_) { this.$val = this; if (arguments.length === 0) { this.Chroot = ""; this.Credential = ptrType$1.nil; this.Ptrace = false; this.Setsid = false; this.Setpgid = false; this.Setctty = false; this.Noctty = false; this.Ctty = 0; this.Foreground = false; this.Pgid = 0; this.Pdeathsig = 0; this.Cloneflags = 0; this.Unshareflags = 0; this.UidMappings = sliceType$3.nil; this.GidMappings = sliceType$3.nil; this.GidMappingsEnableSetgroups = false; this.AmbientCaps = sliceType$2.nil; return; } this.Chroot = Chroot_; this.Credential = Credential_; this.Ptrace = Ptrace_; this.Setsid = Setsid_; this.Setpgid = Setpgid_; this.Setctty = Setctty_; this.Noctty = Noctty_; this.Ctty = Ctty_; this.Foreground = Foreground_; this.Pgid = Pgid_; this.Pdeathsig = Pdeathsig_; this.Cloneflags = Cloneflags_; this.Unshareflags = Unshareflags_; this.UidMappings = UidMappings_; this.GidMappings = GidMappings_; this.GidMappingsEnableSetgroups = GidMappingsEnableSetgroups_; this.AmbientCaps = AmbientCaps_; }); Credential = $pkg.Credential = $newType(0, $kindStruct, "syscall.Credential", true, "syscall", true, function(Uid_, Gid_, Groups_, NoSetGroups_) { this.$val = this; if (arguments.length === 0) { this.Uid = 0; this.Gid = 0; this.Groups = sliceType$10.nil; this.NoSetGroups = false; return; } this.Uid = Uid_; this.Gid = Gid_; this.Groups = Groups_; this.NoSetGroups = NoSetGroups_; }); ProcAttr = $pkg.ProcAttr = $newType(0, $kindStruct, "syscall.ProcAttr", true, "syscall", true, function(Dir_, Env_, Files_, Sys_) { this.$val = this; if (arguments.length === 0) { this.Dir = ""; this.Env = sliceType$1.nil; this.Files = sliceType$2.nil; this.Sys = ptrType.nil; return; } this.Dir = Dir_; this.Env = Env_; this.Files = Files_; this.Sys = Sys_; }); WaitStatus = $pkg.WaitStatus = $newType(4, $kindUint32, "syscall.WaitStatus", true, "syscall", true, null); SockaddrLinklayer = $pkg.SockaddrLinklayer = $newType(0, $kindStruct, "syscall.SockaddrLinklayer", true, "syscall", true, function(Protocol_, Ifindex_, Hatype_, Pkttype_, Halen_, Addr_, raw_) { this.$val = this; if (arguments.length === 0) { this.Protocol = 0; this.Ifindex = 0; this.Hatype = 0; this.Pkttype = 0; this.Halen = 0; this.Addr = arrayType$1.zero(); this.raw = new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$1.zero()); return; } this.Protocol = Protocol_; this.Ifindex = Ifindex_; this.Hatype = Hatype_; this.Pkttype = Pkttype_; this.Halen = Halen_; this.Addr = Addr_; this.raw = raw_; }); SockaddrNetlink = $pkg.SockaddrNetlink = $newType(0, $kindStruct, "syscall.SockaddrNetlink", true, "syscall", true, function(Family_, Pad_, Pid_, Groups_, raw_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Pad = 0; this.Pid = 0; this.Groups = 0; this.raw = new RawSockaddrNetlink.ptr(0, 0, 0, 0); return; } this.Family = Family_; this.Pad = Pad_; this.Pid = Pid_; this.Groups = Groups_; this.raw = raw_; }); mmapper = $pkg.mmapper = $newType(0, $kindStruct, "syscall.mmapper", true, "syscall", false, function(Mutex_, active_, mmap_, munmap_) { this.$val = this; if (arguments.length === 0) { this.Mutex = new sync.Mutex.ptr(0, 0); this.active = false; this.mmap = $throwNilPointerError; this.munmap = $throwNilPointerError; return; } this.Mutex = Mutex_; this.active = active_; this.mmap = mmap_; this.munmap = munmap_; }); Errno = $pkg.Errno = $newType(4, $kindUintptr, "syscall.Errno", true, "syscall", true, null); Signal = $pkg.Signal = $newType(4, $kindInt, "syscall.Signal", true, "syscall", true, null); Sockaddr = $pkg.Sockaddr = $newType(8, $kindInterface, "syscall.Sockaddr", true, "syscall", true, null); SockaddrInet4 = $pkg.SockaddrInet4 = $newType(0, $kindStruct, "syscall.SockaddrInet4", true, "syscall", true, function(Port_, Addr_, raw_) { this.$val = this; if (arguments.length === 0) { this.Port = 0; this.Addr = arrayType$9.zero(); this.raw = new RawSockaddrInet4.ptr(0, 0, arrayType$9.zero(), arrayType$1.zero()); return; } this.Port = Port_; this.Addr = Addr_; this.raw = raw_; }); SockaddrInet6 = $pkg.SockaddrInet6 = $newType(0, $kindStruct, "syscall.SockaddrInet6", true, "syscall", true, function(Port_, ZoneId_, Addr_, raw_) { this.$val = this; if (arguments.length === 0) { this.Port = 0; this.ZoneId = 0; this.Addr = arrayType$2.zero(); this.raw = new RawSockaddrInet6.ptr(0, 0, 0, arrayType$2.zero(), 0); return; } this.Port = Port_; this.ZoneId = ZoneId_; this.Addr = Addr_; this.raw = raw_; }); SockaddrUnix = $pkg.SockaddrUnix = $newType(0, $kindStruct, "syscall.SockaddrUnix", true, "syscall", true, function(Name_, raw_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.raw = new RawSockaddrUnix.ptr(0, arrayType$8.zero()); return; } this.Name = Name_; this.raw = raw_; }); _C_int = $pkg._C_int = $newType(4, $kindInt32, "syscall._C_int", true, "syscall", false, null); Timespec = $pkg.Timespec = $newType(0, $kindStruct, "syscall.Timespec", true, "syscall", true, function(Sec_, Nsec_) { this.$val = this; if (arguments.length === 0) { this.Sec = new $Int64(0, 0); this.Nsec = new $Int64(0, 0); return; } this.Sec = Sec_; this.Nsec = Nsec_; }); Timeval = $pkg.Timeval = $newType(0, $kindStruct, "syscall.Timeval", true, "syscall", true, function(Sec_, Usec_) { this.$val = this; if (arguments.length === 0) { this.Sec = new $Int64(0, 0); this.Usec = new $Int64(0, 0); return; } this.Sec = Sec_; this.Usec = Usec_; }); Rusage = $pkg.Rusage = $newType(0, $kindStruct, "syscall.Rusage", true, "syscall", true, function(Utime_, Stime_, Maxrss_, Ixrss_, Idrss_, Isrss_, Minflt_, Majflt_, Nswap_, Inblock_, Oublock_, Msgsnd_, Msgrcv_, Nsignals_, Nvcsw_, Nivcsw_) { this.$val = this; if (arguments.length === 0) { this.Utime = new Timeval.ptr(new $Int64(0, 0), new $Int64(0, 0)); this.Stime = new Timeval.ptr(new $Int64(0, 0), new $Int64(0, 0)); this.Maxrss = new $Int64(0, 0); this.Ixrss = new $Int64(0, 0); this.Idrss = new $Int64(0, 0); this.Isrss = new $Int64(0, 0); this.Minflt = new $Int64(0, 0); this.Majflt = new $Int64(0, 0); this.Nswap = new $Int64(0, 0); this.Inblock = new $Int64(0, 0); this.Oublock = new $Int64(0, 0); this.Msgsnd = new $Int64(0, 0); this.Msgrcv = new $Int64(0, 0); this.Nsignals = new $Int64(0, 0); this.Nvcsw = new $Int64(0, 0); this.Nivcsw = new $Int64(0, 0); return; } this.Utime = Utime_; this.Stime = Stime_; this.Maxrss = Maxrss_; this.Ixrss = Ixrss_; this.Idrss = Idrss_; this.Isrss = Isrss_; this.Minflt = Minflt_; this.Majflt = Majflt_; this.Nswap = Nswap_; this.Inblock = Inblock_; this.Oublock = Oublock_; this.Msgsnd = Msgsnd_; this.Msgrcv = Msgrcv_; this.Nsignals = Nsignals_; this.Nvcsw = Nvcsw_; this.Nivcsw = Nivcsw_; }); Stat_t = $pkg.Stat_t = $newType(0, $kindStruct, "syscall.Stat_t", true, "syscall", true, function(Dev_, Ino_, Nlink_, Mode_, Uid_, Gid_, X__pad0_, Rdev_, Size_, Blksize_, Blocks_, Atim_, Mtim_, Ctim_, X__unused_) { this.$val = this; if (arguments.length === 0) { this.Dev = new $Uint64(0, 0); this.Ino = new $Uint64(0, 0); this.Nlink = new $Uint64(0, 0); this.Mode = 0; this.Uid = 0; this.Gid = 0; this.X__pad0 = 0; this.Rdev = new $Uint64(0, 0); this.Size = new $Int64(0, 0); this.Blksize = new $Int64(0, 0); this.Blocks = new $Int64(0, 0); this.Atim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); this.Mtim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); this.Ctim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); this.X__unused = arrayType$5.zero(); return; } this.Dev = Dev_; this.Ino = Ino_; this.Nlink = Nlink_; this.Mode = Mode_; this.Uid = Uid_; this.Gid = Gid_; this.X__pad0 = X__pad0_; this.Rdev = Rdev_; this.Size = Size_; this.Blksize = Blksize_; this.Blocks = Blocks_; this.Atim = Atim_; this.Mtim = Mtim_; this.Ctim = Ctim_; this.X__unused = X__unused_; }); RawSockaddrInet4 = $pkg.RawSockaddrInet4 = $newType(0, $kindStruct, "syscall.RawSockaddrInet4", true, "syscall", true, function(Family_, Port_, Addr_, Zero_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Port = 0; this.Addr = arrayType$9.zero(); this.Zero = arrayType$1.zero(); return; } this.Family = Family_; this.Port = Port_; this.Addr = Addr_; this.Zero = Zero_; }); RawSockaddrInet6 = $pkg.RawSockaddrInet6 = $newType(0, $kindStruct, "syscall.RawSockaddrInet6", true, "syscall", true, function(Family_, Port_, Flowinfo_, Addr_, Scope_id_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Port = 0; this.Flowinfo = 0; this.Addr = arrayType$2.zero(); this.Scope_id = 0; return; } this.Family = Family_; this.Port = Port_; this.Flowinfo = Flowinfo_; this.Addr = Addr_; this.Scope_id = Scope_id_; }); RawSockaddrUnix = $pkg.RawSockaddrUnix = $newType(0, $kindStruct, "syscall.RawSockaddrUnix", true, "syscall", true, function(Family_, Path_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Path = arrayType$8.zero(); return; } this.Family = Family_; this.Path = Path_; }); RawSockaddrLinklayer = $pkg.RawSockaddrLinklayer = $newType(0, $kindStruct, "syscall.RawSockaddrLinklayer", true, "syscall", true, function(Family_, Protocol_, Ifindex_, Hatype_, Pkttype_, Halen_, Addr_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Protocol = 0; this.Ifindex = 0; this.Hatype = 0; this.Pkttype = 0; this.Halen = 0; this.Addr = arrayType$1.zero(); return; } this.Family = Family_; this.Protocol = Protocol_; this.Ifindex = Ifindex_; this.Hatype = Hatype_; this.Pkttype = Pkttype_; this.Halen = Halen_; this.Addr = Addr_; }); RawSockaddrNetlink = $pkg.RawSockaddrNetlink = $newType(0, $kindStruct, "syscall.RawSockaddrNetlink", true, "syscall", true, function(Family_, Pad_, Pid_, Groups_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Pad = 0; this.Pid = 0; this.Groups = 0; return; } this.Family = Family_; this.Pad = Pad_; this.Pid = Pid_; this.Groups = Groups_; }); RawSockaddr = $pkg.RawSockaddr = $newType(0, $kindStruct, "syscall.RawSockaddr", true, "syscall", true, function(Family_, Data_) { this.$val = this; if (arguments.length === 0) { this.Family = 0; this.Data = arrayType$10.zero(); return; } this.Family = Family_; this.Data = Data_; }); RawSockaddrAny = $pkg.RawSockaddrAny = $newType(0, $kindStruct, "syscall.RawSockaddrAny", true, "syscall", true, function(Addr_, Pad_) { this.$val = this; if (arguments.length === 0) { this.Addr = new RawSockaddr.ptr(0, arrayType$10.zero()); this.Pad = arrayType$11.zero(); return; } this.Addr = Addr_; this.Pad = Pad_; }); _Socklen = $pkg._Socklen = $newType(4, $kindUint32, "syscall._Socklen", true, "syscall", false, null); Linger = $pkg.Linger = $newType(0, $kindStruct, "syscall.Linger", true, "syscall", true, function(Onoff_, Linger_) { this.$val = this; if (arguments.length === 0) { this.Onoff = 0; this.Linger = 0; return; } this.Onoff = Onoff_; this.Linger = Linger_; }); Iovec = $pkg.Iovec = $newType(0, $kindStruct, "syscall.Iovec", true, "syscall", true, function(Base_, Len_) { this.$val = this; if (arguments.length === 0) { this.Base = ptrType$2.nil; this.Len = new $Uint64(0, 0); return; } this.Base = Base_; this.Len = Len_; }); IPMreq = $pkg.IPMreq = $newType(0, $kindStruct, "syscall.IPMreq", true, "syscall", true, function(Multiaddr_, Interface_) { this.$val = this; if (arguments.length === 0) { this.Multiaddr = arrayType$9.zero(); this.Interface = arrayType$9.zero(); return; } this.Multiaddr = Multiaddr_; this.Interface = Interface_; }); IPMreqn = $pkg.IPMreqn = $newType(0, $kindStruct, "syscall.IPMreqn", true, "syscall", true, function(Multiaddr_, Address_, Ifindex_) { this.$val = this; if (arguments.length === 0) { this.Multiaddr = arrayType$9.zero(); this.Address = arrayType$9.zero(); this.Ifindex = 0; return; } this.Multiaddr = Multiaddr_; this.Address = Address_; this.Ifindex = Ifindex_; }); IPv6Mreq = $pkg.IPv6Mreq = $newType(0, $kindStruct, "syscall.IPv6Mreq", true, "syscall", true, function(Multiaddr_, Interface_) { this.$val = this; if (arguments.length === 0) { this.Multiaddr = arrayType$2.zero(); this.Interface = 0; return; } this.Multiaddr = Multiaddr_; this.Interface = Interface_; }); Msghdr = $pkg.Msghdr = $newType(0, $kindStruct, "syscall.Msghdr", true, "syscall", true, function(Name_, Namelen_, Pad_cgo_0_, Iov_, Iovlen_, Control_, Controllen_, Flags_, Pad_cgo_1_) { this.$val = this; if (arguments.length === 0) { this.Name = ptrType$2.nil; this.Namelen = 0; this.Pad_cgo_0 = arrayType$9.zero(); this.Iov = ptrType$19.nil; this.Iovlen = new $Uint64(0, 0); this.Control = ptrType$2.nil; this.Controllen = new $Uint64(0, 0); this.Flags = 0; this.Pad_cgo_1 = arrayType$9.zero(); return; } this.Name = Name_; this.Namelen = Namelen_; this.Pad_cgo_0 = Pad_cgo_0_; this.Iov = Iov_; this.Iovlen = Iovlen_; this.Control = Control_; this.Controllen = Controllen_; this.Flags = Flags_; this.Pad_cgo_1 = Pad_cgo_1_; }); sliceType = $sliceType($Uint8); sliceType$1 = $sliceType($String); sliceType$2 = $sliceType($Uintptr); ptrType = $ptrType(SysProcAttr); ptrType$1 = $ptrType(Credential); sliceType$3 = $sliceType(SysProcIDMap); ptrType$2 = $ptrType($Uint8); arrayType = $arrayType($Int, 2); ptrType$3 = $ptrType(Errno); sliceType$4 = $sliceType($Int); ptrType$4 = $ptrType($Int32); sliceType$5 = $sliceType(ptrType$2); ptrType$5 = $ptrType(ProcAttr); ptrType$6 = $ptrType(WaitStatus); ptrType$7 = $ptrType(Rusage); arrayType$1 = $arrayType($Uint8, 8); ptrType$8 = $ptrType($Uint16); arrayType$2 = $arrayType($Uint8, 16); ptrType$11 = $ptrType(SockaddrNetlink); arrayType$4 = $arrayType($Uint8, 32); arrayType$5 = $arrayType($Int64, 3); arrayType$7 = $arrayType($Uint8, 4096); ptrType$17 = $ptrType(_C_int); arrayType$8 = $arrayType($Int8, 108); arrayType$9 = $arrayType($Uint8, 4); arrayType$10 = $arrayType($Int8, 14); arrayType$11 = $arrayType($Int8, 96); ptrType$18 = $ptrType(_Socklen); ptrType$19 = $ptrType(Iovec); arrayType$13 = $arrayType(_C_int, 2); structType = $structType("syscall", [{prop: "addr", name: "addr", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cap", name: "cap", embedded: false, exported: false, typ: $Int, tag: ""}]); ptrType$22 = $ptrType($Int64); sliceType$10 = $sliceType($Uint32); ptrType$24 = $ptrType(SockaddrLinklayer); ptrType$25 = $ptrType(mmapper); mapType = $mapType(ptrType$2, sliceType); funcType$2 = $funcType([$Uintptr, $Uintptr, $Int, $Int, $Int, $Int64], [$Uintptr, $error], false); funcType$3 = $funcType([$Uintptr, $Uintptr], [$error], false); ptrType$26 = $ptrType(SockaddrInet4); ptrType$27 = $ptrType(SockaddrInet6); ptrType$28 = $ptrType(SockaddrUnix); ptrType$29 = $ptrType(Timespec); ptrType$30 = $ptrType(Timeval); ptrType$31 = $ptrType(Msghdr); init = function() { $flushConsole = (function() { if (!((lineBuffer.$length === 0))) { $global.console.log($externalize(($bytesToString(lineBuffer)), $String)); lineBuffer = sliceType.nil; } }); }; printWarning = function() { if (!warningPrinted) { $global.console.error($externalize("warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md", $String)); } warningPrinted = true; }; printToConsole = function(b) { var b, goPrintToConsole, i; goPrintToConsole = $global.goPrintToConsole; if (!(goPrintToConsole === undefined)) { goPrintToConsole(b); return; } lineBuffer = $appendSlice(lineBuffer, b); while (true) { i = indexByte(lineBuffer, 10); if (i === -1) { break; } $global.console.log($externalize(($bytesToString($subslice(lineBuffer, 0, i))), $String)); lineBuffer = $subslice(lineBuffer, (i + 1 >> 0)); } }; Exit = function(code) { var code; Syscall(231, ((code >>> 0)), 0, 0); }; $pkg.Exit = Exit; indexByte = function(s, c) { var _i, _ref, b, c, i, s; _ref = s; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (b === c) { return i; } _i++; } return -1; }; runtime_envs = function() { var envkeys, envs$1, i, jsEnv, key, process; process = $global.process; if (process === undefined) { return sliceType$1.nil; } jsEnv = process.env; envkeys = $global.Object.keys(jsEnv); envs$1 = $makeSlice(sliceType$1, $parseInt(envkeys.length)); i = 0; while (true) { if (!(i < $parseInt(envkeys.length))) { break; } key = $internalize(envkeys[i], $String); ((i < 0 || i >= envs$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs$1.$array[envs$1.$offset + i] = key + "=" + $internalize(jsEnv[$externalize(key, $String)], $String)); i = i + (1) >> 0; } return envs$1; }; setenv_c = function(k, v) { var k, process, v; process = $global.process; if (process === undefined) { return; } process.env[$externalize(k, $String)] = $externalize(v, $String); }; syscall = function(name) { var name, require, $deferred; /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); $deferred.push([(function() { $recover(); }), []]); if (syscallModule === null) { if (alreadyTriedToLoad) { return null; } alreadyTriedToLoad = true; require = $global.require; if (require === undefined) { $panic(new $String("")); } syscallModule = require($externalize("syscall", $String)); } return syscallModule[$externalize(name, $String)]; /* */ } catch(err) { $err = err; return null; } finally { $callDeferred($deferred, $err); } }; Syscall = function(trap, a1, a2, a3) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, a1, a2, a3, array, err, f, r, r1, r2, slice, trap; r1 = 0; r2 = 0; err = 0; f = syscall("Syscall"); if (!(f === null)) { r = f(trap, a1, a2, a3); _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); _tmp$2 = ((($parseInt(r[2]) >> 0) >>> 0)); r1 = _tmp; r2 = _tmp$1; err = _tmp$2; return [r1, r2, err]; } if ((trap === 1) && ((a1 === 1) || (a1 === 2))) { array = a2; slice = $makeSlice(sliceType, $parseInt(array.length)); slice.$array = array; printToConsole(slice); _tmp$3 = (($parseInt(array.length) >>> 0)); _tmp$4 = 0; _tmp$5 = 0; r1 = _tmp$3; r2 = _tmp$4; err = _tmp$5; return [r1, r2, err]; } if (trap === 231) { runtime.Goexit(); } printWarning(); _tmp$6 = ((minusOne >>> 0)); _tmp$7 = 0; _tmp$8 = 13; r1 = _tmp$6; r2 = _tmp$7; err = _tmp$8; return [r1, r2, err]; }; $pkg.Syscall = Syscall; Syscall6 = function(trap, a1, a2, a3, a4, a5, a6) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, a4, a5, a6, err, f, r, r1, r2, trap; r1 = 0; r2 = 0; err = 0; f = syscall("Syscall6"); if (!(f === null)) { r = f(trap, a1, a2, a3, a4, a5, a6); _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); _tmp$2 = ((($parseInt(r[2]) >> 0) >>> 0)); r1 = _tmp; r2 = _tmp$1; err = _tmp$2; return [r1, r2, err]; } if (!((trap === 202))) { printWarning(); } _tmp$3 = ((minusOne >>> 0)); _tmp$4 = 0; _tmp$5 = 13; r1 = _tmp$3; r2 = _tmp$4; err = _tmp$5; return [r1, r2, err]; }; $pkg.Syscall6 = Syscall6; RawSyscall = function(trap, a1, a2, a3) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, err, f, r, r1, r2, trap; r1 = 0; r2 = 0; err = 0; f = syscall("Syscall"); if (!(f === null)) { r = f(trap, a1, a2, a3); _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); _tmp$2 = ((($parseInt(r[2]) >> 0) >>> 0)); r1 = _tmp; r2 = _tmp$1; err = _tmp$2; return [r1, r2, err]; } printWarning(); _tmp$3 = ((minusOne >>> 0)); _tmp$4 = 0; _tmp$5 = 13; r1 = _tmp$3; r2 = _tmp$4; err = _tmp$5; return [r1, r2, err]; }; $pkg.RawSyscall = RawSyscall; rawSyscallNoError = function(trap, a1, a2, a3) { var _tmp, _tmp$1, _tmp$2, _tmp$3, a1, a2, a3, f, r, r1, r2, trap; r1 = 0; r2 = 0; f = syscall("Syscall"); if (!(f === null)) { r = f(trap, a1, a2, a3); _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); r1 = _tmp; r2 = _tmp$1; return [r1, r2]; } printWarning(); _tmp$2 = ((minusOne >>> 0)); _tmp$3 = 0; r1 = _tmp$2; r2 = _tmp$3; return [r1, r2]; }; RawSyscall6 = function(trap, a1, a2, a3, a4, a5, a6) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, a4, a5, a6, err, f, r, r1, r2, trap; r1 = 0; r2 = 0; err = 0; f = syscall("Syscall6"); if (!(f === null)) { r = f(trap, a1, a2, a3, a4, a5, a6); _tmp = ((($parseInt(r[0]) >> 0) >>> 0)); _tmp$1 = ((($parseInt(r[1]) >> 0) >>> 0)); _tmp$2 = ((($parseInt(r[2]) >> 0) >>> 0)); r1 = _tmp; r2 = _tmp$1; err = _tmp$2; return [r1, r2, err]; } printWarning(); _tmp$3 = ((minusOne >>> 0)); _tmp$4 = 0; _tmp$5 = 13; r1 = _tmp$3; r2 = _tmp$4; err = _tmp$5; return [r1, r2, err]; }; $pkg.RawSyscall6 = RawSyscall6; BytePtrFromString = function(s) { var _i, _ref, array, b, i, s; array = new ($global.Uint8Array)(s.length + 1 >> 0); _ref = (new sliceType($stringToBytes(s))); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; b = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (b === 0) { return [ptrType$2.nil, new Errno(22)]; } array[i] = b; _i++; } array[s.length] = 0; return [((array)), $ifaceNil]; }; $pkg.BytePtrFromString = BytePtrFromString; readInt = function(b, off, size) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, off, ok, size, u; u = new $Uint64(0, 0); ok = false; if (b.$length < (((off + size >>> 0) >> 0))) { _tmp = new $Uint64(0, 0); _tmp$1 = false; u = _tmp; ok = _tmp$1; return [u, ok]; } if (false) { _tmp$2 = readIntBE($subslice(b, off), size); _tmp$3 = true; u = _tmp$2; ok = _tmp$3; return [u, ok]; } _tmp$4 = readIntLE($subslice(b, off), size); _tmp$5 = true; u = _tmp$4; ok = _tmp$5; return [u, ok]; }; readIntBE = function(b, size) { var _1, b, size, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$3, x$4, x$5, x$6, x$7, x$8, x$9; _1 = size; if (_1 === (1)) { return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); } else if (_1 === (2)) { $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); return (x = (new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), x$1 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); } else if (_1 === (4)) { $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), x$5 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); } else if (_1 === (8)) { $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), x$15 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); } else { $panic(new $String("syscall: readInt with unsupported size")); } }; readIntLE = function(b, size) { var _1, b, size, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$3, x$4, x$5, x$6, x$7, x$8, x$9; _1 = size; if (_1 === (1)) { return (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))); } else if (_1 === (2)) { $unused((1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1])); return (x = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$1 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0)); } else if (_1 === (4)) { $unused((3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3])); return (x$2 = (x$3 = (x$4 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$5 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0)), x$6 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$3.$high | x$6.$high, (x$3.$low | x$6.$low) >>> 0)), x$7 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$2.$high | x$7.$high, (x$2.$low | x$7.$low) >>> 0)); } else if (_1 === (8)) { $unused((7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7])); return (x$8 = (x$9 = (x$10 = (x$11 = (x$12 = (x$13 = (x$14 = (new $Uint64(0, (0 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 0]))), x$15 = $shiftLeft64((new $Uint64(0, (1 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 1]))), 8), new $Uint64(x$14.$high | x$15.$high, (x$14.$low | x$15.$low) >>> 0)), x$16 = $shiftLeft64((new $Uint64(0, (2 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 2]))), 16), new $Uint64(x$13.$high | x$16.$high, (x$13.$low | x$16.$low) >>> 0)), x$17 = $shiftLeft64((new $Uint64(0, (3 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 3]))), 24), new $Uint64(x$12.$high | x$17.$high, (x$12.$low | x$17.$low) >>> 0)), x$18 = $shiftLeft64((new $Uint64(0, (4 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 4]))), 32), new $Uint64(x$11.$high | x$18.$high, (x$11.$low | x$18.$low) >>> 0)), x$19 = $shiftLeft64((new $Uint64(0, (5 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 5]))), 40), new $Uint64(x$10.$high | x$19.$high, (x$10.$low | x$19.$low) >>> 0)), x$20 = $shiftLeft64((new $Uint64(0, (6 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 6]))), 48), new $Uint64(x$9.$high | x$20.$high, (x$9.$low | x$20.$low) >>> 0)), x$21 = $shiftLeft64((new $Uint64(0, (7 >= b.$length ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + 7]))), 56), new $Uint64(x$8.$high | x$21.$high, (x$8.$low | x$21.$low) >>> 0)); } else { $panic(new $String("syscall: readInt with unsupported size")); } }; ParseDirent = function(buf, max, names) { var _i, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _tuple$2, buf, c, consumed, count, i, ino, max, name, names, namlen, newnames, ok, origlen, rec, reclen, x, x$1, x$2; consumed = 0; count = 0; newnames = sliceType$1.nil; origlen = buf.$length; count = 0; while (true) { if (!(!((max === 0)) && buf.$length > 0)) { break; } _tuple = direntReclen(buf); reclen = _tuple[0]; ok = _tuple[1]; if (!ok || (x = (new $Uint64(0, buf.$length)), (reclen.$high > x.$high || (reclen.$high === x.$high && reclen.$low > x.$low)))) { _tmp = origlen; _tmp$1 = count; _tmp$2 = names; consumed = _tmp; count = _tmp$1; newnames = _tmp$2; return [consumed, count, newnames]; } rec = $subslice(buf, 0, $flatten64(reclen)); buf = $subslice(buf, $flatten64(reclen)); _tuple$1 = direntIno(rec); ino = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { break; } if ((ino.$high === 0 && ino.$low === 0)) { continue; } _tuple$2 = direntNamlen(rec); namlen = _tuple$2[0]; ok = _tuple$2[1]; if (!ok || (x$1 = new $Uint64(0 + namlen.$high, 19 + namlen.$low), x$2 = (new $Uint64(0, rec.$length)), (x$1.$high > x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { break; } name = $subslice(rec, 19, $flatten64(new $Uint64(0 + namlen.$high, 19 + namlen.$low))); _ref = name; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (c === 0) { name = $subslice(name, 0, i); break; } _i++; } if (($bytesToString(name)) === "." || ($bytesToString(name)) === "..") { continue; } max = max - (1) >> 0; count = count + (1) >> 0; names = $append(names, ($bytesToString(name))); } _tmp$3 = origlen - buf.$length >> 0; _tmp$4 = count; _tmp$5 = names; consumed = _tmp$3; count = _tmp$4; newnames = _tmp$5; return [consumed, count, newnames]; }; $pkg.ParseDirent = ParseDirent; copyenv = function() { var _entry, _i, _key, _ref, _tuple, i, j, key, ok, s; env = {}; _ref = envs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); j = 0; while (true) { if (!(j < s.length)) { break; } if (s.charCodeAt(j) === 61) { key = $substring(s, 0, j); _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); ok = _tuple[1]; if (!ok) { _key = key; (env || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: i }; } else { ((i < 0 || i >= envs.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs.$array[envs.$offset + i] = ""); } break; } j = j + (1) >> 0; } _i++; } }; Getenv = function(key) { var _entry, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, found, i, i$1, key, ok, s, value, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; found = $f.found; i = $f.i; i$1 = $f.i$1; key = $f.key; ok = $f.ok; s = $f.s; value = $f.value; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); value = ""; found = false; $r = envOnce.Do(copyenv); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (key.length === 0) { _tmp = ""; _tmp$1 = false; value = _tmp; found = _tmp$1; $s = -1; return [value, found]; } $r = envLock.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(envLock, "RUnlock"), []]); _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); i = _tuple[0]; ok = _tuple[1]; if (!ok) { _tmp$2 = ""; _tmp$3 = false; value = _tmp$2; found = _tmp$3; $s = -1; return [value, found]; } s = ((i < 0 || i >= envs.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs.$array[envs.$offset + i]); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } if (s.charCodeAt(i$1) === 61) { _tmp$4 = $substring(s, (i$1 + 1 >> 0)); _tmp$5 = true; value = _tmp$4; found = _tmp$5; $s = -1; return [value, found]; } i$1 = i$1 + (1) >> 0; } _tmp$6 = ""; _tmp$7 = false; value = _tmp$6; found = _tmp$7; $s = -1; return [value, found]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [value, found]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Getenv }; } $f._entry = _entry; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.found = found; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.ok = ok; $f.s = s; $f.value = value; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Getenv = Getenv; Setenv = function(key, value) { var _entry, _key, _tuple, i, i$1, i$2, key, kv, ok, value, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _tuple = $f._tuple; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; key = $f.key; kv = $f.kv; ok = $f.ok; value = $f.value; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); $r = envOnce.Do(copyenv); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (key.length === 0) { $s = -1; return new Errno(22); } i = 0; while (true) { if (!(i < key.length)) { break; } if ((key.charCodeAt(i) === 61) || (key.charCodeAt(i) === 0)) { $s = -1; return new Errno(22); } i = i + (1) >> 0; } i$1 = 0; while (true) { if (!(i$1 < value.length)) { break; } if (value.charCodeAt(i$1) === 0) { $s = -1; return new Errno(22); } i$1 = i$1 + (1) >> 0; } $r = envLock.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(envLock, "Unlock"), []]); _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); i$2 = _tuple[0]; ok = _tuple[1]; kv = key + "=" + value; if (ok) { ((i$2 < 0 || i$2 >= envs.$length) ? ($throwRuntimeError("index out of range"), undefined) : envs.$array[envs.$offset + i$2] = kv); } else { i$2 = envs.$length; envs = $append(envs, kv); } _key = key; (env || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: i$2 }; setenv_c(key, value); $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Setenv }; } $f._entry = _entry; $f._key = _key; $f._tuple = _tuple; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.key = key; $f.kv = kv; $f.ok = ok; $f.value = value; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Setenv = Setenv; Environ = function() { var _i, _ref, a, env$1, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; a = $f.a; env$1 = $f.env$1; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); $r = envOnce.Do(copyenv); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = envLock.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(envLock, "RUnlock"), []]); a = $makeSlice(sliceType$1, 0, envs.$length); _ref = envs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } env$1 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(env$1 === "")) { a = $append(a, env$1); } _i++; } $s = -1; return a; /* */ } return; } } catch(err) { $err = err; $s = -1; return sliceType$1.nil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Environ }; } $f._i = _i; $f._ref = _ref; $f.a = a; $f.env$1 = env$1; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Environ = Environ; runtime_BeforeFork = function() { $throwRuntimeError("native function not implemented: syscall.runtime_BeforeFork"); }; runtime_AfterFork = function() { $throwRuntimeError("native function not implemented: syscall.runtime_AfterFork"); }; runtime_AfterForkInChild = function() { $throwRuntimeError("native function not implemented: syscall.runtime_AfterForkInChild"); }; forkAndExecInChild = function(argv0, argv, envv, chroot, dir, attr, sys, pipe$1) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, argv, argv0, attr, chroot, dir, envv, err, err$1, err1, err2, err2$24ptr, locked, p, pid, pipe$1, r1, sys; pid = 0; err = 0; _tuple = forkAndExecInChild1(argv0, argv, envv, chroot, dir, attr, sys, pipe$1); r1 = _tuple[0]; err1 = _tuple[1]; p = $clone(_tuple[2], arrayType); locked = _tuple[3]; if (locked) { runtime_AfterFork(); } if (!((err1 === 0))) { _tmp = 0; _tmp$1 = err1; pid = _tmp; err = _tmp$1; return [pid, err]; } pid = ((r1 >> 0)); if (!(sys.UidMappings === sliceType$3.nil) || !(sys.GidMappings === sliceType$3.nil)) { Close(p[0]); err$1 = writeUidGidMappings(pid, sys); err2 = 0; if (!($interfaceIsEqual(err$1, $ifaceNil))) { err2 = $assertType(err$1, Errno); } RawSyscall(1, ((p[1] >>> 0)), (((err2$24ptr || (err2$24ptr = new ptrType$3(function() { return err2; }, function($v) { err2 = $v; }))))), 4); Close(p[1]); } _tmp$2 = pid; _tmp$3 = 0; pid = _tmp$2; err = _tmp$3; return [pid, err]; }; forkAndExecInChild1 = function(argv0, argv, envv, chroot, dir, attr, sys, pipe$1) { var _i, _i$1, _ref, _ref$1, _tuple, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$25, _tuple$26, _tuple$27, _tuple$28, _tuple$29, _tuple$3, _tuple$30, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, argv, argv0, attr, c, chroot, cred, dir, envv, err, err1, err1$1, err1$24ptr, err2, err2$24ptr, fd, groups, i, i$1, locked, nextfd, ngroups, p, pgrp, pgrp$24ptr, pid, pipe$1, ppid, r1, sys, ufd, $s; /* */ $s = 0; s: while (true) { switch ($s) { case 0: r1 = 0; err1 = 0; p = arrayType.zero(); locked = false; err2 = 0; nextfd = 0; i = 0; _tuple = rawSyscallNoError(39, 0, 0, 0); ppid = _tuple[0]; fd = $makeSlice(sliceType$4, attr.Files.$length); nextfd = attr.Files.$length; _ref = attr.Files; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i$1 = _i; ufd = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (nextfd < ((ufd >> 0))) { nextfd = ((ufd >> 0)); } ((i$1 < 0 || i$1 >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i$1] = ((ufd >> 0))); _i++; } nextfd = nextfd + (1) >> 0; if (!(sys.UidMappings === sliceType$3.nil) || !(sys.GidMappings === sliceType$3.nil)) { err = forkExecPipe(new sliceType$4(p)); if (!($interfaceIsEqual(err, $ifaceNil))) { err1 = $assertType(err, Errno); $s = -1; return [r1, err1, p, locked]; } } runtime_BeforeFork(); locked = true; if (false && (((sys.Cloneflags & 268435456) >>> 0) === 0)) { _tuple$1 = rawVforkSyscall(56, (16657 | sys.Cloneflags) >>> 0); r1 = _tuple$1[0]; err1 = _tuple$1[1]; } else if (false) { _tuple$2 = RawSyscall6(56, 0, (17 | sys.Cloneflags) >>> 0, 0, 0, 0, 0); r1 = _tuple$2[0]; err1 = _tuple$2[2]; } else { _tuple$3 = RawSyscall6(56, (17 | sys.Cloneflags) >>> 0, 0, 0, 0, 0, 0); r1 = _tuple$3[0]; err1 = _tuple$3[2]; } if (!((err1 === 0)) || !((r1 === 0))) { $s = -1; return [r1, err1, p, locked]; } runtime_AfterForkInChild(); /* */ if (sys.AmbientCaps.$length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (sys.AmbientCaps.$length > 0) { */ case 1: _tuple$4 = RawSyscall6(157, 8, 1, 0, 0, 0, 0); err1 = _tuple$4[2]; /* */ if (!((err1 === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((err1 === 0))) { */ case 3: /* goto childerror */ $s = 5; continue; /* } */ case 4: /* } */ case 2: /* */ if (!(sys.UidMappings === sliceType$3.nil) || !(sys.GidMappings === sliceType$3.nil)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(sys.UidMappings === sliceType$3.nil) || !(sys.GidMappings === sliceType$3.nil)) { */ case 6: _tuple$5 = RawSyscall(3, ((p[1] >>> 0)), 0, 0); err1 = _tuple$5[2]; /* */ if (!((err1 === 0))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!((err1 === 0))) { */ case 8: /* goto childerror */ $s = 5; continue; /* } */ case 9: _tuple$6 = RawSyscall(0, ((p[0] >>> 0)), (((err2$24ptr || (err2$24ptr = new ptrType$3(function() { return err2; }, function($v) { err2 = $v; }))))), 4); r1 = _tuple$6[0]; err1 = _tuple$6[2]; /* */ if (!((err1 === 0))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!((err1 === 0))) { */ case 10: /* goto childerror */ $s = 5; continue; /* } */ case 11: /* */ if (!((r1 === 4))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!((r1 === 4))) { */ case 12: err1 = 22; /* goto childerror */ $s = 5; continue; /* } */ case 13: /* */ if (!((err2 === 0))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!((err2 === 0))) { */ case 14: err1 = err2; /* goto childerror */ $s = 5; continue; /* } */ case 15: /* } */ case 7: /* */ if (sys.Setsid) { $s = 16; continue; } /* */ $s = 17; continue; /* if (sys.Setsid) { */ case 16: _tuple$7 = RawSyscall(112, 0, 0, 0); err1 = _tuple$7[2]; /* */ if (!((err1 === 0))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!((err1 === 0))) { */ case 18: /* goto childerror */ $s = 5; continue; /* } */ case 19: /* } */ case 17: /* */ if (sys.Setpgid || sys.Foreground) { $s = 20; continue; } /* */ $s = 21; continue; /* if (sys.Setpgid || sys.Foreground) { */ case 20: _tuple$8 = RawSyscall(109, 0, ((sys.Pgid >>> 0)), 0); err1 = _tuple$8[2]; /* */ if (!((err1 === 0))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!((err1 === 0))) { */ case 22: /* goto childerror */ $s = 5; continue; /* } */ case 23: /* } */ case 21: /* */ if (sys.Foreground) { $s = 24; continue; } /* */ $s = 25; continue; /* if (sys.Foreground) { */ case 24: pgrp = ((sys.Pgid >> 0)); if (pgrp === 0) { _tuple$9 = rawSyscallNoError(39, 0, 0, 0); r1 = _tuple$9[0]; pgrp = ((r1 >> 0)); } _tuple$10 = RawSyscall(16, ((sys.Ctty >>> 0)), 21520, (((pgrp$24ptr || (pgrp$24ptr = new ptrType$4(function() { return pgrp; }, function($v) { pgrp = $v; })))))); err1 = _tuple$10[2]; /* */ if (!((err1 === 0))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (!((err1 === 0))) { */ case 26: /* goto childerror */ $s = 5; continue; /* } */ case 27: /* } */ case 25: /* */ if (!((sys.Unshareflags === 0))) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!((sys.Unshareflags === 0))) { */ case 28: _tuple$11 = RawSyscall(272, sys.Unshareflags, 0, 0); err1 = _tuple$11[2]; /* */ if (!((err1 === 0))) { $s = 30; continue; } /* */ $s = 31; continue; /* if (!((err1 === 0))) { */ case 30: /* goto childerror */ $s = 5; continue; /* } */ case 31: /* */ if (((sys.Unshareflags & 131072) >>> 0) === 131072) { $s = 32; continue; } /* */ $s = 33; continue; /* if (((sys.Unshareflags & 131072) >>> 0) === 131072) { */ case 32: _tuple$12 = RawSyscall6(165, (($sliceToArray(new sliceType(none)))), (($sliceToArray(new sliceType(slash)))), 0, 278528, 0, 0); err1 = _tuple$12[2]; /* */ if (!((err1 === 0))) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!((err1 === 0))) { */ case 34: /* goto childerror */ $s = 5; continue; /* } */ case 35: /* } */ case 33: /* } */ case 29: /* */ if (!(chroot === ptrType$2.nil)) { $s = 36; continue; } /* */ $s = 37; continue; /* if (!(chroot === ptrType$2.nil)) { */ case 36: _tuple$13 = RawSyscall(161, ((chroot)), 0, 0); err1 = _tuple$13[2]; /* */ if (!((err1 === 0))) { $s = 38; continue; } /* */ $s = 39; continue; /* if (!((err1 === 0))) { */ case 38: /* goto childerror */ $s = 5; continue; /* } */ case 39: /* } */ case 37: cred = sys.Credential; /* */ if (!(cred === ptrType$1.nil)) { $s = 40; continue; } /* */ $s = 41; continue; /* if (!(cred === ptrType$1.nil)) { */ case 40: ngroups = ((cred.Groups.$length >>> 0)); groups = 0; if (ngroups > 0) { groups = (($sliceToArray(cred.Groups))); } /* */ if (!(!(sys.GidMappings === sliceType$3.nil) && !sys.GidMappingsEnableSetgroups && (ngroups === 0)) && !cred.NoSetGroups) { $s = 42; continue; } /* */ $s = 43; continue; /* if (!(!(sys.GidMappings === sliceType$3.nil) && !sys.GidMappingsEnableSetgroups && (ngroups === 0)) && !cred.NoSetGroups) { */ case 42: _tuple$14 = RawSyscall(116, ngroups, groups, 0); err1 = _tuple$14[2]; /* */ if (!((err1 === 0))) { $s = 44; continue; } /* */ $s = 45; continue; /* if (!((err1 === 0))) { */ case 44: /* goto childerror */ $s = 5; continue; /* } */ case 45: /* } */ case 43: _tuple$15 = RawSyscall(106, ((cred.Gid >>> 0)), 0, 0); err1 = _tuple$15[2]; /* */ if (!((err1 === 0))) { $s = 46; continue; } /* */ $s = 47; continue; /* if (!((err1 === 0))) { */ case 46: /* goto childerror */ $s = 5; continue; /* } */ case 47: _tuple$16 = RawSyscall(105, ((cred.Uid >>> 0)), 0, 0); err1 = _tuple$16[2]; /* */ if (!((err1 === 0))) { $s = 48; continue; } /* */ $s = 49; continue; /* if (!((err1 === 0))) { */ case 48: /* goto childerror */ $s = 5; continue; /* } */ case 49: /* } */ case 41: _ref$1 = sys.AmbientCaps; _i$1 = 0; /* while (true) { */ case 50: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 51; continue; } c = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _tuple$17 = RawSyscall6(157, 47, 2, c, 0, 0, 0); err1 = _tuple$17[2]; /* */ if (!((err1 === 0))) { $s = 52; continue; } /* */ $s = 53; continue; /* if (!((err1 === 0))) { */ case 52: /* goto childerror */ $s = 5; continue; /* } */ case 53: _i$1++; /* } */ $s = 50; continue; case 51: /* */ if (!(dir === ptrType$2.nil)) { $s = 54; continue; } /* */ $s = 55; continue; /* if (!(dir === ptrType$2.nil)) { */ case 54: _tuple$18 = RawSyscall(80, ((dir)), 0, 0); err1 = _tuple$18[2]; /* */ if (!((err1 === 0))) { $s = 56; continue; } /* */ $s = 57; continue; /* if (!((err1 === 0))) { */ case 56: /* goto childerror */ $s = 5; continue; /* } */ case 57: /* } */ case 55: /* */ if (!((sys.Pdeathsig === 0))) { $s = 58; continue; } /* */ $s = 59; continue; /* if (!((sys.Pdeathsig === 0))) { */ case 58: _tuple$19 = RawSyscall6(157, 1, ((sys.Pdeathsig >>> 0)), 0, 0, 0, 0); err1 = _tuple$19[2]; /* */ if (!((err1 === 0))) { $s = 60; continue; } /* */ $s = 61; continue; /* if (!((err1 === 0))) { */ case 60: /* goto childerror */ $s = 5; continue; /* } */ case 61: _tuple$20 = rawSyscallNoError(110, 0, 0, 0); r1 = _tuple$20[0]; /* */ if (!((r1 === ppid))) { $s = 62; continue; } /* */ $s = 63; continue; /* if (!((r1 === ppid))) { */ case 62: _tuple$21 = rawSyscallNoError(39, 0, 0, 0); pid = _tuple$21[0]; _tuple$22 = RawSyscall(62, pid, ((sys.Pdeathsig >>> 0)), 0); err1$1 = _tuple$22[2]; /* */ if (!((err1$1 === 0))) { $s = 64; continue; } /* */ $s = 65; continue; /* if (!((err1$1 === 0))) { */ case 64: /* goto childerror */ $s = 5; continue; /* } */ case 65: /* } */ case 63: /* } */ case 59: /* */ if (pipe$1 < nextfd) { $s = 66; continue; } /* */ $s = 67; continue; /* if (pipe$1 < nextfd) { */ case 66: _tuple$23 = RawSyscall(33, ((pipe$1 >>> 0)), ((nextfd >>> 0)), 0); err1 = _tuple$23[2]; /* */ if (!((err1 === 0))) { $s = 68; continue; } /* */ $s = 69; continue; /* if (!((err1 === 0))) { */ case 68: /* goto childerror */ $s = 5; continue; /* } */ case 69: RawSyscall(72, ((nextfd >>> 0)), 2, 1); pipe$1 = nextfd; nextfd = nextfd + (1) >> 0; /* } */ case 67: i = 0; /* while (true) { */ case 70: /* if (!(i < fd.$length)) { break; } */ if(!(i < fd.$length)) { $s = 71; continue; } /* */ if (((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) >= 0 && ((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) < (i)) { $s = 72; continue; } /* */ $s = 73; continue; /* if (((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) >= 0 && ((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) < (i)) { */ case 72: if (nextfd === pipe$1) { nextfd = nextfd + (1) >> 0; } _tuple$24 = RawSyscall(33, ((((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) >>> 0)), ((nextfd >>> 0)), 0); err1 = _tuple$24[2]; /* */ if (!((err1 === 0))) { $s = 74; continue; } /* */ $s = 75; continue; /* if (!((err1 === 0))) { */ case 74: /* goto childerror */ $s = 5; continue; /* } */ case 75: RawSyscall(72, ((nextfd >>> 0)), 2, 1); ((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i] = nextfd); nextfd = nextfd + (1) >> 0; /* } */ case 73: i = i + (1) >> 0; /* } */ $s = 70; continue; case 71: i = 0; /* while (true) { */ case 76: /* if (!(i < fd.$length)) { break; } */ if(!(i < fd.$length)) { $s = 77; continue; } /* */ if (((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) === -1) { $s = 78; continue; } /* */ $s = 79; continue; /* if (((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) === -1) { */ case 78: RawSyscall(3, ((i >>> 0)), 0, 0); i = i + (1) >> 0; /* continue; */ $s = 76; continue; /* } */ case 79: /* */ if (((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) === (i)) { $s = 80; continue; } /* */ $s = 81; continue; /* if (((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) === (i)) { */ case 80: _tuple$25 = RawSyscall(72, ((((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) >>> 0)), 2, 0); err1 = _tuple$25[2]; /* */ if (!((err1 === 0))) { $s = 82; continue; } /* */ $s = 83; continue; /* if (!((err1 === 0))) { */ case 82: /* goto childerror */ $s = 5; continue; /* } */ case 83: i = i + (1) >> 0; /* continue; */ $s = 76; continue; /* } */ case 81: _tuple$26 = RawSyscall(33, ((((i < 0 || i >= fd.$length) ? ($throwRuntimeError("index out of range"), undefined) : fd.$array[fd.$offset + i]) >>> 0)), ((i >>> 0)), 0); err1 = _tuple$26[2]; /* */ if (!((err1 === 0))) { $s = 84; continue; } /* */ $s = 85; continue; /* if (!((err1 === 0))) { */ case 84: /* goto childerror */ $s = 5; continue; /* } */ case 85: i = i + (1) >> 0; /* } */ $s = 76; continue; case 77: i = fd.$length; while (true) { if (!(i < 3)) { break; } RawSyscall(3, ((i >>> 0)), 0, 0); i = i + (1) >> 0; } /* */ if (sys.Noctty) { $s = 86; continue; } /* */ $s = 87; continue; /* if (sys.Noctty) { */ case 86: _tuple$27 = RawSyscall(16, 0, 21538, 0); err1 = _tuple$27[2]; /* */ if (!((err1 === 0))) { $s = 88; continue; } /* */ $s = 89; continue; /* if (!((err1 === 0))) { */ case 88: /* goto childerror */ $s = 5; continue; /* } */ case 89: /* } */ case 87: /* */ if (sys.Setctty) { $s = 90; continue; } /* */ $s = 91; continue; /* if (sys.Setctty) { */ case 90: _tuple$28 = RawSyscall(16, ((sys.Ctty >>> 0)), 21518, 1); err1 = _tuple$28[2]; /* */ if (!((err1 === 0))) { $s = 92; continue; } /* */ $s = 93; continue; /* if (!((err1 === 0))) { */ case 92: /* goto childerror */ $s = 5; continue; /* } */ case 93: /* } */ case 91: /* */ if (sys.Ptrace) { $s = 94; continue; } /* */ $s = 95; continue; /* if (sys.Ptrace) { */ case 94: _tuple$29 = RawSyscall(101, 0, 0, 0); err1 = _tuple$29[2]; /* */ if (!((err1 === 0))) { $s = 96; continue; } /* */ $s = 97; continue; /* if (!((err1 === 0))) { */ case 96: /* goto childerror */ $s = 5; continue; /* } */ case 97: /* } */ case 95: _tuple$30 = RawSyscall(59, ((argv0)), (($sliceToArray(argv))), (($sliceToArray(envv)))); err1 = _tuple$30[2]; /* childerror: */ case 5: RawSyscall(1, ((pipe$1 >>> 0)), (((err1$24ptr || (err1$24ptr = new ptrType$3(function() { return err1; }, function($v) { err1 = $v; }))))), 4); while (true) { RawSyscall(60, 253, 0, 0); } $s = -1; return [r1, err1, p, locked]; /* */ } return; } }; forkExecPipe = function(p) { var _tuple, _tuple$1, err, p; err = $ifaceNil; err = Pipe2(p, 524288); if ($interfaceIsEqual(err, new Errno(38))) { err = Pipe(p); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _tuple = fcntl((0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0]), 2, 1); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _tuple$1 = fcntl((1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1]), 2, 1); err = _tuple$1[1]; } return err; }; writeIDMappings = function(path, idMap) { var _i, _ref, _tuple, _tuple$1, _tuple$2, bytes, data, err, err$1, err$2, fd, idMap, im, path; _tuple = Open(path, 2, 0); fd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } data = ""; _ref = idMap; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } im = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), SysProcIDMap); data = data + itoa(im.ContainerID) + " " + itoa(im.HostID) + " " + itoa(im.Size) + "\n"; _i++; } _tuple$1 = ByteSliceFromString(data); bytes = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { Close(fd); return err; } _tuple$2 = Write(fd, bytes); err$1 = _tuple$2[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { Close(fd); return err$1; } err$2 = Close(fd); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } return $ifaceNil; }; writeSetgroups = function(pid, enable) { var _tuple, _tuple$1, data, enable, err, err$1, fd, pid, sgf; sgf = "/proc/" + itoa(pid) + "/setgroups"; _tuple = Open(sgf, 2, 0); fd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } data = sliceType.nil; if (enable) { data = (new sliceType($stringToBytes("allow"))); } else { data = (new sliceType($stringToBytes("deny"))); } _tuple$1 = Write(fd, data); err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { Close(fd); return err$1; } return Close(fd); }; writeUidGidMappings = function(pid, sys) { var err, err$1, err$2, gidf, pid, sys, uidf; if (!(sys.UidMappings === sliceType$3.nil)) { uidf = "/proc/" + itoa(pid) + "/uid_map"; err = writeIDMappings(uidf, sys.UidMappings); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } } if (!(sys.GidMappings === sliceType$3.nil)) { err$1 = writeSetgroups(pid, sys.GidMappingsEnableSetgroups); if (!($interfaceIsEqual(err$1, $ifaceNil)) && !($interfaceIsEqual(err$1, new Errno(2)))) { return err$1; } gidf = "/proc/" + itoa(pid) + "/gid_map"; err$2 = writeIDMappings(gidf, sys.GidMappings); if (!($interfaceIsEqual(err$2, $ifaceNil))) { return err$2; } } return $ifaceNil; }; SlicePtrFromStrings = function(ss) { var _tuple, bb, err, i, ss, x; err = $ifaceNil; bb = $makeSlice(sliceType$5, (ss.$length + 1 >> 0)); i = 0; while (true) { if (!(i < ss.$length)) { break; } _tuple = BytePtrFromString(((i < 0 || i >= ss.$length) ? ($throwRuntimeError("index out of range"), undefined) : ss.$array[ss.$offset + i])); ((i < 0 || i >= bb.$length) ? ($throwRuntimeError("index out of range"), undefined) : bb.$array[bb.$offset + i] = _tuple[0]); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [sliceType$5.nil, err]; } i = i + (1) >> 0; } (x = ss.$length, ((x < 0 || x >= bb.$length) ? ($throwRuntimeError("index out of range"), undefined) : bb.$array[bb.$offset + x] = ptrType$2.nil)); return [bb, $ifaceNil]; }; $pkg.SlicePtrFromStrings = SlicePtrFromStrings; CloseOnExec = function(fd) { var fd; fcntl(fd, 2, 1); }; $pkg.CloseOnExec = CloseOnExec; SetNonblock = function(fd, nonblocking) { var _tuple, _tuple$1, err, fd, flag, nonblocking; err = $ifaceNil; _tuple = fcntl(fd, 3, 0); flag = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; return err; } if (nonblocking) { flag = flag | (2048); } else { flag = (flag & ~(2048)) >> 0; } _tuple$1 = fcntl(fd, 4, flag); err = _tuple$1[1]; err = err; return err; }; $pkg.SetNonblock = SetNonblock; forkExec = function(argv0, argv, attr) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, argv, argv0, argv0p, argvp, attr, chroot, dir, envvp, err, err1, err1$1, n, p, pid, sys, wstatus, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _tmp$12 = $f._tmp$12; _tmp$13 = $f._tmp$13; _tmp$14 = $f._tmp$14; _tmp$15 = $f._tmp$15; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; argv = $f.argv; argv0 = $f.argv0; argv0p = $f.argv0p; argvp = $f.argvp; attr = $f.attr; chroot = $f.chroot; dir = $f.dir; envvp = $f.envvp; err = $f.err; err1 = $f.err1; err1$1 = $f.err1$1; n = $f.n; p = $f.p; pid = $f.pid; sys = $f.sys; wstatus = $f.wstatus; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err1 = [err1]; wstatus = [wstatus]; pid = 0; err = $ifaceNil; p = arrayType.zero(); n = 0; err1[0] = 0; wstatus[0] = 0; if (attr === ptrType$5.nil) { attr = zeroProcAttr; } sys = attr.Sys; if (sys === ptrType.nil) { sys = zeroSysProcAttr; } p[0] = -1; p[1] = -1; _tuple = BytePtrFromString(argv0); argv0p = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = 0; _tmp$1 = err; pid = _tmp; err = _tmp$1; $s = -1; return [pid, err]; } _tuple$1 = SlicePtrFromStrings(argv); argvp = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = 0; _tmp$3 = err; pid = _tmp$2; err = _tmp$3; $s = -1; return [pid, err]; } _tuple$2 = SlicePtrFromStrings(attr.Env); envvp = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = err; pid = _tmp$4; err = _tmp$5; $s = -1; return [pid, err]; } if (false && (0 >= argv.$length ? ($throwRuntimeError("index out of range"), undefined) : argv.$array[argv.$offset + 0]).length > argv0.length) { (0 >= argvp.$length ? ($throwRuntimeError("index out of range"), undefined) : argvp.$array[argvp.$offset + 0] = argv0p); } chroot = ptrType$2.nil; if (!(sys.Chroot === "")) { _tuple$3 = BytePtrFromString(sys.Chroot); chroot = _tuple$3[0]; err = _tuple$3[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$6 = 0; _tmp$7 = err; pid = _tmp$6; err = _tmp$7; $s = -1; return [pid, err]; } } dir = ptrType$2.nil; if (!(attr.Dir === "")) { _tuple$4 = BytePtrFromString(attr.Dir); dir = _tuple$4[0]; err = _tuple$4[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$8 = 0; _tmp$9 = err; pid = _tmp$8; err = _tmp$9; $s = -1; return [pid, err]; } } $r = $pkg.ForkLock.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err = forkExecPipe(new sliceType$4(p)); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: /* goto error */ $s = 4; continue; /* } */ case 3: _tuple$5 = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, sys, p[1]); pid = _tuple$5[0]; err1[0] = _tuple$5[1]; /* */ if (!((err1[0] === 0))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((err1[0] === 0))) { */ case 5: err = new Errno((err1[0])); /* goto error */ $s = 4; continue; /* } */ case 6: $r = $pkg.ForkLock.Unlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } Close(p[1]); _tuple$6 = readlen(p[0], (((err1.$ptr || (err1.$ptr = new ptrType$3(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, err1))))), 4); n = _tuple$6[0]; err = _tuple$6[1]; Close(p[0]); if (!($interfaceIsEqual(err, $ifaceNil)) || !((n === 0))) { if (n === 4) { err = new Errno((err1[0])); } if ($interfaceIsEqual(err, $ifaceNil)) { err = new Errno(32); } _tuple$7 = Wait4(pid, (wstatus.$ptr || (wstatus.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, wstatus))), 0, ptrType$7.nil); err1$1 = _tuple$7[1]; while (true) { if (!($interfaceIsEqual(err1$1, new Errno(4)))) { break; } _tuple$8 = Wait4(pid, (wstatus.$ptr || (wstatus.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, wstatus))), 0, ptrType$7.nil); err1$1 = _tuple$8[1]; } _tmp$10 = 0; _tmp$11 = err; pid = _tmp$10; err = _tmp$11; $s = -1; return [pid, err]; } _tmp$12 = pid; _tmp$13 = $ifaceNil; pid = _tmp$12; err = _tmp$13; $s = -1; return [pid, err]; /* error: */ case 4: if (p[0] >= 0) { Close(p[0]); Close(p[1]); } $r = $pkg.ForkLock.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$14 = 0; _tmp$15 = err; pid = _tmp$14; err = _tmp$15; $s = -1; return [pid, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: forkExec }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $f._tmp$12 = _tmp$12; $f._tmp$13 = _tmp$13; $f._tmp$14 = _tmp$14; $f._tmp$15 = _tmp$15; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f.argv = argv; $f.argv0 = argv0; $f.argv0p = argv0p; $f.argvp = argvp; $f.attr = attr; $f.chroot = chroot; $f.dir = dir; $f.envvp = envvp; $f.err = err; $f.err1 = err1; $f.err1$1 = err1$1; $f.n = n; $f.p = p; $f.pid = pid; $f.sys = sys; $f.wstatus = wstatus; $f.$s = $s; $f.$r = $r; return $f; }; StartProcess = function(argv0, argv, attr) { var _r, _tmp, _tmp$1, _tmp$2, _tuple, argv, argv0, attr, err, handle, pid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; argv = $f.argv; argv0 = $f.argv0; attr = $f.attr; err = $f.err; handle = $f.handle; pid = $f.pid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pid = 0; handle = 0; err = $ifaceNil; _r = forkExec(argv0, argv, attr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; pid = _tuple[0]; err = _tuple[1]; _tmp = pid; _tmp$1 = 0; _tmp$2 = err; pid = _tmp; handle = _tmp$1; err = _tmp$2; $s = -1; return [pid, handle, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: StartProcess }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.argv = argv; $f.argv0 = argv0; $f.attr = attr; $f.err = err; $f.handle = handle; $f.pid = pid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.StartProcess = StartProcess; msanRead = function(addr, len) { var addr, len; }; msanWrite = function(addr, len) { var addr, len; }; itoa = function(val) { var val; if (val < 0) { return "-" + uitoa(((-val >>> 0))); } return uitoa(((val >>> 0))); }; uitoa = function(val) { var _q, _r, buf, i, val; buf = arrayType$4.zero(); i = 31; while (true) { if (!(val >= 10)) { break; } ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((_r = val % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24))); i = i - (1) >> 0; val = (_q = val / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); } ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((val + 48 >>> 0) << 24 >>> 24))); return ($bytesToString($subslice(new sliceType(buf), i))); }; ByteSliceFromString = function(s) { var a, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) === 0) { return [sliceType.nil, new Errno(22)]; } i = i + (1) >> 0; } a = $makeSlice(sliceType, (s.length + 1 >> 0)); $copyString(a, s); return [a, $ifaceNil]; }; $pkg.ByteSliceFromString = ByteSliceFromString; Timespec.ptr.prototype.Unix = function() { var _tmp, _tmp$1, nsec, sec, ts; sec = new $Int64(0, 0); nsec = new $Int64(0, 0); ts = this; _tmp = (ts.Sec); _tmp$1 = (ts.Nsec); sec = _tmp; nsec = _tmp$1; return [sec, nsec]; }; Timespec.prototype.Unix = function() { return this.$val.Unix(); }; Timeval.ptr.prototype.Unix = function() { var _tmp, _tmp$1, nsec, sec, tv; sec = new $Int64(0, 0); nsec = new $Int64(0, 0); tv = this; _tmp = (tv.Sec); _tmp$1 = $mul64((tv.Usec), new $Int64(0, 1000)); sec = _tmp; nsec = _tmp$1; return [sec, nsec]; }; Timeval.prototype.Unix = function() { return this.$val.Unix(); }; Timespec.ptr.prototype.Nano = function() { var ts, x, x$1; ts = this; return (x = $mul64((ts.Sec), new $Int64(0, 1000000000)), x$1 = (ts.Nsec), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); }; Timespec.prototype.Nano = function() { return this.$val.Nano(); }; Timeval.ptr.prototype.Nano = function() { var tv, x, x$1; tv = this; return (x = $mul64((tv.Sec), new $Int64(0, 1000000000)), x$1 = $mul64((tv.Usec), new $Int64(0, 1000)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); }; Timeval.prototype.Nano = function() { return this.$val.Nano(); }; Chmod = function(path, mode) { var err, mode, path; err = $ifaceNil; err = Fchmodat(-100, path, mode, 0); return err; }; $pkg.Chmod = Chmod; Fchmodat = function(dirfd, path, mode, flags) { var dirfd, err, flags, mode, path; err = $ifaceNil; if (!((((flags & ~256) >> 0) === 0))) { err = new Errno(22); return err; } else if (!(((flags & 256) === 0))) { err = new Errno(95); return err; } err = fchmodat(dirfd, path, mode); return err; }; $pkg.Fchmodat = Fchmodat; Open = function(path, mode, perm) { var _tuple, err, fd, mode, path, perm; fd = 0; err = $ifaceNil; _tuple = openat(-100, path, mode | 0, perm); fd = _tuple[0]; err = _tuple[1]; return [fd, err]; }; $pkg.Open = Open; Rename = function(oldpath, newpath) { var err, newpath, oldpath; err = $ifaceNil; err = Renameat(-100, oldpath, -100, newpath); return err; }; $pkg.Rename = Rename; Rmdir = function(path) { var path; return unlinkat(-100, path, 512); }; $pkg.Rmdir = Rmdir; Unlink = function(path) { var path; return unlinkat(-100, path, 0); }; $pkg.Unlink = Unlink; Getwd = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, buf, err, n, wd, x; wd = ""; err = $ifaceNil; buf = arrayType$7.zero(); _tuple = Getcwd($subslice(new sliceType(buf), 0)); n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ""; _tmp$1 = err; wd = _tmp; err = _tmp$1; return [wd, err]; } if (n < 1 || n > 4096 || !(((x = n - 1 >> 0, ((x < 0 || x >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x])) === 0))) { _tmp$2 = ""; _tmp$3 = new Errno(22); wd = _tmp$2; err = _tmp$3; return [wd, err]; } _tmp$4 = ($bytesToString($subslice(new sliceType(buf), 0, (n - 1 >> 0)))); _tmp$5 = $ifaceNil; wd = _tmp$4; err = _tmp$5; return [wd, err]; }; $pkg.Getwd = Getwd; WaitStatus.prototype.Exited = function() { var w; w = this.$val; return ((w & 127) >>> 0) === 0; }; $ptrType(WaitStatus).prototype.Exited = function() { return new WaitStatus(this.$get()).Exited(); }; WaitStatus.prototype.Signaled = function() { var w; w = this.$val; return !((((w & 127) >>> 0) === 127)) && !((((w & 127) >>> 0) === 0)); }; $ptrType(WaitStatus).prototype.Signaled = function() { return new WaitStatus(this.$get()).Signaled(); }; WaitStatus.prototype.Stopped = function() { var w; w = this.$val; return ((w & 255) >>> 0) === 127; }; $ptrType(WaitStatus).prototype.Stopped = function() { return new WaitStatus(this.$get()).Stopped(); }; WaitStatus.prototype.Continued = function() { var w; w = this.$val; return w === 65535; }; $ptrType(WaitStatus).prototype.Continued = function() { return new WaitStatus(this.$get()).Continued(); }; WaitStatus.prototype.CoreDump = function() { var w; w = this.$val; return new WaitStatus(w).Signaled() && !((((w & 128) >>> 0) === 0)); }; $ptrType(WaitStatus).prototype.CoreDump = function() { return new WaitStatus(this.$get()).CoreDump(); }; WaitStatus.prototype.ExitStatus = function() { var w; w = this.$val; if (!new WaitStatus(w).Exited()) { return -1; } return (((w >>> 8 >>> 0) >> 0)) & 255; }; $ptrType(WaitStatus).prototype.ExitStatus = function() { return new WaitStatus(this.$get()).ExitStatus(); }; WaitStatus.prototype.Signal = function() { var w; w = this.$val; if (!new WaitStatus(w).Signaled()) { return -1; } return ((((w & 127) >>> 0) >> 0)); }; $ptrType(WaitStatus).prototype.Signal = function() { return new WaitStatus(this.$get()).Signal(); }; WaitStatus.prototype.StopSignal = function() { var w; w = this.$val; if (!new WaitStatus(w).Stopped()) { return -1; } return (((w >>> 8 >>> 0) >> 0)) & 255; }; $ptrType(WaitStatus).prototype.StopSignal = function() { return new WaitStatus(this.$get()).StopSignal(); }; WaitStatus.prototype.TrapCause = function() { var w; w = this.$val; if (!((new WaitStatus(w).StopSignal() === 5))) { return -1; } return (((w >>> 8 >>> 0) >> 0)) >> 8 >> 0; }; $ptrType(WaitStatus).prototype.TrapCause = function() { return new WaitStatus(this.$get()).TrapCause(); }; Wait4 = function(pid, wstatus, options, rusage) { var _tuple, err, options, pid, rusage, status, status$24ptr, wpid, wstatus; wpid = 0; err = $ifaceNil; status = 0; _tuple = wait4(pid, (status$24ptr || (status$24ptr = new ptrType$17(function() { return status; }, function($v) { status = $v; }))), options, rusage); wpid = _tuple[0]; err = _tuple[1]; if (!(wstatus === ptrType$6.nil)) { wstatus.$set(((status >>> 0))); } return [wpid, err]; }; $pkg.Wait4 = Wait4; SockaddrInet4.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, p, sa, x, x$1, x$2; sa = this; if (sa.Port < 0 || sa.Port > 65535) { return [0, 0, new Errno(22)]; } sa.raw.Family = 2; p = (((x = sa.raw, (x.$ptr_Port || (x.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, x)))))); p.nilCheck, p[0] = (((sa.Port >> 8 >> 0) << 24 >>> 24)); p.nilCheck, p[1] = ((sa.Port << 24 >>> 24)); i = 0; while (true) { if (!(i < 4)) { break; } (x$2 = sa.raw.Addr, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = (x$1 = sa.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])))); i = i + (1) >> 0; } _array = new Uint8Array(16); return [(_array), 16, $ifaceNil]; }; SockaddrInet4.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrInet6.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, p, sa, x, x$1, x$2; sa = this; if (sa.Port < 0 || sa.Port > 65535) { return [0, 0, new Errno(22)]; } sa.raw.Family = 10; p = (((x = sa.raw, (x.$ptr_Port || (x.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, x)))))); p.nilCheck, p[0] = (((sa.Port >> 8 >> 0) << 24 >>> 24)); p.nilCheck, p[1] = ((sa.Port << 24 >>> 24)); sa.raw.Scope_id = sa.ZoneId; i = 0; while (true) { if (!(i < 16)) { break; } (x$2 = sa.raw.Addr, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = (x$1 = sa.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])))); i = i + (1) >> 0; } _array = new Uint8Array(28); return [(_array), 28, $ifaceNil]; }; SockaddrInet6.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrUnix.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, n, name, sa, sl, x; sa = this; name = sa.Name; n = name.length; if (n > 108) { return [0, 0, new Errno(22)]; } if ((n === 108) && !((name.charCodeAt(0) === 64))) { return [0, 0, new Errno(22)]; } sa.raw.Family = 1; i = 0; while (true) { if (!(i < n)) { break; } (x = sa.raw.Path, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i] = ((name.charCodeAt(i) << 24 >> 24)))); i = i + (1) >> 0; } sl = 2; if (n > 0) { sl = sl + ((((n >>> 0)) + 1 >>> 0)) >>> 0; } if (sa.raw.Path[0] === 64) { sa.raw.Path[0] = 0; sl = sl - (1) >>> 0; } _array = new Uint8Array(110); return [(_array), sl, $ifaceNil]; }; SockaddrUnix.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrLinklayer.ptr.prototype.sockaddr = function() { var _array, _struct, _view, i, sa, x, x$1; sa = this; if (sa.Ifindex < 0 || sa.Ifindex > 2147483647) { return [0, 0, new Errno(22)]; } sa.raw.Family = 17; sa.raw.Protocol = sa.Protocol; sa.raw.Ifindex = ((sa.Ifindex >> 0)); sa.raw.Hatype = sa.Hatype; sa.raw.Pkttype = sa.Pkttype; sa.raw.Halen = sa.Halen; i = 0; while (true) { if (!(i < 8)) { break; } (x$1 = sa.raw.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = (x = sa.Addr, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])))); i = i + (1) >> 0; } _array = new Uint8Array(20); return [(_array), 20, $ifaceNil]; }; SockaddrLinklayer.prototype.sockaddr = function() { return this.$val.sockaddr(); }; SockaddrNetlink.ptr.prototype.sockaddr = function() { var _array, _struct, _view, sa; sa = this; sa.raw.Family = 16; sa.raw.Pad = sa.Pad; sa.raw.Pid = sa.Pid; sa.raw.Groups = sa.Groups; _array = new Uint8Array(12); return [(_array), 12, $ifaceNil]; }; SockaddrNetlink.prototype.sockaddr = function() { return this.$val.sockaddr(); }; anyToSockaddr = function(rsa) { var _1, _array, _array$1, _array$2, _array$3, _array$4, _array$5, _array$6, _array$7, _array$8, _array$9, _struct, _struct$1, _struct$2, _struct$3, _struct$4, _struct$5, _struct$6, _struct$7, _struct$8, _struct$9, _view, _view$1, _view$2, _view$3, _view$4, _view$5, _view$6, _view$7, _view$8, _view$9, bytes, i, i$1, i$2, n, p, p$1, pp, pp$1, pp$2, pp$3, pp$4, rsa, sa, sa$1, sa$2, sa$3, sa$4, x, x$1, x$2, x$3, x$4, x$5, x$6; _1 = rsa.Addr.Family; if (_1 === (16)) { _array$1 = new Uint8Array(112); pp = ((_array = (_array$1), _struct = new RawSockaddrNetlink.ptr(0, 0, 0, 0), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Family = _view.getUint16(0, true), _struct.Pad = _view.getUint16(2, true), _struct.Pid = _view.getUint32(4, true), _struct.Groups = _view.getUint32(8, true), _struct)); _struct$1 = rsa, _view$1 = new DataView(_array$1.buffer, _array$1.byteOffset), _struct$1.Addr.Family = _view$1.getUint16(0, true), _struct$1.Addr.Data = new ($nativeArray($kindInt8))(_array$1.buffer, $min(_array$1.byteOffset + 2, _array$1.buffer.byteLength)), _struct$1.Pad = new ($nativeArray($kindInt8))(_array$1.buffer, $min(_array$1.byteOffset + 16, _array$1.buffer.byteLength)); sa = new SockaddrNetlink.ptr(0, 0, 0, 0, new RawSockaddrNetlink.ptr(0, 0, 0, 0)); sa.Family = pp.Family; sa.Pad = pp.Pad; sa.Pid = pp.Pid; sa.Groups = pp.Groups; return [sa, $ifaceNil]; } else if (_1 === (17)) { _array$3 = new Uint8Array(112); pp$1 = ((_array$2 = (_array$3), _struct$2 = new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$1.zero()), _view$2 = new DataView(_array$2.buffer, _array$2.byteOffset), _struct$2.Family = _view$2.getUint16(0, true), _struct$2.Protocol = _view$2.getUint16(2, true), _struct$2.Ifindex = _view$2.getInt32(4, true), _struct$2.Hatype = _view$2.getUint16(8, true), _struct$2.Pkttype = _view$2.getUint8(10, true), _struct$2.Halen = _view$2.getUint8(11, true), _struct$2.Addr = new ($nativeArray($kindUint8))(_array$2.buffer, $min(_array$2.byteOffset + 12, _array$2.buffer.byteLength)), _struct$2)); _struct$3 = rsa, _view$3 = new DataView(_array$3.buffer, _array$3.byteOffset), _struct$3.Addr.Family = _view$3.getUint16(0, true), _struct$3.Addr.Data = new ($nativeArray($kindInt8))(_array$3.buffer, $min(_array$3.byteOffset + 2, _array$3.buffer.byteLength)), _struct$3.Pad = new ($nativeArray($kindInt8))(_array$3.buffer, $min(_array$3.byteOffset + 16, _array$3.buffer.byteLength)); sa$1 = new SockaddrLinklayer.ptr(0, 0, 0, 0, 0, arrayType$1.zero(), new RawSockaddrLinklayer.ptr(0, 0, 0, 0, 0, 0, arrayType$1.zero())); sa$1.Protocol = pp$1.Protocol; sa$1.Ifindex = ((pp$1.Ifindex >> 0)); sa$1.Hatype = pp$1.Hatype; sa$1.Pkttype = pp$1.Pkttype; sa$1.Halen = pp$1.Halen; i = 0; while (true) { if (!(i < 8)) { break; } (x$1 = sa$1.Addr, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i] = (x = pp$1.Addr, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])))); i = i + (1) >> 0; } return [sa$1, $ifaceNil]; } else if (_1 === (1)) { _array$5 = new Uint8Array(112); pp$2 = ((_array$4 = (_array$5), _struct$4 = new RawSockaddrUnix.ptr(0, arrayType$8.zero()), _view$4 = new DataView(_array$4.buffer, _array$4.byteOffset), _struct$4.Family = _view$4.getUint16(0, true), _struct$4.Path = new ($nativeArray($kindInt8))(_array$4.buffer, $min(_array$4.byteOffset + 2, _array$4.buffer.byteLength)), _struct$4)); _struct$5 = rsa, _view$5 = new DataView(_array$5.buffer, _array$5.byteOffset), _struct$5.Addr.Family = _view$5.getUint16(0, true), _struct$5.Addr.Data = new ($nativeArray($kindInt8))(_array$5.buffer, $min(_array$5.byteOffset + 2, _array$5.buffer.byteLength)), _struct$5.Pad = new ($nativeArray($kindInt8))(_array$5.buffer, $min(_array$5.byteOffset + 16, _array$5.buffer.byteLength)); sa$2 = new SockaddrUnix.ptr("", new RawSockaddrUnix.ptr(0, arrayType$8.zero())); if (pp$2.Path[0] === 0) { pp$2.Path[0] = 64; } n = 0; while (true) { if (!(n < 108 && !(((x$2 = pp$2.Path, ((n < 0 || n >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[n])) === 0)))) { break; } n = n + (1) >> 0; } bytes = $subslice(new sliceType((($sliceToArray(new sliceType(pp$2.Path))))), 0, n); sa$2.Name = ($bytesToString(bytes)); return [sa$2, $ifaceNil]; } else if (_1 === (2)) { _array$7 = new Uint8Array(112); pp$3 = ((_array$6 = (_array$7), _struct$6 = new RawSockaddrInet4.ptr(0, 0, arrayType$9.zero(), arrayType$1.zero()), _view$6 = new DataView(_array$6.buffer, _array$6.byteOffset), _struct$6.Family = _view$6.getUint16(0, true), _struct$6.Port = _view$6.getUint16(2, true), _struct$6.Addr = new ($nativeArray($kindUint8))(_array$6.buffer, $min(_array$6.byteOffset + 4, _array$6.buffer.byteLength)), _struct$6.Zero = new ($nativeArray($kindUint8))(_array$6.buffer, $min(_array$6.byteOffset + 8, _array$6.buffer.byteLength)), _struct$6)); _struct$7 = rsa, _view$7 = new DataView(_array$7.buffer, _array$7.byteOffset), _struct$7.Addr.Family = _view$7.getUint16(0, true), _struct$7.Addr.Data = new ($nativeArray($kindInt8))(_array$7.buffer, $min(_array$7.byteOffset + 2, _array$7.buffer.byteLength)), _struct$7.Pad = new ($nativeArray($kindInt8))(_array$7.buffer, $min(_array$7.byteOffset + 16, _array$7.buffer.byteLength)); sa$3 = new SockaddrInet4.ptr(0, arrayType$9.zero(), new RawSockaddrInet4.ptr(0, 0, arrayType$9.zero(), arrayType$1.zero())); p = (((pp$3.$ptr_Port || (pp$3.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, pp$3))))); sa$3.Port = ((((p.nilCheck, p[0]) >> 0)) << 8 >> 0) + (((p.nilCheck, p[1]) >> 0)) >> 0; i$1 = 0; while (true) { if (!(i$1 < 4)) { break; } (x$4 = sa$3.Addr, ((i$1 < 0 || i$1 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[i$1] = (x$3 = pp$3.Addr, ((i$1 < 0 || i$1 >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[i$1])))); i$1 = i$1 + (1) >> 0; } return [sa$3, $ifaceNil]; } else if (_1 === (10)) { _array$9 = new Uint8Array(112); pp$4 = ((_array$8 = (_array$9), _struct$8 = new RawSockaddrInet6.ptr(0, 0, 0, arrayType$2.zero(), 0), _view$8 = new DataView(_array$8.buffer, _array$8.byteOffset), _struct$8.Family = _view$8.getUint16(0, true), _struct$8.Port = _view$8.getUint16(2, true), _struct$8.Flowinfo = _view$8.getUint32(4, true), _struct$8.Addr = new ($nativeArray($kindUint8))(_array$8.buffer, $min(_array$8.byteOffset + 8, _array$8.buffer.byteLength)), _struct$8.Scope_id = _view$8.getUint32(24, true), _struct$8)); _struct$9 = rsa, _view$9 = new DataView(_array$9.buffer, _array$9.byteOffset), _struct$9.Addr.Family = _view$9.getUint16(0, true), _struct$9.Addr.Data = new ($nativeArray($kindInt8))(_array$9.buffer, $min(_array$9.byteOffset + 2, _array$9.buffer.byteLength)), _struct$9.Pad = new ($nativeArray($kindInt8))(_array$9.buffer, $min(_array$9.byteOffset + 16, _array$9.buffer.byteLength)); sa$4 = new SockaddrInet6.ptr(0, 0, arrayType$2.zero(), new RawSockaddrInet6.ptr(0, 0, 0, arrayType$2.zero(), 0)); p$1 = (((pp$4.$ptr_Port || (pp$4.$ptr_Port = new ptrType$8(function() { return this.$target.Port; }, function($v) { this.$target.Port = $v; }, pp$4))))); sa$4.Port = ((((p$1.nilCheck, p$1[0]) >> 0)) << 8 >> 0) + (((p$1.nilCheck, p$1[1]) >> 0)) >> 0; sa$4.ZoneId = pp$4.Scope_id; i$2 = 0; while (true) { if (!(i$2 < 16)) { break; } (x$6 = sa$4.Addr, ((i$2 < 0 || i$2 >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i$2] = (x$5 = pp$4.Addr, ((i$2 < 0 || i$2 >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i$2])))); i$2 = i$2 + (1) >> 0; } return [sa$4, $ifaceNil]; } return [$ifaceNil, new Errno(97)]; }; Accept = function(fd) { var _tuple, _tuple$1, err, fd, len, len$24ptr, nfd, rsa, sa; nfd = 0; sa = $ifaceNil; err = $ifaceNil; rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); len = 112; _tuple = accept(fd, rsa, (len$24ptr || (len$24ptr = new ptrType$18(function() { return len; }, function($v) { len = $v; })))); nfd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [nfd, sa, err]; } _tuple$1 = anyToSockaddr(rsa); sa = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { Close(nfd); nfd = 0; } return [nfd, sa, err]; }; $pkg.Accept = Accept; Accept4 = function(fd, flags) { var _tuple, _tuple$1, err, fd, flags, len, len$24ptr, nfd, rsa, sa; nfd = 0; sa = $ifaceNil; err = $ifaceNil; rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); len = 112; _tuple = accept4(fd, rsa, (len$24ptr || (len$24ptr = new ptrType$18(function() { return len; }, function($v) { len = $v; }))), flags); nfd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [nfd, sa, err]; } if (len > 112) { $panic(new $String("RawSockaddrAny too small")); } _tuple$1 = anyToSockaddr(rsa); sa = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { Close(nfd); nfd = 0; } return [nfd, sa, err]; }; $pkg.Accept4 = Accept4; SetsockoptIPMreqn = function(fd, level, opt, mreq) { var _array, _struct, _view, err, fd, level, mreq, opt; err = $ifaceNil; _array = new Uint8Array(12); err = setsockopt(fd, level, opt, (_array), 12); _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Address = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 4, _array.buffer.byteLength)), _struct.Ifindex = _view.getInt32(8, true); return err; }; $pkg.SetsockoptIPMreqn = SetsockoptIPMreqn; Recvmsg = function(fd, p, oob, flags) { var _array, _struct, _tuple, _tuple$1, _tuple$2, _view, dummy, dummy$24ptr, err, fd, flags, from, iov, msg, n, oob, oobn, p, recvflags, rsa, sockType; n = 0; oobn = 0; recvflags = 0; from = $ifaceNil; err = $ifaceNil; msg = new Msghdr.ptr(ptrType$2.nil, 0, arrayType$9.zero(), ptrType$19.nil, new $Uint64(0, 0), ptrType$2.nil, new $Uint64(0, 0), 0, arrayType$9.zero()); rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); _array = new Uint8Array(112); msg.Name = ((_array)); _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); msg.Namelen = 112; iov = new Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0)); if (p.$length > 0) { iov.Base = $indexPtr(p.$array, p.$offset + 0, ptrType$2); iov.SetLen(p.$length); } dummy = 0; if (oob.$length > 0) { if (p.$length === 0) { sockType = 0; _tuple = GetsockoptInt(fd, 1, 3); sockType = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [n, oobn, recvflags, from, err]; } if (!((sockType === 2))) { iov.Base = (dummy$24ptr || (dummy$24ptr = new ptrType$2(function() { return dummy; }, function($v) { dummy = $v; }))); iov.SetLen(1); } } msg.Control = $indexPtr(oob.$array, oob.$offset + 0, ptrType$2); msg.SetControllen(oob.$length); } msg.Iov = iov; msg.Iovlen = new $Uint64(0, 1); _tuple$1 = recvmsg(fd, msg, flags); n = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [n, oobn, recvflags, from, err]; } oobn = ((msg.Controllen.$low >> 0)); recvflags = ((msg.Flags >> 0)); if (!((rsa.Addr.Family === 0))) { _tuple$2 = anyToSockaddr(rsa); from = _tuple$2[0]; err = _tuple$2[1]; } return [n, oobn, recvflags, from, err]; }; $pkg.Recvmsg = Recvmsg; SendmsgN = function(fd, p, oob, to, flags) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, dummy, err, err$1, fd, flags, iov, msg, n, oob, p, ptr, salen, sockType, to, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; dummy = $f.dummy; err = $f.err; err$1 = $f.err$1; fd = $f.fd; flags = $f.flags; iov = $f.iov; msg = $f.msg; n = $f.n; oob = $f.oob; p = $f.p; ptr = $f.ptr; salen = $f.salen; sockType = $f.sockType; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dummy = [dummy]; iov = [iov]; msg = [msg]; n = 0; err = $ifaceNil; ptr = 0; salen = 0; /* */ if (!($interfaceIsEqual(to, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(to, $ifaceNil))) { */ case 1: err$1 = $ifaceNil; _r = to.sockaddr(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ptr = _tuple[0]; salen = _tuple[1]; err$1 = _tuple[2]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } /* } */ case 2: msg[0] = new Msghdr.ptr(ptrType$2.nil, 0, arrayType$9.zero(), ptrType$19.nil, new $Uint64(0, 0), ptrType$2.nil, new $Uint64(0, 0), 0, arrayType$9.zero()); msg[0].Name = (ptr); msg[0].Namelen = ((salen >>> 0)); iov[0] = new Iovec.ptr(ptrType$2.nil, new $Uint64(0, 0)); if (p.$length > 0) { iov[0].Base = $indexPtr(p.$array, p.$offset + 0, ptrType$2); iov[0].SetLen(p.$length); } dummy[0] = 0; if (oob.$length > 0) { if (p.$length === 0) { sockType = 0; _tuple$1 = GetsockoptInt(fd, 1, 3); sockType = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = 0; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } if (!((sockType === 2))) { iov[0].Base = (dummy.$ptr || (dummy.$ptr = new ptrType$2(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, dummy))); iov[0].SetLen(1); } } msg[0].Control = $indexPtr(oob.$array, oob.$offset + 0, ptrType$2); msg[0].SetControllen(oob.$length); } msg[0].Iov = iov[0]; msg[0].Iovlen = new $Uint64(0, 1); _tuple$2 = sendmsg(fd, msg[0], flags); n = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$4 = 0; _tmp$5 = err; n = _tmp$4; err = _tmp$5; $s = -1; return [n, err]; } if (oob.$length > 0 && (p.$length === 0)) { n = 0; } _tmp$6 = n; _tmp$7 = $ifaceNil; n = _tmp$6; err = _tmp$7; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: SendmsgN }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.dummy = dummy; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.flags = flags; $f.iov = iov; $f.msg = msg; $f.n = n; $f.oob = oob; $f.p = p; $f.ptr = ptr; $f.salen = salen; $f.sockType = sockType; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.SendmsgN = SendmsgN; ReadDirent = function(fd, buf) { var _tuple, buf, err, fd, n; n = 0; err = $ifaceNil; _tuple = Getdents(fd, buf); n = _tuple[0]; err = _tuple[1]; return [n, err]; }; $pkg.ReadDirent = ReadDirent; direntIno = function(buf) { var buf; return readInt(buf, 0, 8); }; direntReclen = function(buf) { var buf; return readInt(buf, 16, 2); }; direntNamlen = function(buf) { var _tuple, buf, ok, reclen; _tuple = direntReclen(buf); reclen = _tuple[0]; ok = _tuple[1]; if (!ok) { return [new $Uint64(0, 0), false]; } return [new $Uint64(reclen.$high - 0, reclen.$low - 19), true]; }; Stat = function(path, stat) { var err, path, stat; err = $ifaceNil; err = fstatat(-100, path, stat, 0); return err; }; $pkg.Stat = Stat; Pipe = function(p) { var err, p, pp; err = $ifaceNil; if (!((p.$length === 2))) { err = new Errno(22); return err; } pp = arrayType$13.zero(); err = pipe(pp); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((pp[0] >> 0))); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((pp[1] >> 0))); return err; }; $pkg.Pipe = Pipe; Pipe2 = function(p, flags) { var err, flags, p, pp; err = $ifaceNil; if (!((p.$length === 2))) { err = new Errno(22); return err; } pp = arrayType$13.zero(); err = pipe2(pp, flags); (0 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 0] = ((pp[0] >> 0))); (1 >= p.$length ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + 1] = ((pp[1] >> 0))); return err; }; $pkg.Pipe2 = Pipe2; Iovec.ptr.prototype.SetLen = function(length) { var iov, length; iov = this; iov.Len = (new $Uint64(0, length)); }; Iovec.prototype.SetLen = function(length) { return this.$val.SetLen(length); }; Msghdr.ptr.prototype.SetControllen = function(length) { var length, msghdr; msghdr = this; msghdr.Controllen = (new $Uint64(0, length)); }; Msghdr.prototype.SetControllen = function(length) { return this.$val.SetControllen(length); }; rawVforkSyscall = function() { $throwRuntimeError("native function not implemented: syscall.rawVforkSyscall"); }; mmapper.ptr.prototype.Mmap = function(fd, offset, length, prot, flags) { var _key, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, addr, b, data, err, errno, fd, flags, length, m, offset, p, prot, sl, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; addr = $f.addr; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; fd = $f.fd; flags = $f.flags; length = $f.length; m = $f.m; offset = $f.offset; p = $f.p; prot = $f.prot; sl = $f.sl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); sl = [sl]; data = sliceType.nil; err = $ifaceNil; m = this; if (length <= 0) { _tmp = sliceType.nil; _tmp$1 = new Errno(22); data = _tmp; err = _tmp$1; $s = -1; return [data, err]; } _r = m.mmap(0, ((length >>> 0)), prot, flags, fd, offset); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; addr = _tuple[0]; errno = _tuple[1]; if (!($interfaceIsEqual(errno, $ifaceNil))) { _tmp$2 = sliceType.nil; _tmp$3 = errno; data = _tmp$2; err = _tmp$3; $s = -1; return [data, err]; } sl[0] = new structType.ptr(addr, length, length); b = sl[0]; p = $indexPtr(b.$array, b.$offset + (b.$capacity - 1 >> 0), ptrType$2); $r = m.Mutex.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); _key = p; (m.active || $throwRuntimeError("assignment to entry in nil map"))[ptrType$2.keyFor(_key)] = { k: _key, v: b }; _tmp$4 = b; _tmp$5 = $ifaceNil; data = _tmp$4; err = _tmp$5; $s = -1; return [data, err]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [data, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Mmap }; } $f._key = _key; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.fd = fd; $f.flags = flags; $f.length = length; $f.m = m; $f.offset = offset; $f.p = p; $f.prot = prot; $f.sl = sl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; mmapper.prototype.Mmap = function(fd, offset, length, prot, flags) { return this.$val.Mmap(fd, offset, length, prot, flags); }; mmapper.ptr.prototype.Munmap = function(data) { var _entry, _r, b, data, err, errno, m, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; m = $f.m; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = $ifaceNil; m = this; if ((data.$length === 0) || !((data.$length === data.$capacity))) { err = new Errno(22); $s = -1; return err; } p = $indexPtr(data.$array, data.$offset + (data.$capacity - 1 >> 0), ptrType$2); $r = m.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); b = (_entry = m.active[ptrType$2.keyFor(p)], _entry !== undefined ? _entry.v : sliceType.nil); if (b === sliceType.nil || !($indexPtr(b.$array, b.$offset + 0, ptrType$2) === $indexPtr(data.$array, data.$offset + 0, ptrType$2))) { err = new Errno(22); $s = -1; return err; } _r = m.munmap((($sliceToArray(b))), ((b.$length >>> 0))); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } errno = _r; if (!($interfaceIsEqual(errno, $ifaceNil))) { err = errno; $s = -1; return err; } delete m.active[ptrType$2.keyFor(p)]; err = $ifaceNil; $s = -1; return err; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Munmap }; } $f._entry = _entry; $f._r = _r; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.m = m; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; mmapper.prototype.Munmap = function(data) { return this.$val.Munmap(data); }; Errno.prototype.Error = function() { var e, s; e = this.$val; if (0 <= ((e >> 0)) && ((e >> 0)) < 133) { s = ((e < 0 || e >= errors.length) ? ($throwRuntimeError("index out of range"), undefined) : errors[e]); if (!(s === "")) { return s; } } return "errno " + itoa(((e >> 0))); }; $ptrType(Errno).prototype.Error = function() { return new Errno(this.$get()).Error(); }; Errno.prototype.Temporary = function() { var e; e = this.$val; return (e === 4) || (e === 24) || new Errno(e).Timeout(); }; $ptrType(Errno).prototype.Temporary = function() { return new Errno(this.$get()).Temporary(); }; Errno.prototype.Timeout = function() { var e; e = this.$val; return (e === 11) || (e === 11) || (e === 110); }; $ptrType(Errno).prototype.Timeout = function() { return new Errno(this.$get()).Timeout(); }; errnoErr = function(e) { var _1, e; _1 = e; if (_1 === (0)) { return $ifaceNil; } else if (_1 === (11)) { return errEAGAIN; } else if (_1 === (22)) { return errEINVAL; } else if (_1 === (2)) { return errENOENT; } return new Errno(e); }; Signal.prototype.Signal = function() { var s; s = this.$val; }; $ptrType(Signal).prototype.Signal = function() { return new Signal(this.$get()).Signal(); }; Signal.prototype.String = function() { var s, str; s = this.$val; if (0 <= s && ((s >> 0)) < 32) { str = ((s < 0 || s >= signals.length) ? ($throwRuntimeError("index out of range"), undefined) : signals[s]); if (!(str === "")) { return str; } } return "signal " + itoa(((s >> 0))); }; $ptrType(Signal).prototype.String = function() { return new Signal(this.$get()).String(); }; Read = function(fd, p) { var _tuple, err, fd, n, p; n = 0; err = $ifaceNil; _tuple = read(fd, p); n = _tuple[0]; err = _tuple[1]; if (false) { if (n > 0) { race.WriteRange(($sliceToArray(p)), n); } if ($interfaceIsEqual(err, $ifaceNil)) { race.Acquire(((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; }))))); } } if (false && n > 0) { msanWrite(($sliceToArray(p)), n); } return [n, err]; }; $pkg.Read = Read; Write = function(fd, p) { var _tuple, err, fd, n, p; n = 0; err = $ifaceNil; if (false) { race.ReleaseMerge(((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; }))))); } _tuple = write(fd, p); n = _tuple[0]; err = _tuple[1]; if (false && n > 0) { race.ReadRange(($sliceToArray(p)), n); } if (false && n > 0) { msanRead(($sliceToArray(p)), n); } return [n, err]; }; $pkg.Write = Write; GetsockoptInt = function(fd, level, opt) { var _tmp, _tmp$1, err, fd, level, n, n$24ptr, opt, vallen, vallen$24ptr, value; value = 0; err = $ifaceNil; n = 0; vallen = 4; err = getsockopt(fd, level, opt, ((n$24ptr || (n$24ptr = new ptrType$4(function() { return n; }, function($v) { n = $v; })))), (vallen$24ptr || (vallen$24ptr = new ptrType$18(function() { return vallen; }, function($v) { vallen = $v; })))); _tmp = ((n >> 0)); _tmp$1 = err; value = _tmp; err = _tmp$1; return [value, err]; }; $pkg.GetsockoptInt = GetsockoptInt; Recvfrom = function(fd, p, flags) { var _tuple, _tuple$1, err, fd, flags, from, len, len$24ptr, n, p, rsa; n = 0; from = $ifaceNil; err = $ifaceNil; rsa = new RawSockaddrAny.ptr(new RawSockaddr.ptr(0, arrayType$10.zero()), arrayType$11.zero()); len = 112; _tuple = recvfrom(fd, p, flags, rsa, (len$24ptr || (len$24ptr = new ptrType$18(function() { return len; }, function($v) { len = $v; })))); n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [n, from, err]; } if (!((rsa.Addr.Family === 0))) { _tuple$1 = anyToSockaddr(rsa); from = _tuple$1[0]; err = _tuple$1[1]; } return [n, from, err]; }; $pkg.Recvfrom = Recvfrom; Sendto = function(fd, p, flags, to) { var _r, _tuple, err, fd, flags, n, p, ptr, to, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; fd = $f.fd; flags = $f.flags; n = $f.n; p = $f.p; ptr = $f.ptr; to = $f.to; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; _r = to.sockaddr(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ptr = _tuple[0]; n = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { err = err; $s = -1; return err; } err = sendto(fd, p, flags, ptr, n); $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Sendto }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.flags = flags; $f.n = n; $f.p = p; $f.ptr = ptr; $f.to = to; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sendto = Sendto; SetsockoptByte = function(fd, level, opt, value) { var err, fd, level, opt, value, value$24ptr; err = $ifaceNil; err = setsockopt(fd, level, opt, ((value$24ptr || (value$24ptr = new ptrType$2(function() { return value; }, function($v) { value = $v; })))), 1); return err; }; $pkg.SetsockoptByte = SetsockoptByte; SetsockoptInt = function(fd, level, opt, value) { var err, fd, level, n, n$24ptr, opt, value; err = $ifaceNil; n = ((value >> 0)); err = setsockopt(fd, level, opt, ((n$24ptr || (n$24ptr = new ptrType$4(function() { return n; }, function($v) { n = $v; })))), 4); return err; }; $pkg.SetsockoptInt = SetsockoptInt; SetsockoptInet4Addr = function(fd, level, opt, value) { var err, fd, level, opt, value; err = $ifaceNil; err = setsockopt(fd, level, opt, ($sliceToArray(new sliceType(value))), 4); return err; }; $pkg.SetsockoptInet4Addr = SetsockoptInet4Addr; SetsockoptIPMreq = function(fd, level, opt, mreq) { var _array, _struct, _view, err, fd, level, mreq, opt; err = $ifaceNil; _array = new Uint8Array(8); err = setsockopt(fd, level, opt, (_array), 8); _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Interface = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 4, _array.buffer.byteLength)); return err; }; $pkg.SetsockoptIPMreq = SetsockoptIPMreq; SetsockoptIPv6Mreq = function(fd, level, opt, mreq) { var _array, _struct, _view, err, fd, level, mreq, opt; err = $ifaceNil; _array = new Uint8Array(20); err = setsockopt(fd, level, opt, (_array), 20); _struct = mreq, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Multiaddr = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 0, _array.buffer.byteLength)), _struct.Interface = _view.getUint32(16, true); return err; }; $pkg.SetsockoptIPv6Mreq = SetsockoptIPv6Mreq; SetsockoptLinger = function(fd, level, opt, l) { var _array, _struct, _view, err, fd, l, level, opt; err = $ifaceNil; _array = new Uint8Array(8); err = setsockopt(fd, level, opt, (_array), 8); _struct = l, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Onoff = _view.getInt32(0, true), _struct.Linger = _view.getInt32(4, true); return err; }; $pkg.SetsockoptLinger = SetsockoptLinger; fchmodat = function(dirfd, path, mode) { var _p0, _tuple, _tuple$1, dirfd, e1, err, mode, path; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _tuple$1 = Syscall(268, ((dirfd >>> 0)), ((_p0)), ((mode >>> 0))); e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; openat = function(dirfd, path, flags, mode) { var _p0, _tuple, _tuple$1, dirfd, e1, err, fd, flags, mode, path, r0; fd = 0; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [fd, err]; } _tuple$1 = Syscall6(257, ((dirfd >>> 0)), ((_p0)), ((flags >>> 0)), ((mode >>> 0)), 0, 0); r0 = _tuple$1[0]; e1 = _tuple$1[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [fd, err]; }; unlinkat = function(dirfd, path, flags) { var _p0, _tuple, _tuple$1, dirfd, e1, err, flags, path; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _tuple$1 = Syscall(263, ((dirfd >>> 0)), ((_p0)), ((flags >>> 0))); e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; Getcwd = function(buf) { var _p0, _tuple, buf, e1, err, n, r0; n = 0; err = $ifaceNil; _p0 = 0; if (buf.$length > 0) { _p0 = ($sliceToArray(buf)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall(79, (_p0), ((buf.$length >>> 0)), 0); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; $pkg.Getcwd = Getcwd; wait4 = function(pid, wstatus, options, rusage) { var _array, _struct, _tuple, _view, e1, err, options, pid, r0, rusage, wpid, wstatus; wpid = 0; err = $ifaceNil; _array = new Uint8Array(144); _tuple = Syscall6(61, ((pid >>> 0)), ((wstatus)), ((options >>> 0)), ((_array)), 0, 0); _struct = rusage, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Utime.Sec = new $Int64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Utime.Usec = new $Int64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Stime.Sec = new $Int64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Stime.Usec = new $Int64(_view.getUint32(28, true), _view.getUint32(24, true)), _struct.Maxrss = new $Int64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Ixrss = new $Int64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Idrss = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Isrss = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Minflt = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Majflt = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Nswap = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Inblock = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Oublock = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Msgsnd = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Msgrcv = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.Nsignals = new $Int64(_view.getUint32(124, true), _view.getUint32(120, true)), _struct.Nvcsw = new $Int64(_view.getUint32(132, true), _view.getUint32(128, true)), _struct.Nivcsw = new $Int64(_view.getUint32(140, true), _view.getUint32(136, true)); r0 = _tuple[0]; e1 = _tuple[2]; wpid = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [wpid, err]; }; Close = function(fd) { var _tuple, e1, err, fd; err = $ifaceNil; _tuple = Syscall(3, ((fd >>> 0)), 0, 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Close = Close; Dup = function(oldfd) { var _tuple, e1, err, fd, oldfd, r0; fd = 0; err = $ifaceNil; _tuple = Syscall(32, ((oldfd >>> 0)), 0, 0); r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [fd, err]; }; $pkg.Dup = Dup; Fchdir = function(fd) { var _tuple, e1, err, fd; err = $ifaceNil; _tuple = Syscall(81, ((fd >>> 0)), 0, 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Fchdir = Fchdir; Fchmod = function(fd, mode) { var _tuple, e1, err, fd, mode; err = $ifaceNil; _tuple = Syscall(91, ((fd >>> 0)), ((mode >>> 0)), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Fchmod = Fchmod; fcntl = function(fd, cmd, arg) { var _tuple, arg, cmd, e1, err, fd, r0, val; val = 0; err = $ifaceNil; _tuple = Syscall(72, ((fd >>> 0)), ((cmd >>> 0)), ((arg >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; val = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [val, err]; }; Fsync = function(fd) { var _tuple, e1, err, fd; err = $ifaceNil; _tuple = Syscall(74, ((fd >>> 0)), 0, 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Fsync = Fsync; Getdents = function(fd, buf) { var _p0, _tuple, buf, e1, err, fd, n, r0; n = 0; err = $ifaceNil; _p0 = 0; if (buf.$length > 0) { _p0 = ($sliceToArray(buf)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall(217, ((fd >>> 0)), (_p0), ((buf.$length >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; $pkg.Getdents = Getdents; Getpid = function() { var _tuple, pid, r0; pid = 0; _tuple = rawSyscallNoError(39, 0, 0, 0); r0 = _tuple[0]; pid = ((r0 >> 0)); return pid; }; $pkg.Getpid = Getpid; Kill = function(pid, sig) { var _tuple, e1, err, pid, sig; err = $ifaceNil; _tuple = RawSyscall(62, ((pid >>> 0)), ((sig >>> 0)), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Kill = Kill; read = function(fd, p) { var _p0, _tuple, e1, err, fd, n, p, r0; n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToArray(p)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall(0, ((fd >>> 0)), (_p0), ((p.$length >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; Renameat = function(olddirfd, oldpath, newdirfd, newpath) { var _p0, _p1, _tuple, _tuple$1, _tuple$2, e1, err, newdirfd, newpath, olddirfd, oldpath; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(oldpath); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _p1 = ptrType$2.nil; _tuple$1 = BytePtrFromString(newpath); _p1 = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _tuple$2 = Syscall6(264, ((olddirfd >>> 0)), ((_p0)), ((newdirfd >>> 0)), ((_p1)), 0, 0); e1 = _tuple$2[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Renameat = Renameat; write = function(fd, p) { var _p0, _tuple, e1, err, fd, n, p, r0; n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToArray(p)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall(1, ((fd >>> 0)), (_p0), ((p.$length >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; readlen = function(fd, p, np) { var _tuple, e1, err, fd, n, np, p, r0; n = 0; err = $ifaceNil; _tuple = Syscall(0, ((fd >>> 0)), ((p)), ((np >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; munmap = function(addr, length) { var _tuple, addr, e1, err, length; err = $ifaceNil; _tuple = Syscall(11, (addr), (length), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; Fchown = function(fd, uid, gid) { var _tuple, e1, err, fd, gid, uid; err = $ifaceNil; _tuple = Syscall(93, ((fd >>> 0)), ((uid >>> 0)), ((gid >>> 0))); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Fchown = Fchown; Fstat = function(fd, stat) { var _array, _struct, _tuple, _view, e1, err, fd, stat; err = $ifaceNil; _array = new Uint8Array(144); _tuple = Syscall(5, ((fd >>> 0)), ((_array)), 0); _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Fstat = Fstat; Ftruncate = function(fd, length) { var _tuple, e1, err, fd, length; err = $ifaceNil; _tuple = Syscall(77, ((fd >>> 0)), ((length.$low >>> 0)), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Ftruncate = Ftruncate; Lstat = function(path, stat) { var _array, _p0, _struct, _tuple, _tuple$1, _view, e1, err, path, stat; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _array = new Uint8Array(144); _tuple$1 = Syscall(6, ((_p0)), ((_array)), 0); _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Lstat = Lstat; Pread = function(fd, p, offset) { var _p0, _tuple, e1, err, fd, n, offset, p, r0; n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToArray(p)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall6(17, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((offset.$low >>> 0)), 0, 0); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; $pkg.Pread = Pread; Pwrite = function(fd, p, offset) { var _p0, _tuple, e1, err, fd, n, offset, p, r0; n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToArray(p)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall6(18, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((offset.$low >>> 0)), 0, 0); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; $pkg.Pwrite = Pwrite; Seek = function(fd, offset, whence) { var _tuple, e1, err, fd, off, offset, r0, whence; off = new $Int64(0, 0); err = $ifaceNil; _tuple = Syscall(8, ((fd >>> 0)), ((offset.$low >>> 0)), ((whence >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; off = (new $Int64(0, r0.constructor === Number ? r0 : 1)); if (!((e1 === 0))) { err = errnoErr(e1); } return [off, err]; }; $pkg.Seek = Seek; Shutdown = function(fd, how) { var _tuple, e1, err, fd, how; err = $ifaceNil; _tuple = Syscall(48, ((fd >>> 0)), ((how >>> 0)), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; $pkg.Shutdown = Shutdown; accept = function(s, rsa, addrlen) { var _array, _struct, _tuple, _view, addrlen, e1, err, fd, r0, rsa, s; fd = 0; err = $ifaceNil; _array = new Uint8Array(112); _tuple = Syscall(43, ((s >>> 0)), ((_array)), ((addrlen))); _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [fd, err]; }; accept4 = function(s, rsa, addrlen, flags) { var _array, _struct, _tuple, _view, addrlen, e1, err, fd, flags, r0, rsa, s; fd = 0; err = $ifaceNil; _array = new Uint8Array(112); _tuple = Syscall6(288, ((s >>> 0)), ((_array)), ((addrlen)), ((flags >>> 0)), 0, 0); _struct = rsa, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); r0 = _tuple[0]; e1 = _tuple[2]; fd = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [fd, err]; }; fstatat = function(fd, path, stat, flags) { var _array, _p0, _struct, _tuple, _tuple$1, _view, e1, err, fd, flags, path, stat; err = $ifaceNil; _p0 = ptrType$2.nil; _tuple = BytePtrFromString(path); _p0 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } _array = new Uint8Array(144); _tuple$1 = Syscall6(262, ((fd >>> 0)), ((_p0)), ((_array)), ((flags >>> 0)), 0, 0); _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); e1 = _tuple$1[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; getsockopt = function(s, level, name, val, vallen) { var _tuple, e1, err, level, name, s, val, vallen; err = $ifaceNil; _tuple = Syscall6(55, ((s >>> 0)), ((level >>> 0)), ((name >>> 0)), (val), ((vallen)), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; setsockopt = function(s, level, name, val, vallen) { var _tuple, e1, err, level, name, s, val, vallen; err = $ifaceNil; _tuple = Syscall6(54, ((s >>> 0)), ((level >>> 0)), ((name >>> 0)), (val), (vallen), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; recvfrom = function(fd, p, flags, from, fromlen) { var _array, _p0, _struct, _tuple, _view, e1, err, fd, flags, from, fromlen, n, p, r0; n = 0; err = $ifaceNil; _p0 = 0; if (p.$length > 0) { _p0 = ($sliceToArray(p)); } else { _p0 = (new Uint8Array(0)); } _array = new Uint8Array(112); _tuple = Syscall6(45, ((fd >>> 0)), (_p0), ((p.$length >>> 0)), ((flags >>> 0)), ((_array)), ((fromlen))); _struct = from, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Addr.Family = _view.getUint16(0, true), _struct.Addr.Data = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 2, _array.buffer.byteLength)), _struct.Pad = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 16, _array.buffer.byteLength)); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; sendto = function(s, buf, flags, to, addrlen) { var _p0, _tuple, addrlen, buf, e1, err, flags, s, to; err = $ifaceNil; _p0 = 0; if (buf.$length > 0) { _p0 = ($sliceToArray(buf)); } else { _p0 = (new Uint8Array(0)); } _tuple = Syscall6(44, ((s >>> 0)), (_p0), ((buf.$length >>> 0)), ((flags >>> 0)), (to), ((addrlen >>> 0))); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; recvmsg = function(s, msg, flags) { var _array, _struct, _tuple, _view, e1, err, flags, msg, n, r0, s; n = 0; err = $ifaceNil; _array = new Uint8Array(48); _tuple = Syscall(47, ((s >>> 0)), ((_array)), ((flags >>> 0))); _struct = msg, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Namelen = _view.getUint32(4, true), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 8, _array.buffer.byteLength)), _struct.Iovlen = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Controllen = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Flags = _view.getInt32(40, true), _struct.Pad_cgo_1 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 44, _array.buffer.byteLength)); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; sendmsg = function(s, msg, flags) { var _array, _struct, _tuple, _view, e1, err, flags, msg, n, r0, s; n = 0; err = $ifaceNil; _array = new Uint8Array(48); _tuple = Syscall(46, ((s >>> 0)), ((_array)), ((flags >>> 0))); _struct = msg, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Namelen = _view.getUint32(4, true), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 8, _array.buffer.byteLength)), _struct.Iovlen = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Controllen = new $Uint64(_view.getUint32(36, true), _view.getUint32(32, true)), _struct.Flags = _view.getInt32(40, true), _struct.Pad_cgo_1 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 44, _array.buffer.byteLength)); r0 = _tuple[0]; e1 = _tuple[2]; n = ((r0 >> 0)); if (!((e1 === 0))) { err = errnoErr(e1); } return [n, err]; }; mmap = function(addr, length, prot, flags, fd, offset) { var _tuple, addr, e1, err, fd, flags, length, offset, prot, r0, xaddr; xaddr = 0; err = $ifaceNil; _tuple = Syscall6(9, (addr), (length), ((prot >>> 0)), ((flags >>> 0)), ((fd >>> 0)), ((offset.$low >>> 0))); r0 = _tuple[0]; e1 = _tuple[2]; xaddr = (r0); if (!((e1 === 0))) { err = errnoErr(e1); } return [xaddr, err]; }; pipe = function(p) { var _tuple, e1, err, p; err = $ifaceNil; _tuple = RawSyscall(22, ((p)), 0, 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; pipe2 = function(p, flags) { var _tuple, e1, err, flags, p; err = $ifaceNil; _tuple = RawSyscall(293, ((p)), ((flags >>> 0)), 0); e1 = _tuple[2]; if (!((e1 === 0))) { err = errnoErr(e1); } return err; }; WaitStatus.methods = [{prop: "Exited", name: "Exited", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Signaled", name: "Signaled", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Stopped", name: "Stopped", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Continued", name: "Continued", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "CoreDump", name: "CoreDump", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ExitStatus", name: "ExitStatus", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Signal", name: "Signal", pkg: "", typ: $funcType([], [Signal], false)}, {prop: "StopSignal", name: "StopSignal", pkg: "", typ: $funcType([], [Signal], false)}, {prop: "TrapCause", name: "TrapCause", pkg: "", typ: $funcType([], [$Int], false)}]; ptrType$24.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$11.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$25.methods = [{prop: "Mmap", name: "Mmap", pkg: "", typ: $funcType([$Int, $Int64, $Int, $Int, $Int], [sliceType, $error], false)}, {prop: "Munmap", name: "Munmap", pkg: "", typ: $funcType([sliceType], [$error], false)}]; Errno.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; Signal.methods = [{prop: "Signal", name: "Signal", pkg: "", typ: $funcType([], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$26.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$27.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$28.methods = [{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]; ptrType$29.methods = [{prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64, $Int64], false)}, {prop: "Nano", name: "Nano", pkg: "", typ: $funcType([], [$Int64], false)}]; ptrType$30.methods = [{prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64, $Int64], false)}, {prop: "Nano", name: "Nano", pkg: "", typ: $funcType([], [$Int64], false)}]; ptrType$19.methods = [{prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}]; ptrType$31.methods = [{prop: "SetControllen", name: "SetControllen", pkg: "", typ: $funcType([$Int], [], false)}]; SysProcIDMap.init("", [{prop: "ContainerID", name: "ContainerID", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "HostID", name: "HostID", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Size", name: "Size", embedded: false, exported: true, typ: $Int, tag: ""}]); SysProcAttr.init("", [{prop: "Chroot", name: "Chroot", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Credential", name: "Credential", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Ptrace", name: "Ptrace", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Setsid", name: "Setsid", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Setpgid", name: "Setpgid", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Setctty", name: "Setctty", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Noctty", name: "Noctty", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Ctty", name: "Ctty", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Foreground", name: "Foreground", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Pgid", name: "Pgid", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Pdeathsig", name: "Pdeathsig", embedded: false, exported: true, typ: Signal, tag: ""}, {prop: "Cloneflags", name: "Cloneflags", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Unshareflags", name: "Unshareflags", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "UidMappings", name: "UidMappings", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "GidMappings", name: "GidMappings", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "GidMappingsEnableSetgroups", name: "GidMappingsEnableSetgroups", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "AmbientCaps", name: "AmbientCaps", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); Credential.init("", [{prop: "Uid", name: "Uid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: sliceType$10, tag: ""}, {prop: "NoSetGroups", name: "NoSetGroups", embedded: false, exported: true, typ: $Bool, tag: ""}]); ProcAttr.init("", [{prop: "Dir", name: "Dir", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Env", name: "Env", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "Files", name: "Files", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Sys", name: "Sys", embedded: false, exported: true, typ: ptrType, tag: ""}]); SockaddrLinklayer.init("syscall", [{prop: "Protocol", name: "Protocol", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Hatype", name: "Hatype", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pkttype", name: "Pkttype", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Halen", name: "Halen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$1, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrLinklayer, tag: ""}]); SockaddrNetlink.init("syscall", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrNetlink, tag: ""}]); mmapper.init("syscall", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: sync.Mutex, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "mmap", name: "mmap", embedded: false, exported: false, typ: funcType$2, tag: ""}, {prop: "munmap", name: "munmap", embedded: false, exported: false, typ: funcType$3, tag: ""}]); Sockaddr.init([{prop: "sockaddr", name: "sockaddr", pkg: "syscall", typ: $funcType([], [$UnsafePointer, _Socklen, $error], false)}]); SockaddrInet4.init("syscall", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrInet4, tag: ""}]); SockaddrInet6.init("syscall", [{prop: "Port", name: "Port", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ZoneId", name: "ZoneId", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$2, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrInet6, tag: ""}]); SockaddrUnix.init("syscall", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "raw", name: "raw", embedded: false, exported: false, typ: RawSockaddrUnix, tag: ""}]); Timespec.init("", [{prop: "Sec", name: "Sec", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nsec", name: "Nsec", embedded: false, exported: true, typ: $Int64, tag: ""}]); Timeval.init("", [{prop: "Sec", name: "Sec", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Usec", name: "Usec", embedded: false, exported: true, typ: $Int64, tag: ""}]); Rusage.init("", [{prop: "Utime", name: "Utime", embedded: false, exported: true, typ: Timeval, tag: ""}, {prop: "Stime", name: "Stime", embedded: false, exported: true, typ: Timeval, tag: ""}, {prop: "Maxrss", name: "Maxrss", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Ixrss", name: "Ixrss", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Idrss", name: "Idrss", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Isrss", name: "Isrss", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Minflt", name: "Minflt", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Majflt", name: "Majflt", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nswap", name: "Nswap", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Inblock", name: "Inblock", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Oublock", name: "Oublock", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Msgsnd", name: "Msgsnd", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Msgrcv", name: "Msgrcv", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nsignals", name: "Nsignals", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nvcsw", name: "Nvcsw", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Nivcsw", name: "Nivcsw", embedded: false, exported: true, typ: $Int64, tag: ""}]); Stat_t.init("", [{prop: "Dev", name: "Dev", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Ino", name: "Ino", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Nlink", name: "Nlink", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Mode", name: "Mode", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Uid", name: "Uid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "X__pad0", name: "X__pad0", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Rdev", name: "Rdev", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Size", name: "Size", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Blksize", name: "Blksize", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Blocks", name: "Blocks", embedded: false, exported: true, typ: $Int64, tag: ""}, {prop: "Atim", name: "Atim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "Mtim", name: "Mtim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "Ctim", name: "Ctim", embedded: false, exported: true, typ: Timespec, tag: ""}, {prop: "X__unused", name: "X__unused", embedded: false, exported: true, typ: arrayType$5, tag: ""}]); RawSockaddrInet4.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Zero", name: "Zero", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); RawSockaddrInet6.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Port", name: "Port", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Flowinfo", name: "Flowinfo", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$2, tag: ""}, {prop: "Scope_id", name: "Scope_id", embedded: false, exported: true, typ: $Uint32, tag: ""}]); RawSockaddrUnix.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: arrayType$8, tag: ""}]); RawSockaddrLinklayer.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Protocol", name: "Protocol", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Hatype", name: "Hatype", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pkttype", name: "Pkttype", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Halen", name: "Halen", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Addr", name: "Addr", embedded: false, exported: true, typ: arrayType$1, tag: ""}]); RawSockaddrNetlink.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Groups", name: "Groups", embedded: false, exported: true, typ: $Uint32, tag: ""}]); RawSockaddr.init("", [{prop: "Family", name: "Family", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Data", name: "Data", embedded: false, exported: true, typ: arrayType$10, tag: ""}]); RawSockaddrAny.init("", [{prop: "Addr", name: "Addr", embedded: false, exported: true, typ: RawSockaddr, tag: ""}, {prop: "Pad", name: "Pad", embedded: false, exported: true, typ: arrayType$11, tag: ""}]); Linger.init("", [{prop: "Onoff", name: "Onoff", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Linger", name: "Linger", embedded: false, exported: true, typ: $Int32, tag: ""}]); Iovec.init("", [{prop: "Base", name: "Base", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Uint64, tag: ""}]); IPMreq.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Interface", name: "Interface", embedded: false, exported: true, typ: arrayType$9, tag: ""}]); IPMreqn.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Address", name: "Address", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Ifindex", name: "Ifindex", embedded: false, exported: true, typ: $Int32, tag: ""}]); IPv6Mreq.init("", [{prop: "Multiaddr", name: "Multiaddr", embedded: false, exported: true, typ: arrayType$2, tag: ""}, {prop: "Interface", name: "Interface", embedded: false, exported: true, typ: $Uint32, tag: ""}]); Msghdr.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Namelen", name: "Namelen", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Pad_cgo_0", name: "Pad_cgo_0", embedded: false, exported: true, typ: arrayType$9, tag: ""}, {prop: "Iov", name: "Iov", embedded: false, exported: true, typ: ptrType$19, tag: ""}, {prop: "Iovlen", name: "Iovlen", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Control", name: "Control", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "Controllen", name: "Controllen", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Flags", name: "Flags", embedded: false, exported: true, typ: $Int32, tag: ""}, {prop: "Pad_cgo_1", name: "Pad_cgo_1", embedded: false, exported: true, typ: arrayType$9, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = race.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } lineBuffer = sliceType.nil; syscallModule = null; envOnce = new sync.Once.ptr(new sync.Mutex.ptr(0, 0), 0); envLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); env = false; $pkg.ForkLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); zeroProcAttr = new ProcAttr.ptr("", sliceType$1.nil, sliceType$2.nil, ptrType.nil); zeroSysProcAttr = new SysProcAttr.ptr("", ptrType$1.nil, false, false, false, false, false, 0, false, 0, 0, 0, 0, sliceType$3.nil, sliceType$3.nil, false, sliceType$2.nil); ioSync = new $Int64(0, 0); warningPrinted = false; alreadyTriedToLoad = false; minusOne = -1; envs = runtime_envs(); none = $toNativeArray($kindUint8, [110, 111, 110, 101, 0]); slash = $toNativeArray($kindUint8, [47, 0]); $pkg.Stdin = 0; $pkg.Stdout = 1; $pkg.Stderr = 2; errEAGAIN = new Errno(11); errEINVAL = new Errno(22); errENOENT = new Errno(2); errors = $toNativeArray($kindString, ["", "operation not permitted", "no such file or directory", "no such process", "interrupted system call", "input/output error", "no such device or address", "argument list too long", "exec format error", "bad file descriptor", "no child processes", "resource temporarily unavailable", "cannot allocate memory", "permission denied", "bad address", "block device required", "device or resource busy", "file exists", "invalid cross-device link", "no such device", "not a directory", "is a directory", "invalid argument", "too many open files in system", "too many open files", "inappropriate ioctl for device", "text file busy", "file too large", "no space left on device", "illegal seek", "read-only file system", "too many links", "broken pipe", "numerical argument out of domain", "numerical result out of range", "resource deadlock avoided", "file name too long", "no locks available", "function not implemented", "directory not empty", "too many levels of symbolic links", "", "no message of desired type", "identifier removed", "channel number out of range", "level 2 not synchronized", "level 3 halted", "level 3 reset", "link number out of range", "protocol driver not attached", "no CSI structure available", "level 2 halted", "invalid exchange", "invalid request descriptor", "exchange full", "no anode", "invalid request code", "invalid slot", "", "bad font file format", "device not a stream", "no data available", "timer expired", "out of streams resources", "machine is not on the network", "package not installed", "object is remote", "link has been severed", "advertise error", "srmount error", "communication error on send", "protocol error", "multihop attempted", "RFS specific error", "bad message", "value too large for defined data type", "name not unique on network", "file descriptor in bad state", "remote address changed", "can not access a needed shared library", "accessing a corrupted shared library", ".lib section in a.out corrupted", "attempting to link in too many shared libraries", "cannot exec a shared library directly", "invalid or incomplete multibyte or wide character", "interrupted system call should be restarted", "streams pipe error", "too many users", "socket operation on non-socket", "destination address required", "message too long", "protocol wrong type for socket", "protocol not available", "protocol not supported", "socket type not supported", "operation not supported", "protocol family not supported", "address family not supported by protocol", "address already in use", "cannot assign requested address", "network is down", "network is unreachable", "network dropped connection on reset", "software caused connection abort", "connection reset by peer", "no buffer space available", "transport endpoint is already connected", "transport endpoint is not connected", "cannot send after transport endpoint shutdown", "too many references: cannot splice", "connection timed out", "connection refused", "host is down", "no route to host", "operation already in progress", "operation now in progress", "stale NFS file handle", "structure needs cleaning", "not a XENIX named type file", "no XENIX semaphores available", "is a named type file", "remote I/O error", "disk quota exceeded", "no medium found", "wrong medium type", "operation canceled", "required key not available", "key has expired", "key has been revoked", "key was rejected by service", "owner died", "state not recoverable", "operation not possible due to RF-kill"]); signals = $toNativeArray($kindString, ["", "hangup", "interrupt", "quit", "illegal instruction", "trace/breakpoint trap", "aborted", "bus error", "floating point exception", "killed", "user defined signal 1", "segmentation fault", "user defined signal 2", "broken pipe", "alarm clock", "terminated", "stack fault", "child exited", "continued", "stopped (signal)", "stopped", "stopped (tty input)", "stopped (tty output)", "urgent I/O condition", "CPU time limit exceeded", "file size limit exceeded", "virtual timer expired", "profiling timer expired", "window changed", "I/O possible", "power failure", "bad system call"]); mapper = new mmapper.ptr(new sync.Mutex.ptr(0, 0), {}, mmap, munmap); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/gopherjs/gopherjs/nosync"] = (function() { var $pkg = {}, $init, Mutex, Once, ptrType$1, funcType$1, ptrType$4; Mutex = $pkg.Mutex = $newType(0, $kindStruct, "nosync.Mutex", true, "github.com/gopherjs/gopherjs/nosync", true, function(locked_) { this.$val = this; if (arguments.length === 0) { this.locked = false; return; } this.locked = locked_; }); Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", true, "github.com/gopherjs/gopherjs/nosync", true, function(doing_, done_) { this.$val = this; if (arguments.length === 0) { this.doing = false; this.done = false; return; } this.doing = doing_; this.done = done_; }); ptrType$1 = $ptrType(Mutex); funcType$1 = $funcType([], [], false); ptrType$4 = $ptrType(Once); Mutex.ptr.prototype.Lock = function() { var m; m = this; if (m.locked) { $panic(new $String("nosync: mutex is already locked")); } m.locked = true; }; Mutex.prototype.Lock = function() { return this.$val.Lock(); }; Mutex.ptr.prototype.Unlock = function() { var m; m = this; if (!m.locked) { $panic(new $String("nosync: unlock of unlocked mutex")); } m.locked = false; }; Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; Once.ptr.prototype.Do = function(f) { var f, o, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); o = [o]; o[0] = this; if (o[0].done) { $s = -1; return; } if (o[0].doing) { $panic(new $String("nosync: Do called within f")); } o[0].doing = true; $deferred.push([(function(o) { return function() { o[0].doing = false; o[0].done = true; }; })(o), []]); $r = f(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Once.prototype.Do = function(f) { return this.$val.Do(f); }; ptrType$1.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; ptrType$4.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}]; Mutex.init("github.com/gopherjs/gopherjs/nosync", [{prop: "locked", name: "locked", embedded: false, exported: false, typ: $Bool, tag: ""}]); Once.init("github.com/gopherjs/gopherjs/nosync", [{prop: "doing", name: "doing", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: $Bool, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["time"] = (function() { var $pkg = {}, $init, errors, js, nosync, runtime, syscall, runtimeTimer, ParseError, Timer, Time, Month, Weekday, Duration, Location, zone, zoneTrans, sliceType, sliceType$1, ptrType, sliceType$2, structType, arrayType, sliceType$3, arrayType$1, arrayType$2, ptrType$2, arrayType$3, funcType$1, ptrType$3, ptrType$4, ptrType$5, chanType$1, ptrType$7, zoneSources, std0x, longDayNames, shortDayNames, shortMonthNames, longMonthNames, atoiError, errBad, errLeadingInt, months, days, daysBefore, utcLoc, utcLoc$24ptr, localLoc, localLoc$24ptr, localOnce, errLocation, badData, init, initLocal, runtimeNano, now, Sleep, startTimer, stopTimer, indexByte, startsWithLowerCase, nextStdChunk, match, lookup, appendInt, atoi, formatNano, quote, isDigit, getnum, cutspace, skip, Parse, parse, parseTimeZone, parseGMT, parseSignedOffset, parseNanoseconds, leadingInt, when, absWeekday, absClock, fmtFrac, fmtInt, lessThanHalf, Until, absDate, daysIn, Now, unixTime, Unix, isLeap, norm, Date, div, FixedZone; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; runtime = $packages["runtime"]; syscall = $packages["syscall"]; runtimeTimer = $pkg.runtimeTimer = $newType(0, $kindStruct, "time.runtimeTimer", true, "time", false, function(i_, when_, period_, f_, arg_, timeout_, active_) { this.$val = this; if (arguments.length === 0) { this.i = 0; this.when = new $Int64(0, 0); this.period = new $Int64(0, 0); this.f = $throwNilPointerError; this.arg = $ifaceNil; this.timeout = null; this.active = false; return; } this.i = i_; this.when = when_; this.period = period_; this.f = f_; this.arg = arg_; this.timeout = timeout_; this.active = active_; }); ParseError = $pkg.ParseError = $newType(0, $kindStruct, "time.ParseError", true, "time", true, function(Layout_, Value_, LayoutElem_, ValueElem_, Message_) { this.$val = this; if (arguments.length === 0) { this.Layout = ""; this.Value = ""; this.LayoutElem = ""; this.ValueElem = ""; this.Message = ""; return; } this.Layout = Layout_; this.Value = Value_; this.LayoutElem = LayoutElem_; this.ValueElem = ValueElem_; this.Message = Message_; }); Timer = $pkg.Timer = $newType(0, $kindStruct, "time.Timer", true, "time", true, function(C_, r_) { this.$val = this; if (arguments.length === 0) { this.C = $chanNil; this.r = new runtimeTimer.ptr(0, new $Int64(0, 0), new $Int64(0, 0), $throwNilPointerError, $ifaceNil, null, false); return; } this.C = C_; this.r = r_; }); Time = $pkg.Time = $newType(0, $kindStruct, "time.Time", true, "time", true, function(wall_, ext_, loc_) { this.$val = this; if (arguments.length === 0) { this.wall = new $Uint64(0, 0); this.ext = new $Int64(0, 0); this.loc = ptrType$2.nil; return; } this.wall = wall_; this.ext = ext_; this.loc = loc_; }); Month = $pkg.Month = $newType(4, $kindInt, "time.Month", true, "time", true, null); Weekday = $pkg.Weekday = $newType(4, $kindInt, "time.Weekday", true, "time", true, null); Duration = $pkg.Duration = $newType(8, $kindInt64, "time.Duration", true, "time", true, null); Location = $pkg.Location = $newType(0, $kindStruct, "time.Location", true, "time", true, function(name_, zone_, tx_, cacheStart_, cacheEnd_, cacheZone_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.zone = sliceType.nil; this.tx = sliceType$1.nil; this.cacheStart = new $Int64(0, 0); this.cacheEnd = new $Int64(0, 0); this.cacheZone = ptrType.nil; return; } this.name = name_; this.zone = zone_; this.tx = tx_; this.cacheStart = cacheStart_; this.cacheEnd = cacheEnd_; this.cacheZone = cacheZone_; }); zone = $pkg.zone = $newType(0, $kindStruct, "time.zone", true, "time", false, function(name_, offset_, isDST_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.offset = 0; this.isDST = false; return; } this.name = name_; this.offset = offset_; this.isDST = isDST_; }); zoneTrans = $pkg.zoneTrans = $newType(0, $kindStruct, "time.zoneTrans", true, "time", false, function(when_, index_, isstd_, isutc_) { this.$val = this; if (arguments.length === 0) { this.when = new $Int64(0, 0); this.index = 0; this.isstd = false; this.isutc = false; return; } this.when = when_; this.index = index_; this.isstd = isstd_; this.isutc = isutc_; }); sliceType = $sliceType(zone); sliceType$1 = $sliceType(zoneTrans); ptrType = $ptrType(zone); sliceType$2 = $sliceType($String); structType = $structType("", []); arrayType = $arrayType($Uint8, 20); sliceType$3 = $sliceType($Uint8); arrayType$1 = $arrayType($Uint8, 9); arrayType$2 = $arrayType($Uint8, 64); ptrType$2 = $ptrType(Location); arrayType$3 = $arrayType($Uint8, 32); funcType$1 = $funcType([$emptyInterface, $Uintptr], [], false); ptrType$3 = $ptrType(js.Object); ptrType$4 = $ptrType(ParseError); ptrType$5 = $ptrType(Timer); chanType$1 = $chanType(Time, false, true); ptrType$7 = $ptrType(Time); init = function() { $unused(Unix(new $Int64(0, 0), new $Int64(0, 0))); }; initLocal = function() { var d, i, j, s; d = new ($global.Date)(); s = $internalize(d, $String); i = indexByte(s, 40); j = indexByte(s, 41); if ((i === -1) || (j === -1)) { localLoc.name = "UTC"; return; } localLoc.name = $substring(s, (i + 1 >> 0), j); localLoc.zone = new sliceType([new zone.ptr(localLoc.name, $imul(($parseInt(d.getTimezoneOffset()) >> 0), -60), false)]); }; runtimeNano = function() { return $mul64($internalize(new ($global.Date)().getTime(), $Int64), new $Int64(0, 1000000)); }; now = function() { var _tmp, _tmp$1, _tmp$2, mono, n, nsec, sec, x; sec = new $Int64(0, 0); nsec = 0; mono = new $Int64(0, 0); n = runtimeNano(); _tmp = $div64(n, new $Int64(0, 1000000000), false); _tmp$1 = (((x = $div64(n, new $Int64(0, 1000000000), true), x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); _tmp$2 = n; sec = _tmp; nsec = _tmp$1; mono = _tmp$2; return [sec, nsec, mono]; }; Sleep = function(d) { var _r, c, d, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; d = $f.d; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; c[0] = new $Chan(structType, 0); $setTimeout((function(c) { return function() { $close(c[0]); }; })(c), (((x = $div64(d, new Duration(0, 1000000), false), x.$low + ((x.$high >> 31) * 4294967296)) >> 0))); _r = $recv(c[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r[0]; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Sleep }; } $f._r = _r; $f.c = c; $f.d = d; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sleep = Sleep; startTimer = function(t) { var diff, t, x, x$1; t.active = true; diff = $div64(((x = t.when, x$1 = runtimeNano(), new $Int64(x.$high - x$1.$high, x.$low - x$1.$low))), new $Int64(0, 1000000), false); if ((diff.$high > 0 || (diff.$high === 0 && diff.$low > 2147483647))) { return; } if ((diff.$high < 0 || (diff.$high === 0 && diff.$low < 0))) { diff = new $Int64(0, 0); } t.timeout = $setTimeout((function() { var x$2, x$3, x$4; t.active = false; if (!((x$2 = t.period, (x$2.$high === 0 && x$2.$low === 0)))) { t.when = (x$3 = t.when, x$4 = t.period, new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); startTimer(t); } $go(t.f, [t.arg, 0]); }), $externalize(new $Int64(diff.$high + 0, diff.$low + 1), $Int64)); }; stopTimer = function(t) { var t, wasActive; $global.clearTimeout(t.timeout); wasActive = t.active; t.active = false; return wasActive; }; indexByte = function(s, c) { var c, s; return $parseInt(s.indexOf($global.String.fromCharCode(c))) >> 0; }; startsWithLowerCase = function(str) { var c, str; if (str.length === 0) { return false; } c = str.charCodeAt(0); return 97 <= c && c <= 122; }; nextStdChunk = function(layout) { var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$5, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$6, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$7, _tmp$70, _tmp$71, _tmp$72, _tmp$73, _tmp$74, _tmp$75, _tmp$76, _tmp$77, _tmp$78, _tmp$79, _tmp$8, _tmp$80, _tmp$81, _tmp$82, _tmp$83, _tmp$84, _tmp$85, _tmp$86, _tmp$9, c, ch, i, j, layout, prefix, std, std$1, suffix, x; prefix = ""; std = 0; suffix = ""; i = 0; while (true) { if (!(i < layout.length)) { break; } c = ((layout.charCodeAt(i) >> 0)); _1 = c; if (_1 === (74)) { if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Jan") { if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "January") { _tmp = $substring(layout, 0, i); _tmp$1 = 257; _tmp$2 = $substring(layout, (i + 7 >> 0)); prefix = _tmp; std = _tmp$1; suffix = _tmp$2; return [prefix, std, suffix]; } if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { _tmp$3 = $substring(layout, 0, i); _tmp$4 = 258; _tmp$5 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$3; std = _tmp$4; suffix = _tmp$5; return [prefix, std, suffix]; } } } else if (_1 === (77)) { if (layout.length >= (i + 3 >> 0)) { if ($substring(layout, i, (i + 3 >> 0)) === "Mon") { if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Monday") { _tmp$6 = $substring(layout, 0, i); _tmp$7 = 261; _tmp$8 = $substring(layout, (i + 6 >> 0)); prefix = _tmp$6; std = _tmp$7; suffix = _tmp$8; return [prefix, std, suffix]; } if (!startsWithLowerCase($substring(layout, (i + 3 >> 0)))) { _tmp$9 = $substring(layout, 0, i); _tmp$10 = 262; _tmp$11 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$9; std = _tmp$10; suffix = _tmp$11; return [prefix, std, suffix]; } } if ($substring(layout, i, (i + 3 >> 0)) === "MST") { _tmp$12 = $substring(layout, 0, i); _tmp$13 = 21; _tmp$14 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$12; std = _tmp$13; suffix = _tmp$14; return [prefix, std, suffix]; } } } else if (_1 === (48)) { if (layout.length >= (i + 2 >> 0) && 49 <= layout.charCodeAt((i + 1 >> 0)) && layout.charCodeAt((i + 1 >> 0)) <= 54) { _tmp$15 = $substring(layout, 0, i); _tmp$16 = (x = layout.charCodeAt((i + 1 >> 0)) - 49 << 24 >>> 24, ((x < 0 || x >= std0x.length) ? ($throwRuntimeError("index out of range"), undefined) : std0x[x])); _tmp$17 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$15; std = _tmp$16; suffix = _tmp$17; return [prefix, std, suffix]; } } else if (_1 === (49)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 53)) { _tmp$18 = $substring(layout, 0, i); _tmp$19 = 522; _tmp$20 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$18; std = _tmp$19; suffix = _tmp$20; return [prefix, std, suffix]; } _tmp$21 = $substring(layout, 0, i); _tmp$22 = 259; _tmp$23 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$21; std = _tmp$22; suffix = _tmp$23; return [prefix, std, suffix]; } else if (_1 === (50)) { if (layout.length >= (i + 4 >> 0) && $substring(layout, i, (i + 4 >> 0)) === "2006") { _tmp$24 = $substring(layout, 0, i); _tmp$25 = 273; _tmp$26 = $substring(layout, (i + 4 >> 0)); prefix = _tmp$24; std = _tmp$25; suffix = _tmp$26; return [prefix, std, suffix]; } _tmp$27 = $substring(layout, 0, i); _tmp$28 = 263; _tmp$29 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$27; std = _tmp$28; suffix = _tmp$29; return [prefix, std, suffix]; } else if (_1 === (95)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 50)) { if (layout.length >= (i + 5 >> 0) && $substring(layout, (i + 1 >> 0), (i + 5 >> 0)) === "2006") { _tmp$30 = $substring(layout, 0, (i + 1 >> 0)); _tmp$31 = 273; _tmp$32 = $substring(layout, (i + 5 >> 0)); prefix = _tmp$30; std = _tmp$31; suffix = _tmp$32; return [prefix, std, suffix]; } _tmp$33 = $substring(layout, 0, i); _tmp$34 = 264; _tmp$35 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$33; std = _tmp$34; suffix = _tmp$35; return [prefix, std, suffix]; } } else if (_1 === (51)) { _tmp$36 = $substring(layout, 0, i); _tmp$37 = 523; _tmp$38 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$36; std = _tmp$37; suffix = _tmp$38; return [prefix, std, suffix]; } else if (_1 === (52)) { _tmp$39 = $substring(layout, 0, i); _tmp$40 = 525; _tmp$41 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$39; std = _tmp$40; suffix = _tmp$41; return [prefix, std, suffix]; } else if (_1 === (53)) { _tmp$42 = $substring(layout, 0, i); _tmp$43 = 527; _tmp$44 = $substring(layout, (i + 1 >> 0)); prefix = _tmp$42; std = _tmp$43; suffix = _tmp$44; return [prefix, std, suffix]; } else if (_1 === (80)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 77)) { _tmp$45 = $substring(layout, 0, i); _tmp$46 = 531; _tmp$47 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$45; std = _tmp$46; suffix = _tmp$47; return [prefix, std, suffix]; } } else if (_1 === (112)) { if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 109)) { _tmp$48 = $substring(layout, 0, i); _tmp$49 = 532; _tmp$50 = $substring(layout, (i + 2 >> 0)); prefix = _tmp$48; std = _tmp$49; suffix = _tmp$50; return [prefix, std, suffix]; } } else if (_1 === (45)) { if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "-070000") { _tmp$51 = $substring(layout, 0, i); _tmp$52 = 28; _tmp$53 = $substring(layout, (i + 7 >> 0)); prefix = _tmp$51; std = _tmp$52; suffix = _tmp$53; return [prefix, std, suffix]; } if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "-07:00:00") { _tmp$54 = $substring(layout, 0, i); _tmp$55 = 31; _tmp$56 = $substring(layout, (i + 9 >> 0)); prefix = _tmp$54; std = _tmp$55; suffix = _tmp$56; return [prefix, std, suffix]; } if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "-0700") { _tmp$57 = $substring(layout, 0, i); _tmp$58 = 27; _tmp$59 = $substring(layout, (i + 5 >> 0)); prefix = _tmp$57; std = _tmp$58; suffix = _tmp$59; return [prefix, std, suffix]; } if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "-07:00") { _tmp$60 = $substring(layout, 0, i); _tmp$61 = 30; _tmp$62 = $substring(layout, (i + 6 >> 0)); prefix = _tmp$60; std = _tmp$61; suffix = _tmp$62; return [prefix, std, suffix]; } if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "-07") { _tmp$63 = $substring(layout, 0, i); _tmp$64 = 29; _tmp$65 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$63; std = _tmp$64; suffix = _tmp$65; return [prefix, std, suffix]; } } else if (_1 === (90)) { if (layout.length >= (i + 7 >> 0) && $substring(layout, i, (i + 7 >> 0)) === "Z070000") { _tmp$66 = $substring(layout, 0, i); _tmp$67 = 23; _tmp$68 = $substring(layout, (i + 7 >> 0)); prefix = _tmp$66; std = _tmp$67; suffix = _tmp$68; return [prefix, std, suffix]; } if (layout.length >= (i + 9 >> 0) && $substring(layout, i, (i + 9 >> 0)) === "Z07:00:00") { _tmp$69 = $substring(layout, 0, i); _tmp$70 = 26; _tmp$71 = $substring(layout, (i + 9 >> 0)); prefix = _tmp$69; std = _tmp$70; suffix = _tmp$71; return [prefix, std, suffix]; } if (layout.length >= (i + 5 >> 0) && $substring(layout, i, (i + 5 >> 0)) === "Z0700") { _tmp$72 = $substring(layout, 0, i); _tmp$73 = 22; _tmp$74 = $substring(layout, (i + 5 >> 0)); prefix = _tmp$72; std = _tmp$73; suffix = _tmp$74; return [prefix, std, suffix]; } if (layout.length >= (i + 6 >> 0) && $substring(layout, i, (i + 6 >> 0)) === "Z07:00") { _tmp$75 = $substring(layout, 0, i); _tmp$76 = 25; _tmp$77 = $substring(layout, (i + 6 >> 0)); prefix = _tmp$75; std = _tmp$76; suffix = _tmp$77; return [prefix, std, suffix]; } if (layout.length >= (i + 3 >> 0) && $substring(layout, i, (i + 3 >> 0)) === "Z07") { _tmp$78 = $substring(layout, 0, i); _tmp$79 = 24; _tmp$80 = $substring(layout, (i + 3 >> 0)); prefix = _tmp$78; std = _tmp$79; suffix = _tmp$80; return [prefix, std, suffix]; } } else if (_1 === (46)) { if ((i + 1 >> 0) < layout.length && ((layout.charCodeAt((i + 1 >> 0)) === 48) || (layout.charCodeAt((i + 1 >> 0)) === 57))) { ch = layout.charCodeAt((i + 1 >> 0)); j = i + 1 >> 0; while (true) { if (!(j < layout.length && (layout.charCodeAt(j) === ch))) { break; } j = j + (1) >> 0; } if (!isDigit(layout, j)) { std$1 = 32; if (layout.charCodeAt((i + 1 >> 0)) === 57) { std$1 = 33; } std$1 = std$1 | ((((j - ((i + 1 >> 0)) >> 0)) << 16 >> 0)); _tmp$81 = $substring(layout, 0, i); _tmp$82 = std$1; _tmp$83 = $substring(layout, j); prefix = _tmp$81; std = _tmp$82; suffix = _tmp$83; return [prefix, std, suffix]; } } } i = i + (1) >> 0; } _tmp$84 = layout; _tmp$85 = 0; _tmp$86 = ""; prefix = _tmp$84; std = _tmp$85; suffix = _tmp$86; return [prefix, std, suffix]; }; match = function(s1, s2) { var c1, c2, i, s1, s2; i = 0; while (true) { if (!(i < s1.length)) { break; } c1 = s1.charCodeAt(i); c2 = s2.charCodeAt(i); if (!((c1 === c2))) { c1 = (c1 | (32)) >>> 0; c2 = (c2 | (32)) >>> 0; if (!((c1 === c2)) || c1 < 97 || c1 > 122) { return false; } } i = i + (1) >> 0; } return true; }; lookup = function(tab, val) { var _i, _ref, i, tab, v, val; _ref = tab; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (val.length >= v.length && match($substring(val, 0, v.length), v)) { return [i, $substring(val, v.length), $ifaceNil]; } _i++; } return [-1, val, errBad]; }; appendInt = function(b, x, width) { var _q, b, buf, i, q, u, w, width, x; u = ((x >>> 0)); if (x < 0) { b = $append(b, 45); u = ((-x >>> 0)); } buf = arrayType.zero(); i = 20; while (true) { if (!(u >= 10)) { break; } i = i - (1) >> 0; q = (_q = u / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((48 + u >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24))); u = q; } i = i - (1) >> 0; ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((48 + u >>> 0) << 24 >>> 24))); w = 20 - i >> 0; while (true) { if (!(w < width)) { break; } b = $append(b, 48); w = w + (1) >> 0; } return $appendSlice(b, $subslice(new sliceType$3(buf), i)); }; atoi = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, neg, q, rem, s, x; x = 0; err = $ifaceNil; neg = false; if (!(s === "") && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { neg = s.charCodeAt(0) === 45; s = $substring(s, 1); } _tuple = leadingInt(s); q = _tuple[0]; rem = _tuple[1]; err = _tuple[2]; x = (((q.$low + ((q.$high >> 31) * 4294967296)) >> 0)); if (!($interfaceIsEqual(err, $ifaceNil)) || !(rem === "")) { _tmp = 0; _tmp$1 = atoiError; x = _tmp; err = _tmp$1; return [x, err]; } if (neg) { x = -x; } _tmp$2 = x; _tmp$3 = $ifaceNil; x = _tmp$2; err = _tmp$3; return [x, err]; }; formatNano = function(b, nanosec, n, trim) { var _q, _r, b, buf, n, nanosec, start, trim, u, x; u = nanosec; buf = arrayType$1.zero(); start = 9; while (true) { if (!(start > 0)) { break; } start = start - (1) >> 0; ((start < 0 || start >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[start] = ((((_r = u % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24))); u = (_q = u / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); } if (n > 9) { n = 9; } if (trim) { while (true) { if (!(n > 0 && ((x = n - 1 >> 0, ((x < 0 || x >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x])) === 48))) { break; } n = n - (1) >> 0; } if (n === 0) { return b; } } b = $append(b, 46); return $appendSlice(b, $subslice(new sliceType$3(buf), 0, n)); }; Time.ptr.prototype.String = function() { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, buf, m0, m1, m2, s, sign, t, wid, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; buf = $f.buf; m0 = $f.m0; m1 = $f.m1; m2 = $f.m2; s = $f.s; sign = $f.sign; t = $f.t; wid = $f.wid; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).Format("2006-01-02 15:04:05.999999999 -0700 MST"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = _r; if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { m2 = ((x$2 = t.ext, new $Uint64(x$2.$high, x$2.$low))); sign = 43; if ((x$3 = t.ext, (x$3.$high < 0 || (x$3.$high === 0 && x$3.$low < 0)))) { sign = 45; m2 = new $Uint64(-m2.$high, -m2.$low); } _tmp = $div64(m2, new $Uint64(0, 1000000000), false); _tmp$1 = $div64(m2, new $Uint64(0, 1000000000), true); m1 = _tmp; m2 = _tmp$1; _tmp$2 = $div64(m1, new $Uint64(0, 1000000000), false); _tmp$3 = $div64(m1, new $Uint64(0, 1000000000), true); m0 = _tmp$2; m1 = _tmp$3; buf = sliceType$3.nil; buf = $appendSlice(buf, " m="); buf = $append(buf, sign); wid = 0; if (!((m0.$high === 0 && m0.$low === 0))) { buf = appendInt(buf, ((m0.$low >> 0)), 0); wid = 9; } buf = appendInt(buf, ((m1.$low >> 0)), wid); buf = $append(buf, 46); buf = appendInt(buf, ((m2.$low >> 0)), 9); s = s + (($bytesToString(buf))); } $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.String }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.buf = buf; $f.m0 = m0; $f.m1 = m1; $f.m2 = m2; $f.s = s; $f.sign = sign; $f.t = t; $f.wid = wid; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.String = function() { return this.$val.String(); }; Time.ptr.prototype.Format = function(layout) { var _r, b, buf, layout, max, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; buf = $f.buf; layout = $f.layout; max = $f.max; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; b = sliceType$3.nil; max = layout.length + 10 >> 0; if (max < 64) { buf = arrayType$2.zero(); b = $subslice(new sliceType$3(buf), 0, 0); } else { b = $makeSlice(sliceType$3, 0, max); } _r = $clone(t, Time).AppendFormat(b, layout); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } b = _r; $s = -1; return ($bytesToString(b)); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Format }; } $f._r = _r; $f.b = b; $f.buf = buf; $f.layout = layout; $f.max = max; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Format = function(layout) { return this.$val.Format(layout); }; Time.ptr.prototype.AppendFormat = function(b, layout) { var _1, _q, _q$1, _q$2, _q$3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, _tuple$2, _tuple$3, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, year, zone$1, zone$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _q$3 = $f._q$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; abs = $f.abs; absoffset = $f.absoffset; b = $f.b; day = $f.day; hour = $f.hour; hr = $f.hr; hr$1 = $f.hr$1; layout = $f.layout; m = $f.m; min = $f.min; month = $f.month; name = $f.name; offset = $f.offset; prefix = $f.prefix; s = $f.s; sec = $f.sec; std = $f.std; suffix = $f.suffix; t = $f.t; y = $f.y; year = $f.year; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).locabs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; name = _tuple[0]; offset = _tuple[1]; abs = _tuple[2]; year = -1; month = 0; day = 0; hour = -1; min = 0; sec = 0; while (true) { if (!(!(layout === ""))) { break; } _tuple$1 = nextStdChunk(layout); prefix = _tuple$1[0]; std = _tuple$1[1]; suffix = _tuple$1[2]; if (!(prefix === "")) { b = $appendSlice(b, prefix); } if (std === 0) { break; } layout = suffix; if (year < 0 && !(((std & 256) === 0))) { _tuple$2 = absDate(abs, true); year = _tuple$2[0]; month = _tuple$2[1]; day = _tuple$2[2]; } if (hour < 0 && !(((std & 512) === 0))) { _tuple$3 = absClock(abs); hour = _tuple$3[0]; min = _tuple$3[1]; sec = _tuple$3[2]; } switch (0) { default: _1 = std & 65535; if (_1 === (274)) { y = year; if (y < 0) { y = -y; } b = appendInt(b, (_r$1 = y % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")), 2); } else if (_1 === (273)) { b = appendInt(b, year, 4); } else if (_1 === (258)) { b = $appendSlice(b, $substring(new Month(month).String(), 0, 3)); } else if (_1 === (257)) { m = new Month(month).String(); b = $appendSlice(b, m); } else if (_1 === (259)) { b = appendInt(b, ((month >> 0)), 0); } else if (_1 === (260)) { b = appendInt(b, ((month >> 0)), 2); } else if (_1 === (262)) { b = $appendSlice(b, $substring(new Weekday(absWeekday(abs)).String(), 0, 3)); } else if (_1 === (261)) { s = new Weekday(absWeekday(abs)).String(); b = $appendSlice(b, s); } else if (_1 === (263)) { b = appendInt(b, day, 0); } else if (_1 === (264)) { if (day < 10) { b = $append(b, 32); } b = appendInt(b, day, 0); } else if (_1 === (265)) { b = appendInt(b, day, 2); } else if (_1 === (522)) { b = appendInt(b, hour, 2); } else if (_1 === (523)) { hr = (_r$2 = hour % 12, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")); if (hr === 0) { hr = 12; } b = appendInt(b, hr, 0); } else if (_1 === (524)) { hr$1 = (_r$3 = hour % 12, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); if (hr$1 === 0) { hr$1 = 12; } b = appendInt(b, hr$1, 2); } else if (_1 === (525)) { b = appendInt(b, min, 0); } else if (_1 === (526)) { b = appendInt(b, min, 2); } else if (_1 === (527)) { b = appendInt(b, sec, 0); } else if (_1 === (528)) { b = appendInt(b, sec, 2); } else if (_1 === (531)) { if (hour >= 12) { b = $appendSlice(b, "PM"); } else { b = $appendSlice(b, "AM"); } } else if (_1 === (532)) { if (hour >= 12) { b = $appendSlice(b, "pm"); } else { b = $appendSlice(b, "am"); } } else if ((_1 === (22)) || (_1 === (25)) || (_1 === (23)) || (_1 === (24)) || (_1 === (26)) || (_1 === (27)) || (_1 === (30)) || (_1 === (28)) || (_1 === (29)) || (_1 === (31))) { if ((offset === 0) && ((std === 22) || (std === 25) || (std === 23) || (std === 24) || (std === 26))) { b = $append(b, 90); break; } zone$1 = (_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); absoffset = offset; if (zone$1 < 0) { b = $append(b, 45); zone$1 = -zone$1; absoffset = -absoffset; } else { b = $append(b, 43); } b = appendInt(b, (_q$1 = zone$1 / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 2); if ((std === 25) || (std === 30) || (std === 26) || (std === 31)) { b = $append(b, 58); } if (!((std === 29)) && !((std === 24))) { b = appendInt(b, (_r$4 = zone$1 % 60, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")), 2); } if ((std === 23) || (std === 28) || (std === 31) || (std === 26)) { if ((std === 31) || (std === 26)) { b = $append(b, 58); } b = appendInt(b, (_r$5 = absoffset % 60, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")), 2); } } else if (_1 === (21)) { if (!(name === "")) { b = $appendSlice(b, name); break; } zone$2 = (_q$2 = offset / 60, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")); if (zone$2 < 0) { b = $append(b, 45); zone$2 = -zone$2; } else { b = $append(b, 43); } b = appendInt(b, (_q$3 = zone$2 / 60, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")), 2); b = appendInt(b, (_r$6 = zone$2 % 60, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")), 2); } else if ((_1 === (32)) || (_1 === (33))) { b = formatNano(b, (($clone(t, Time).Nanosecond() >>> 0)), std >> 16 >> 0, (std & 65535) === 33); } } } $s = -1; return b; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AppendFormat }; } $f._1 = _1; $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._q$3 = _q$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f.abs = abs; $f.absoffset = absoffset; $f.b = b; $f.day = day; $f.hour = hour; $f.hr = hr; $f.hr$1 = hr$1; $f.layout = layout; $f.m = m; $f.min = min; $f.month = month; $f.name = name; $f.offset = offset; $f.prefix = prefix; $f.s = s; $f.sec = sec; $f.std = std; $f.suffix = suffix; $f.t = t; $f.y = y; $f.year = year; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.AppendFormat = function(b, layout) { return this.$val.AppendFormat(b, layout); }; quote = function(s) { var s; return "\"" + s + "\""; }; ParseError.ptr.prototype.Error = function() { var e; e = this; if (e.Message === "") { return "parsing time " + quote(e.Value) + " as " + quote(e.Layout) + ": cannot parse " + quote(e.ValueElem) + " as " + quote(e.LayoutElem); } return "parsing time " + quote(e.Value) + e.Message; }; ParseError.prototype.Error = function() { return this.$val.Error(); }; isDigit = function(s, i) { var c, i, s; if (s.length <= i) { return false; } c = s.charCodeAt(i); return 48 <= c && c <= 57; }; getnum = function(s, fixed) { var fixed, s; if (!isDigit(s, 0)) { return [0, s, errBad]; } if (!isDigit(s, 1)) { if (fixed) { return [0, s, errBad]; } return [(((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), $substring(s, 1), $ifaceNil]; } return [($imul((((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0)), 10)) + (((s.charCodeAt(1) - 48 << 24 >>> 24) >> 0)) >> 0, $substring(s, 2), $ifaceNil]; }; cutspace = function(s) { var s; while (true) { if (!(s.length > 0 && (s.charCodeAt(0) === 32))) { break; } s = $substring(s, 1); } return s; }; skip = function(value, prefix) { var prefix, value; while (true) { if (!(prefix.length > 0)) { break; } if (prefix.charCodeAt(0) === 32) { if (value.length > 0 && !((value.charCodeAt(0) === 32))) { return [value, errBad]; } prefix = cutspace(prefix); value = cutspace(value); continue; } if ((value.length === 0) || !((value.charCodeAt(0) === prefix.charCodeAt(0)))) { return [value, errBad]; } prefix = $substring(prefix, 1); value = $substring(value, 1); } return [value, $ifaceNil]; }; Parse = function(layout, value) { var _r, layout, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; layout = $f.layout; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = parse(layout, value, $pkg.UTC, $pkg.Local); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f._r = _r; $f.layout = layout; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Parse = Parse; parse = function(layout, value, defaultLocation, local) { var _1, _2, _3, _4, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alayout, amSet, avalue, day, defaultLocation, err, hour, hour$1, hr, i, layout, local, min, min$1, mm, month, n, n$1, name, ndigit, nsec, offset, offset$1, ok, ok$1, p, pmSet, prefix, rangeErrString, sec, seconds, sign, ss, std, stdstr, suffix, t, t$1, value, x, x$1, year, z, zoneName, zoneOffset, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _tmp$12 = $f._tmp$12; _tmp$13 = $f._tmp$13; _tmp$14 = $f._tmp$14; _tmp$15 = $f._tmp$15; _tmp$16 = $f._tmp$16; _tmp$17 = $f._tmp$17; _tmp$18 = $f._tmp$18; _tmp$19 = $f._tmp$19; _tmp$2 = $f._tmp$2; _tmp$20 = $f._tmp$20; _tmp$21 = $f._tmp$21; _tmp$22 = $f._tmp$22; _tmp$23 = $f._tmp$23; _tmp$24 = $f._tmp$24; _tmp$25 = $f._tmp$25; _tmp$26 = $f._tmp$26; _tmp$27 = $f._tmp$27; _tmp$28 = $f._tmp$28; _tmp$29 = $f._tmp$29; _tmp$3 = $f._tmp$3; _tmp$30 = $f._tmp$30; _tmp$31 = $f._tmp$31; _tmp$32 = $f._tmp$32; _tmp$33 = $f._tmp$33; _tmp$34 = $f._tmp$34; _tmp$35 = $f._tmp$35; _tmp$36 = $f._tmp$36; _tmp$37 = $f._tmp$37; _tmp$38 = $f._tmp$38; _tmp$39 = $f._tmp$39; _tmp$4 = $f._tmp$4; _tmp$40 = $f._tmp$40; _tmp$41 = $f._tmp$41; _tmp$42 = $f._tmp$42; _tmp$43 = $f._tmp$43; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$10 = $f._tuple$10; _tuple$11 = $f._tuple$11; _tuple$12 = $f._tuple$12; _tuple$13 = $f._tuple$13; _tuple$14 = $f._tuple$14; _tuple$15 = $f._tuple$15; _tuple$16 = $f._tuple$16; _tuple$17 = $f._tuple$17; _tuple$18 = $f._tuple$18; _tuple$19 = $f._tuple$19; _tuple$2 = $f._tuple$2; _tuple$20 = $f._tuple$20; _tuple$21 = $f._tuple$21; _tuple$22 = $f._tuple$22; _tuple$23 = $f._tuple$23; _tuple$24 = $f._tuple$24; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; alayout = $f.alayout; amSet = $f.amSet; avalue = $f.avalue; day = $f.day; defaultLocation = $f.defaultLocation; err = $f.err; hour = $f.hour; hour$1 = $f.hour$1; hr = $f.hr; i = $f.i; layout = $f.layout; local = $f.local; min = $f.min; min$1 = $f.min$1; mm = $f.mm; month = $f.month; n = $f.n; n$1 = $f.n$1; name = $f.name; ndigit = $f.ndigit; nsec = $f.nsec; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; pmSet = $f.pmSet; prefix = $f.prefix; rangeErrString = $f.rangeErrString; sec = $f.sec; seconds = $f.seconds; sign = $f.sign; ss = $f.ss; std = $f.std; stdstr = $f.stdstr; suffix = $f.suffix; t = $f.t; t$1 = $f.t$1; value = $f.value; x = $f.x; x$1 = $f.x$1; year = $f.year; z = $f.z; zoneName = $f.zoneName; zoneOffset = $f.zoneOffset; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tmp = layout; _tmp$1 = value; alayout = _tmp; avalue = _tmp$1; rangeErrString = ""; amSet = false; pmSet = false; year = 0; month = 1; day = 1; hour = 0; min = 0; sec = 0; nsec = 0; z = ptrType$2.nil; zoneOffset = -1; zoneName = ""; while (true) { err = $ifaceNil; _tuple = nextStdChunk(layout); prefix = _tuple[0]; std = _tuple[1]; suffix = _tuple[2]; stdstr = $substring(layout, prefix.length, (layout.length - suffix.length >> 0)); _tuple$1 = skip(value, prefix); value = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, prefix, value, "")]; } if (std === 0) { if (!((value.length === 0))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": extra text: " + value)]; } break; } layout = suffix; p = ""; switch (0) { default: _1 = std & 65535; if (_1 === (274)) { if (value.length < 2) { err = errBad; break; } _tmp$2 = $substring(value, 0, 2); _tmp$3 = $substring(value, 2); p = _tmp$2; value = _tmp$3; _tuple$2 = atoi(p); year = _tuple$2[0]; err = _tuple$2[1]; if (year >= 69) { year = year + (1900) >> 0; } else { year = year + (2000) >> 0; } } else if (_1 === (273)) { if (value.length < 4 || !isDigit(value, 0)) { err = errBad; break; } _tmp$4 = $substring(value, 0, 4); _tmp$5 = $substring(value, 4); p = _tmp$4; value = _tmp$5; _tuple$3 = atoi(p); year = _tuple$3[0]; err = _tuple$3[1]; } else if (_1 === (258)) { _tuple$4 = lookup(shortMonthNames, value); month = _tuple$4[0]; value = _tuple$4[1]; err = _tuple$4[2]; month = month + (1) >> 0; } else if (_1 === (257)) { _tuple$5 = lookup(longMonthNames, value); month = _tuple$5[0]; value = _tuple$5[1]; err = _tuple$5[2]; month = month + (1) >> 0; } else if ((_1 === (259)) || (_1 === (260))) { _tuple$6 = getnum(value, std === 260); month = _tuple$6[0]; value = _tuple$6[1]; err = _tuple$6[2]; if (month <= 0 || 12 < month) { rangeErrString = "month"; } } else if (_1 === (262)) { _tuple$7 = lookup(shortDayNames, value); value = _tuple$7[1]; err = _tuple$7[2]; } else if (_1 === (261)) { _tuple$8 = lookup(longDayNames, value); value = _tuple$8[1]; err = _tuple$8[2]; } else if ((_1 === (263)) || (_1 === (264)) || (_1 === (265))) { if ((std === 264) && value.length > 0 && (value.charCodeAt(0) === 32)) { value = $substring(value, 1); } _tuple$9 = getnum(value, std === 265); day = _tuple$9[0]; value = _tuple$9[1]; err = _tuple$9[2]; if (day < 0) { rangeErrString = "day"; } } else if (_1 === (522)) { _tuple$10 = getnum(value, false); hour = _tuple$10[0]; value = _tuple$10[1]; err = _tuple$10[2]; if (hour < 0 || 24 <= hour) { rangeErrString = "hour"; } } else if ((_1 === (523)) || (_1 === (524))) { _tuple$11 = getnum(value, std === 524); hour = _tuple$11[0]; value = _tuple$11[1]; err = _tuple$11[2]; if (hour < 0 || 12 < hour) { rangeErrString = "hour"; } } else if ((_1 === (525)) || (_1 === (526))) { _tuple$12 = getnum(value, std === 526); min = _tuple$12[0]; value = _tuple$12[1]; err = _tuple$12[2]; if (min < 0 || 60 <= min) { rangeErrString = "minute"; } } else if ((_1 === (527)) || (_1 === (528))) { _tuple$13 = getnum(value, std === 528); sec = _tuple$13[0]; value = _tuple$13[1]; err = _tuple$13[2]; if (sec < 0 || 60 <= sec) { rangeErrString = "second"; break; } if (value.length >= 2 && (value.charCodeAt(0) === 46) && isDigit(value, 1)) { _tuple$14 = nextStdChunk(layout); std = _tuple$14[1]; std = std & (65535); if ((std === 32) || (std === 33)) { break; } n = 2; while (true) { if (!(n < value.length && isDigit(value, n))) { break; } n = n + (1) >> 0; } _tuple$15 = parseNanoseconds(value, n); nsec = _tuple$15[0]; rangeErrString = _tuple$15[1]; err = _tuple$15[2]; value = $substring(value, n); } } else if (_1 === (531)) { if (value.length < 2) { err = errBad; break; } _tmp$6 = $substring(value, 0, 2); _tmp$7 = $substring(value, 2); p = _tmp$6; value = _tmp$7; _2 = p; if (_2 === ("PM")) { pmSet = true; } else if (_2 === ("AM")) { amSet = true; } else { err = errBad; } } else if (_1 === (532)) { if (value.length < 2) { err = errBad; break; } _tmp$8 = $substring(value, 0, 2); _tmp$9 = $substring(value, 2); p = _tmp$8; value = _tmp$9; _3 = p; if (_3 === ("pm")) { pmSet = true; } else if (_3 === ("am")) { amSet = true; } else { err = errBad; } } else if ((_1 === (22)) || (_1 === (25)) || (_1 === (23)) || (_1 === (24)) || (_1 === (26)) || (_1 === (27)) || (_1 === (29)) || (_1 === (30)) || (_1 === (28)) || (_1 === (31))) { if (((std === 22) || (std === 24) || (std === 25)) && value.length >= 1 && (value.charCodeAt(0) === 90)) { value = $substring(value, 1); z = $pkg.UTC; break; } _tmp$10 = ""; _tmp$11 = ""; _tmp$12 = ""; _tmp$13 = ""; sign = _tmp$10; hour$1 = _tmp$11; min$1 = _tmp$12; seconds = _tmp$13; if ((std === 25) || (std === 30)) { if (value.length < 6) { err = errBad; break; } if (!((value.charCodeAt(3) === 58))) { err = errBad; break; } _tmp$14 = $substring(value, 0, 1); _tmp$15 = $substring(value, 1, 3); _tmp$16 = $substring(value, 4, 6); _tmp$17 = "00"; _tmp$18 = $substring(value, 6); sign = _tmp$14; hour$1 = _tmp$15; min$1 = _tmp$16; seconds = _tmp$17; value = _tmp$18; } else if ((std === 29) || (std === 24)) { if (value.length < 3) { err = errBad; break; } _tmp$19 = $substring(value, 0, 1); _tmp$20 = $substring(value, 1, 3); _tmp$21 = "00"; _tmp$22 = "00"; _tmp$23 = $substring(value, 3); sign = _tmp$19; hour$1 = _tmp$20; min$1 = _tmp$21; seconds = _tmp$22; value = _tmp$23; } else if ((std === 26) || (std === 31)) { if (value.length < 9) { err = errBad; break; } if (!((value.charCodeAt(3) === 58)) || !((value.charCodeAt(6) === 58))) { err = errBad; break; } _tmp$24 = $substring(value, 0, 1); _tmp$25 = $substring(value, 1, 3); _tmp$26 = $substring(value, 4, 6); _tmp$27 = $substring(value, 7, 9); _tmp$28 = $substring(value, 9); sign = _tmp$24; hour$1 = _tmp$25; min$1 = _tmp$26; seconds = _tmp$27; value = _tmp$28; } else if ((std === 23) || (std === 28)) { if (value.length < 7) { err = errBad; break; } _tmp$29 = $substring(value, 0, 1); _tmp$30 = $substring(value, 1, 3); _tmp$31 = $substring(value, 3, 5); _tmp$32 = $substring(value, 5, 7); _tmp$33 = $substring(value, 7); sign = _tmp$29; hour$1 = _tmp$30; min$1 = _tmp$31; seconds = _tmp$32; value = _tmp$33; } else { if (value.length < 5) { err = errBad; break; } _tmp$34 = $substring(value, 0, 1); _tmp$35 = $substring(value, 1, 3); _tmp$36 = $substring(value, 3, 5); _tmp$37 = "00"; _tmp$38 = $substring(value, 5); sign = _tmp$34; hour$1 = _tmp$35; min$1 = _tmp$36; seconds = _tmp$37; value = _tmp$38; } _tmp$39 = 0; _tmp$40 = 0; _tmp$41 = 0; hr = _tmp$39; mm = _tmp$40; ss = _tmp$41; _tuple$16 = atoi(hour$1); hr = _tuple$16[0]; err = _tuple$16[1]; if ($interfaceIsEqual(err, $ifaceNil)) { _tuple$17 = atoi(min$1); mm = _tuple$17[0]; err = _tuple$17[1]; } if ($interfaceIsEqual(err, $ifaceNil)) { _tuple$18 = atoi(seconds); ss = _tuple$18[0]; err = _tuple$18[1]; } zoneOffset = ($imul(((($imul(hr, 60)) + mm >> 0)), 60)) + ss >> 0; _4 = sign.charCodeAt(0); if (_4 === (43)) { } else if (_4 === (45)) { zoneOffset = -zoneOffset; } else { err = errBad; } } else if (_1 === (21)) { if (value.length >= 3 && $substring(value, 0, 3) === "UTC") { z = $pkg.UTC; value = $substring(value, 3); break; } _tuple$19 = parseTimeZone(value); n$1 = _tuple$19[0]; ok = _tuple$19[1]; if (!ok) { err = errBad; break; } _tmp$42 = $substring(value, 0, n$1); _tmp$43 = $substring(value, n$1); zoneName = _tmp$42; value = _tmp$43; } else if (_1 === (32)) { ndigit = 1 + ((std >> 16 >> 0)) >> 0; if (value.length < ndigit) { err = errBad; break; } _tuple$20 = parseNanoseconds(value, ndigit); nsec = _tuple$20[0]; rangeErrString = _tuple$20[1]; err = _tuple$20[2]; value = $substring(value, ndigit); } else if (_1 === (33)) { if (value.length < 2 || !((value.charCodeAt(0) === 46)) || value.charCodeAt(1) < 48 || 57 < value.charCodeAt(1)) { break; } i = 0; while (true) { if (!(i < 9 && (i + 1 >> 0) < value.length && 48 <= value.charCodeAt((i + 1 >> 0)) && value.charCodeAt((i + 1 >> 0)) <= 57)) { break; } i = i + (1) >> 0; } _tuple$21 = parseNanoseconds(value, 1 + i >> 0); nsec = _tuple$21[0]; rangeErrString = _tuple$21[1]; err = _tuple$21[2]; value = $substring(value, (1 + i >> 0)); } } if (!(rangeErrString === "")) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, ": " + rangeErrString + " out of range")]; } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, stdstr, value, "")]; } } if (pmSet && hour < 12) { hour = hour + (12) >> 0; } else if (amSet && (hour === 12)) { hour = 0; } if (day < 1 || day > daysIn(((month >> 0)), year)) { $s = -1; return [new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil), new ParseError.ptr(alayout, avalue, "", value, ": day out of range")]; } /* */ if (!(z === ptrType$2.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(z === ptrType$2.nil)) { */ case 1: _r = Date(year, ((month >> 0)), day, hour, min, sec, nsec, z); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return [_r, $ifaceNil]; /* } */ case 2: /* */ if (!((zoneOffset === -1))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!((zoneOffset === -1))) { */ case 4: _r$1 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = $clone(_r$1, Time); t.addSec((x = (new $Int64(0, zoneOffset)), new $Int64(-x.$high, -x.$low))); _r$2 = local.lookup(t.unixSec()); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$22 = _r$2; name = _tuple$22[0]; offset = _tuple$22[1]; if ((offset === zoneOffset) && (zoneName === "" || name === zoneName)) { t.setLoc(local); $s = -1; return [t, $ifaceNil]; } t.setLoc(FixedZone(zoneName, zoneOffset)); $s = -1; return [t, $ifaceNil]; /* } */ case 5: /* */ if (!(zoneName === "")) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(zoneName === "")) { */ case 8: _r$3 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } t$1 = $clone(_r$3, Time); _r$4 = local.lookupName(zoneName, t$1.unixSec()); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$23 = _r$4; offset$1 = _tuple$23[0]; ok$1 = _tuple$23[1]; if (ok$1) { t$1.addSec((x$1 = (new $Int64(0, offset$1)), new $Int64(-x$1.$high, -x$1.$low))); t$1.setLoc(local); $s = -1; return [t$1, $ifaceNil]; } if (zoneName.length > 3 && $substring(zoneName, 0, 3) === "GMT") { _tuple$24 = atoi($substring(zoneName, 3)); offset$1 = _tuple$24[0]; offset$1 = $imul(offset$1, (3600)); } t$1.setLoc(FixedZone(zoneName, offset$1)); $s = -1; return [t$1, $ifaceNil]; /* } */ case 9: _r$5 = Date(year, ((month >> 0)), day, hour, min, sec, nsec, defaultLocation); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $s = -1; return [_r$5, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parse }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $f._tmp$12 = _tmp$12; $f._tmp$13 = _tmp$13; $f._tmp$14 = _tmp$14; $f._tmp$15 = _tmp$15; $f._tmp$16 = _tmp$16; $f._tmp$17 = _tmp$17; $f._tmp$18 = _tmp$18; $f._tmp$19 = _tmp$19; $f._tmp$2 = _tmp$2; $f._tmp$20 = _tmp$20; $f._tmp$21 = _tmp$21; $f._tmp$22 = _tmp$22; $f._tmp$23 = _tmp$23; $f._tmp$24 = _tmp$24; $f._tmp$25 = _tmp$25; $f._tmp$26 = _tmp$26; $f._tmp$27 = _tmp$27; $f._tmp$28 = _tmp$28; $f._tmp$29 = _tmp$29; $f._tmp$3 = _tmp$3; $f._tmp$30 = _tmp$30; $f._tmp$31 = _tmp$31; $f._tmp$32 = _tmp$32; $f._tmp$33 = _tmp$33; $f._tmp$34 = _tmp$34; $f._tmp$35 = _tmp$35; $f._tmp$36 = _tmp$36; $f._tmp$37 = _tmp$37; $f._tmp$38 = _tmp$38; $f._tmp$39 = _tmp$39; $f._tmp$4 = _tmp$4; $f._tmp$40 = _tmp$40; $f._tmp$41 = _tmp$41; $f._tmp$42 = _tmp$42; $f._tmp$43 = _tmp$43; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$10 = _tuple$10; $f._tuple$11 = _tuple$11; $f._tuple$12 = _tuple$12; $f._tuple$13 = _tuple$13; $f._tuple$14 = _tuple$14; $f._tuple$15 = _tuple$15; $f._tuple$16 = _tuple$16; $f._tuple$17 = _tuple$17; $f._tuple$18 = _tuple$18; $f._tuple$19 = _tuple$19; $f._tuple$2 = _tuple$2; $f._tuple$20 = _tuple$20; $f._tuple$21 = _tuple$21; $f._tuple$22 = _tuple$22; $f._tuple$23 = _tuple$23; $f._tuple$24 = _tuple$24; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.alayout = alayout; $f.amSet = amSet; $f.avalue = avalue; $f.day = day; $f.defaultLocation = defaultLocation; $f.err = err; $f.hour = hour; $f.hour$1 = hour$1; $f.hr = hr; $f.i = i; $f.layout = layout; $f.local = local; $f.min = min; $f.min$1 = min$1; $f.mm = mm; $f.month = month; $f.n = n; $f.n$1 = n$1; $f.name = name; $f.ndigit = ndigit; $f.nsec = nsec; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.pmSet = pmSet; $f.prefix = prefix; $f.rangeErrString = rangeErrString; $f.sec = sec; $f.seconds = seconds; $f.sign = sign; $f.ss = ss; $f.std = std; $f.stdstr = stdstr; $f.suffix = suffix; $f.t = t; $f.t$1 = t$1; $f.value = value; $f.x = x; $f.x$1 = x$1; $f.year = year; $f.z = z; $f.zoneName = zoneName; $f.zoneOffset = zoneOffset; $f.$s = $s; $f.$r = $r; return $f; }; parseTimeZone = function(value) { var _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, length, nUpper, ok, value; length = 0; ok = false; if (value.length < 3) { _tmp = 0; _tmp$1 = false; length = _tmp; ok = _tmp$1; return [length, ok]; } if (value.length >= 4 && ($substring(value, 0, 4) === "ChST" || $substring(value, 0, 4) === "MeST")) { _tmp$2 = 4; _tmp$3 = true; length = _tmp$2; ok = _tmp$3; return [length, ok]; } if ($substring(value, 0, 3) === "GMT") { length = parseGMT(value); _tmp$4 = length; _tmp$5 = true; length = _tmp$4; ok = _tmp$5; return [length, ok]; } if ((value.charCodeAt(0) === 43) || (value.charCodeAt(0) === 45)) { length = parseSignedOffset(value); _tmp$6 = length; _tmp$7 = true; length = _tmp$6; ok = _tmp$7; return [length, ok]; } nUpper = 0; nUpper = 0; while (true) { if (!(nUpper < 6)) { break; } if (nUpper >= value.length) { break; } c = value.charCodeAt(nUpper); if (c < 65 || 90 < c) { break; } nUpper = nUpper + (1) >> 0; } _1 = nUpper; if ((_1 === (0)) || (_1 === (1)) || (_1 === (2)) || (_1 === (6))) { _tmp$8 = 0; _tmp$9 = false; length = _tmp$8; ok = _tmp$9; return [length, ok]; } else if (_1 === (5)) { if (value.charCodeAt(4) === 84) { _tmp$10 = 5; _tmp$11 = true; length = _tmp$10; ok = _tmp$11; return [length, ok]; } } else if (_1 === (4)) { if ((value.charCodeAt(3) === 84) || $substring(value, 0, 4) === "WITA") { _tmp$12 = 4; _tmp$13 = true; length = _tmp$12; ok = _tmp$13; return [length, ok]; } } else if (_1 === (3)) { _tmp$14 = 3; _tmp$15 = true; length = _tmp$14; ok = _tmp$15; return [length, ok]; } _tmp$16 = 0; _tmp$17 = false; length = _tmp$16; ok = _tmp$17; return [length, ok]; }; parseGMT = function(value) { var value; value = $substring(value, 3); if (value.length === 0) { return 3; } return 3 + parseSignedOffset(value) >> 0; }; parseSignedOffset = function(value) { var _tuple, err, rem, sign, value, x; sign = value.charCodeAt(0); if (!((sign === 45)) && !((sign === 43))) { return 0; } _tuple = leadingInt($substring(value, 1)); x = _tuple[0]; rem = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { return 0; } if (sign === 45) { x = new $Int64(-x.$high, -x.$low); } if ((x.$high === 0 && x.$low === 0) || (x.$high < -1 || (x.$high === -1 && x.$low < 4294967282)) || (0 < x.$high || (0 === x.$high && 12 < x.$low))) { return 0; } return value.length - rem.length >> 0; }; parseNanoseconds = function(value, nbytes) { var _tuple, err, i, nbytes, ns, rangeErrString, scaleDigits, value; ns = 0; rangeErrString = ""; err = $ifaceNil; if (!((value.charCodeAt(0) === 46))) { err = errBad; return [ns, rangeErrString, err]; } _tuple = atoi($substring(value, 1, nbytes)); ns = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { return [ns, rangeErrString, err]; } if (ns < 0 || 1000000000 <= ns) { rangeErrString = "fractional second"; return [ns, rangeErrString, err]; } scaleDigits = 10 - nbytes >> 0; i = 0; while (true) { if (!(i < scaleDigits)) { break; } ns = $imul(ns, (10)); i = i + (1) >> 0; } return [ns, rangeErrString, err]; }; leadingInt = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, c, err, i, rem, s, x, x$1, x$2, x$3; x = new $Int64(0, 0); rem = ""; err = $ifaceNil; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (c < 48 || c > 57) { break; } if ((x.$high > 214748364 || (x.$high === 214748364 && x.$low > 3435973836))) { _tmp = new $Int64(0, 0); _tmp$1 = ""; _tmp$2 = errLeadingInt; x = _tmp; rem = _tmp$1; err = _tmp$2; return [x, rem, err]; } x = (x$1 = (x$2 = $mul64(x, new $Int64(0, 10)), x$3 = (new $Int64(0, c)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), new $Int64(x$1.$high - 0, x$1.$low - 48)); if ((x.$high < 0 || (x.$high === 0 && x.$low < 0))) { _tmp$3 = new $Int64(0, 0); _tmp$4 = ""; _tmp$5 = errLeadingInt; x = _tmp$3; rem = _tmp$4; err = _tmp$5; return [x, rem, err]; } i = i + (1) >> 0; } _tmp$6 = x; _tmp$7 = $substring(s, i); _tmp$8 = $ifaceNil; x = _tmp$6; rem = _tmp$7; err = _tmp$8; return [x, rem, err]; }; when = function(d) { var d, t, x, x$1; if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { return runtimeNano(); } t = (x = runtimeNano(), x$1 = (new $Int64(d.$high, d.$low)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); if ((t.$high < 0 || (t.$high === 0 && t.$low < 0))) { t = new $Int64(2147483647, 4294967295); } return t; }; Timer.ptr.prototype.Stop = function() { var t; t = this; if (t.r.f === $throwNilPointerError) { $panic(new $String("time: Stop called on uninitialized Timer")); } return stopTimer(t.r); }; Timer.prototype.Stop = function() { return this.$val.Stop(); }; Timer.ptr.prototype.Reset = function(d) { var active, d, t, w; t = this; if (t.r.f === $throwNilPointerError) { $panic(new $String("time: Reset called on uninitialized Timer")); } w = when(d); active = stopTimer(t.r); t.r.when = w; startTimer(t.r); return active; }; Timer.prototype.Reset = function(d) { return this.$val.Reset(d); }; Time.ptr.prototype.nsec = function() { var t, x; t = this; return (((x = t.wall, new $Uint64(x.$high & 0, (x.$low & 1073741823) >>> 0)).$low >> 0)); }; Time.prototype.nsec = function() { return this.$val.nsec(); }; Time.ptr.prototype.sec = function() { var t, x, x$1, x$2, x$3; t = this; if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { return (x$2 = ((x$3 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$3.$high, x$3.$low))), new $Int64(13 + x$2.$high, 3618733952 + x$2.$low)); } return t.ext; }; Time.prototype.sec = function() { return this.$val.sec(); }; Time.ptr.prototype.unixSec = function() { var t, x; t = this; return (x = t.sec(), new $Int64(x.$high + -15, x.$low + 2288912640)); }; Time.prototype.unixSec = function() { return this.$val.unixSec(); }; Time.ptr.prototype.addSec = function(d) { var d, dsec, sec, t, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; t = this; if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { sec = ((x$2 = $shiftRightUint64($shiftLeft64(t.wall, 1), 31), new $Int64(x$2.$high, x$2.$low))); dsec = new $Int64(sec.$high + d.$high, sec.$low + d.$low); if ((0 < dsec.$high || (0 === dsec.$high && 0 <= dsec.$low)) && (dsec.$high < 1 || (dsec.$high === 1 && dsec.$low <= 4294967295))) { t.wall = (x$3 = (x$4 = (x$5 = t.wall, new $Uint64(x$5.$high & 0, (x$5.$low & 1073741823) >>> 0)), x$6 = $shiftLeft64((new $Uint64(dsec.$high, dsec.$low)), 30), new $Uint64(x$4.$high | x$6.$high, (x$4.$low | x$6.$low) >>> 0)), new $Uint64(x$3.$high | 2147483648, (x$3.$low | 0) >>> 0)); return; } t.stripMono(); } t.ext = (x$7 = t.ext, x$8 = d, new $Int64(x$7.$high + x$8.$high, x$7.$low + x$8.$low)); }; Time.prototype.addSec = function(d) { return this.$val.addSec(d); }; Time.ptr.prototype.setLoc = function(loc) { var loc, t; t = this; if (loc === utcLoc) { loc = ptrType$2.nil; } t.stripMono(); t.loc = loc; }; Time.prototype.setLoc = function(loc) { return this.$val.setLoc(loc); }; Time.ptr.prototype.stripMono = function() { var t, x, x$1, x$2, x$3; t = this; if (!((x = (x$1 = t.wall, new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { t.ext = t.sec(); t.wall = (x$2 = t.wall, x$3 = new $Uint64(0, 1073741823), new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); } }; Time.prototype.stripMono = function() { return this.$val.stripMono(); }; Time.ptr.prototype.After = function(u) { var t, ts, u, us, x, x$1, x$2, x$3, x$4, x$5; t = this; if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { return (x$4 = t.ext, x$5 = u.ext, (x$4.$high > x$5.$high || (x$4.$high === x$5.$high && x$4.$low > x$5.$low))); } ts = t.sec(); us = u.sec(); return (ts.$high > us.$high || (ts.$high === us.$high && ts.$low > us.$low)) || (ts.$high === us.$high && ts.$low === us.$low) && t.nsec() > u.nsec(); }; Time.prototype.After = function(u) { return this.$val.After(u); }; Time.ptr.prototype.Before = function(u) { var t, u, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { return (x$4 = t.ext, x$5 = u.ext, (x$4.$high < x$5.$high || (x$4.$high === x$5.$high && x$4.$low < x$5.$low))); } return (x$6 = t.sec(), x$7 = u.sec(), (x$6.$high < x$7.$high || (x$6.$high === x$7.$high && x$6.$low < x$7.$low))) || (x$8 = t.sec(), x$9 = u.sec(), (x$8.$high === x$9.$high && x$8.$low === x$9.$low)) && t.nsec() < u.nsec(); }; Time.prototype.Before = function(u) { return this.$val.Before(u); }; Time.ptr.prototype.Equal = function(u) { var t, u, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; t = this; if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { return (x$4 = t.ext, x$5 = u.ext, (x$4.$high === x$5.$high && x$4.$low === x$5.$low)); } return (x$6 = t.sec(), x$7 = u.sec(), (x$6.$high === x$7.$high && x$6.$low === x$7.$low)) && (t.nsec() === u.nsec()); }; Time.prototype.Equal = function(u) { return this.$val.Equal(u); }; Month.prototype.String = function() { var buf, m, n, x; m = this.$val; if (1 <= m && m <= 12) { return (x = m - 1 >> 0, ((x < 0 || x >= months.length) ? ($throwRuntimeError("index out of range"), undefined) : months[x])); } buf = $makeSlice(sliceType$3, 20); n = fmtInt(buf, (new $Uint64(0, m))); return "%!Month(" + ($bytesToString($subslice(buf, n))) + ")"; }; $ptrType(Month).prototype.String = function() { return new Month(this.$get()).String(); }; Weekday.prototype.String = function() { var buf, d, n; d = this.$val; if (0 <= d && d <= 6) { return ((d < 0 || d >= days.length) ? ($throwRuntimeError("index out of range"), undefined) : days[d]); } buf = $makeSlice(sliceType$3, 20); n = fmtInt(buf, (new $Uint64(0, d))); return "%!Weekday(" + ($bytesToString($subslice(buf, n))) + ")"; }; $ptrType(Weekday).prototype.String = function() { return new Weekday(this.$get()).String(); }; Time.ptr.prototype.IsZero = function() { var t, x; t = this; return (x = t.sec(), (x.$high === 0 && x.$low === 0)) && (t.nsec() === 0); }; Time.prototype.IsZero = function() { return this.$val.IsZero(); }; Time.ptr.prototype.abs = function() { var _r, _r$1, _tuple, l, offset, sec, t, x, x$1, x$2, x$3, x$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; l = $f.l; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; l = t.loc; /* */ if (l === ptrType$2.nil || l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === ptrType$2.nil || l === localLoc) { */ case 1: _r = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } l = _r; /* } */ case 2: sec = t.unixSec(); /* */ if (!(l === utcLoc)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(l === utcLoc)) { */ case 4: /* */ if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { */ case 6: sec = (x$2 = (new $Int64(0, l.cacheZone.offset)), new $Int64(sec.$high + x$2.$high, sec.$low + x$2.$low)); $s = 8; continue; /* } else { */ case 7: _r$1 = l.lookup(sec); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; offset = _tuple[1]; sec = (x$3 = (new $Int64(0, offset)), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); /* } */ case 8: /* } */ case 5: $s = -1; return ((x$4 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$4.$high, x$4.$low))); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.abs }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.l = l; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.abs = function() { return this.$val.abs(); }; Time.ptr.prototype.locabs = function() { var _r, _r$1, _tuple, abs, l, name, offset, sec, t, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; abs = $f.abs; l = $f.l; name = $f.name; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = ""; offset = 0; abs = new $Uint64(0, 0); t = this; l = t.loc; /* */ if (l === ptrType$2.nil || l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === ptrType$2.nil || l === localLoc) { */ case 1: _r = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } l = _r; /* } */ case 2: sec = t.unixSec(); /* */ if (!(l === utcLoc)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(l === utcLoc)) { */ case 4: /* */ if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(l.cacheZone === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { */ case 7: name = l.cacheZone.name; offset = l.cacheZone.offset; $s = 9; continue; /* } else { */ case 8: _r$1 = l.lookup(sec); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; name = _tuple[0]; offset = _tuple[1]; /* } */ case 9: sec = (x$2 = (new $Int64(0, offset)), new $Int64(sec.$high + x$2.$high, sec.$low + x$2.$low)); $s = 6; continue; /* } else { */ case 5: name = "UTC"; /* } */ case 6: abs = ((x$3 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$3.$high, x$3.$low))); $s = -1; return [name, offset, abs]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.locabs }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.abs = abs; $f.l = l; $f.name = name; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.locabs = function() { return this.$val.locabs(); }; Time.ptr.prototype.Date = function() { var _r, _tuple, day, month, t, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; day = $f.day; month = $f.month; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: year = 0; month = 0; day = 0; t = this; _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; $s = -1; return [year, month, day]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Date }; } $f._r = _r; $f._tuple = _tuple; $f.day = day; $f.month = month; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Date = function() { return this.$val.Date(); }; Time.ptr.prototype.Year = function() { var _r, _tuple, t, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; year = _tuple[0]; $s = -1; return year; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Year }; } $f._r = _r; $f._tuple = _tuple; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Year = function() { return this.$val.Year(); }; Time.ptr.prototype.Month = function() { var _r, _tuple, month, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; month = $f.month; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; month = _tuple[1]; $s = -1; return month; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Month }; } $f._r = _r; $f._tuple = _tuple; $f.month = month; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Month = function() { return this.$val.Month(); }; Time.ptr.prototype.Day = function() { var _r, _tuple, day, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; day = $f.day; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; day = _tuple[2]; $s = -1; return day; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Day }; } $f._r = _r; $f._tuple = _tuple; $f.day = day; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Day = function() { return this.$val.Day(); }; Time.ptr.prototype.Weekday = function() { var _r, _r$1, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = absWeekday(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Weekday }; } $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Weekday = function() { return this.$val.Weekday(); }; absWeekday = function(abs) { var _q, abs, sec; sec = $div64((new $Uint64(abs.$high + 0, abs.$low + 86400)), new $Uint64(0, 604800), true); return (((_q = ((sec.$low >> 0)) / 86400, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0)); }; Time.ptr.prototype.ISOWeek = function() { var _q, _r, _r$1, _r$2, _r$3, _r$4, _tuple, day, dec31wday, jan1wday, month, t, wday, week, yday, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; day = $f.day; dec31wday = $f.dec31wday; jan1wday = $f.jan1wday; month = $f.month; t = $f.t; wday = $f.wday; week = $f.week; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: year = 0; week = 0; t = this; _r = $clone(t, Time).date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; yday = _tuple[3]; _r$2 = $clone(t, Time).Weekday(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } wday = (_r$1 = (((_r$2 + 6 >> 0) >> 0)) % 7, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); week = (_q = (((yday - wday >> 0) + 7 >> 0)) / 7, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); jan1wday = (_r$3 = (((wday - yday >> 0) + 371 >> 0)) % 7, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); if (1 <= jan1wday && jan1wday <= 3) { week = week + (1) >> 0; } if (week === 0) { year = year - (1) >> 0; week = 52; if ((jan1wday === 4) || ((jan1wday === 5) && isLeap(year))) { week = week + (1) >> 0; } } if ((month === 12) && day >= 29 && wday < 3) { dec31wday = (_r$4 = (((wday + 31 >> 0) - day >> 0)) % 7, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); if (0 <= dec31wday && dec31wday <= 2) { year = year + (1) >> 0; week = 1; } } $s = -1; return [year, week]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.ISOWeek }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.day = day; $f.dec31wday = dec31wday; $f.jan1wday = jan1wday; $f.month = month; $f.t = t; $f.wday = wday; $f.week = week; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.ISOWeek = function() { return this.$val.ISOWeek(); }; Time.ptr.prototype.Clock = function() { var _r, _r$1, _tuple, hour, min, sec, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; hour = $f.hour; min = $f.min; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: hour = 0; min = 0; sec = 0; t = this; _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = absClock(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; hour = _tuple[0]; min = _tuple[1]; sec = _tuple[2]; $s = -1; return [hour, min, sec]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Clock }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.hour = hour; $f.min = min; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Clock = function() { return this.$val.Clock(); }; absClock = function(abs) { var _q, _q$1, abs, hour, min, sec; hour = 0; min = 0; sec = 0; sec = (($div64(abs, new $Uint64(0, 86400), true).$low >> 0)); hour = (_q = sec / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); sec = sec - (($imul(hour, 3600))) >> 0; min = (_q$1 = sec / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); sec = sec - (($imul(min, 60))) >> 0; return [hour, min, sec]; }; Time.ptr.prototype.Hour = function() { var _q, _r, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return (_q = (($div64(_r, new $Uint64(0, 86400), true).$low >> 0)) / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Hour }; } $f._q = _q; $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Hour = function() { return this.$val.Hour(); }; Time.ptr.prototype.Minute = function() { var _q, _r, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return (_q = (($div64(_r, new $Uint64(0, 3600), true).$low >> 0)) / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Minute }; } $f._q = _q; $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Minute = function() { return this.$val.Minute(); }; Time.ptr.prototype.Second = function() { var _r, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return (($div64(_r, new $Uint64(0, 60), true).$low >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Second }; } $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Second = function() { return this.$val.Second(); }; Time.ptr.prototype.Nanosecond = function() { var t; t = this; return ((t.nsec() >> 0)); }; Time.prototype.Nanosecond = function() { return this.$val.Nanosecond(); }; Time.ptr.prototype.YearDay = function() { var _r, _tuple, t, yday, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; t = $f.t; yday = $f.yday; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; yday = _tuple[3]; $s = -1; return yday + 1 >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.YearDay }; } $f._r = _r; $f._tuple = _tuple; $f.t = t; $f.yday = yday; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.YearDay = function() { return this.$val.YearDay(); }; Duration.prototype.String = function() { var _tuple, _tuple$1, buf, d, neg, prec, u, w; d = this; buf = arrayType$3.zero(); w = 32; u = (new $Uint64(d.$high, d.$low)); neg = (d.$high < 0 || (d.$high === 0 && d.$low < 0)); if (neg) { u = new $Uint64(-u.$high, -u.$low); } if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000000000))) { prec = 0; w = w - (1) >> 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 115); w = w - (1) >> 0; if ((u.$high === 0 && u.$low === 0)) { return "0s"; } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000))) { prec = 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 110); } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000000))) { prec = 3; w = w - (1) >> 0; $copyString($subslice(new sliceType$3(buf), w), "\xC2\xB5"); } else { prec = 6; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 109); } _tuple = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, prec); w = _tuple[0]; u = _tuple[1]; w = fmtInt($subslice(new sliceType$3(buf), 0, w), u); } else { w = w - (1) >> 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 115); _tuple$1 = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, 9); w = _tuple$1[0]; u = _tuple$1[1]; w = fmtInt($subslice(new sliceType$3(buf), 0, w), $div64(u, new $Uint64(0, 60), true)); u = $div64(u, (new $Uint64(0, 60)), false); if ((u.$high > 0 || (u.$high === 0 && u.$low > 0))) { w = w - (1) >> 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 109); w = fmtInt($subslice(new sliceType$3(buf), 0, w), $div64(u, new $Uint64(0, 60), true)); u = $div64(u, (new $Uint64(0, 60)), false); if ((u.$high > 0 || (u.$high === 0 && u.$low > 0))) { w = w - (1) >> 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 104); w = fmtInt($subslice(new sliceType$3(buf), 0, w), u); } } } if (neg) { w = w - (1) >> 0; ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); } return ($bytesToString($subslice(new sliceType$3(buf), w))); }; $ptrType(Duration).prototype.String = function() { return this.$get().String(); }; fmtFrac = function(buf, v, prec) { var _tmp, _tmp$1, buf, digit, i, nv, nw, prec, print, v, w; nw = 0; nv = new $Uint64(0, 0); w = buf.$length; print = false; i = 0; while (true) { if (!(i < prec)) { break; } digit = $div64(v, new $Uint64(0, 10), true); print = print || !((digit.$high === 0 && digit.$low === 0)); if (print) { w = w - (1) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = (((digit.$low << 24 >>> 24)) + 48 << 24 >>> 24)); } v = $div64(v, (new $Uint64(0, 10)), false); i = i + (1) >> 0; } if (print) { w = w - (1) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = 46); } _tmp = w; _tmp$1 = v; nw = _tmp; nv = _tmp$1; return [nw, nv]; }; fmtInt = function(buf, v) { var buf, v, w; w = buf.$length; if ((v.$high === 0 && v.$low === 0)) { w = w - (1) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = 48); } else { while (true) { if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } w = w - (1) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = ((($div64(v, new $Uint64(0, 10), true).$low << 24 >>> 24)) + 48 << 24 >>> 24)); v = $div64(v, (new $Uint64(0, 10)), false); } } return w; }; Duration.prototype.Nanoseconds = function() { var d; d = this; return (new $Int64(d.$high, d.$low)); }; $ptrType(Duration).prototype.Nanoseconds = function() { return this.$get().Nanoseconds(); }; Duration.prototype.Seconds = function() { var d, nsec, sec; d = this; sec = $div64(d, new Duration(0, 1000000000), false); nsec = $div64(d, new Duration(0, 1000000000), true); return ($flatten64(sec)) + ($flatten64(nsec)) / 1e+09; }; $ptrType(Duration).prototype.Seconds = function() { return this.$get().Seconds(); }; Duration.prototype.Minutes = function() { var d, min, nsec; d = this; min = $div64(d, new Duration(13, 4165425152), false); nsec = $div64(d, new Duration(13, 4165425152), true); return ($flatten64(min)) + ($flatten64(nsec)) / 6e+10; }; $ptrType(Duration).prototype.Minutes = function() { return this.$get().Minutes(); }; Duration.prototype.Hours = function() { var d, hour, nsec; d = this; hour = $div64(d, new Duration(838, 817405952), false); nsec = $div64(d, new Duration(838, 817405952), true); return ($flatten64(hour)) + ($flatten64(nsec)) / 3.6e+12; }; $ptrType(Duration).prototype.Hours = function() { return this.$get().Hours(); }; Duration.prototype.Truncate = function(m) { var d, m, x; d = this; if ((m.$high < 0 || (m.$high === 0 && m.$low <= 0))) { return d; } return (x = $div64(d, m, true), new Duration(d.$high - x.$high, d.$low - x.$low)); }; $ptrType(Duration).prototype.Truncate = function(m) { return this.$get().Truncate(m); }; lessThanHalf = function(x, y) { var x, x$1, x$2, x$3, x$4, y; return (x$1 = (x$2 = (new $Uint64(x.$high, x.$low)), x$3 = (new $Uint64(x.$high, x.$low)), new $Uint64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), x$4 = (new $Uint64(y.$high, y.$low)), (x$1.$high < x$4.$high || (x$1.$high === x$4.$high && x$1.$low < x$4.$low))); }; Duration.prototype.Round = function(m) { var d, d1, d1$1, m, r, x, x$1; d = this; if ((m.$high < 0 || (m.$high === 0 && m.$low <= 0))) { return d; } r = $div64(d, m, true); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0))) { r = new Duration(-r.$high, -r.$low); if (lessThanHalf(r, m)) { return new Duration(d.$high + r.$high, d.$low + r.$low); } d1 = (x = new Duration(d.$high - m.$high, d.$low - m.$low), new Duration(x.$high + r.$high, x.$low + r.$low)); if ((d1.$high < d.$high || (d1.$high === d.$high && d1.$low < d.$low))) { return d1; } return new Duration(-2147483648, 0); } if (lessThanHalf(r, m)) { return new Duration(d.$high - r.$high, d.$low - r.$low); } d1$1 = (x$1 = new Duration(d.$high + m.$high, d.$low + m.$low), new Duration(x$1.$high - r.$high, x$1.$low - r.$low)); if ((d1$1.$high > d.$high || (d1$1.$high === d.$high && d1$1.$low > d.$low))) { return d1$1; } return new Duration(2147483647, 4294967295); }; $ptrType(Duration).prototype.Round = function(m) { return this.$get().Round(m); }; Time.ptr.prototype.Add = function(d) { var d, dsec, nsec, t, te, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; dsec = ((x = $div64(d, new Duration(0, 1000000000), false), new $Int64(x.$high, x.$low))); nsec = t.nsec() + (((x$1 = $div64(d, new Duration(0, 1000000000), true), x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0)) >> 0; if (nsec >= 1000000000) { dsec = (x$2 = new $Int64(0, 1), new $Int64(dsec.$high + x$2.$high, dsec.$low + x$2.$low)); nsec = nsec - (1000000000) >> 0; } else if (nsec < 0) { dsec = (x$3 = new $Int64(0, 1), new $Int64(dsec.$high - x$3.$high, dsec.$low - x$3.$low)); nsec = nsec + (1000000000) >> 0; } t.wall = (x$4 = (x$5 = t.wall, new $Uint64(x$5.$high & ~0, (x$5.$low & ~1073741823) >>> 0)), x$6 = (new $Uint64(0, nsec)), new $Uint64(x$4.$high | x$6.$high, (x$4.$low | x$6.$low) >>> 0)); t.addSec(dsec); if (!((x$7 = (x$8 = t.wall, new $Uint64(x$8.$high & 2147483648, (x$8.$low & 0) >>> 0)), (x$7.$high === 0 && x$7.$low === 0)))) { te = (x$9 = t.ext, x$10 = (new $Int64(d.$high, d.$low)), new $Int64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (x$11 = t.ext, (te.$high > x$11.$high || (te.$high === x$11.$high && te.$low > x$11.$low))) || (d.$high > 0 || (d.$high === 0 && d.$low > 0)) && (x$12 = t.ext, (te.$high < x$12.$high || (te.$high === x$12.$high && te.$low < x$12.$low)))) { t.stripMono(); } else { t.ext = te; } } return t; }; Time.prototype.Add = function(d) { return this.$val.Add(d); }; Time.ptr.prototype.Sub = function(u) { var d, d$1, t, te, u, ue, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; t = this; if (!((x = (x$1 = (x$2 = t.wall, x$3 = u.wall, new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)), new $Uint64(x$1.$high & 2147483648, (x$1.$low & 0) >>> 0)), (x.$high === 0 && x.$low === 0)))) { te = t.ext; ue = u.ext; d = ((x$4 = new $Int64(te.$high - ue.$high, te.$low - ue.$low), new Duration(x$4.$high, x$4.$low))); if ((d.$high < 0 || (d.$high === 0 && d.$low < 0)) && (te.$high > ue.$high || (te.$high === ue.$high && te.$low > ue.$low))) { return new Duration(2147483647, 4294967295); } if ((d.$high > 0 || (d.$high === 0 && d.$low > 0)) && (te.$high < ue.$high || (te.$high === ue.$high && te.$low < ue.$low))) { return new Duration(-2147483648, 0); } return d; } d$1 = (x$5 = $mul64(((x$6 = (x$7 = t.sec(), x$8 = u.sec(), new $Int64(x$7.$high - x$8.$high, x$7.$low - x$8.$low)), new Duration(x$6.$high, x$6.$low))), new Duration(0, 1000000000)), x$9 = (new Duration(0, (t.nsec() - u.nsec() >> 0))), new Duration(x$5.$high + x$9.$high, x$5.$low + x$9.$low)); if ($clone($clone(u, Time).Add(d$1), Time).Equal($clone(t, Time))) { return d$1; } else if ($clone(t, Time).Before($clone(u, Time))) { return new Duration(-2147483648, 0); } else { return new Duration(2147483647, 4294967295); } }; Time.prototype.Sub = function(u) { return this.$val.Sub(u); }; Until = function(t) { var t; return $clone(t, Time).Sub($clone(Now(), Time)); }; $pkg.Until = Until; Time.ptr.prototype.AddDate = function(years, months$1, days$1) { var _r, _r$1, _r$2, _tuple, _tuple$1, day, days$1, hour, min, month, months$1, sec, t, year, years, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; day = $f.day; days$1 = $f.days$1; hour = $f.hour; min = $f.min; month = $f.month; months$1 = $f.months$1; sec = $f.sec; t = $f.t; year = $f.year; years = $f.years; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; _r$1 = $clone(t, Time).Clock(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; hour = _tuple$1[0]; min = _tuple$1[1]; sec = _tuple$1[2]; _r$2 = Date(year + years >> 0, month + ((months$1 >> 0)) >> 0, day + days$1 >> 0, hour, min, sec, ((t.nsec() >> 0)), $clone(t, Time).Location()); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AddDate }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.day = day; $f.days$1 = days$1; $f.hour = hour; $f.min = min; $f.month = month; $f.months$1 = months$1; $f.sec = sec; $f.t = t; $f.year = year; $f.years = years; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.AddDate = function(years, months$1, days$1) { return this.$val.AddDate(years, months$1, days$1); }; Time.ptr.prototype.date = function(full) { var _r, _r$1, _tuple, day, full, month, t, yday, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; day = $f.day; full = $f.full; month = $f.month; t = $f.t; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: year = 0; month = 0; day = 0; yday = 0; t = this; _r = $clone(t, Time).abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = absDate(_r, full); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; year = _tuple[0]; month = _tuple[1]; day = _tuple[2]; yday = _tuple[3]; $s = -1; return [year, month, day, yday]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.date }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.day = day; $f.full = full; $f.month = month; $f.t = t; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.date = function(full) { return this.$val.date(full); }; absDate = function(abs, full) { var _q, abs, begin, d, day, end, full, month, n, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, yday, year; year = 0; month = 0; day = 0; yday = 0; d = $div64(abs, new $Uint64(0, 86400), false); n = $div64(d, new $Uint64(0, 146097), false); y = $mul64(new $Uint64(0, 400), n); d = (x = $mul64(new $Uint64(0, 146097), n), new $Uint64(d.$high - x.$high, d.$low - x.$low)); n = $div64(d, new $Uint64(0, 36524), false); n = (x$1 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$1.$high, n.$low - x$1.$low)); y = (x$2 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high + x$2.$high, y.$low + x$2.$low)); d = (x$3 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high - x$3.$high, d.$low - x$3.$low)); n = $div64(d, new $Uint64(0, 1461), false); y = (x$4 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high + x$4.$high, y.$low + x$4.$low)); d = (x$5 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high - x$5.$high, d.$low - x$5.$low)); n = $div64(d, new $Uint64(0, 365), false); n = (x$6 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$6.$high, n.$low - x$6.$low)); y = (x$7 = n, new $Uint64(y.$high + x$7.$high, y.$low + x$7.$low)); d = (x$8 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high - x$8.$high, d.$low - x$8.$low)); year = (((x$9 = (x$10 = (new $Int64(y.$high, y.$low)), new $Int64(x$10.$high + -69, x$10.$low + 4075721025)), x$9.$low + ((x$9.$high >> 31) * 4294967296)) >> 0)); yday = ((d.$low >> 0)); if (!full) { return [year, month, day, yday]; } day = yday; if (isLeap(year)) { if (day > 59) { day = day - (1) >> 0; } else if ((day === 59)) { month = 2; day = 29; return [year, month, day, yday]; } } month = (((_q = day / 31, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0)); end = (((x$11 = month + 1 >> 0, ((x$11 < 0 || x$11 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$11])) >> 0)); begin = 0; if (day >= end) { month = month + (1) >> 0; begin = end; } else { begin = ((((month < 0 || month >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[month]) >> 0)); } month = month + (1) >> 0; day = (day - begin >> 0) + 1 >> 0; return [year, month, day, yday]; }; daysIn = function(m, year) { var m, x, year; if ((m === 2) && isLeap(year)) { return 29; } return (((((m < 0 || m >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[m]) - (x = m - 1 >> 0, ((x < 0 || x >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x])) >> 0) >> 0)); }; Now = function() { var _tuple, mono, nsec, sec, x, x$1, x$2, x$3, x$4; _tuple = now(); sec = _tuple[0]; nsec = _tuple[1]; mono = _tuple[2]; sec = (x = new $Int64(0, 2682288000), new $Int64(sec.$high + x.$high, sec.$low + x.$low)); if (!((x$1 = $shiftRightUint64((new $Uint64(sec.$high, sec.$low)), 33), (x$1.$high === 0 && x$1.$low === 0)))) { return new Time.ptr((new $Uint64(0, nsec)), new $Int64(sec.$high + 13, sec.$low + 3618733952), $pkg.Local); } return new Time.ptr((x$2 = (x$3 = $shiftLeft64((new $Uint64(sec.$high, sec.$low)), 30), new $Uint64(2147483648 | x$3.$high, (0 | x$3.$low) >>> 0)), x$4 = (new $Uint64(0, nsec)), new $Uint64(x$2.$high | x$4.$high, (x$2.$low | x$4.$low) >>> 0)), mono, $pkg.Local); }; $pkg.Now = Now; unixTime = function(sec, nsec) { var nsec, sec; return new Time.ptr((new $Uint64(0, nsec)), new $Int64(sec.$high + 14, sec.$low + 2006054656), $pkg.Local); }; Time.ptr.prototype.UTC = function() { var t; t = this; t.setLoc(utcLoc); return t; }; Time.prototype.UTC = function() { return this.$val.UTC(); }; Time.ptr.prototype.Local = function() { var t; t = this; t.setLoc($pkg.Local); return t; }; Time.prototype.Local = function() { return this.$val.Local(); }; Time.ptr.prototype.In = function(loc) { var loc, t; t = this; if (loc === ptrType$2.nil) { $panic(new $String("time: missing Location in call to Time.In")); } t.setLoc(loc); return t; }; Time.prototype.In = function(loc) { return this.$val.In(loc); }; Time.ptr.prototype.Location = function() { var l, t; t = this; l = t.loc; if (l === ptrType$2.nil) { l = $pkg.UTC; } return l; }; Time.prototype.Location = function() { return this.$val.Location(); }; Time.ptr.prototype.Zone = function() { var _r, _tuple, name, offset, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; name = $f.name; offset = $f.offset; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = ""; offset = 0; t = this; _r = t.loc.lookup(t.unixSec()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; name = _tuple[0]; offset = _tuple[1]; $s = -1; return [name, offset]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Zone }; } $f._r = _r; $f._tuple = _tuple; $f.name = name; $f.offset = offset; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.Zone = function() { return this.$val.Zone(); }; Time.ptr.prototype.Unix = function() { var t; t = this; return t.unixSec(); }; Time.prototype.Unix = function() { return this.$val.Unix(); }; Time.ptr.prototype.UnixNano = function() { var t, x, x$1; t = this; return (x = $mul64((t.unixSec()), new $Int64(0, 1000000000)), x$1 = (new $Int64(0, t.nsec())), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); }; Time.prototype.UnixNano = function() { return this.$val.UnixNano(); }; Time.ptr.prototype.MarshalBinary = function() { var _q, _r, _r$1, _tuple, enc, nsec, offset, offsetMin, sec, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; enc = $f.enc; nsec = $f.nsec; offset = $f.offset; offsetMin = $f.offsetMin; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; offsetMin = 0; /* */ if ($clone(t, Time).Location() === $pkg.UTC) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(t, Time).Location() === $pkg.UTC) { */ case 1: offsetMin = -1; $s = 3; continue; /* } else { */ case 2: _r = $clone(t, Time).Zone(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; offset = _tuple[1]; if (!(((_r$1 = offset % 60, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0))) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalBinary: zone offset has fractional minute")]; } offset = (_q = offset / (60), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (offset < -32768 || (offset === -1) || offset > 32767) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalBinary: unexpected zone offset")]; } offsetMin = ((offset << 16 >> 16)); /* } */ case 3: sec = t.sec(); nsec = t.nsec(); enc = new sliceType$3([1, (($shiftRightInt64(sec, 56).$low << 24 >>> 24)), (($shiftRightInt64(sec, 48).$low << 24 >>> 24)), (($shiftRightInt64(sec, 40).$low << 24 >>> 24)), (($shiftRightInt64(sec, 32).$low << 24 >>> 24)), (($shiftRightInt64(sec, 24).$low << 24 >>> 24)), (($shiftRightInt64(sec, 16).$low << 24 >>> 24)), (($shiftRightInt64(sec, 8).$low << 24 >>> 24)), ((sec.$low << 24 >>> 24)), (((nsec >> 24 >> 0) << 24 >>> 24)), (((nsec >> 16 >> 0) << 24 >>> 24)), (((nsec >> 8 >> 0) << 24 >>> 24)), ((nsec << 24 >>> 24)), (((offsetMin >> 8 << 16 >> 16) << 24 >>> 24)), ((offsetMin << 24 >>> 24))]); $s = -1; return [enc, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalBinary }; } $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.enc = enc; $f.nsec = nsec; $f.offset = offset; $f.offsetMin = offsetMin; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; Time.ptr.prototype.UnmarshalBinary = function(data) { var _r, _tuple, buf, data, localoff, nsec, offset, sec, t, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; data = $f.data; localoff = $f.localoff; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; buf = data; if (buf.$length === 0) { $s = -1; return errors.New("Time.UnmarshalBinary: no data"); } if (!(((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) === 1))) { $s = -1; return errors.New("Time.UnmarshalBinary: unsupported version"); } if (!((buf.$length === 15))) { $s = -1; return errors.New("Time.UnmarshalBinary: invalid length"); } buf = $subslice(buf, 1); sec = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = (new $Int64(0, (7 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 7]))), x$7 = $shiftLeft64((new $Int64(0, (6 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 6]))), 8), new $Int64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64((new $Int64(0, (5 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 5]))), 16), new $Int64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64((new $Int64(0, (4 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 4]))), 24), new $Int64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64((new $Int64(0, (3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]))), 32), new $Int64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64((new $Int64(0, (2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]))), 40), new $Int64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64((new $Int64(0, (1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]))), 48), new $Int64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64((new $Int64(0, (0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]))), 56), new $Int64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); buf = $subslice(buf, 8); nsec = (((((3 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 3]) >> 0)) | ((((2 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 2]) >> 0)) << 8 >> 0)) | ((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) >> 0)) << 16 >> 0)) | ((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) >> 0)) << 24 >> 0); buf = $subslice(buf, 4); offset = $imul(((((((1 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 1]) << 16 >> 16)) | ((((0 >= buf.$length ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + 0]) << 16 >> 16)) << 8 << 16 >> 16)) >> 0)), 60); Time.copy(t, new Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$2.nil)); t.wall = (new $Uint64(0, nsec)); t.ext = sec; /* */ if (offset === -60) { $s = 1; continue; } /* */ $s = 2; continue; /* if (offset === -60) { */ case 1: t.setLoc(utcLoc); $s = 3; continue; /* } else { */ case 2: _r = $pkg.Local.lookup(t.unixSec()); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; localoff = _tuple[1]; if (offset === localoff) { t.setLoc($pkg.Local); } else { t.setLoc(FixedZone("", offset)); } /* } */ case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalBinary }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.data = data; $f.localoff = localoff; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.UnmarshalBinary = function(data) { return this.$val.UnmarshalBinary(data); }; Time.ptr.prototype.GobEncode = function() { var _r, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobEncode }; } $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.GobEncode = function() { return this.$val.GobEncode(); }; Time.ptr.prototype.GobDecode = function(data) { var _r, data, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; data = $f.data; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = t.UnmarshalBinary(data); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobDecode }; } $f._r = _r; $f.data = data; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.GobDecode = function(data) { return this.$val.GobDecode(data); }; Time.ptr.prototype.MarshalJSON = function() { var _r, _r$1, b, t, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } y = _r; if (y < 0 || y >= 10000) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]")]; } b = $makeSlice(sliceType$3, 0, 37); b = $append(b, 34); _r$1 = $clone(t, Time).AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } b = _r$1; b = $append(b, 34); $s = -1; return [b, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalJSON }; } $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; Time.ptr.prototype.UnmarshalJSON = function(data) { var _r, _tuple, data, err, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; data = $f.data; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (($bytesToString(data)) === "null") { $s = -1; return $ifaceNil; } err = $ifaceNil; _r = Parse("\"2006-01-02T15:04:05Z07:00\"", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; Time.copy(t, _tuple[0]); err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalJSON }; } $f._r = _r; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.UnmarshalJSON = function(data) { return this.$val.UnmarshalJSON(data); }; Time.ptr.prototype.MarshalText = function() { var _r, _r$1, b, t, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = $clone(t, Time).Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } y = _r; if (y < 0 || y >= 10000) { $s = -1; return [sliceType$3.nil, errors.New("Time.MarshalText: year outside of range [0,9999]")]; } b = $makeSlice(sliceType$3, 0, 35); _r$1 = $clone(t, Time).AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return [_r$1, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalText }; } $f._r = _r; $f._r$1 = _r$1; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.MarshalText = function() { return this.$val.MarshalText(); }; Time.ptr.prototype.UnmarshalText = function(data) { var _r, _tuple, data, err, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; data = $f.data; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; err = $ifaceNil; _r = Parse("2006-01-02T15:04:05Z07:00", ($bytesToString(data))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; Time.copy(t, _tuple[0]); err = _tuple[1]; $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalText }; } $f._r = _r; $f._tuple = _tuple; $f.data = data; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Time.prototype.UnmarshalText = function(data) { return this.$val.UnmarshalText(data); }; Unix = function(sec, nsec) { var n, nsec, sec, x, x$1, x$2, x$3; if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0)) || (nsec.$high > 0 || (nsec.$high === 0 && nsec.$low >= 1000000000))) { n = $div64(nsec, new $Int64(0, 1000000000), false); sec = (x = n, new $Int64(sec.$high + x.$high, sec.$low + x.$low)); nsec = (x$1 = $mul64(n, new $Int64(0, 1000000000)), new $Int64(nsec.$high - x$1.$high, nsec.$low - x$1.$low)); if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0))) { nsec = (x$2 = new $Int64(0, 1000000000), new $Int64(nsec.$high + x$2.$high, nsec.$low + x$2.$low)); sec = (x$3 = new $Int64(0, 1), new $Int64(sec.$high - x$3.$high, sec.$low - x$3.$low)); } } return unixTime(sec, (((nsec.$low + ((nsec.$high >> 31) * 4294967296)) >> 0))); }; $pkg.Unix = Unix; isLeap = function(year) { var _r, _r$1, _r$2, year; return ((_r = year % 4, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0) && (!(((_r$1 = year % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0)) || ((_r$2 = year % 400, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0)); }; norm = function(hi, lo, base) { var _q, _q$1, _tmp, _tmp$1, base, hi, lo, n, n$1, nhi, nlo; nhi = 0; nlo = 0; if (lo < 0) { n = (_q = ((-lo - 1 >> 0)) / base, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; hi = hi - (n) >> 0; lo = lo + (($imul(n, base))) >> 0; } if (lo >= base) { n$1 = (_q$1 = lo / base, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); hi = hi + (n$1) >> 0; lo = lo - (($imul(n$1, base))) >> 0; } _tmp = hi; _tmp$1 = lo; nhi = _tmp; nlo = _tmp$1; return [nhi, nlo]; }; Date = function(year, month, day, hour, min, sec, nsec, loc) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, abs, d, day, end, hour, loc, m, min, month, n, nsec, offset, sec, start, t, unix, utc, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; abs = $f.abs; d = $f.d; day = $f.day; end = $f.end; hour = $f.hour; loc = $f.loc; m = $f.m; min = $f.min; month = $f.month; n = $f.n; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; start = $f.start; t = $f.t; unix = $f.unix; utc = $f.utc; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; y = $f.y; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (loc === ptrType$2.nil) { $panic(new $String("time: missing Location in call to Date")); } m = ((month >> 0)) - 1 >> 0; _tuple = norm(year, m, 12); year = _tuple[0]; m = _tuple[1]; month = ((m >> 0)) + 1 >> 0; _tuple$1 = norm(sec, nsec, 1000000000); sec = _tuple$1[0]; nsec = _tuple$1[1]; _tuple$2 = norm(min, sec, 60); min = _tuple$2[0]; sec = _tuple$2[1]; _tuple$3 = norm(hour, min, 60); hour = _tuple$3[0]; min = _tuple$3[1]; _tuple$4 = norm(day, hour, 24); day = _tuple$4[0]; hour = _tuple$4[1]; y = ((x = (x$1 = (new $Int64(0, year)), new $Int64(x$1.$high - -69, x$1.$low - 4075721025)), new $Uint64(x.$high, x.$low))); n = $div64(y, new $Uint64(0, 400), false); y = (x$2 = $mul64(new $Uint64(0, 400), n), new $Uint64(y.$high - x$2.$high, y.$low - x$2.$low)); d = $mul64(new $Uint64(0, 146097), n); n = $div64(y, new $Uint64(0, 100), false); y = (x$3 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high - x$3.$high, y.$low - x$3.$low)); d = (x$4 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high + x$4.$high, d.$low + x$4.$low)); n = $div64(y, new $Uint64(0, 4), false); y = (x$5 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high - x$5.$high, y.$low - x$5.$low)); d = (x$6 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high + x$6.$high, d.$low + x$6.$low)); n = y; d = (x$7 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high + x$7.$high, d.$low + x$7.$low)); d = (x$8 = (new $Uint64(0, (x$9 = month - 1 >> 0, ((x$9 < 0 || x$9 >= daysBefore.length) ? ($throwRuntimeError("index out of range"), undefined) : daysBefore[x$9])))), new $Uint64(d.$high + x$8.$high, d.$low + x$8.$low)); if (isLeap(year) && month >= 3) { d = (x$10 = new $Uint64(0, 1), new $Uint64(d.$high + x$10.$high, d.$low + x$10.$low)); } d = (x$11 = (new $Uint64(0, (day - 1 >> 0))), new $Uint64(d.$high + x$11.$high, d.$low + x$11.$low)); abs = $mul64(d, new $Uint64(0, 86400)); abs = (x$12 = (new $Uint64(0, ((($imul(hour, 3600)) + ($imul(min, 60)) >> 0) + sec >> 0))), new $Uint64(abs.$high + x$12.$high, abs.$low + x$12.$low)); unix = (x$13 = (new $Int64(abs.$high, abs.$low)), new $Int64(x$13.$high + -2147483647, x$13.$low + 3844486912)); _r = loc.lookup(unix); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$5 = _r; offset = _tuple$5[1]; start = _tuple$5[2]; end = _tuple$5[3]; /* */ if (!((offset === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((offset === 0))) { */ case 2: utc = (x$14 = (new $Int64(0, offset)), new $Int64(unix.$high - x$14.$high, unix.$low - x$14.$low)); /* */ if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { $s = 5; continue; } /* */ if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { */ case 5: _r$1 = loc.lookup(new $Int64(start.$high - 0, start.$low - 1)); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$6 = _r$1; offset = _tuple$6[1]; $s = 7; continue; /* } else if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { */ case 6: _r$2 = loc.lookup(end); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$7 = _r$2; offset = _tuple$7[1]; /* } */ case 7: case 4: unix = (x$15 = (new $Int64(0, offset)), new $Int64(unix.$high - x$15.$high, unix.$low - x$15.$low)); /* } */ case 3: t = $clone(unixTime(unix, ((nsec >> 0))), Time); t.setLoc(loc); $s = -1; return t; /* */ } return; } if ($f === undefined) { $f = { $blk: Date }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.abs = abs; $f.d = d; $f.day = day; $f.end = end; $f.hour = hour; $f.loc = loc; $f.m = m; $f.min = min; $f.month = month; $f.n = n; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.start = start; $f.t = t; $f.unix = unix; $f.utc = utc; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.y = y; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Date = Date; Time.ptr.prototype.Truncate = function(d) { var _tuple, d, r, t; t = this; t.stripMono(); if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { return t; } _tuple = div($clone(t, Time), d); r = _tuple[1]; return $clone(t, Time).Add(new Duration(-r.$high, -r.$low)); }; Time.prototype.Truncate = function(d) { return this.$val.Truncate(d); }; Time.ptr.prototype.Round = function(d) { var _tuple, d, r, t; t = this; t.stripMono(); if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { return t; } _tuple = div($clone(t, Time), d); r = _tuple[1]; if (lessThanHalf(r, d)) { return $clone(t, Time).Add(new Duration(-r.$high, -r.$low)); } return $clone(t, Time).Add(new Duration(d.$high - r.$high, d.$low - r.$low)); }; Time.prototype.Round = function(d) { return this.$val.Round(d); }; div = function(t, d) { var _q, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, d0, d1, d1$1, neg, nsec, qmod2, r, sec, sec$1, t, tmp, u0, u0x, u1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; qmod2 = 0; r = new Duration(0, 0); neg = false; nsec = t.nsec(); sec = t.sec(); if ((sec.$high < 0 || (sec.$high === 0 && sec.$low < 0))) { neg = true; sec = new $Int64(-sec.$high, -sec.$low); nsec = -nsec; if (nsec < 0) { nsec = nsec + (1000000000) >> 0; sec = (x = new $Int64(0, 1), new $Int64(sec.$high - x.$high, sec.$low - x.$low)); } } if ((d.$high < 0 || (d.$high === 0 && d.$low < 1000000000)) && (x$1 = $div64(new Duration(0, 1000000000), (new Duration(d.$high + d.$high, d.$low + d.$low)), true), (x$1.$high === 0 && x$1.$low === 0))) { qmod2 = (((_q = nsec / (((d.$low + ((d.$high >> 31) * 4294967296)) >> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0)) & 1; r = (new Duration(0, (_r = nsec % (((d.$low + ((d.$high >> 31) * 4294967296)) >> 0)), _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); } else if ((x$2 = $div64(d, new Duration(0, 1000000000), true), (x$2.$high === 0 && x$2.$low === 0))) { d1 = ((x$3 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$3.$high, x$3.$low))); qmod2 = (((x$4 = $div64(sec, d1, false), x$4.$low + ((x$4.$high >> 31) * 4294967296)) >> 0)) & 1; r = (x$5 = $mul64(((x$6 = $div64(sec, d1, true), new Duration(x$6.$high, x$6.$low))), new Duration(0, 1000000000)), x$7 = (new Duration(0, nsec)), new Duration(x$5.$high + x$7.$high, x$5.$low + x$7.$low)); } else { sec$1 = (new $Uint64(sec.$high, sec.$low)); tmp = $mul64(($shiftRightUint64(sec$1, 32)), new $Uint64(0, 1000000000)); u1 = $shiftRightUint64(tmp, 32); u0 = $shiftLeft64(tmp, 32); tmp = $mul64((new $Uint64(sec$1.$high & 0, (sec$1.$low & 4294967295) >>> 0)), new $Uint64(0, 1000000000)); _tmp = u0; _tmp$1 = new $Uint64(u0.$high + tmp.$high, u0.$low + tmp.$low); u0x = _tmp; u0 = _tmp$1; if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { u1 = (x$8 = new $Uint64(0, 1), new $Uint64(u1.$high + x$8.$high, u1.$low + x$8.$low)); } _tmp$2 = u0; _tmp$3 = (x$9 = (new $Uint64(0, nsec)), new $Uint64(u0.$high + x$9.$high, u0.$low + x$9.$low)); u0x = _tmp$2; u0 = _tmp$3; if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { u1 = (x$10 = new $Uint64(0, 1), new $Uint64(u1.$high + x$10.$high, u1.$low + x$10.$low)); } d1$1 = (new $Uint64(d.$high, d.$low)); while (true) { if (!(!((x$11 = $shiftRightUint64(d1$1, 63), (x$11.$high === 0 && x$11.$low === 1))))) { break; } d1$1 = $shiftLeft64(d1$1, (1)); } d0 = new $Uint64(0, 0); while (true) { qmod2 = 0; if ((u1.$high > d1$1.$high || (u1.$high === d1$1.$high && u1.$low > d1$1.$low)) || (u1.$high === d1$1.$high && u1.$low === d1$1.$low) && (u0.$high > d0.$high || (u0.$high === d0.$high && u0.$low >= d0.$low))) { qmod2 = 1; _tmp$4 = u0; _tmp$5 = new $Uint64(u0.$high - d0.$high, u0.$low - d0.$low); u0x = _tmp$4; u0 = _tmp$5; if ((u0.$high > u0x.$high || (u0.$high === u0x.$high && u0.$low > u0x.$low))) { u1 = (x$12 = new $Uint64(0, 1), new $Uint64(u1.$high - x$12.$high, u1.$low - x$12.$low)); } u1 = (x$13 = d1$1, new $Uint64(u1.$high - x$13.$high, u1.$low - x$13.$low)); } if ((d1$1.$high === 0 && d1$1.$low === 0) && (x$14 = (new $Uint64(d.$high, d.$low)), (d0.$high === x$14.$high && d0.$low === x$14.$low))) { break; } d0 = $shiftRightUint64(d0, (1)); d0 = (x$15 = $shiftLeft64((new $Uint64(d1$1.$high & 0, (d1$1.$low & 1) >>> 0)), 63), new $Uint64(d0.$high | x$15.$high, (d0.$low | x$15.$low) >>> 0)); d1$1 = $shiftRightUint64(d1$1, (1)); } r = (new Duration(u0.$high, u0.$low)); } if (neg && !((r.$high === 0 && r.$low === 0))) { qmod2 = (qmod2 ^ (1)) >> 0; r = new Duration(d.$high - r.$high, d.$low - r.$low); } return [qmod2, r]; }; Location.ptr.prototype.get = function() { var l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; if (l === ptrType$2.nil) { $s = -1; return utcLoc; } /* */ if (l === localLoc) { $s = 1; continue; } /* */ $s = 2; continue; /* if (l === localLoc) { */ case 1: $r = localOnce.Do(initLocal); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return l; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.get }; } $f.l = l; $f.$s = $s; $f.$r = $r; return $f; }; Location.prototype.get = function() { return this.$val.get(); }; Location.ptr.prototype.String = function() { var _r, l, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: l = this; _r = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r.name; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.String }; } $f._r = _r; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; }; Location.prototype.String = function() { return this.$val.String(); }; FixedZone = function(name, offset) { var l, name, offset, x; l = new Location.ptr(name, new sliceType([new zone.ptr(name, offset, false)]), new sliceType$1([new zoneTrans.ptr(new $Int64(-2147483648, 0), 0, false, false)]), new $Int64(-2147483648, 0), new $Int64(2147483647, 4294967295), ptrType.nil); l.cacheZone = (x = l.zone, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); return l; }; $pkg.FixedZone = FixedZone; Location.ptr.prototype.lookup = function(sec) { var _q, _r, end, hi, l, lim, lo, m, name, offset, sec, start, tx, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, zone$1, zone$2, zone$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _r = $f._r; end = $f.end; hi = $f.hi; l = $f.l; lim = $f.lim; lo = $f.lo; m = $f.m; name = $f.name; offset = $f.offset; sec = $f.sec; start = $f.start; tx = $f.tx; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; zone$1 = $f.zone$1; zone$2 = $f.zone$2; zone$3 = $f.zone$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = ""; offset = 0; start = new $Int64(0, 0); end = new $Int64(0, 0); l = this; _r = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } l = _r; if (l.zone.$length === 0) { name = "UTC"; offset = 0; start = new $Int64(-2147483648, 0); end = new $Int64(2147483647, 4294967295); $s = -1; return [name, offset, start, end]; } zone$1 = l.cacheZone; if (!(zone$1 === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { name = zone$1.name; offset = zone$1.offset; start = l.cacheStart; end = l.cacheEnd; $s = -1; return [name, offset, start, end]; } if ((l.tx.$length === 0) || (x$2 = (x$3 = l.tx, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).when, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { zone$2 = (x$4 = l.zone, x$5 = l.lookupFirstZone(), ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])); name = zone$2.name; offset = zone$2.offset; start = new $Int64(-2147483648, 0); if (l.tx.$length > 0) { end = (x$6 = l.tx, (0 >= x$6.$length ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + 0])).when; } else { end = new $Int64(2147483647, 4294967295); } $s = -1; return [name, offset, start, end]; } tx = l.tx; end = new $Int64(2147483647, 4294967295); lo = 0; hi = tx.$length; while (true) { if (!((hi - lo >> 0) > 1)) { break; } m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; lim = ((m < 0 || m >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + m]).when; if ((sec.$high < lim.$high || (sec.$high === lim.$high && sec.$low < lim.$low))) { end = lim; hi = m; } else { lo = m; } } zone$3 = (x$7 = l.zone, x$8 = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).index, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8])); name = zone$3.name; offset = zone$3.offset; start = ((lo < 0 || lo >= tx.$length) ? ($throwRuntimeError("index out of range"), undefined) : tx.$array[tx.$offset + lo]).when; $s = -1; return [name, offset, start, end]; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookup }; } $f._q = _q; $f._r = _r; $f.end = end; $f.hi = hi; $f.l = l; $f.lim = lim; $f.lo = lo; $f.m = m; $f.name = name; $f.offset = offset; $f.sec = sec; $f.start = start; $f.tx = tx; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.zone$3 = zone$3; $f.$s = $s; $f.$r = $r; return $f; }; Location.prototype.lookup = function(sec) { return this.$val.lookup(sec); }; Location.ptr.prototype.lookupFirstZone = function() { var _i, _ref, l, x, x$1, x$2, x$3, x$4, x$5, zi, zi$1; l = this; if (!l.firstZoneUsed()) { return 0; } if (l.tx.$length > 0 && (x = l.zone, x$1 = (x$2 = l.tx, (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0])).index, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])).isDST) { zi = (((x$3 = l.tx, (0 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 0])).index >> 0)) - 1 >> 0; while (true) { if (!(zi >= 0)) { break; } if (!(x$4 = l.zone, ((zi < 0 || zi >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + zi])).isDST) { return zi; } zi = zi - (1) >> 0; } } _ref = l.zone; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } zi$1 = _i; if (!(x$5 = l.zone, ((zi$1 < 0 || zi$1 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + zi$1])).isDST) { return zi$1; } _i++; } return 0; }; Location.prototype.lookupFirstZone = function() { return this.$val.lookupFirstZone(); }; Location.ptr.prototype.firstZoneUsed = function() { var _i, _ref, l, tx; l = this; _ref = l.tx; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } tx = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), zoneTrans); if (tx.index === 0) { return true; } _i++; } return false; }; Location.prototype.firstZoneUsed = function() { return this.$val.firstZoneUsed(); }; Location.ptr.prototype.lookupName = function(name, unix) { var _i, _i$1, _r, _r$1, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, i, i$1, l, nam, name, offset, offset$1, ok, unix, x, x$1, x$2, zone$1, zone$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; i = $f.i; i$1 = $f.i$1; l = $f.l; nam = $f.nam; name = $f.name; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; unix = $f.unix; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: offset = 0; ok = false; l = this; _r = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } l = _r; _ref = l.zone; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } i = _i; zone$1 = (x = l.zone, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); /* */ if (zone$1.name === name) { $s = 4; continue; } /* */ $s = 5; continue; /* if (zone$1.name === name) { */ case 4: _r$1 = l.lookup((x$1 = (new $Int64(0, zone$1.offset)), new $Int64(unix.$high - x$1.$high, unix.$low - x$1.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; nam = _tuple[0]; offset$1 = _tuple[1]; if (nam === zone$1.name) { _tmp = offset$1; _tmp$1 = true; offset = _tmp; ok = _tmp$1; $s = -1; return [offset, ok]; } /* } */ case 5: _i++; /* } */ $s = 2; continue; case 3: _ref$1 = l.zone; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; zone$2 = (x$2 = l.zone, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); if (zone$2.name === name) { _tmp$2 = zone$2.offset; _tmp$3 = true; offset = _tmp$2; ok = _tmp$3; $s = -1; return [offset, ok]; } _i$1++; } $s = -1; return [offset, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookupName }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.i = i; $f.i$1 = i$1; $f.l = l; $f.nam = nam; $f.name = name; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.unix = unix; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; }; Location.prototype.lookupName = function(name, unix) { return this.$val.lookupName(name, unix); }; ptrType$4.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$5.methods = [{prop: "Stop", name: "Stop", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([Duration], [$Bool], false)}]; Time.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "AppendFormat", name: "AppendFormat", pkg: "", typ: $funcType([sliceType$3, $String], [sliceType$3], false)}, {prop: "After", name: "After", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Before", name: "Before", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "abs", name: "abs", pkg: "time", typ: $funcType([], [$Uint64], false)}, {prop: "locabs", name: "locabs", pkg: "time", typ: $funcType([], [$String, $Int, $Uint64], false)}, {prop: "Date", name: "Date", pkg: "", typ: $funcType([], [$Int, Month, $Int], false)}, {prop: "Year", name: "Year", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Month", name: "Month", pkg: "", typ: $funcType([], [Month], false)}, {prop: "Day", name: "Day", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Weekday", name: "Weekday", pkg: "", typ: $funcType([], [Weekday], false)}, {prop: "ISOWeek", name: "ISOWeek", pkg: "", typ: $funcType([], [$Int, $Int], false)}, {prop: "Clock", name: "Clock", pkg: "", typ: $funcType([], [$Int, $Int, $Int], false)}, {prop: "Hour", name: "Hour", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Minute", name: "Minute", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Second", name: "Second", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Nanosecond", name: "Nanosecond", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "YearDay", name: "YearDay", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([Time], [Duration], false)}, {prop: "AddDate", name: "AddDate", pkg: "", typ: $funcType([$Int, $Int, $Int], [Time], false)}, {prop: "date", name: "date", pkg: "time", typ: $funcType([$Bool], [$Int, Month, $Int, $Int], false)}, {prop: "UTC", name: "UTC", pkg: "", typ: $funcType([], [Time], false)}, {prop: "Local", name: "Local", pkg: "", typ: $funcType([], [Time], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([ptrType$2], [Time], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$2], false)}, {prop: "Zone", name: "Zone", pkg: "", typ: $funcType([], [$String, $Int], false)}, {prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixNano", name: "UnixNano", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Time], false)}]; ptrType$7.methods = [{prop: "nsec", name: "nsec", pkg: "time", typ: $funcType([], [$Int32], false)}, {prop: "sec", name: "sec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "unixSec", name: "unixSec", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "addSec", name: "addSec", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "setLoc", name: "setLoc", pkg: "time", typ: $funcType([ptrType$2], [], false)}, {prop: "stripMono", name: "stripMono", pkg: "time", typ: $funcType([], [], false)}, {prop: "setMono", name: "setMono", pkg: "time", typ: $funcType([$Int64], [], false)}, {prop: "mono", name: "mono", pkg: "time", typ: $funcType([], [$Int64], false)}, {prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$3], [$error], false)}]; Month.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; Weekday.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; Duration.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Nanoseconds", name: "Nanoseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seconds", name: "Seconds", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Minutes", name: "Minutes", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Hours", name: "Hours", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Duration], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Duration], false)}]; ptrType$2.methods = [{prop: "get", name: "get", pkg: "time", typ: $funcType([], [ptrType$2], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "lookup", name: "lookup", pkg: "time", typ: $funcType([$Int64], [$String, $Int, $Int64, $Int64], false)}, {prop: "lookupFirstZone", name: "lookupFirstZone", pkg: "time", typ: $funcType([], [$Int], false)}, {prop: "firstZoneUsed", name: "firstZoneUsed", pkg: "time", typ: $funcType([], [$Bool], false)}, {prop: "lookupName", name: "lookupName", pkg: "time", typ: $funcType([$String, $Int64], [$Int, $Bool], false)}]; runtimeTimer.init("time", [{prop: "i", name: "i", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "period", name: "period", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "f", name: "f", embedded: false, exported: false, typ: funcType$1, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "timeout", name: "timeout", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "active", name: "active", embedded: false, exported: false, typ: $Bool, tag: ""}]); ParseError.init("", [{prop: "Layout", name: "Layout", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "LayoutElem", name: "LayoutElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "ValueElem", name: "ValueElem", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}]); Timer.init("time", [{prop: "C", name: "C", embedded: false, exported: true, typ: chanType$1, tag: ""}, {prop: "r", name: "r", embedded: false, exported: false, typ: runtimeTimer, tag: ""}]); Time.init("time", [{prop: "wall", name: "wall", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "ext", name: "ext", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "loc", name: "loc", embedded: false, exported: false, typ: ptrType$2, tag: ""}]); Location.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "zone", name: "zone", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "tx", name: "tx", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "cacheStart", name: "cacheStart", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheEnd", name: "cacheEnd", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "cacheZone", name: "cacheZone", embedded: false, exported: false, typ: ptrType, tag: ""}]); zone.init("time", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "isDST", name: "isDST", embedded: false, exported: false, typ: $Bool, tag: ""}]); zoneTrans.init("time", [{prop: "when", name: "when", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "isstd", name: "isstd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "isutc", name: "isutc", embedded: false, exported: false, typ: $Bool, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = nosync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } localLoc = new Location.ptr("", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); localOnce = new nosync.Once.ptr(false, false); zoneSources = new sliceType$2([runtime.GOROOT() + "/lib/time/zoneinfo.zip"]); std0x = $toNativeArray($kindInt, [260, 265, 524, 526, 528, 274]); longDayNames = new sliceType$2(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); shortDayNames = new sliceType$2(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); shortMonthNames = new sliceType$2(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]); longMonthNames = new sliceType$2(["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); atoiError = errors.New("time: invalid number"); errBad = errors.New("bad value for field"); errLeadingInt = errors.New("time: bad [0-9]*"); months = $toNativeArray($kindString, ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); days = $toNativeArray($kindString, ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); daysBefore = $toNativeArray($kindInt32, [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]); utcLoc = new Location.ptr("UTC", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); $pkg.UTC = utcLoc; $pkg.Local = localLoc; errLocation = errors.New("time: invalid location name"); badData = errors.New("malformed time zone information"); $unused(new sliceType$2(["/usr/share/zoneinfo/", "/usr/share/lib/zoneinfo/", "/usr/lib/locale/TZ/", runtime.GOROOT() + "/lib/time/zoneinfo.zip"])); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/poll"] = (function() { var $pkg = {}, $init, errors, io, runtime, atomic, syscall, time, pollDesc, TimeoutError, fdMutex, FD, ptrType, chanType, sliceType, ptrType$1, ptrType$2, arrayType, sliceType$2, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, sliceType$3, ptrType$12, funcType, funcType$1, ptrType$13, ptrType$14, ptrType$15, ptrType$16, sliceType$4, ptrType$17, semWaiters, tryDupCloexec, tryDupCloexec$24ptr, runtime_Semacquire, runtime_Semrelease, errClosing, consume, DupCloseOnExec, dupCloseOnExecOld, accept; errors = $packages["errors"]; io = $packages["io"]; runtime = $packages["runtime"]; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; time = $packages["time"]; pollDesc = $pkg.pollDesc = $newType(0, $kindStruct, "poll.pollDesc", true, "internal/poll", false, function(closing_) { this.$val = this; if (arguments.length === 0) { this.closing = false; return; } this.closing = closing_; }); TimeoutError = $pkg.TimeoutError = $newType(0, $kindStruct, "poll.TimeoutError", true, "internal/poll", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); fdMutex = $pkg.fdMutex = $newType(0, $kindStruct, "poll.fdMutex", true, "internal/poll", false, function(state_, rsema_, wsema_) { this.$val = this; if (arguments.length === 0) { this.state = new $Uint64(0, 0); this.rsema = 0; this.wsema = 0; return; } this.state = state_; this.rsema = rsema_; this.wsema = wsema_; }); FD = $pkg.FD = $newType(0, $kindStruct, "poll.FD", true, "internal/poll", true, function(fdmu_, Sysfd_, pd_, iovecs_, csema_, isBlocking_, IsStream_, ZeroReadIsEOF_, isFile_) { this.$val = this; if (arguments.length === 0) { this.fdmu = new fdMutex.ptr(new $Uint64(0, 0), 0, 0); this.Sysfd = 0; this.pd = new pollDesc.ptr(false); this.iovecs = ptrType$6.nil; this.csema = 0; this.isBlocking = 0; this.IsStream = false; this.ZeroReadIsEOF = false; this.isFile = false; return; } this.fdmu = fdmu_; this.Sysfd = Sysfd_; this.pd = pd_; this.iovecs = iovecs_; this.csema = csema_; this.isBlocking = isBlocking_; this.IsStream = IsStream_; this.ZeroReadIsEOF = ZeroReadIsEOF_; this.isFile = isFile_; }); ptrType = $ptrType($Uint32); chanType = $chanType($Bool, false, false); sliceType = $sliceType(chanType); ptrType$1 = $ptrType($Uint64); ptrType$2 = $ptrType($Int32); arrayType = $arrayType($Uint8, 4); sliceType$2 = $sliceType(syscall.Iovec); ptrType$6 = $ptrType(sliceType$2); ptrType$7 = $ptrType($Uint8); ptrType$8 = $ptrType(FD); ptrType$9 = $ptrType(pollDesc); ptrType$10 = $ptrType(TimeoutError); ptrType$11 = $ptrType(fdMutex); sliceType$3 = $sliceType($Uint8); ptrType$12 = $ptrType(syscall.Stat_t); funcType = $funcType([$Uintptr], [], false); funcType$1 = $funcType([$Uintptr], [$Bool], false); ptrType$13 = $ptrType(syscall.Linger); ptrType$14 = $ptrType(syscall.IPMreqn); ptrType$15 = $ptrType(syscall.IPMreq); ptrType$16 = $ptrType(syscall.IPv6Mreq); sliceType$4 = $sliceType(sliceType$3); ptrType$17 = $ptrType(sliceType$4); pollDesc.ptr.prototype.init = function(fd) { var fd, pd; pd = this; return $ifaceNil; }; pollDesc.prototype.init = function(fd) { return this.$val.init(fd); }; pollDesc.ptr.prototype.close = function() { var pd; pd = this; }; pollDesc.prototype.close = function() { return this.$val.close(); }; pollDesc.ptr.prototype.evict = function() { var pd; pd = this; pd.closing = true; }; pollDesc.prototype.evict = function() { return this.$val.evict(); }; pollDesc.ptr.prototype.prepare = function(mode, isFile) { var isFile, mode, pd; pd = this; if (pd.closing) { return errClosing(isFile); } return $ifaceNil; }; pollDesc.prototype.prepare = function(mode, isFile) { return this.$val.prepare(mode, isFile); }; pollDesc.ptr.prototype.prepareRead = function(isFile) { var isFile, pd; pd = this; return pd.prepare(114, isFile); }; pollDesc.prototype.prepareRead = function(isFile) { return this.$val.prepareRead(isFile); }; pollDesc.ptr.prototype.prepareWrite = function(isFile) { var isFile, pd; pd = this; return pd.prepare(119, isFile); }; pollDesc.prototype.prepareWrite = function(isFile) { return this.$val.prepareWrite(isFile); }; pollDesc.ptr.prototype.wait = function(mode, isFile) { var isFile, mode, pd; pd = this; if (pd.closing) { return errClosing(isFile); } return $pkg.ErrTimeout; }; pollDesc.prototype.wait = function(mode, isFile) { return this.$val.wait(mode, isFile); }; pollDesc.ptr.prototype.waitRead = function(isFile) { var isFile, pd; pd = this; return pd.wait(114, isFile); }; pollDesc.prototype.waitRead = function(isFile) { return this.$val.waitRead(isFile); }; pollDesc.ptr.prototype.waitWrite = function(isFile) { var isFile, pd; pd = this; return pd.wait(119, isFile); }; pollDesc.prototype.waitWrite = function(isFile) { return this.$val.waitWrite(isFile); }; pollDesc.ptr.prototype.pollable = function() { return true; }; pollDesc.prototype.pollable = function() { return this.$val.pollable(); }; FD.ptr.prototype.SetDeadline = function(t) { var t; return $ifaceNil; }; FD.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; FD.ptr.prototype.SetReadDeadline = function(t) { var t; return $ifaceNil; }; FD.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; FD.ptr.prototype.SetWriteDeadline = function(t) { var t; return $ifaceNil; }; FD.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; runtime_Semacquire = function(s) { var _entry, _key, _r, ch, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; _r = $f._r; ch = $f.ch; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (s.$get() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (s.$get() === 0) { */ case 1: ch = new $Chan($Bool, 0); _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType.keyFor(_key)] = { k: _key, v: $append((_entry = semWaiters[ptrType.keyFor(s)], _entry !== undefined ? _entry.v : sliceType.nil), ch) }; _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r[0]; /* } */ case 2: s.$set(s.$get() - (1) >>> 0); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semacquire }; } $f._entry = _entry; $f._key = _key; $f._r = _r; $f.ch = ch; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; runtime_Semrelease = function(s) { var _entry, _key, ch, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _key = $f._key; ch = $f.ch; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s.$set(s.$get() + (1) >>> 0); w = (_entry = semWaiters[ptrType.keyFor(s)], _entry !== undefined ? _entry.v : sliceType.nil); if (w.$length === 0) { $s = -1; return; } ch = (0 >= w.$length ? ($throwRuntimeError("index out of range"), undefined) : w.$array[w.$offset + 0]); w = $subslice(w, 1); _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType.keyFor(_key)] = { k: _key, v: w }; if (w.$length === 0) { delete semWaiters[ptrType.keyFor(s)]; } $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f._entry = _entry; $f._key = _key; $f.ch = ch; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; errClosing = function(isFile) { var isFile; if (isFile) { return $pkg.ErrFileClosing; } return $pkg.ErrNetClosing; }; TimeoutError.ptr.prototype.Error = function() { var e; e = this; return "i/o timeout"; }; TimeoutError.prototype.Error = function() { return this.$val.Error(); }; TimeoutError.ptr.prototype.Timeout = function() { var e; e = this; return true; }; TimeoutError.prototype.Timeout = function() { return this.$val.Timeout(); }; TimeoutError.ptr.prototype.Temporary = function() { var e; e = this; return true; }; TimeoutError.prototype.Temporary = function() { return this.$val.Temporary(); }; consume = function(v, n) { var ln0, n, v, x, x$1, x$2, x$3; while (true) { if (!(v.$get().$length > 0)) { break; } ln0 = (new $Int64(0, (x = v.$get(), (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).$length)); if ((ln0.$high > n.$high || (ln0.$high === n.$high && ln0.$low > n.$low))) { (x$2 = v.$get(), (0 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 0] = $subslice((x$1 = v.$get(), (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])), $flatten64(n)))); return; } n = (x$3 = ln0, new $Int64(n.$high - x$3.$high, n.$low - x$3.$low)); v.$set($subslice((v.$get()), 1)); } }; fdMutex.ptr.prototype.incref = function() { var mu, new$1, old, x, x$1; mu = this; while (true) { old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { return false; } new$1 = new $Uint64(old.$high + 0, old.$low + 8); if ((x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { return true; } } }; fdMutex.prototype.incref = function() { return this.$val.incref(); }; fdMutex.ptr.prototype.increfAndClose = function() { var mu, new$1, old, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; mu = $f.mu; new$1 = $f.new$1; old = $f.old; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mu = this; /* while (true) { */ case 1: old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { $s = -1; return false; } new$1 = (x$1 = new $Uint64(old.$high | 0, (old.$low | 1) >>> 0), new $Uint64(x$1.$high + 0, x$1.$low + 8)); if ((x$2 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$2.$high === 0 && x$2.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } new$1 = (x$3 = new $Uint64(2147483647, 4286578688), new $Uint64(new$1.$high & ~x$3.$high, (new$1.$low & ~x$3.$low) >>> 0)); /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: /* while (true) { */ case 5: /* if (!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { break; } */ if(!(!((x$4 = new $Uint64(old.$high & 2047, (old.$low & 4286578688) >>> 0), (x$4.$high === 0 && x$4.$low === 0))))) { $s = 6; continue; } old = (x$5 = new $Uint64(0, 8388608), new $Uint64(old.$high - x$5.$high, old.$low - x$5.$low)); $r = runtime_Semrelease((mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 5; continue; case 6: /* while (true) { */ case 8: /* if (!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { break; } */ if(!(!((x$6 = new $Uint64(old.$high & 2147481600, (old.$low & 0) >>> 0), (x$6.$high === 0 && x$6.$low === 0))))) { $s = 9; continue; } old = (x$7 = new $Uint64(2048, 0), new $Uint64(old.$high - x$7.$high, old.$low - x$7.$low)); $r = runtime_Semrelease((mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu)))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 8; continue; case 9: $s = -1; return true; /* } */ case 4: /* } */ $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.increfAndClose }; } $f.mu = mu; $f.new$1 = new$1; $f.old = old; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.$s = $s; $f.$r = $r; return $f; }; fdMutex.prototype.increfAndClose = function() { return this.$val.increfAndClose(); }; fdMutex.ptr.prototype.decref = function() { var mu, new$1, old, x, x$1; mu = this; while (true) { old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if ((x = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x.$high === 0 && x.$low === 0))) { $panic(new $String("inconsistent poll.fdMutex")); } new$1 = new $Uint64(old.$high - 0, old.$low - 8); if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { return (x$1 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$1.$high === 0 && x$1.$low === 1)); } } }; fdMutex.prototype.decref = function() { return this.$val.decref(); }; fdMutex.ptr.prototype.rwlock = function(read) { var _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mu = $f.mu; mutexBit = $f.mutexBit; mutexMask = $f.mutexMask; mutexSema = $f.mutexSema; mutexWait = $f.mutexWait; new$1 = $f.new$1; old = $f.old; read = $f.read; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mu = this; _tmp = new $Uint64(0, 0); _tmp$1 = new $Uint64(0, 0); _tmp$2 = new $Uint64(0, 0); mutexBit = _tmp; mutexWait = _tmp$1; mutexMask = _tmp$2; mutexSema = ptrType.nil; if (read) { mutexBit = new $Uint64(0, 2); mutexWait = new $Uint64(0, 8388608); mutexMask = new $Uint64(2047, 4286578688); mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); } else { mutexBit = new $Uint64(0, 4); mutexWait = new $Uint64(2048, 0); mutexMask = new $Uint64(2147481600, 0); mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); } /* while (true) { */ case 1: old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if (!((x = new $Uint64(old.$high & 0, (old.$low & 1) >>> 0), (x.$high === 0 && x.$low === 0)))) { $s = -1; return false; } new$1 = new $Uint64(0, 0); if ((x$1 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { new$1 = (x$2 = new $Uint64(old.$high | mutexBit.$high, (old.$low | mutexBit.$low) >>> 0), new $Uint64(x$2.$high + 0, x$2.$low + 8)); if ((x$3 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388600) >>> 0), (x$3.$high === 0 && x$3.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } } else { new$1 = new $Uint64(old.$high + mutexWait.$high, old.$low + mutexWait.$low); if ((x$4 = new $Uint64(new$1.$high & mutexMask.$high, (new$1.$low & mutexMask.$low) >>> 0), (x$4.$high === 0 && x$4.$low === 0))) { $panic(new $String("too many concurrent operations on a single file or socket (max 1048575)")); } } /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: if ((x$5 = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0))) { $s = -1; return true; } $r = runtime_Semacquire(mutexSema); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: /* } */ $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.rwlock }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mu = mu; $f.mutexBit = mutexBit; $f.mutexMask = mutexMask; $f.mutexSema = mutexSema; $f.mutexWait = mutexWait; $f.new$1 = new$1; $f.old = old; $f.read = read; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; fdMutex.prototype.rwlock = function(read) { return this.$val.rwlock(read); }; fdMutex.ptr.prototype.rwunlock = function(read) { var _tmp, _tmp$1, _tmp$2, mu, mutexBit, mutexMask, mutexSema, mutexWait, new$1, old, read, x, x$1, x$2, x$3, x$4, x$5, x$6, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; mu = $f.mu; mutexBit = $f.mutexBit; mutexMask = $f.mutexMask; mutexSema = $f.mutexSema; mutexWait = $f.mutexWait; new$1 = $f.new$1; old = $f.old; read = $f.read; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mu = this; _tmp = new $Uint64(0, 0); _tmp$1 = new $Uint64(0, 0); _tmp$2 = new $Uint64(0, 0); mutexBit = _tmp; mutexWait = _tmp$1; mutexMask = _tmp$2; mutexSema = ptrType.nil; if (read) { mutexBit = new $Uint64(0, 2); mutexWait = new $Uint64(0, 8388608); mutexMask = new $Uint64(2047, 4286578688); mutexSema = (mu.$ptr_rsema || (mu.$ptr_rsema = new ptrType(function() { return this.$target.rsema; }, function($v) { this.$target.rsema = $v; }, mu))); } else { mutexBit = new $Uint64(0, 4); mutexWait = new $Uint64(2048, 0); mutexMask = new $Uint64(2147481600, 0); mutexSema = (mu.$ptr_wsema || (mu.$ptr_wsema = new ptrType(function() { return this.$target.wsema; }, function($v) { this.$target.wsema = $v; }, mu))); } /* while (true) { */ case 1: old = atomic.LoadUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu)))); if ((x = new $Uint64(old.$high & mutexBit.$high, (old.$low & mutexBit.$low) >>> 0), (x.$high === 0 && x.$low === 0)) || (x$1 = new $Uint64(old.$high & 0, (old.$low & 8388600) >>> 0), (x$1.$high === 0 && x$1.$low === 0))) { $panic(new $String("inconsistent poll.fdMutex")); } new$1 = (x$2 = new $Uint64(old.$high & ~mutexBit.$high, (old.$low & ~mutexBit.$low) >>> 0), new $Uint64(x$2.$high - 0, x$2.$low - 8)); if (!((x$3 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$3.$high === 0 && x$3.$low === 0)))) { new$1 = (x$4 = mutexWait, new $Uint64(new$1.$high - x$4.$high, new$1.$low - x$4.$low)); } /* */ if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (atomic.CompareAndSwapUint64((mu.$ptr_state || (mu.$ptr_state = new ptrType$1(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, mu))), old, new$1)) { */ case 3: /* */ if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((x$5 = new $Uint64(old.$high & mutexMask.$high, (old.$low & mutexMask.$low) >>> 0), (x$5.$high === 0 && x$5.$low === 0)))) { */ case 5: $r = runtime_Semrelease(mutexSema); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $s = -1; return (x$6 = new $Uint64(new$1.$high & 0, (new$1.$low & 8388601) >>> 0), (x$6.$high === 0 && x$6.$low === 1)); /* } */ case 4: /* } */ $s = 1; continue; case 2: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: fdMutex.ptr.prototype.rwunlock }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.mu = mu; $f.mutexBit = mutexBit; $f.mutexMask = mutexMask; $f.mutexSema = mutexSema; $f.mutexWait = mutexWait; $f.new$1 = new$1; $f.old = old; $f.read = read; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.$s = $s; $f.$r = $r; return $f; }; fdMutex.prototype.rwunlock = function(read) { return this.$val.rwunlock(read); }; FD.ptr.prototype.incref = function() { var fd; fd = this; if (!fd.fdmu.incref()) { return errClosing(fd.isFile); } return $ifaceNil; }; FD.prototype.incref = function() { return this.$val.incref(); }; FD.ptr.prototype.decref = function() { var _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; /* */ if (fd.fdmu.decref()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (fd.fdmu.decref()) { */ case 1: _r = fd.destroy(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.decref }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.decref = function() { return this.$val.decref(); }; FD.ptr.prototype.readLock = function() { var _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwlock(true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r) { */ case 1: $s = -1; return errClosing(fd.isFile); /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.readLock }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.readLock = function() { return this.$val.readLock(); }; FD.ptr.prototype.readUnlock = function() { var _r, _r$1, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwunlock(true); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r) { */ case 1: _r$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.readUnlock }; } $f._r = _r; $f._r$1 = _r$1; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.readUnlock = function() { return this.$val.readUnlock(); }; FD.ptr.prototype.writeLock = function() { var _r, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwlock(false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r) { */ case 1: $s = -1; return errClosing(fd.isFile); /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.writeLock }; } $f._r = _r; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.writeLock = function() { return this.$val.writeLock(); }; FD.ptr.prototype.writeUnlock = function() { var _r, _r$1, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.rwunlock(false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r) { */ case 1: _r$1 = fd.destroy(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.writeUnlock }; } $f._r = _r; $f._r$1 = _r$1; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.writeUnlock = function() { return this.$val.writeUnlock(); }; FD.ptr.prototype.eofError = function(n, err) { var err, fd, n; fd = this; if ((n === 0) && $interfaceIsEqual(err, $ifaceNil) && fd.ZeroReadIsEOF) { return io.EOF; } return err; }; FD.prototype.eofError = function(n, err) { return this.$val.eofError(n, err); }; FD.ptr.prototype.Fchmod = function(mode) { var err, fd, mode, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; mode = $f.mode; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Fchmod(fd.Sysfd, mode); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchmod }; } $f.err = err; $f.fd = fd; $f.mode = mode; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fchmod = function(mode) { return this.$val.Fchmod(mode); }; FD.ptr.prototype.Fchown = function(uid, gid) { var err, fd, gid, uid, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; gid = $f.gid; uid = $f.uid; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Fchown(fd.Sysfd, uid, gid); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchown }; } $f.err = err; $f.fd = fd; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fchown = function(uid, gid) { return this.$val.Fchown(uid, gid); }; FD.ptr.prototype.Ftruncate = function(size) { var err, fd, size, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; size = $f.size; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Ftruncate(fd.Sysfd, size); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Ftruncate }; } $f.err = err; $f.fd = fd; $f.size = size; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Ftruncate = function(size) { return this.$val.Ftruncate(size); }; FD.ptr.prototype.Fsync = function() { var err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Fsync(fd.Sysfd); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fsync }; } $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fsync = function() { return this.$val.Fsync(); }; FD.ptr.prototype.Init = function(net, pollable) { var err, fd, net, pollable; fd = this; if (net === "file") { fd.isFile = true; } if (!pollable) { fd.isBlocking = 1; return $ifaceNil; } err = fd.pd.init(fd); if (!($interfaceIsEqual(err, $ifaceNil))) { fd.isBlocking = 1; } return err; }; FD.prototype.Init = function(net, pollable) { return this.$val.Init(net, pollable); }; FD.ptr.prototype.destroy = function() { var _r, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; fd.pd.close(); _r = $pkg.CloseFunc(fd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; fd.Sysfd = -1; $r = runtime_Semrelease((fd.$ptr_csema || (fd.$ptr_csema = new ptrType(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.destroy }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.destroy = function() { return this.$val.destroy(); }; FD.ptr.prototype.Close = function() { var _r, _r$1, err, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; _r = fd.fdmu.increfAndClose(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r) { */ case 1: $s = -1; return errClosing(fd.isFile); /* } */ case 2: fd.pd.evict(); _r$1 = fd.decref(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; /* */ if (fd.isBlocking === 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (fd.isBlocking === 0) { */ case 5: $r = runtime_Semacquire((fd.$ptr_csema || (fd.$ptr_csema = new ptrType(function() { return this.$target.csema; }, function($v) { this.$target.csema = $v; }, fd)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Close }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.Close = function() { return this.$val.Close(); }; FD.ptr.prototype.Shutdown = function(how) { var err, fd, how, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; how = $f.how; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Shutdown(fd.Sysfd, how); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Shutdown }; } $f.err = err; $f.fd = fd; $f.how = how; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Shutdown = function(how) { return this.$val.Shutdown(how); }; FD.ptr.prototype.SetBlocking = function() { var err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); atomic.StoreUint32((fd.$ptr_isBlocking || (fd.$ptr_isBlocking = new ptrType(function() { return this.$target.isBlocking; }, function($v) { this.$target.isBlocking = $v; }, fd))), 1); $s = -1; return syscall.SetNonblock(fd.Sysfd, false); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetBlocking }; } $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetBlocking = function() { return this.$val.SetBlocking(); }; FD.ptr.prototype.Read = function(p) { var _r, _tuple, err, err$1, err$2, fd, n, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } $deferred.push([$methodVal(fd, "readUnlock"), []]); if (p.$length === 0) { $s = -1; return [0, $ifaceNil]; } err$1 = fd.pd.prepareRead(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [0, err$1]; } if (fd.IsStream && p.$length > 1073741824) { p = $subslice(p, 0, 1073741824); } while (true) { _tuple = syscall.Read(fd.Sysfd, p); n = _tuple[0]; err$2 = _tuple[1]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { n = 0; if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { continue; } } if (false && $interfaceIsEqual(err$2, new syscall.Errno(4))) { continue; } } err$2 = fd.eofError(n, err$2); $s = -1; return [n, err$2]; } $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Read = function(p) { return this.$val.Read(p); }; FD.ptr.prototype.Pread = function(p, off) { var _r, _tuple, err, err$1, fd, n, off, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; fd = $f.fd; n = $f.n; off = $f.off; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } if (fd.IsStream && p.$length > 1073741824) { p = $subslice(p, 0, 1073741824); } _tuple = syscall.Pread(fd.Sysfd, p, off); n = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { n = 0; } _r = fd.decref(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; err$1 = fd.eofError(n, err$1); $s = -1; return [n, err$1]; /* */ } return; } if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Pread }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.n = n; $f.off = off; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; FD.prototype.Pread = function(p, off) { return this.$val.Pread(p, off); }; FD.ptr.prototype.ReadFrom = function(p) { var _r, _tuple, err, err$1, err$2, fd, n, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, $ifaceNil, err]; } $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [0, $ifaceNil, err$1]; } while (true) { _tuple = syscall.Recvfrom(fd.Sysfd, p, 0); n = _tuple[0]; sa = _tuple[1]; err$2 = _tuple[2]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { n = 0; if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { continue; } } } err$2 = fd.eofError(n, err$2); $s = -1; return [n, sa, err$2]; } $s = -1; return [0, $ifaceNil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadFrom }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.ReadFrom = function(p) { return this.$val.ReadFrom(p); }; FD.ptr.prototype.ReadMsg = function(p, oob) { var _r, _tuple, err, err$1, err$2, fd, flags, n, oob, oobn, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; flags = $f.flags; n = $f.n; oob = $f.oob; oobn = $f.oobn; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, 0, 0, $ifaceNil, err]; } $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [0, 0, 0, $ifaceNil, err$1]; } while (true) { _tuple = syscall.Recvmsg(fd.Sysfd, p, oob, 0); n = _tuple[0]; oobn = _tuple[1]; flags = _tuple[2]; sa = _tuple[3]; err$2 = _tuple[4]; if (!($interfaceIsEqual(err$2, $ifaceNil))) { if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { continue; } } } err$2 = fd.eofError(n, err$2); $s = -1; return [n, oobn, flags, sa, err$2]; } $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, 0, $ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadMsg }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.flags = flags; $f.n = n; $f.oob = oob; $f.oobn = oobn; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.ReadMsg = function(p, oob) { return this.$val.ReadMsg(p, oob); }; FD.ptr.prototype.Write = function(p) { var _r, _tuple, err, err$1, err$2, fd, max, n, nn, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; max = $f.max; n = $f.n; nn = $f.nn; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [0, err$1]; } nn = 0; while (true) { max = p.$length; if (fd.IsStream && (max - nn >> 0) > 1073741824) { max = nn + 1073741824 >> 0; } _tuple = syscall.Write(fd.Sysfd, $subslice(p, nn, max)); n = _tuple[0]; err$2 = _tuple[1]; if (n > 0) { nn = nn + (n) >> 0; } if (nn === p.$length) { $s = -1; return [nn, err$2]; } if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { continue; } } if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [nn, err$2]; } if (n === 0) { $s = -1; return [nn, io.ErrUnexpectedEOF]; } } $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Write }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.max = max; $f.n = n; $f.nn = nn; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Write = function(p) { return this.$val.Write(p); }; FD.ptr.prototype.Pwrite = function(p, off) { var _tuple, err, err$1, fd, max, n, nn, off, p, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; fd = $f.fd; max = $f.max; n = $f.n; nn = $f.nn; off = $f.off; p = $f.p; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } $deferred.push([$methodVal(fd, "decref"), []]); nn = 0; while (true) { max = p.$length; if (fd.IsStream && (max - nn >> 0) > 1073741824) { max = nn + 1073741824 >> 0; } _tuple = syscall.Pwrite(fd.Sysfd, $subslice(p, nn, max), (x = (new $Int64(0, nn)), new $Int64(off.$high + x.$high, off.$low + x.$low))); n = _tuple[0]; err$1 = _tuple[1]; if (n > 0) { nn = nn + (n) >> 0; } if (nn === p.$length) { $s = -1; return [nn, err$1]; } if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [nn, err$1]; } if (n === 0) { $s = -1; return [nn, io.ErrUnexpectedEOF]; } } $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Pwrite }; } $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.max = max; $f.n = n; $f.nn = nn; $f.off = off; $f.p = p; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Pwrite = function(p, off) { return this.$val.Pwrite(p, off); }; FD.ptr.prototype.WriteTo = function(p, sa) { var _r, _r$1, err, err$1, err$2, fd, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [0, err$1]; } /* while (true) { */ case 2: _r$1 = syscall.Sendto(fd.Sysfd, p, 0, sa); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$2 = _r$1; if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 2; continue; } } if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [0, err$2]; } $s = -1; return [p.$length, $ifaceNil]; /* } */ $s = 2; continue; case 3: $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteTo }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.WriteTo = function(p, sa) { return this.$val.WriteTo(p, sa); }; FD.ptr.prototype.WriteMsg = function(p, oob, sa) { var _r, _r$1, _tuple, err, err$1, err$2, fd, n, oob, p, sa, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; n = $f.n; oob = $f.oob; p = $f.p; sa = $f.sa; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, 0, err]; } $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [0, 0, err$1]; } /* while (true) { */ case 2: _r$1 = syscall.SendmsgN(fd.Sysfd, p, oob, sa, 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err$2 = _tuple[1]; if ($interfaceIsEqual(err$2, new syscall.Errno(11)) && fd.pd.pollable()) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 2; continue; } } if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return [n, 0, err$2]; } $s = -1; return [n, oob.$length, err$2]; /* } */ $s = 2; continue; case 3: $s = -1; return [0, 0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, 0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteMsg }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.n = n; $f.oob = oob; $f.p = p; $f.sa = sa; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.WriteMsg = function(p, oob, sa) { return this.$val.WriteMsg(p, oob, sa); }; FD.ptr.prototype.Accept = function() { var _1, _r, _r$1, _tuple, err, err$1, err$2, errcall, fd, rsa, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; errcall = $f.errcall; fd = $f.fd; rsa = $f.rsa; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [-1, $ifaceNil, "", err]; } $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [-1, $ifaceNil, "", err$1]; } /* while (true) { */ case 2: _r$1 = accept(fd.Sysfd); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; s = _tuple[0]; rsa = _tuple[1]; errcall = _tuple[2]; err$2 = _tuple[3]; if ($interfaceIsEqual(err$2, $ifaceNil)) { $s = -1; return [s, rsa, "", err$2]; } _1 = err$2; if ($interfaceIsEqual(_1, new syscall.Errno((11)))) { if (fd.pd.pollable()) { err$2 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 2; continue; } } } else if ($interfaceIsEqual(_1, new syscall.Errno((103)))) { /* continue; */ $s = 2; continue; } $s = -1; return [-1, $ifaceNil, errcall, err$2]; /* } */ $s = 2; continue; case 3: $s = -1; return [0, $ifaceNil, "", $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Accept }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.errcall = errcall; $f.fd = fd; $f.rsa = rsa; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Accept = function() { return this.$val.Accept(); }; FD.ptr.prototype.Seek = function(offset, whence) { var err, fd, offset, whence, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; offset = $f.offset; whence = $f.whence; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new $Int64(0, 0), err]; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Seek(fd.Sysfd, offset, whence); /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Seek }; } $f.err = err; $f.fd = fd; $f.offset = offset; $f.whence = whence; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; FD.ptr.prototype.ReadDirent = function(buf) { var _tuple, buf, err, err$1, fd, n, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; buf = $f.buf; err = $f.err; err$1 = $f.err$1; fd = $f.fd; n = $f.n; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } $deferred.push([$methodVal(fd, "decref"), []]); while (true) { _tuple = syscall.ReadDirent(fd.Sysfd, buf); n = _tuple[0]; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { n = 0; if ($interfaceIsEqual(err$1, new syscall.Errno(11)) && fd.pd.pollable()) { err$1 = fd.pd.waitRead(fd.isFile); if ($interfaceIsEqual(err$1, $ifaceNil)) { continue; } } } $s = -1; return [n, err$1]; } $s = -1; return [0, $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.ReadDirent }; } $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.err$1 = err$1; $f.fd = fd; $f.n = n; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.ReadDirent = function(buf) { return this.$val.ReadDirent(buf); }; FD.ptr.prototype.Fchdir = function() { var err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Fchdir(fd.Sysfd); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fchdir }; } $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fchdir = function() { return this.$val.Fchdir(); }; FD.ptr.prototype.Fstat = function(s) { var err, fd, s, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; s = $f.s; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.Fstat(fd.Sysfd, s); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Fstat }; } $f.err = err; $f.fd = fd; $f.s = s; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Fstat = function(s) { return this.$val.Fstat(s); }; DupCloseOnExec = function(fd) { var _1, _r, _tuple, e1, fd, r0, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; e1 = $f.e1; fd = $f.fd; r0 = $f.r0; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (atomic.LoadInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$2(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; })))) === 1) { _tuple = syscall.Syscall(72, ((fd >>> 0)), 1030, 0); r0 = _tuple[0]; e1 = _tuple[2]; _1 = e1; if (_1 === (0)) { $s = -1; return [((r0 >> 0)), "", $ifaceNil]; } else if ((_1 === (22)) || (_1 === (38))) { atomic.StoreInt32((tryDupCloexec$24ptr || (tryDupCloexec$24ptr = new ptrType$2(function() { return tryDupCloexec; }, function($v) { tryDupCloexec = $v; }))), 0); } else { $s = -1; return [-1, "fcntl", new syscall.Errno(e1)]; } } _r = dupCloseOnExecOld(fd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: DupCloseOnExec }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.e1 = e1; $f.fd = fd; $f.r0 = r0; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.DupCloseOnExec = DupCloseOnExec; dupCloseOnExecOld = function(fd) { var _tuple, err, fd, newfd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; err = $f.err; fd = $f.fd; newfd = $f.newfd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); $r = syscall.ForkLock.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(syscall.ForkLock, "RUnlock"), []]); _tuple = syscall.Dup(fd); newfd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [-1, "dup", err]; } syscall.CloseOnExec(newfd); $s = -1; return [newfd, "", $ifaceNil]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: dupCloseOnExecOld }; } $f._tuple = _tuple; $f.err = err; $f.fd = fd; $f.newfd = newfd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.ptr.prototype.Dup = function() { var _r, err, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [-1, "", err]; } $deferred.push([$methodVal(fd, "decref"), []]); _r = DupCloseOnExec(fd.Sysfd); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, "", $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Dup }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Dup = function() { return this.$val.Dup(); }; FD.ptr.prototype.WaitWrite = function() { var fd; fd = this; return fd.pd.waitWrite(fd.isFile); }; FD.prototype.WaitWrite = function() { return this.$val.WaitWrite(); }; FD.ptr.prototype.WriteOnce = function(p) { var _r, err, fd, p, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; fd = $f.fd; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [0, err]; } $deferred.push([$methodVal(fd, "writeUnlock"), []]); $s = -1; return syscall.Write(fd.Sysfd, p); /* */ } return; } } catch(err) { $err = err; $s = -1; return [0, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.WriteOnce }; } $f._r = _r; $f.err = err; $f.fd = fd; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.WriteOnce = function(p) { return this.$val.WriteOnce(p); }; FD.ptr.prototype.RawControl = function(f) { var err, f, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $r = f(((fd.Sysfd >>> 0))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawControl }; } $f.err = err; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.RawControl = function(f) { return this.$val.RawControl(f); }; FD.ptr.prototype.RawRead = function(f) { var _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.readLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "readUnlock"), []]); err$1 = fd.pd.prepareRead(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* while (true) { */ case 2: _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: $s = -1; return $ifaceNil; /* } */ case 5: err$2 = fd.pd.waitRead(fd.isFile); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ $s = 2; continue; case 3: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawRead }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.RawRead = function(f) { return this.$val.RawRead(f); }; FD.ptr.prototype.RawWrite = function(f) { var _r, _r$1, err, err$1, err$2, f, fd, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; fd = $f.fd; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return err$1; } /* while (true) { */ case 2: _r$1 = f(((fd.Sysfd >>> 0))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: $s = -1; return $ifaceNil; /* } */ case 5: err$2 = fd.pd.waitWrite(fd.isFile); if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = -1; return err$2; } /* } */ $s = 2; continue; case 3: $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.RawWrite }; } $f._r = _r; $f._r$1 = _r$1; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.fd = fd; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.RawWrite = function(f) { return this.$val.RawWrite(f); }; accept = function(s) { var _1, _r, _r$1, _r$2, _tuple, _tuple$1, err, ns, s, sa, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; ns = $f.ns; s = $f.s; sa = $f.sa; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $pkg.Accept4Func(s, 526336); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ns = _tuple[0]; sa = _tuple[1]; err = _tuple[2]; _1 = err; if ($interfaceIsEqual(_1, $ifaceNil)) { $s = -1; return [ns, sa, "", $ifaceNil]; } else if ($interfaceIsEqual(_1, new syscall.Errno((38)))) { } else if ($interfaceIsEqual(_1, new syscall.Errno((22)))) { } else if ($interfaceIsEqual(_1, new syscall.Errno((13)))) { } else if ($interfaceIsEqual(_1, new syscall.Errno((14)))) { } else { $s = -1; return [-1, sa, "accept4", err]; } _r$1 = $pkg.AcceptFunc(s); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; ns = _tuple$1[0]; sa = _tuple$1[1]; err = _tuple$1[2]; if ($interfaceIsEqual(err, $ifaceNil)) { syscall.CloseOnExec(ns); } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [-1, $ifaceNil, "accept", err]; } err = syscall.SetNonblock(ns, true); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: _r$2 = $pkg.CloseFunc(ns); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return [-1, $ifaceNil, "setnonblock", err]; /* } */ case 4: $s = -1; return [ns, sa, "", $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: accept }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.ns = ns; $f.s = s; $f.sa = sa; $f.$s = $s; $f.$r = $r; return $f; }; FD.ptr.prototype.SetsockoptInt = function(level, name, arg) { var arg, err, fd, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptInt(fd.Sysfd, level, name, arg); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptInt }; } $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptInt = function(level, name, arg) { return this.$val.SetsockoptInt(level, name, arg); }; FD.ptr.prototype.SetsockoptInet4Addr = function(level, name, arg) { var arg, err, fd, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptInet4Addr(fd.Sysfd, level, name, $clone(arg, arrayType)); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptInet4Addr }; } $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptInet4Addr = function(level, name, arg) { return this.$val.SetsockoptInet4Addr(level, name, arg); }; FD.ptr.prototype.SetsockoptLinger = function(level, name, l) { var err, fd, l, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; l = $f.l; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptLinger(fd.Sysfd, level, name, l); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptLinger }; } $f.err = err; $f.fd = fd; $f.l = l; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptLinger = function(level, name, l) { return this.$val.SetsockoptLinger(level, name, l); }; FD.ptr.prototype.SetsockoptIPMreqn = function(level, name, mreq) { var err, fd, level, mreq, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptIPMreqn(fd.Sysfd, level, name, mreq); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPMreqn }; } $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptIPMreqn = function(level, name, mreq) { return this.$val.SetsockoptIPMreqn(level, name, mreq); }; FD.ptr.prototype.SetsockoptByte = function(level, name, arg) { var arg, err, fd, level, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; arg = $f.arg; err = $f.err; fd = $f.fd; level = $f.level; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptByte(fd.Sysfd, level, name, arg); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptByte }; } $f.arg = arg; $f.err = err; $f.fd = fd; $f.level = level; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptByte = function(level, name, arg) { return this.$val.SetsockoptByte(level, name, arg); }; FD.ptr.prototype.SetsockoptIPMreq = function(level, name, mreq) { var err, fd, level, mreq, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptIPMreq(fd.Sysfd, level, name, mreq); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPMreq }; } $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptIPMreq = function(level, name, mreq) { return this.$val.SetsockoptIPMreq(level, name, mreq); }; FD.ptr.prototype.SetsockoptIPv6Mreq = function(level, name, mreq) { var err, fd, level, mreq, name, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; err = $f.err; fd = $f.fd; level = $f.level; mreq = $f.mreq; name = $f.name; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); fd = this; err = fd.incref(); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $deferred.push([$methodVal(fd, "decref"), []]); $s = -1; return syscall.SetsockoptIPv6Mreq(fd.Sysfd, level, name, mreq); /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.SetsockoptIPv6Mreq }; } $f.err = err; $f.fd = fd; $f.level = level; $f.mreq = mreq; $f.name = name; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.SetsockoptIPv6Mreq = function(level, name, mreq) { return this.$val.SetsockoptIPv6Mreq(level, name, mreq); }; FD.ptr.prototype.Writev = function(v) { var _i, _r, _ref, _tuple, chunk, e0, err, err$1, err$2, fd, iovecs, maxVec, n, v, wrote, x, x$1, x$2, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; chunk = $f.chunk; e0 = $f.e0; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; iovecs = $f.iovecs; maxVec = $f.maxVec; n = $f.n; v = $f.v; wrote = $f.wrote; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); iovecs = [iovecs]; fd = this; _r = fd.writeLock(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [new $Int64(0, 0), err]; } $deferred.push([$methodVal(fd, "writeUnlock"), []]); err$1 = fd.pd.prepareWrite(fd.isFile); if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = -1; return [new $Int64(0, 0), err$1]; } iovecs[0] = sliceType$2.nil; if (!(fd.iovecs === ptrType$6.nil)) { iovecs[0] = fd.iovecs.$get(); } maxVec = 1024; n = new $Int64(0, 0); err$2 = $ifaceNil; /* while (true) { */ case 2: /* if (!(v.$get().$length > 0)) { break; } */ if(!(v.$get().$length > 0)) { $s = 3; continue; } iovecs[0] = $subslice(iovecs[0], 0, 0); _ref = v.$get(); _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } chunk = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (chunk.$length === 0) { _i++; /* continue; */ $s = 4; continue; } iovecs[0] = $append(iovecs[0], new syscall.Iovec.ptr($indexPtr(chunk.$array, chunk.$offset + 0, ptrType$7), new $Uint64(0, 0))); if (fd.IsStream && chunk.$length > 1073741824) { (x = iovecs[0].$length - 1 >> 0, ((x < 0 || x >= iovecs[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs[0].$array[iovecs[0].$offset + x])).SetLen(1073741824); /* break; */ $s = 5; continue; } (x$1 = iovecs[0].$length - 1 >> 0, ((x$1 < 0 || x$1 >= iovecs[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : iovecs[0].$array[iovecs[0].$offset + x$1])).SetLen(chunk.$length); if (iovecs[0].$length === maxVec) { /* break; */ $s = 5; continue; } _i++; /* } */ $s = 4; continue; case 5: if (iovecs[0].$length === 0) { /* break; */ $s = 3; continue; } fd.iovecs = (iovecs.$ptr || (iovecs.$ptr = new ptrType$6(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, iovecs))); _tuple = syscall.Syscall(20, ((fd.Sysfd >>> 0)), (($sliceToArray(iovecs[0]))), ((iovecs[0].$length >>> 0))); wrote = _tuple[0]; e0 = _tuple[2]; if (wrote === 4294967295) { wrote = 0; } $r = $pkg.TestHookDidWritev(((wrote >> 0))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } n = (x$2 = (new $Int64(0, wrote.constructor === Number ? wrote : 1)), new $Int64(n.$high + x$2.$high, n.$low + x$2.$low)); consume(v, (new $Int64(0, wrote.constructor === Number ? wrote : 1))); if (e0 === 11) { err$2 = fd.pd.waitWrite(fd.isFile); if ($interfaceIsEqual(err$2, $ifaceNil)) { /* continue; */ $s = 2; continue; } } else if (!((e0 === 0))) { err$2 = new syscall.Errno((e0)); } if (!($interfaceIsEqual(err$2, $ifaceNil))) { /* break; */ $s = 3; continue; } if ((n.$high === 0 && n.$low === 0)) { err$2 = io.ErrUnexpectedEOF; /* break; */ $s = 3; continue; } /* } */ $s = 2; continue; case 3: $s = -1; return [n, err$2]; /* */ } return; } } catch(err) { $err = err; $s = -1; return [new $Int64(0, 0), $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: FD.ptr.prototype.Writev }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.chunk = chunk; $f.e0 = e0; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.iovecs = iovecs; $f.maxVec = maxVec; $f.n = n; $f.v = v; $f.wrote = wrote; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; FD.prototype.Writev = function(v) { return this.$val.Writev(v); }; ptrType$9.methods = [{prop: "init", name: "init", pkg: "internal/poll", typ: $funcType([ptrType$8], [$error], false)}, {prop: "close", name: "close", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "evict", name: "evict", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "prepare", name: "prepare", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "prepareRead", name: "prepareRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "prepareWrite", name: "prepareWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "wait", name: "wait", pkg: "internal/poll", typ: $funcType([$Int, $Bool], [$error], false)}, {prop: "waitRead", name: "waitRead", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitWrite", name: "waitWrite", pkg: "internal/poll", typ: $funcType([$Bool], [$error], false)}, {prop: "waitCanceled", name: "waitCanceled", pkg: "internal/poll", typ: $funcType([$Int], [], false)}, {prop: "pollable", name: "pollable", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}]; ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$11.methods = [{prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "increfAndClose", name: "increfAndClose", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$Bool], false)}, {prop: "rwlock", name: "rwlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}, {prop: "rwunlock", name: "rwunlock", pkg: "internal/poll", typ: $funcType([$Bool], [$Bool], false)}]; ptrType$8.methods = [{prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "incref", name: "incref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "decref", name: "decref", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readLock", name: "readLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "readUnlock", name: "readUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "writeLock", name: "writeLock", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "writeUnlock", name: "writeUnlock", pkg: "internal/poll", typ: $funcType([], [], false)}, {prop: "eofError", name: "eofError", pkg: "internal/poll", typ: $funcType([$Int, $error], [$error], false)}, {prop: "Fchmod", name: "Fchmod", pkg: "", typ: $funcType([$Uint32], [$error], false)}, {prop: "Fchown", name: "Fchown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Ftruncate", name: "Ftruncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Fsync", name: "Fsync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Init", name: "Init", pkg: "", typ: $funcType([$String, $Bool], [$error], false)}, {prop: "destroy", name: "destroy", pkg: "internal/poll", typ: $funcType([], [$error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Shutdown", name: "Shutdown", pkg: "", typ: $funcType([$Int], [$error], false)}, {prop: "SetBlocking", name: "SetBlocking", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Pread", name: "Pread", pkg: "", typ: $funcType([sliceType$3, $Int64], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([sliceType$3], [$Int, syscall.Sockaddr, $error], false)}, {prop: "ReadMsg", name: "ReadMsg", pkg: "", typ: $funcType([sliceType$3, sliceType$3], [$Int, $Int, $Int, syscall.Sockaddr, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Pwrite", name: "Pwrite", pkg: "", typ: $funcType([sliceType$3, $Int64], [$Int, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([sliceType$3, syscall.Sockaddr], [$Int, $error], false)}, {prop: "WriteMsg", name: "WriteMsg", pkg: "", typ: $funcType([sliceType$3, sliceType$3, syscall.Sockaddr], [$Int, $Int, $error], false)}, {prop: "Accept", name: "Accept", pkg: "", typ: $funcType([], [$Int, syscall.Sockaddr, $String, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "ReadDirent", name: "ReadDirent", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "Fchdir", name: "Fchdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Fstat", name: "Fstat", pkg: "", typ: $funcType([ptrType$12], [$error], false)}, {prop: "Dup", name: "Dup", pkg: "", typ: $funcType([], [$Int, $String, $error], false)}, {prop: "WaitWrite", name: "WaitWrite", pkg: "", typ: $funcType([], [$error], false)}, {prop: "WriteOnce", name: "WriteOnce", pkg: "", typ: $funcType([sliceType$3], [$Int, $error], false)}, {prop: "RawControl", name: "RawControl", pkg: "", typ: $funcType([funcType], [$error], false)}, {prop: "RawRead", name: "RawRead", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "RawWrite", name: "RawWrite", pkg: "", typ: $funcType([funcType$1], [$error], false)}, {prop: "SetsockoptInt", name: "SetsockoptInt", pkg: "", typ: $funcType([$Int, $Int, $Int], [$error], false)}, {prop: "SetsockoptInet4Addr", name: "SetsockoptInet4Addr", pkg: "", typ: $funcType([$Int, $Int, arrayType], [$error], false)}, {prop: "SetsockoptLinger", name: "SetsockoptLinger", pkg: "", typ: $funcType([$Int, $Int, ptrType$13], [$error], false)}, {prop: "SetsockoptIPMreqn", name: "SetsockoptIPMreqn", pkg: "", typ: $funcType([$Int, $Int, ptrType$14], [$error], false)}, {prop: "SetsockoptByte", name: "SetsockoptByte", pkg: "", typ: $funcType([$Int, $Int, $Uint8], [$error], false)}, {prop: "SetsockoptIPMreq", name: "SetsockoptIPMreq", pkg: "", typ: $funcType([$Int, $Int, ptrType$15], [$error], false)}, {prop: "SetsockoptIPv6Mreq", name: "SetsockoptIPv6Mreq", pkg: "", typ: $funcType([$Int, $Int, ptrType$16], [$error], false)}, {prop: "Writev", name: "Writev", pkg: "", typ: $funcType([ptrType$17], [$Int64, $error], false)}]; pollDesc.init("internal/poll", [{prop: "closing", name: "closing", embedded: false, exported: false, typ: $Bool, tag: ""}]); TimeoutError.init("", []); fdMutex.init("internal/poll", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "rsema", name: "rsema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "wsema", name: "wsema", embedded: false, exported: false, typ: $Uint32, tag: ""}]); FD.init("internal/poll", [{prop: "fdmu", name: "fdmu", embedded: false, exported: false, typ: fdMutex, tag: ""}, {prop: "Sysfd", name: "Sysfd", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "pd", name: "pd", embedded: false, exported: false, typ: pollDesc, tag: ""}, {prop: "iovecs", name: "iovecs", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "csema", name: "csema", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "isBlocking", name: "isBlocking", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "IsStream", name: "IsStream", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ZeroReadIsEOF", name: "ZeroReadIsEOF", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "isFile", name: "isFile", embedded: false, exported: false, typ: $Bool, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } semWaiters = {}; $pkg.ErrNetClosing = errors.New("use of closed network connection"); $pkg.ErrFileClosing = errors.New("use of closed file"); $pkg.ErrNoDeadline = errors.New("file type does not support deadline"); $pkg.ErrTimeout = new TimeoutError.ptr(); $pkg.TestHookDidWritev = (function(wrote) { var wrote; }); tryDupCloexec = 1; $pkg.Accept4Func = syscall.Accept4; $pkg.CloseFunc = syscall.Close; $pkg.AcceptFunc = syscall.Accept; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/syscall/unix"] = (function() { var $pkg = {}, $init, atomic, syscall, IsNonblock; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; IsNonblock = function(fd) { var _tmp, _tmp$1, err, fd, nonblocking; nonblocking = false; err = $ifaceNil; _tmp = false; _tmp$1 = $ifaceNil; nonblocking = _tmp; err = _tmp$1; return [nonblocking, err]; }; $pkg.IsNonblock = IsNonblock; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = atomic.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["internal/testlog"] = (function() { var $pkg = {}, $init, atomic, Interface, ptrType, logger, Logger, Getenv, Open, Stat; atomic = $packages["sync/atomic"]; Interface = $pkg.Interface = $newType(8, $kindInterface, "testlog.Interface", true, "internal/testlog", true, null); ptrType = $ptrType(Interface); Logger = function() { var impl; impl = logger.Load(); if ($interfaceIsEqual(impl, $ifaceNil)) { return $ifaceNil; } return $assertType(impl, ptrType).$get(); }; $pkg.Logger = Logger; Getenv = function(name) { var log, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: log = Logger(); /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: $r = log.Getenv(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Getenv }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getenv = Getenv; Open = function(name) { var log, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: log = Logger(); /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: $r = log.Open(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Open }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Open = Open; Stat = function(name) { var log, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; log = $f.log; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: log = Logger(); /* */ if (!($interfaceIsEqual(log, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(log, $ifaceNil))) { */ case 1: $r = log.Stat(name); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Stat }; } $f.log = log; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Stat = Stat; Interface.init([{prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Getenv", name: "Getenv", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Open", name: "Open", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([$String], [], false)}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = atomic.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } logger = new atomic.Value.ptr($ifaceNil); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["os"] = (function() { var $pkg = {}, $init, errors, js, poll, unix, testlog, io, runtime, sync, atomic, syscall, time, timeout, PathError, SyscallError, Process, ProcAttr, Signal, ProcessState, LinkError, file, dirInfo, File, FileInfo, FileMode, fileStat, structType, sliceType, ptrType, sliceType$1, ptrType$1, sliceType$2, ptrType$2, ptrType$3, ptrType$4, ptrType$5, funcType, ptrType$6, ptrType$7, ptrType$8, sliceType$3, ptrType$9, ptrType$10, ptrType$11, sliceType$5, ptrType$12, arrayType$1, ptrType$13, funcType$1, arrayType$2, sliceType$6, ptrType$15, arrayType$3, arrayType$6, ptrType$16, arrayType$7, ptrType$17, sliceType$8, errFinished, lstat, getwdCache, useSyscallwd, runtime_args, init, runtime_beforeExit, Getenv, Setenv, Environ, NewSyscallError, IsExist, IsNotExist, underlyingError, wrapSyscallError, isExist, isNotExist, newProcess, Getpid, StartProcess, startProcess, setStickyBit, Open, OpenFile, Rename, TempDir, Chmod, sigpipe, syscallMode, chmod, fixLongPath, rename, NewFile, newFile, epipecheck, openFileNolog, Remove, tempDir, Getwd, IsPathSeparator, basename, Pipe, init$1, Exit, Stat, Lstat, fillFileStatFromSys, timespecToTime, statNolog, lstatNolog, itoa, uitoa, SameFile, sameFile; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; poll = $packages["internal/poll"]; unix = $packages["internal/syscall/unix"]; testlog = $packages["internal/testlog"]; io = $packages["io"]; runtime = $packages["runtime"]; sync = $packages["sync"]; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; time = $packages["time"]; timeout = $pkg.timeout = $newType(8, $kindInterface, "os.timeout", true, "os", false, null); PathError = $pkg.PathError = $newType(0, $kindStruct, "os.PathError", true, "os", true, function(Op_, Path_, Err_) { this.$val = this; if (arguments.length === 0) { this.Op = ""; this.Path = ""; this.Err = $ifaceNil; return; } this.Op = Op_; this.Path = Path_; this.Err = Err_; }); SyscallError = $pkg.SyscallError = $newType(0, $kindStruct, "os.SyscallError", true, "os", true, function(Syscall_, Err_) { this.$val = this; if (arguments.length === 0) { this.Syscall = ""; this.Err = $ifaceNil; return; } this.Syscall = Syscall_; this.Err = Err_; }); Process = $pkg.Process = $newType(0, $kindStruct, "os.Process", true, "os", true, function(Pid_, handle_, isdone_, sigMu_) { this.$val = this; if (arguments.length === 0) { this.Pid = 0; this.handle = 0; this.isdone = 0; this.sigMu = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); return; } this.Pid = Pid_; this.handle = handle_; this.isdone = isdone_; this.sigMu = sigMu_; }); ProcAttr = $pkg.ProcAttr = $newType(0, $kindStruct, "os.ProcAttr", true, "os", true, function(Dir_, Env_, Files_, Sys_) { this.$val = this; if (arguments.length === 0) { this.Dir = ""; this.Env = sliceType.nil; this.Files = sliceType$8.nil; this.Sys = ptrType$8.nil; return; } this.Dir = Dir_; this.Env = Env_; this.Files = Files_; this.Sys = Sys_; }); Signal = $pkg.Signal = $newType(8, $kindInterface, "os.Signal", true, "os", true, null); ProcessState = $pkg.ProcessState = $newType(0, $kindStruct, "os.ProcessState", true, "os", true, function(pid_, status_, rusage_) { this.$val = this; if (arguments.length === 0) { this.pid = 0; this.status = 0; this.rusage = ptrType$11.nil; return; } this.pid = pid_; this.status = status_; this.rusage = rusage_; }); LinkError = $pkg.LinkError = $newType(0, $kindStruct, "os.LinkError", true, "os", true, function(Op_, Old_, New_, Err_) { this.$val = this; if (arguments.length === 0) { this.Op = ""; this.Old = ""; this.New = ""; this.Err = $ifaceNil; return; } this.Op = Op_; this.Old = Old_; this.New = New_; this.Err = Err_; }); file = $pkg.file = $newType(0, $kindStruct, "os.file", true, "os", false, function(pfd_, name_, dirinfo_, nonblock_, stdoutOrErr_) { this.$val = this; if (arguments.length === 0) { this.pfd = new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), 0, new poll.pollDesc.ptr(false), ptrType$12.nil, 0, 0, false, false, false); this.name = ""; this.dirinfo = ptrType$1.nil; this.nonblock = false; this.stdoutOrErr = false; return; } this.pfd = pfd_; this.name = name_; this.dirinfo = dirinfo_; this.nonblock = nonblock_; this.stdoutOrErr = stdoutOrErr_; }); dirInfo = $pkg.dirInfo = $newType(0, $kindStruct, "os.dirInfo", true, "os", false, function(buf_, nbuf_, bufp_) { this.$val = this; if (arguments.length === 0) { this.buf = sliceType$2.nil; this.nbuf = 0; this.bufp = 0; return; } this.buf = buf_; this.nbuf = nbuf_; this.bufp = bufp_; }); File = $pkg.File = $newType(0, $kindStruct, "os.File", true, "os", true, function(file_) { this.$val = this; if (arguments.length === 0) { this.file = ptrType$13.nil; return; } this.file = file_; }); FileInfo = $pkg.FileInfo = $newType(8, $kindInterface, "os.FileInfo", true, "os", true, null); FileMode = $pkg.FileMode = $newType(4, $kindUint32, "os.FileMode", true, "os", true, null); fileStat = $pkg.fileStat = $newType(0, $kindStruct, "os.fileStat", true, "os", false, function(name_, size_, mode_, modTime_, sys_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.size = new $Int64(0, 0); this.mode = 0; this.modTime = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil); this.sys = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero()); return; } this.name = name_; this.size = size_; this.mode = mode_; this.modTime = modTime_; this.sys = sys_; }); structType = $structType("os", [{prop: "Mutex", name: "Mutex", embedded: true, exported: true, typ: sync.Mutex, tag: ""}, {prop: "dir", name: "dir", embedded: false, exported: false, typ: $String, tag: ""}]); sliceType = $sliceType($String); ptrType = $ptrType(File); sliceType$1 = $sliceType(FileInfo); ptrType$1 = $ptrType(dirInfo); sliceType$2 = $sliceType($Uint8); ptrType$2 = $ptrType(PathError); ptrType$3 = $ptrType(LinkError); ptrType$4 = $ptrType(SyscallError); ptrType$5 = $ptrType(Process); funcType = $funcType([ptrType$5], [$error], false); ptrType$6 = $ptrType($Uint32); ptrType$7 = $ptrType(ProcAttr); ptrType$8 = $ptrType(syscall.SysProcAttr); sliceType$3 = $sliceType($Uintptr); ptrType$9 = $ptrType(ProcessState); ptrType$10 = $ptrType(syscall.WaitStatus); ptrType$11 = $ptrType(syscall.Rusage); sliceType$5 = $sliceType(syscall.Iovec); ptrType$12 = $ptrType(sliceType$5); arrayType$1 = $arrayType($Int64, 3); ptrType$13 = $ptrType(file); funcType$1 = $funcType([ptrType$13], [$error], false); arrayType$2 = $arrayType($Int, 2); sliceType$6 = $sliceType($Int); ptrType$15 = $ptrType(time.Location); arrayType$3 = $arrayType($Uint8, 20); arrayType$6 = $arrayType($Uint8, 32); ptrType$16 = $ptrType(fileStat); arrayType$7 = $arrayType($Uint64, 16); ptrType$17 = $ptrType($Uint64); sliceType$8 = $sliceType(ptrType); runtime_args = function() { return $pkg.Args; }; init = function() { var argv, i, process; process = $global.process; if (!(process === undefined)) { argv = process.argv; $pkg.Args = $makeSlice(sliceType, ($parseInt(argv.length) - 1 >> 0)); i = 0; while (true) { if (!(i < ($parseInt(argv.length) - 1 >> 0))) { break; } ((i < 0 || i >= $pkg.Args.$length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.Args.$array[$pkg.Args.$offset + i] = $internalize(argv[(i + 1 >> 0)], $String)); i = i + (1) >> 0; } } if ($pkg.Args.$length === 0) { $pkg.Args = new sliceType(["?"]); } }; runtime_beforeExit = function() { }; File.ptr.prototype.Readdir = function(n) { var _r, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType.nil) { $s = -1; return [sliceType$1.nil, $pkg.ErrInvalid]; } _r = f.readdir(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdir }; } $f._r = _r; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Readdir = function(n) { return this.$val.Readdir(n); }; File.ptr.prototype.Readdirnames = function(n) { var _r, _tmp, _tmp$1, _tuple, err, f, n, names, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: names = sliceType.nil; err = $ifaceNil; f = this; if (f === ptrType.nil) { _tmp = sliceType.nil; _tmp$1 = $pkg.ErrInvalid; names = _tmp; err = _tmp$1; $s = -1; return [names, err]; } _r = f.readdirnames(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; names = _tuple[0]; err = _tuple[1]; $s = -1; return [names, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdirnames }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Readdirnames = function(n) { return this.$val.Readdirnames(n); }; File.ptr.prototype.readdir = function(n) { var _i, _r, _r$1, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, dirname, err, f, fi, filename, fip, lerr, n, names, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirname = $f.dirname; err = $f.err; f = $f.f; fi = $f.fi; filename = $f.filename; fip = $f.fip; lerr = $f.lerr; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fi = sliceType$1.nil; err = $ifaceNil; f = this; dirname = f.file.name; if (dirname === "") { dirname = "."; } _r = f.Readdirnames(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; names = _tuple[0]; err = _tuple[1]; fi = $makeSlice(sliceType$1, 0, names.$length); _ref = names; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } filename = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = lstat(dirname + "/" + filename); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; fip = _tuple$1[0]; lerr = _tuple$1[1]; if (IsNotExist(lerr)) { _i++; /* continue; */ $s = 2; continue; } if (!($interfaceIsEqual(lerr, $ifaceNil))) { _tmp = fi; _tmp$1 = lerr; fi = _tmp; err = _tmp$1; $s = -1; return [fi, err]; } fi = $append(fi, fip); _i++; /* } */ $s = 2; continue; case 3: if ((fi.$length === 0) && $interfaceIsEqual(err, $ifaceNil) && n > 0) { err = io.EOF; } _tmp$2 = fi; _tmp$3 = err; fi = _tmp$2; err = _tmp$3; $s = -1; return [fi, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdir }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirname = dirname; $f.err = err; $f.f = f; $f.fi = fi; $f.filename = filename; $f.fip = fip; $f.lerr = lerr; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.readdir = function(n) { return this.$val.readdir(n); }; File.ptr.prototype.readdirnames = function(n) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, d, err, errno, f, n, names, nb, nc, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; d = $f.d; err = $f.err; errno = $f.errno; f = $f.f; n = $f.n; names = $f.names; nb = $f.nb; nc = $f.nc; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: names = sliceType.nil; err = $ifaceNil; f = this; if (f.file.dirinfo === ptrType$1.nil) { f.file.dirinfo = new dirInfo.ptr(sliceType$2.nil, 0, 0); f.file.dirinfo.buf = $makeSlice(sliceType$2, 8192); } d = f.file.dirinfo; size = n; if (size <= 0) { size = 100; n = -1; } names = $makeSlice(sliceType, 0, size); /* while (true) { */ case 1: /* if (!(!((n === 0)))) { break; } */ if(!(!((n === 0)))) { $s = 2; continue; } /* */ if (d.bufp >= d.nbuf) { $s = 3; continue; } /* */ $s = 4; continue; /* if (d.bufp >= d.nbuf) { */ case 3: d.bufp = 0; errno = $ifaceNil; _r = f.file.pfd.ReadDirent(d.buf); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; d.nbuf = _tuple[0]; errno = _tuple[1]; runtime.KeepAlive(f); if (!($interfaceIsEqual(errno, $ifaceNil))) { _tmp = names; _tmp$1 = wrapSyscallError("readdirent", errno); names = _tmp; err = _tmp$1; $s = -1; return [names, err]; } if (d.nbuf <= 0) { /* break; */ $s = 2; continue; } /* } */ case 4: _tmp$2 = 0; _tmp$3 = 0; nb = _tmp$2; nc = _tmp$3; _tuple$1 = syscall.ParseDirent($subslice(d.buf, d.bufp, d.nbuf), n, names); nb = _tuple$1[0]; nc = _tuple$1[1]; names = _tuple$1[2]; d.bufp = d.bufp + (nb) >> 0; n = n - (nc) >> 0; /* } */ $s = 1; continue; case 2: if (n >= 0 && (names.$length === 0)) { _tmp$4 = names; _tmp$5 = io.EOF; names = _tmp$4; err = _tmp$5; $s = -1; return [names, err]; } _tmp$6 = names; _tmp$7 = $ifaceNil; names = _tmp$6; err = _tmp$7; $s = -1; return [names, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdirnames }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.d = d; $f.err = err; $f.errno = errno; $f.f = f; $f.n = n; $f.names = names; $f.nb = nb; $f.nc = nc; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.readdirnames = function(n) { return this.$val.readdirnames(n); }; Getenv = function(key) { var _r, _tuple, key, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; key = $f.key; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Getenv(key); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = syscall.Getenv(key); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; v = _tuple[0]; $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: Getenv }; } $f._r = _r; $f._tuple = _tuple; $f.key = key; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getenv = Getenv; Setenv = function(key, value) { var _r, err, key, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; key = $f.key; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Setenv(key, value); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return NewSyscallError("setenv", err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Setenv }; } $f._r = _r; $f.err = err; $f.key = key; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Setenv = Setenv; Environ = function() { var _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = syscall.Environ(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Environ }; } $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Environ = Environ; PathError.ptr.prototype.Error = function() { var _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return e.Op + " " + e.Path + ": " + _r; /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; PathError.prototype.Error = function() { return this.$val.Error(); }; PathError.ptr.prototype.Timeout = function() { var _r, _tuple, _v, e, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, timeout, true); t = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 1: $s = -1; return _v; /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Timeout }; } $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; PathError.prototype.Timeout = function() { return this.$val.Timeout(); }; SyscallError.ptr.prototype.Error = function() { var _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return e.Syscall + ": " + _r; /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; SyscallError.prototype.Error = function() { return this.$val.Error(); }; SyscallError.ptr.prototype.Timeout = function() { var _r, _tuple, _v, e, ok, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _v = $f._v; e = $f.e; ok = $f.ok; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _tuple = $assertType(e.Err, timeout, true); t = _tuple[0]; ok = _tuple[1]; if (!(ok)) { _v = false; $s = 1; continue s; } _r = t.Timeout(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 1: $s = -1; return _v; /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Timeout }; } $f._r = _r; $f._tuple = _tuple; $f._v = _v; $f.e = e; $f.ok = ok; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; SyscallError.prototype.Timeout = function() { return this.$val.Timeout(); }; NewSyscallError = function(syscall$1, err) { var err, syscall$1; if ($interfaceIsEqual(err, $ifaceNil)) { return $ifaceNil; } return new SyscallError.ptr(syscall$1, err); }; $pkg.NewSyscallError = NewSyscallError; IsExist = function(err) { var err; return isExist(err); }; $pkg.IsExist = IsExist; IsNotExist = function(err) { var err; return isNotExist(err); }; $pkg.IsNotExist = IsNotExist; underlyingError = function(err) { var _ref, err, err$1, err$2, err$3; _ref = err; if ($assertType(_ref, ptrType$2, true)[1]) { err$1 = _ref.$val; return err$1.Err; } else if ($assertType(_ref, ptrType$3, true)[1]) { err$2 = _ref.$val; return err$2.Err; } else if ($assertType(_ref, ptrType$4, true)[1]) { err$3 = _ref.$val; return err$3.Err; } return err; }; wrapSyscallError = function(name, err) { var _tuple, err, name, ok; _tuple = $assertType(err, syscall.Errno, true); ok = _tuple[1]; if (ok) { err = NewSyscallError(name, err); } return err; }; isExist = function(err) { var err; err = underlyingError(err); return $interfaceIsEqual(err, new syscall.Errno(17)) || $interfaceIsEqual(err, new syscall.Errno(39)) || $interfaceIsEqual(err, $pkg.ErrExist); }; isNotExist = function(err) { var err; err = underlyingError(err); return $interfaceIsEqual(err, new syscall.Errno(2)) || $interfaceIsEqual(err, $pkg.ErrNotExist); }; newProcess = function(pid, handle) { var handle, p, pid; p = new Process.ptr(pid, handle, 0, new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0)); runtime.SetFinalizer(p, new funcType($methodExpr(ptrType$5, "Release"))); return p; }; Process.ptr.prototype.setDone = function() { var p; p = this; atomic.StoreUint32((p.$ptr_isdone || (p.$ptr_isdone = new ptrType$6(function() { return this.$target.isdone; }, function($v) { this.$target.isdone = $v; }, p))), 1); }; Process.prototype.setDone = function() { return this.$val.setDone(); }; Process.ptr.prototype.done = function() { var p; p = this; return atomic.LoadUint32((p.$ptr_isdone || (p.$ptr_isdone = new ptrType$6(function() { return this.$target.isdone; }, function($v) { this.$target.isdone = $v; }, p)))) > 0; }; Process.prototype.done = function() { return this.$val.done(); }; Getpid = function() { return syscall.Getpid(); }; $pkg.Getpid = Getpid; StartProcess = function(name, argv, attr) { var _r, argv, attr, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; argv = $f.argv; attr = $f.attr; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Open(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = startProcess(name, argv, attr); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: StartProcess }; } $f._r = _r; $f.argv = argv; $f.attr = attr; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.StartProcess = StartProcess; Process.ptr.prototype.Release = function() { var p; p = this; return p.release(); }; Process.prototype.Release = function() { return this.$val.Release(); }; Process.ptr.prototype.Kill = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = p.kill(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Process.ptr.prototype.Kill }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Process.prototype.Kill = function() { return this.$val.Kill(); }; Process.ptr.prototype.Wait = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = p.wait(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Process.ptr.prototype.Wait }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Process.prototype.Wait = function() { return this.$val.Wait(); }; Process.ptr.prototype.Signal = function(sig) { var _r, p, sig, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; sig = $f.sig; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = p.signal(sig); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Process.ptr.prototype.Signal }; } $f._r = _r; $f.p = p; $f.sig = sig; $f.$s = $s; $f.$r = $r; return $f; }; Process.prototype.Signal = function(sig) { return this.$val.Signal(sig); }; ProcessState.ptr.prototype.UserTime = function() { var p; p = this; return p.userTime(); }; ProcessState.prototype.UserTime = function() { return this.$val.UserTime(); }; ProcessState.ptr.prototype.SystemTime = function() { var p; p = this; return p.systemTime(); }; ProcessState.prototype.SystemTime = function() { return this.$val.SystemTime(); }; ProcessState.ptr.prototype.Exited = function() { var p; p = this; return p.exited(); }; ProcessState.prototype.Exited = function() { return this.$val.Exited(); }; ProcessState.ptr.prototype.Success = function() { var p; p = this; return p.success(); }; ProcessState.prototype.Success = function() { return this.$val.Success(); }; ProcessState.ptr.prototype.Sys = function() { var p; p = this; return p.sys(); }; ProcessState.prototype.Sys = function() { return this.$val.Sys(); }; ProcessState.ptr.prototype.SysUsage = function() { var p; p = this; return p.sysUsage(); }; ProcessState.prototype.SysUsage = function() { return this.$val.SysUsage(); }; startProcess = function(name, argv, attr) { var _i, _r, _r$1, _r$2, _r$3, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, argv, attr, e, err, err$1, f, h, name, p, pe, pid, sysattr, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; argv = $f.argv; attr = $f.attr; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; h = $f.h; name = $f.name; p = $f.p; pe = $f.pe; pid = $f.pid; sysattr = $f.sysattr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = ptrType$5.nil; err = $ifaceNil; /* */ if (!(attr === ptrType$7.nil) && attr.Sys === ptrType$8.nil && !(attr.Dir === "")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(attr === ptrType$7.nil) && attr.Sys === ptrType$8.nil && !(attr.Dir === "")) { */ case 1: _r = Stat(attr.Dir); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err$1 = _tuple[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { pe = $assertType(err$1, ptrType$2); pe.Op = "chdir"; _tmp = ptrType$5.nil; _tmp$1 = pe; p = _tmp; err = _tmp$1; $s = -1; return [p, err]; } /* } */ case 2: sysattr = new syscall.ProcAttr.ptr(attr.Dir, attr.Env, sliceType$3.nil, attr.Sys); /* */ if (sysattr.Env === sliceType.nil) { $s = 4; continue; } /* */ $s = 5; continue; /* if (sysattr.Env === sliceType.nil) { */ case 4: _r$1 = Environ(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } sysattr.Env = _r$1; /* } */ case 5: _ref = attr.Files; _i = 0; /* while (true) { */ case 7: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 8; continue; } f = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$2 = f.Fd(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } sysattr.Files = $append(sysattr.Files, _r$2); _i++; /* } */ $s = 7; continue; case 8: _r$3 = syscall.StartProcess(name, argv, sysattr); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; pid = _tuple$1[0]; h = _tuple$1[1]; e = _tuple$1[2]; if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp$2 = ptrType$5.nil; _tmp$3 = new PathError.ptr("fork/exec", name, e); p = _tmp$2; err = _tmp$3; $s = -1; return [p, err]; } _tmp$4 = newProcess(pid, h); _tmp$5 = $ifaceNil; p = _tmp$4; err = _tmp$5; $s = -1; return [p, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: startProcess }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.argv = argv; $f.attr = attr; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.h = h; $f.name = name; $f.p = p; $f.pe = pe; $f.pid = pid; $f.sysattr = sysattr; $f.$s = $s; $f.$r = $r; return $f; }; Process.ptr.prototype.kill = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _r = p.Signal($pkg.Kill); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Process.ptr.prototype.kill }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; Process.prototype.kill = function() { return this.$val.kill(); }; ProcessState.ptr.prototype.Pid = function() { var p; p = this; return p.pid; }; ProcessState.prototype.Pid = function() { return this.$val.Pid(); }; ProcessState.ptr.prototype.exited = function() { var p; p = this; return new syscall.WaitStatus(p.status).Exited(); }; ProcessState.prototype.exited = function() { return this.$val.exited(); }; ProcessState.ptr.prototype.success = function() { var p; p = this; return new syscall.WaitStatus(p.status).ExitStatus() === 0; }; ProcessState.prototype.success = function() { return this.$val.success(); }; ProcessState.ptr.prototype.sys = function() { var p; p = this; return new syscall.WaitStatus(p.status); }; ProcessState.prototype.sys = function() { return this.$val.sys(); }; ProcessState.ptr.prototype.sysUsage = function() { var p; p = this; return p.rusage; }; ProcessState.prototype.sysUsage = function() { return this.$val.sysUsage(); }; ProcessState.ptr.prototype.String = function() { var p, res, status; p = this; if (p === ptrType$9.nil) { return ""; } status = $assertType(p.Sys(), syscall.WaitStatus); res = ""; if (new syscall.WaitStatus(status).Exited()) { res = "exit status " + itoa(new syscall.WaitStatus(status).ExitStatus()); } else if (new syscall.WaitStatus(status).Signaled()) { res = "signal: " + new syscall.Signal(new syscall.WaitStatus(status).Signal()).String(); } else if (new syscall.WaitStatus(status).Stopped()) { res = "stop signal: " + new syscall.Signal(new syscall.WaitStatus(status).StopSignal()).String(); if ((new syscall.WaitStatus(status).StopSignal() === 5) && !((new syscall.WaitStatus(status).TrapCause() === 0))) { res = res + (" (trap " + itoa(new syscall.WaitStatus(status).TrapCause()) + ")"); } } else if (new syscall.WaitStatus(status).Continued()) { res = "continued"; } if (new syscall.WaitStatus(status).CoreDump()) { res = res + (" (core dumped)"); } return res; }; ProcessState.prototype.String = function() { return this.$val.String(); }; Process.ptr.prototype.wait = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, e, err, p, pid1, ps, ready, rusage, status, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; p = $f.p; pid1 = $f.pid1; ps = $f.ps; ready = $f.ready; rusage = $f.rusage; status = $f.status; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rusage = [rusage]; status = [status]; ps = ptrType$9.nil; err = $ifaceNil; p = this; if (p.Pid === -1) { _tmp = ptrType$9.nil; _tmp$1 = new syscall.Errno(22); ps = _tmp; err = _tmp$1; $s = -1; return [ps, err]; } _tuple = p.blockUntilWaitable(); ready = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$2 = ptrType$9.nil; _tmp$3 = err; ps = _tmp$2; err = _tmp$3; $s = -1; return [ps, err]; } /* */ if (ready) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ready) { */ case 1: p.setDone(); $r = p.sigMu.Lock(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = p.sigMu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: status[0] = 0; rusage[0] = new syscall.Rusage.ptr(new syscall.Timeval.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timeval.ptr(new $Int64(0, 0), new $Int64(0, 0)), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0)); _tuple$1 = syscall.Wait4(p.Pid, (status.$ptr || (status.$ptr = new ptrType$10(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, status))), 0, rusage[0]); pid1 = _tuple$1[0]; e = _tuple$1[1]; if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp$4 = ptrType$9.nil; _tmp$5 = NewSyscallError("wait", e); ps = _tmp$4; err = _tmp$5; $s = -1; return [ps, err]; } if (!((pid1 === 0))) { p.setDone(); } ps = new ProcessState.ptr(pid1, status[0], rusage[0]); _tmp$6 = ps; _tmp$7 = $ifaceNil; ps = _tmp$6; err = _tmp$7; $s = -1; return [ps, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Process.ptr.prototype.wait }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.p = p; $f.pid1 = pid1; $f.ps = ps; $f.ready = ready; $f.rusage = rusage; $f.status = status; $f.$s = $s; $f.$r = $r; return $f; }; Process.prototype.wait = function() { return this.$val.wait(); }; Process.ptr.prototype.signal = function(sig) { var _tuple, e, ok, p, s, sig, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; e = $f.e; ok = $f.ok; p = $f.p; s = $f.s; sig = $f.sig; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); p = this; if (p.Pid === -1) { $s = -1; return errors.New("os: process already released"); } if (p.Pid === 0) { $s = -1; return errors.New("os: process not initialized"); } $r = p.sigMu.RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $deferred.push([$methodVal(p.sigMu, "RUnlock"), []]); if (p.done()) { $s = -1; return errFinished; } _tuple = $assertType(sig, syscall.Signal, true); s = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return errors.New("os: unsupported signal type"); } e = syscall.Kill(p.Pid, s); if (!($interfaceIsEqual(e, $ifaceNil))) { if ($interfaceIsEqual(e, new syscall.Errno(3))) { $s = -1; return errFinished; } $s = -1; return e; } $s = -1; return $ifaceNil; /* */ } return; } } catch(err) { $err = err; $s = -1; return $ifaceNil; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Process.ptr.prototype.signal }; } $f._tuple = _tuple; $f.e = e; $f.ok = ok; $f.p = p; $f.s = s; $f.sig = sig; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; Process.prototype.signal = function(sig) { return this.$val.signal(sig); }; Process.ptr.prototype.release = function() { var p; p = this; p.Pid = -1; runtime.SetFinalizer(p, $ifaceNil); return $ifaceNil; }; Process.prototype.release = function() { return this.$val.release(); }; ProcessState.ptr.prototype.userTime = function() { var p, x; p = this; return $mul64(((x = p.rusage.Utime.Nano(), new time.Duration(x.$high, x.$low))), new time.Duration(0, 1)); }; ProcessState.prototype.userTime = function() { return this.$val.userTime(); }; ProcessState.ptr.prototype.systemTime = function() { var p, x; p = this; return $mul64(((x = p.rusage.Stime.Nano(), new time.Duration(x.$high, x.$low))), new time.Duration(0, 1)); }; ProcessState.prototype.systemTime = function() { return this.$val.systemTime(); }; File.ptr.prototype.Name = function() { var f; f = this; return f.file.name; }; File.prototype.Name = function() { return this.$val.Name(); }; LinkError.ptr.prototype.Error = function() { var _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return e.Op + " " + e.Old + " " + e.New + ": " + _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LinkError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; LinkError.prototype.Error = function() { return this.$val.Error(); }; File.ptr.prototype.Read = function(b) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("read"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r = f.read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; e = _tuple[1]; _tmp$2 = n; _tmp$3 = f.wrapErr("read", e); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Read = function(b) { return this.$val.Read(b); }; File.ptr.prototype.ReadAt = function(b, off) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; m = $f.m; n = $f.n; off = $f.off; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("read"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { _tmp$2 = 0; _tmp$3 = new PathError.ptr("readat", f.file.name, errors.New("negative offset")); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* while (true) { */ case 1: /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } _r = f.pread(b, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = _tuple[0]; e = _tuple[1]; if (!($interfaceIsEqual(e, $ifaceNil))) { err = f.wrapErr("read", e); /* break; */ $s = 2; continue; } n = n + (m) >> 0; b = $subslice(b, m); off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); /* } */ $s = 1; continue; case 2: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.ReadAt }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.m = m; $f.n = n; $f.off = off; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; File.ptr.prototype.Write = function(b) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("write"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } _r = f.write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; e = _tuple[1]; if (n < 0) { n = 0; } if (!((n === b.$length))) { err = io.ErrShortWrite; } epipecheck(f, e); if (!($interfaceIsEqual(e, $ifaceNil))) { err = f.wrapErr("write", e); } _tmp$2 = n; _tmp$3 = err; n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Write }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Write = function(b) { return this.$val.Write(b); }; File.ptr.prototype.WriteAt = function(b, off) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, err$1, f, m, n, off, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; m = $f.m; n = $f.n; off = $f.off; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; err$1 = f.checkValid("write"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = 0; _tmp$1 = err$1; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { _tmp$2 = 0; _tmp$3 = new PathError.ptr("writeat", f.file.name, errors.New("negative offset")); n = _tmp$2; err = _tmp$3; $s = -1; return [n, err]; } /* while (true) { */ case 1: /* if (!(b.$length > 0)) { break; } */ if(!(b.$length > 0)) { $s = 2; continue; } _r = f.pwrite(b, off); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = _tuple[0]; e = _tuple[1]; if (!($interfaceIsEqual(e, $ifaceNil))) { err = f.wrapErr("write", e); /* break; */ $s = 2; continue; } n = n + (m) >> 0; b = $subslice(b, m); off = (x = (new $Int64(0, m)), new $Int64(off.$high + x.$high, off.$low + x.$low)); /* } */ $s = 1; continue; case 2: $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.WriteAt }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.m = m; $f.n = n; $f.off = off; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.WriteAt = function(b, off) { return this.$val.WriteAt(b, off); }; File.ptr.prototype.Seek = function(offset, whence) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, err$1, f, offset, r, ret, whence, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; e = $f.e; err = $f.err; err$1 = $f.err$1; f = $f.f; offset = $f.offset; r = $f.r; ret = $f.ret; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = new $Int64(0, 0); err = $ifaceNil; f = this; err$1 = f.checkValid("seek"); if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tmp = new $Int64(0, 0); _tmp$1 = err$1; ret = _tmp; err = _tmp$1; $s = -1; return [ret, err]; } _r = f.seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; e = _tuple[1]; if ($interfaceIsEqual(e, $ifaceNil) && !(f.file.dirinfo === ptrType$1.nil) && !((r.$high === 0 && r.$low === 0))) { e = new syscall.Errno(21); } if (!($interfaceIsEqual(e, $ifaceNil))) { _tmp$2 = new $Int64(0, 0); _tmp$3 = f.wrapErr("seek", e); ret = _tmp$2; err = _tmp$3; $s = -1; return [ret, err]; } _tmp$4 = r; _tmp$5 = $ifaceNil; ret = _tmp$4; err = _tmp$5; $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Seek }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.f = f; $f.offset = offset; $f.r = r; $f.ret = ret; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; File.ptr.prototype.WriteString = function(s) { var _r, _tuple, err, f, n, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; f = $f.f; n = $f.n; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r = f.Write((new sliceType$2($stringToBytes(s)))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.WriteString }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.n = n; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; setStickyBit = function(name) { var _arg, _arg$1, _r, _r$1, _r$2, _tuple, err, fi, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; fi = $f.fi; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fi = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _arg = name; _r$1 = fi.Mode(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = (_r$1 | 1048576) >>> 0; _r$2 = Chmod(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: setStickyBit }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.fi = fi; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; Open = function(name) { var _r, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = OpenFile(name, 0, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Open }; } $f._r = _r; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Open = Open; OpenFile = function(name, flag, perm) { var _r, flag, name, perm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; flag = $f.flag; name = $f.name; perm = $f.perm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Open(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = openFileNolog(name, flag, perm); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenFile }; } $f._r = _r; $f.flag = flag; $f.name = name; $f.perm = perm; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenFile = OpenFile; Rename = function(oldpath, newpath) { var _r, newpath, oldpath, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; newpath = $f.newpath; oldpath = $f.oldpath; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = rename(oldpath, newpath); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Rename }; } $f._r = _r; $f.newpath = newpath; $f.oldpath = oldpath; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Rename = Rename; File.ptr.prototype.wrapErr = function(op, err) { var err, f, op; f = this; if ($interfaceIsEqual(err, $ifaceNil) || $interfaceIsEqual(err, io.EOF)) { return err; } if ($interfaceIsEqual(err, poll.ErrFileClosing)) { err = $pkg.ErrClosed; } return new PathError.ptr(op, f.file.name, err); }; File.prototype.wrapErr = function(op, err) { return this.$val.wrapErr(op, err); }; TempDir = function() { var _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = tempDir(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: TempDir }; } $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TempDir = TempDir; Chmod = function(name, mode) { var mode, name; return chmod(name, mode); }; $pkg.Chmod = Chmod; File.ptr.prototype.Chmod = function(mode) { var _r, f, mode, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; _r = f.chmod(mode); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chmod }; } $f._r = _r; $f.f = f; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Chmod = function(mode) { return this.$val.Chmod(mode); }; File.ptr.prototype.SetDeadline = function(t) { var f, t; f = this; return f.setDeadline($clone(t, time.Time)); }; File.prototype.SetDeadline = function(t) { return this.$val.SetDeadline(t); }; File.ptr.prototype.SetReadDeadline = function(t) { var f, t; f = this; return f.setReadDeadline($clone(t, time.Time)); }; File.prototype.SetReadDeadline = function(t) { return this.$val.SetReadDeadline(t); }; File.ptr.prototype.SetWriteDeadline = function(t) { var f, t; f = this; return f.setWriteDeadline($clone(t, time.Time)); }; File.prototype.SetWriteDeadline = function(t) { return this.$val.SetWriteDeadline(t); }; sigpipe = function() { $throwRuntimeError("native function not implemented: os.sigpipe"); }; syscallMode = function(i) { var i, o; o = 0; o = (o | (((new FileMode(i).Perm() >>> 0)))) >>> 0; if (!((((i & 8388608) >>> 0) === 0))) { o = (o | (2048)) >>> 0; } if (!((((i & 4194304) >>> 0) === 0))) { o = (o | (1024)) >>> 0; } if (!((((i & 1048576) >>> 0) === 0))) { o = (o | (512)) >>> 0; } return o; }; chmod = function(name, mode) { var e, mode, name; e = syscall.Chmod(fixLongPath(name), syscallMode(mode)); if (!($interfaceIsEqual(e, $ifaceNil))) { return new PathError.ptr("chmod", name, e); } return $ifaceNil; }; File.ptr.prototype.chmod = function(mode) { var _r, e, err, f, mode, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; mode = $f.mode; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("chmod"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = f.file.pfd.Fchmod(syscallMode(mode)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("chmod", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.chmod }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.mode = mode; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.chmod = function(mode) { return this.$val.chmod(mode); }; File.ptr.prototype.Chown = function(uid, gid) { var _r, e, err, f, gid, uid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; gid = $f.gid; uid = $f.uid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("chown"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = f.file.pfd.Fchown(uid, gid); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("chown", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chown }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.gid = gid; $f.uid = uid; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Chown = function(uid, gid) { return this.$val.Chown(uid, gid); }; File.ptr.prototype.Truncate = function(size) { var _r, e, err, f, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("truncate"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = f.file.pfd.Ftruncate(size); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("truncate", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Truncate }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Truncate = function(size) { return this.$val.Truncate(size); }; File.ptr.prototype.Sync = function() { var _r, e, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("sync"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = f.file.pfd.Fsync(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("sync", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Sync }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Sync = function() { return this.$val.Sync(); }; File.ptr.prototype.Chdir = function() { var _r, e, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; err = f.checkValid("chdir"); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r = f.file.pfd.Fchdir(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil))) { $s = -1; return f.wrapErr("chdir", e); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Chdir }; } $f._r = _r; $f.e = e; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Chdir = function() { return this.$val.Chdir(); }; File.ptr.prototype.setDeadline = function(t) { var err, f, t; f = this; err = f.checkValid("SetDeadline"); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } return f.file.pfd.SetDeadline($clone(t, time.Time)); }; File.prototype.setDeadline = function(t) { return this.$val.setDeadline(t); }; File.ptr.prototype.setReadDeadline = function(t) { var err, f, t; f = this; err = f.checkValid("SetReadDeadline"); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } return f.file.pfd.SetReadDeadline($clone(t, time.Time)); }; File.prototype.setReadDeadline = function(t) { return this.$val.setReadDeadline(t); }; File.ptr.prototype.setWriteDeadline = function(t) { var err, f, t; f = this; err = f.checkValid("SetWriteDeadline"); if (!($interfaceIsEqual(err, $ifaceNil))) { return err; } return f.file.pfd.SetWriteDeadline($clone(t, time.Time)); }; File.prototype.setWriteDeadline = function(t) { return this.$val.setWriteDeadline(t); }; File.ptr.prototype.checkValid = function(op) { var f, op; f = this; if (f === ptrType.nil) { return $pkg.ErrInvalid; } return $ifaceNil; }; File.prototype.checkValid = function(op) { return this.$val.checkValid(op); }; fixLongPath = function(path) { var path; return path; }; rename = function(oldname, newname) { var _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, _v, err, err$1, fi, newname, ok, oldname, pe, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; err = $f.err; err$1 = $f.err$1; fi = $f.fi; newname = $f.newname; ok = $f.ok; oldname = $f.oldname; pe = $f.pe; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = Lstat(newname); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fi = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _v = false; $s = 4; continue s; } _r$1 = fi.IsDir(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 4: /* */ if (_v) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_v) { */ case 2: _r$2 = Lstat(oldname); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { _tuple$2 = $assertType(err$1, ptrType$2, true); pe = _tuple$2[0]; ok = _tuple$2[1]; if (ok) { err$1 = pe.Err; } $s = -1; return new LinkError.ptr("rename", oldname, newname, err$1); } $s = -1; return new LinkError.ptr("rename", oldname, newname, new syscall.Errno(17)); /* } */ case 3: err = syscall.Rename(oldname, newname); if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return new LinkError.ptr("rename", oldname, newname, err); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: rename }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f.err = err; $f.err$1 = err$1; $f.fi = fi; $f.newname = newname; $f.ok = ok; $f.oldname = oldname; $f.pe = pe; $f.$s = $s; $f.$r = $r; return $f; }; File.ptr.prototype.Fd = function() { var _r, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType.nil) { $s = -1; return 4294967295; } /* */ if (f.file.nonblock) { $s = 1; continue; } /* */ $s = 2; continue; /* if (f.file.nonblock) { */ case 1: _r = f.file.pfd.SetBlocking(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 2: $s = -1; return ((f.file.pfd.Sysfd >>> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Fd }; } $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Fd = function() { return this.$val.Fd(); }; NewFile = function(fd, name) { var _tuple, err, fd, kind, name, nb; kind = 0; _tuple = unix.IsNonblock(((fd >> 0))); nb = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil) && nb) { kind = 3; } return newFile(fd, name, kind); }; $pkg.NewFile = NewFile; newFile = function(fd, name, kind) { var err, err$1, err$2, f, fd, fdi, kind, name, pollable, st; fdi = ((fd >> 0)); if (fdi < 0) { return ptrType.nil; } f = new File.ptr(new file.ptr(new poll.FD.ptr(new poll.fdMutex.ptr(new $Uint64(0, 0), 0, 0), fdi, new poll.pollDesc.ptr(false), ptrType$12.nil, 0, 0, true, true, false), name, ptrType$1.nil, false, (fdi === 1) || (fdi === 2))); pollable = (kind === 1) || (kind === 2) || (kind === 3); if (false && (kind === 1)) { pollable = false; } if (false && (kind === 1)) { st = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero()); err = syscall.Fstat(fdi, st); if ($interfaceIsEqual(err, $ifaceNil) && (((st.Mode & 61440) >>> 0) === 4096)) { pollable = false; } } err$1 = f.file.pfd.Init("file", pollable); if (!($interfaceIsEqual(err$1, $ifaceNil))) { } else if (pollable) { err$2 = syscall.SetNonblock(fdi, true); if ($interfaceIsEqual(err$2, $ifaceNil)) { f.file.nonblock = true; } } runtime.SetFinalizer(f.file, new funcType$1($methodExpr(ptrType$13, "close"))); return f; }; epipecheck = function(file$1, e) { var e, file$1; if ($interfaceIsEqual(e, new syscall.Errno(32)) && file$1.file.stdoutOrErr) { sigpipe(); } }; openFileNolog = function(name, flag, perm) { var _r, _r$1, _tuple, _tuple$1, e, err, flag, name, perm, r, setSticky, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; flag = $f.flag; name = $f.name; perm = $f.perm; r = $f.r; setSticky = $f.setSticky; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: setSticky = false; /* */ if (false && !(((flag & 64) === 0)) && !((((perm & 1048576) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (false && !(((flag & 64) === 0)) && !((((perm & 1048576) >>> 0) === 0))) { */ case 1: _r = Stat(name); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; if (IsNotExist(err)) { setSticky = true; } /* } */ case 2: r = 0; /* while (true) { */ case 4: e = $ifaceNil; _tuple$1 = syscall.Open(name, flag | 524288, syscallMode(perm)); r = _tuple$1[0]; e = _tuple$1[1]; if ($interfaceIsEqual(e, $ifaceNil)) { /* break; */ $s = 5; continue; } if (false && $interfaceIsEqual(e, new syscall.Errno(4))) { /* continue; */ $s = 4; continue; } $s = -1; return [ptrType.nil, new PathError.ptr("open", name, e)]; /* } */ $s = 4; continue; case 5: /* */ if (setSticky) { $s = 6; continue; } /* */ $s = 7; continue; /* if (setSticky) { */ case 6: _r$1 = setStickyBit(name); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 7: if (false) { syscall.CloseOnExec(r); } $s = -1; return [newFile(((r >>> 0)), name, 1), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: openFileNolog }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.flag = flag; $f.name = name; $f.perm = perm; $f.r = r; $f.setSticky = setSticky; $f.$s = $s; $f.$r = $r; return $f; }; File.ptr.prototype.Close = function() { var _r, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = this; if (f === ptrType.nil) { $s = -1; return $pkg.ErrInvalid; } _r = f.file.close(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Close }; } $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Close = function() { return this.$val.Close(); }; file.ptr.prototype.close = function() { var _r, e, err, file$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; err = $f.err; file$1 = $f.file$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file$1 = this; if (file$1 === ptrType$13.nil) { $s = -1; return new syscall.Errno(22); } err = $ifaceNil; _r = file$1.pfd.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } e = _r; if (!($interfaceIsEqual(e, $ifaceNil))) { if ($interfaceIsEqual(e, poll.ErrFileClosing)) { e = $pkg.ErrClosed; } err = new PathError.ptr("close", file$1.name, e); } runtime.SetFinalizer(file$1, $ifaceNil); $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: file.ptr.prototype.close }; } $f._r = _r; $f.e = e; $f.err = err; $f.file$1 = file$1; $f.$s = $s; $f.$r = $r; return $f; }; file.prototype.close = function() { return this.$val.close(); }; File.ptr.prototype.read = function(b) { var _r, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r = f.file.pfd.Read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.read }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.read = function(b) { return this.$val.read(b); }; File.ptr.prototype.pread = function(b, off) { var _r, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r = f.file.pfd.Pread(b, off); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.pread }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.pread = function(b, off) { return this.$val.pread(b, off); }; File.ptr.prototype.write = function(b) { var _r, _tmp, _tmp$1, _tuple, b, err, f, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r = f.file.pfd.Write(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.write }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.write = function(b) { return this.$val.write(b); }; File.ptr.prototype.pwrite = function(b, off) { var _r, _tmp, _tmp$1, _tuple, b, err, f, n, off, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; err = $f.err; f = $f.f; n = $f.n; off = $f.off; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; f = this; _r = f.file.pfd.Pwrite(b, off); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(f); _tmp = n; _tmp$1 = err; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.pwrite }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.f = f; $f.n = n; $f.off = off; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.pwrite = function(b, off) { return this.$val.pwrite(b, off); }; File.ptr.prototype.seek = function(offset, whence) { var _r, _tmp, _tmp$1, _tuple, err, f, offset, ret, whence, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; offset = $f.offset; ret = $f.ret; whence = $f.whence; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ret = new $Int64(0, 0); err = $ifaceNil; f = this; _r = f.file.pfd.Seek(offset, whence); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ret = _tuple[0]; err = _tuple[1]; runtime.KeepAlive(f); _tmp = ret; _tmp$1 = err; ret = _tmp; err = _tmp$1; $s = -1; return [ret, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.seek }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.offset = offset; $f.ret = ret; $f.whence = whence; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.seek = function(offset, whence) { return this.$val.seek(offset, whence); }; Remove = function(name) { var e, e1, name; e = syscall.Unlink(name); if ($interfaceIsEqual(e, $ifaceNil)) { return $ifaceNil; } e1 = syscall.Rmdir(name); if ($interfaceIsEqual(e1, $ifaceNil)) { return $ifaceNil; } if (!($interfaceIsEqual(e1, new syscall.Errno(20)))) { e = e1; } return new PathError.ptr("remove", name, e); }; $pkg.Remove = Remove; tempDir = function() { var _r, dir, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; dir = $f.dir; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = Getenv("TMPDIR"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } dir = _r; if (dir === "") { if (false) { dir = "/data/local/tmp"; } else { dir = "/tmp"; } } $s = -1; return dir; /* */ } return; } if ($f === undefined) { $f = { $blk: tempDir }; } $f._r = _r; $f.dir = dir; $f.$s = $s; $f.$r = $r; return $f; }; Getwd = function() { var _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, d, d$1, d$2, dir, dot, e, err, err$1, err$2, err$3, err$4, fd, name, names, parent, pd, root, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _tmp$12 = $f._tmp$12; _tmp$13 = $f._tmp$13; _tmp$14 = $f._tmp$14; _tmp$15 = $f._tmp$15; _tmp$16 = $f._tmp$16; _tmp$17 = $f._tmp$17; _tmp$18 = $f._tmp$18; _tmp$19 = $f._tmp$19; _tmp$2 = $f._tmp$2; _tmp$20 = $f._tmp$20; _tmp$21 = $f._tmp$21; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; d = $f.d; d$1 = $f.d$1; d$2 = $f.d$2; dir = $f.dir; dot = $f.dot; e = $f.e; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; err$3 = $f.err$3; err$4 = $f.err$4; fd = $f.fd; name = $f.name; names = $f.names; parent = $f.parent; pd = $f.pd; root = $f.root; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: dir = ""; err = $ifaceNil; if (false) { _tuple = syscall.Getwd(); dir = _tuple[0]; err = _tuple[1]; $s = -1; return [dir, err]; } _tuple$1 = statNolog("."); dot = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp = ""; _tmp$1 = err; dir = _tmp; err = _tmp$1; $s = -1; return [dir, err]; } _r = Getenv("PWD"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } dir = _r; if (dir.length > 0 && (dir.charCodeAt(0) === 47)) { _tuple$2 = statNolog(dir); d = _tuple$2[0]; err$1 = _tuple$2[1]; if ($interfaceIsEqual(err$1, $ifaceNil) && SameFile(dot, d)) { _tmp$2 = dir; _tmp$3 = $ifaceNil; dir = _tmp$2; err = _tmp$3; $s = -1; return [dir, err]; } } /* */ if (true) { $s = 2; continue; } /* */ $s = 3; continue; /* if (true) { */ case 2: _tuple$3 = syscall.Getwd(); s = _tuple$3[0]; e = _tuple$3[1]; _r$1 = useSyscallwd(e); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: _tmp$4 = s; _tmp$5 = NewSyscallError("getwd", e); dir = _tmp$4; err = _tmp$5; $s = -1; return [dir, err]; /* } */ case 5: /* } */ case 3: $r = getwdCache.Mutex.Lock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } dir = getwdCache.dir; $r = getwdCache.Mutex.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (dir.length > 0) { _tuple$4 = statNolog(dir); d$1 = _tuple$4[0]; err$2 = _tuple$4[1]; if ($interfaceIsEqual(err$2, $ifaceNil) && SameFile(dot, d$1)) { _tmp$6 = dir; _tmp$7 = $ifaceNil; dir = _tmp$6; err = _tmp$7; $s = -1; return [dir, err]; } } _tuple$5 = statNolog("/"); root = _tuple$5[0]; err = _tuple$5[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tmp$8 = ""; _tmp$9 = err; dir = _tmp$8; err = _tmp$9; $s = -1; return [dir, err]; } if (SameFile(root, dot)) { _tmp$10 = "/"; _tmp$11 = $ifaceNil; dir = _tmp$10; err = _tmp$11; $s = -1; return [dir, err]; } dir = ""; parent = ".."; /* while (true) { */ case 9: if (parent.length >= 1024) { _tmp$12 = ""; _tmp$13 = new syscall.Errno(36); dir = _tmp$12; err = _tmp$13; $s = -1; return [dir, err]; } _r$2 = openFileNolog(parent, 0, 0); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$6 = _r$2; fd = _tuple$6[0]; err$3 = _tuple$6[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { _tmp$14 = ""; _tmp$15 = err$3; dir = _tmp$14; err = _tmp$15; $s = -1; return [dir, err]; } /* while (true) { */ case 12: _r$3 = fd.Readdirnames(100); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$7 = _r$3; names = _tuple$7[0]; err$4 = _tuple$7[1]; /* */ if (!($interfaceIsEqual(err$4, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err$4, $ifaceNil))) { */ case 15: _r$4 = fd.Close(); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; _tmp$16 = ""; _tmp$17 = err$4; dir = _tmp$16; err = _tmp$17; $s = -1; return [dir, err]; /* } */ case 16: _ref = names; _i = 0; /* while (true) { */ case 18: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 19; continue; } name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tuple$8 = lstatNolog(parent + "/" + name); d$2 = _tuple$8[0]; /* */ if (SameFile(d$2, dot)) { $s = 20; continue; } /* */ $s = 21; continue; /* if (SameFile(d$2, dot)) { */ case 20: dir = "/" + name + dir; /* goto Found */ $s = 22; continue; /* } */ case 21: _i++; /* } */ $s = 18; continue; case 19: /* } */ $s = 12; continue; case 13: /* Found: */ case 22: _r$5 = fd.Stat(); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$9 = _r$5; pd = _tuple$9[0]; err$3 = _tuple$9[1]; if (!($interfaceIsEqual(err$3, $ifaceNil))) { _tmp$18 = ""; _tmp$19 = err$3; dir = _tmp$18; err = _tmp$19; $s = -1; return [dir, err]; } _r$6 = fd.Close(); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; if (SameFile(pd, root)) { /* break; */ $s = 10; continue; } dot = pd; parent = "../" + parent; /* } */ $s = 9; continue; case 10: $r = getwdCache.Mutex.Lock(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } getwdCache.dir = dir; $r = getwdCache.Mutex.Unlock(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$20 = dir; _tmp$21 = $ifaceNil; dir = _tmp$20; err = _tmp$21; $s = -1; return [dir, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Getwd }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $f._tmp$12 = _tmp$12; $f._tmp$13 = _tmp$13; $f._tmp$14 = _tmp$14; $f._tmp$15 = _tmp$15; $f._tmp$16 = _tmp$16; $f._tmp$17 = _tmp$17; $f._tmp$18 = _tmp$18; $f._tmp$19 = _tmp$19; $f._tmp$2 = _tmp$2; $f._tmp$20 = _tmp$20; $f._tmp$21 = _tmp$21; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.d = d; $f.d$1 = d$1; $f.d$2 = d$2; $f.dir = dir; $f.dot = dot; $f.e = e; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.err$3 = err$3; $f.err$4 = err$4; $f.fd = fd; $f.name = name; $f.names = names; $f.parent = parent; $f.pd = pd; $f.root = root; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Getwd = Getwd; IsPathSeparator = function(c) { var c; return 47 === c; }; $pkg.IsPathSeparator = IsPathSeparator; basename = function(name) { var i, name; i = name.length - 1 >> 0; while (true) { if (!(i > 0 && (name.charCodeAt(i) === 47))) { break; } name = $substring(name, 0, i); i = i - (1) >> 0; } i = i - (1) >> 0; while (true) { if (!(i >= 0)) { break; } if (name.charCodeAt(i) === 47) { name = $substring(name, (i + 1 >> 0)); break; } i = i - (1) >> 0; } return name; }; Pipe = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, e, err, p, r, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; e = $f.e; err = $f.err; p = $f.p; r = $f.r; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = ptrType.nil; w = ptrType.nil; err = $ifaceNil; p = arrayType$2.zero(); e = syscall.Pipe2($subslice(new sliceType$6(p), 0), 524288); /* */ if ($interfaceIsEqual(e, new syscall.Errno(38))) { $s = 1; continue; } /* */ if (!($interfaceIsEqual(e, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(e, new syscall.Errno(38))) { */ case 1: $r = syscall.ForkLock.RLock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } e = syscall.Pipe($subslice(new sliceType$6(p), 0)); /* */ if (!($interfaceIsEqual(e, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(e, $ifaceNil))) { */ case 5: $r = syscall.ForkLock.RUnlock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = ptrType.nil; _tmp$1 = ptrType.nil; _tmp$2 = NewSyscallError("pipe", e); r = _tmp; w = _tmp$1; err = _tmp$2; $s = -1; return [r, w, err]; /* } */ case 6: syscall.CloseOnExec(p[0]); syscall.CloseOnExec(p[1]); $r = syscall.ForkLock.RUnlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else if (!($interfaceIsEqual(e, $ifaceNil))) { */ case 2: _tmp$3 = ptrType.nil; _tmp$4 = ptrType.nil; _tmp$5 = NewSyscallError("pipe2", e); r = _tmp$3; w = _tmp$4; err = _tmp$5; $s = -1; return [r, w, err]; /* } */ case 3: _tmp$6 = newFile(((p[0] >>> 0)), "|0", 2); _tmp$7 = newFile(((p[1] >>> 0)), "|1", 2); _tmp$8 = $ifaceNil; r = _tmp$6; w = _tmp$7; err = _tmp$8; $s = -1; return [r, w, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Pipe }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f.e = e; $f.err = err; $f.p = p; $f.r = r; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Pipe = Pipe; init$1 = function() { if (false) { return; } $pkg.Args = runtime_args(); }; Exit = function(code) { var code; if (code === 0) { runtime_beforeExit(); } syscall.Exit(code); }; $pkg.Exit = Exit; Stat = function(name) { var name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return statNolog(name); /* */ } return; } if ($f === undefined) { $f = { $blk: Stat }; } $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Stat = Stat; Lstat = function(name) { var name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = testlog.Stat(name); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return lstatNolog(name); /* */ } return; } if ($f === undefined) { $f = { $blk: Lstat }; } $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Lstat = Lstat; fillFileStatFromSys = function(fs, name) { var _1, fs, name; fs.name = basename(name); fs.size = fs.sys.Size; time.Time.copy(fs.modTime, timespecToTime($clone(fs.sys.Mtim, syscall.Timespec))); fs.mode = ((((fs.sys.Mode & 511) >>> 0) >>> 0)); _1 = (fs.sys.Mode & 61440) >>> 0; if (_1 === (24576)) { fs.mode = (fs.mode | (67108864)) >>> 0; } else if (_1 === (8192)) { fs.mode = (fs.mode | (69206016)) >>> 0; } else if (_1 === (16384)) { fs.mode = (fs.mode | (2147483648)) >>> 0; } else if (_1 === (4096)) { fs.mode = (fs.mode | (33554432)) >>> 0; } else if (_1 === (40960)) { fs.mode = (fs.mode | (134217728)) >>> 0; } else if (_1 === (32768)) { } else if (_1 === (49152)) { fs.mode = (fs.mode | (16777216)) >>> 0; } if (!((((fs.sys.Mode & 1024) >>> 0) === 0))) { fs.mode = (fs.mode | (4194304)) >>> 0; } if (!((((fs.sys.Mode & 2048) >>> 0) === 0))) { fs.mode = (fs.mode | (8388608)) >>> 0; } if (!((((fs.sys.Mode & 512) >>> 0) === 0))) { fs.mode = (fs.mode | (1048576)) >>> 0; } }; timespecToTime = function(ts) { var ts; return time.Unix((ts.Sec), (ts.Nsec)); }; File.ptr.prototype.Stat = function() { var _r, err, f, fs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; f = $f.f; fs = $f.fs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fs = [fs]; f = this; if (f === ptrType.nil) { $s = -1; return [$ifaceNil, $pkg.ErrInvalid]; } fs[0] = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); _r = f.file.pfd.Fstat(fs[0].sys); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, new PathError.ptr("stat", f.file.name, err)]; } fillFileStatFromSys(fs[0], f.file.name); $s = -1; return [fs[0], $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Stat }; } $f._r = _r; $f.err = err; $f.f = f; $f.fs = fs; $f.$s = $s; $f.$r = $r; return $f; }; File.prototype.Stat = function() { return this.$val.Stat(); }; statNolog = function(name) { var err, fs, name; fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); err = syscall.Stat(name, fs.sys); if (!($interfaceIsEqual(err, $ifaceNil))) { return [$ifaceNil, new PathError.ptr("stat", name, err)]; } fillFileStatFromSys(fs, name); return [fs, $ifaceNil]; }; lstatNolog = function(name) { var err, fs, name; fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$15.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); err = syscall.Lstat(name, fs.sys); if (!($interfaceIsEqual(err, $ifaceNil))) { return [$ifaceNil, new PathError.ptr("lstat", name, err)]; } fillFileStatFromSys(fs, name); return [fs, $ifaceNil]; }; itoa = function(val) { var val; if (val < 0) { return "-" + uitoa(((-val >>> 0))); } return uitoa(((val >>> 0))); }; uitoa = function(val) { var _q, buf, i, q, val; if (val === 0) { return "0"; } buf = arrayType$3.zero(); i = 19; while (true) { if (!(val >= 10)) { break; } q = (_q = val / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = ((((48 + val >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24))); i = i - (1) >> 0; val = q; } ((i < 0 || i >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i] = (((48 + val >>> 0) << 24 >>> 24))); return ($bytesToString($subslice(new sliceType$2(buf), i))); }; FileMode.prototype.String = function() { var _i, _i$1, _ref, _ref$1, _rune, _rune$1, buf, c, c$1, i, i$1, m, w, y, y$1; m = this.$val; buf = arrayType$6.zero(); w = 0; _ref = "dalTLDpSugct?"; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; c = _rune[0]; if (!((((m & (((y = (((31 - i >> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0) === 0))) { ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = ((c << 24 >>> 24))); w = w + (1) >> 0; } _i += _rune[1]; } if (w === 0) { ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); w = w + (1) >> 0; } _ref$1 = "rwxrwxrwx"; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.length)) { break; } _rune$1 = $decodeRune(_ref$1, _i$1); i$1 = _i$1; c$1 = _rune$1[0]; if (!((((m & (((y$1 = (((8 - i$1 >> 0) >>> 0)), y$1 < 32 ? (1 << y$1) : 0) >>> 0))) >>> 0) === 0))) { ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = ((c$1 << 24 >>> 24))); } else { ((w < 0 || w >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[w] = 45); } w = w + (1) >> 0; _i$1 += _rune$1[1]; } return ($bytesToString($subslice(new sliceType$2(buf), 0, w))); }; $ptrType(FileMode).prototype.String = function() { return new FileMode(this.$get()).String(); }; FileMode.prototype.IsDir = function() { var m; m = this.$val; return !((((m & 2147483648) >>> 0) === 0)); }; $ptrType(FileMode).prototype.IsDir = function() { return new FileMode(this.$get()).IsDir(); }; FileMode.prototype.IsRegular = function() { var m; m = this.$val; return ((m & 2399666176) >>> 0) === 0; }; $ptrType(FileMode).prototype.IsRegular = function() { return new FileMode(this.$get()).IsRegular(); }; FileMode.prototype.Perm = function() { var m; m = this.$val; return (m & 511) >>> 0; }; $ptrType(FileMode).prototype.Perm = function() { return new FileMode(this.$get()).Perm(); }; fileStat.ptr.prototype.Name = function() { var fs; fs = this; return fs.name; }; fileStat.prototype.Name = function() { return this.$val.Name(); }; fileStat.ptr.prototype.IsDir = function() { var fs; fs = this; return new FileMode(fs.Mode()).IsDir(); }; fileStat.prototype.IsDir = function() { return this.$val.IsDir(); }; SameFile = function(fi1, fi2) { var _tuple, _tuple$1, fi1, fi2, fs1, fs2, ok1, ok2; _tuple = $assertType(fi1, ptrType$16, true); fs1 = _tuple[0]; ok1 = _tuple[1]; _tuple$1 = $assertType(fi2, ptrType$16, true); fs2 = _tuple$1[0]; ok2 = _tuple$1[1]; if (!ok1 || !ok2) { return false; } return sameFile(fs1, fs2); }; $pkg.SameFile = SameFile; fileStat.ptr.prototype.Size = function() { var fs; fs = this; return fs.size; }; fileStat.prototype.Size = function() { return this.$val.Size(); }; fileStat.ptr.prototype.Mode = function() { var fs; fs = this; return fs.mode; }; fileStat.prototype.Mode = function() { return this.$val.Mode(); }; fileStat.ptr.prototype.ModTime = function() { var fs; fs = this; return fs.modTime; }; fileStat.prototype.ModTime = function() { return this.$val.ModTime(); }; fileStat.ptr.prototype.Sys = function() { var fs; fs = this; return fs.sys; }; fileStat.prototype.Sys = function() { return this.$val.Sys(); }; sameFile = function(fs1, fs2) { var fs1, fs2, x, x$1, x$2, x$3; return (x = fs1.sys.Dev, x$1 = fs2.sys.Dev, (x.$high === x$1.$high && x.$low === x$1.$low)) && (x$2 = fs1.sys.Ino, x$3 = fs2.sys.Ino, (x$2.$high === x$3.$high && x$2.$low === x$3.$low)); }; Process.ptr.prototype.blockUntilWaitable = function() { var _tuple, e, p, psig, siginfo; p = this; siginfo = arrayType$7.zero(); psig = $indexPtr(siginfo, 0, ptrType$17); _tuple = syscall.Syscall6(247, 1, ((p.Pid >>> 0)), ((psig)), 16777220, 0, 0); e = _tuple[2]; runtime.KeepAlive(p); if (!((e === 0))) { if (e === 38) { return [false, $ifaceNil]; } return [false, NewSyscallError("waitid", new syscall.Errno(e))]; } return [true, $ifaceNil]; }; Process.prototype.blockUntilWaitable = function() { return this.$val.blockUntilWaitable(); }; ptrType$2.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$4.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$5.methods = [{prop: "setDone", name: "setDone", pkg: "os", typ: $funcType([], [], false)}, {prop: "done", name: "done", pkg: "os", typ: $funcType([], [$Bool], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Kill", name: "Kill", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [ptrType$9, $error], false)}, {prop: "Signal", name: "Signal", pkg: "", typ: $funcType([Signal], [$error], false)}, {prop: "kill", name: "kill", pkg: "os", typ: $funcType([], [$error], false)}, {prop: "wait", name: "wait", pkg: "os", typ: $funcType([], [ptrType$9, $error], false)}, {prop: "signal", name: "signal", pkg: "os", typ: $funcType([Signal], [$error], false)}, {prop: "release", name: "release", pkg: "os", typ: $funcType([], [$error], false)}, {prop: "blockUntilWaitable", name: "blockUntilWaitable", pkg: "os", typ: $funcType([], [$Bool, $error], false)}]; ptrType$9.methods = [{prop: "UserTime", name: "UserTime", pkg: "", typ: $funcType([], [time.Duration], false)}, {prop: "SystemTime", name: "SystemTime", pkg: "", typ: $funcType([], [time.Duration], false)}, {prop: "Exited", name: "Exited", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Success", name: "Success", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "SysUsage", name: "SysUsage", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Pid", name: "Pid", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "exited", name: "exited", pkg: "os", typ: $funcType([], [$Bool], false)}, {prop: "success", name: "success", pkg: "os", typ: $funcType([], [$Bool], false)}, {prop: "sys", name: "sys", pkg: "os", typ: $funcType([], [$emptyInterface], false)}, {prop: "sysUsage", name: "sysUsage", pkg: "os", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "userTime", name: "userTime", pkg: "os", typ: $funcType([], [time.Duration], false)}, {prop: "systemTime", name: "systemTime", pkg: "os", typ: $funcType([], [time.Duration], false)}]; ptrType$3.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$13.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [$error], false)}]; ptrType.methods = [{prop: "Readdir", name: "Readdir", pkg: "", typ: $funcType([$Int], [sliceType$1, $error], false)}, {prop: "Readdirnames", name: "Readdirnames", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "readdir", name: "readdir", pkg: "os", typ: $funcType([$Int], [sliceType$1, $error], false)}, {prop: "readdirnames", name: "readdirnames", pkg: "os", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteAt", name: "WriteAt", pkg: "", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "wrapErr", name: "wrapErr", pkg: "os", typ: $funcType([$String, $error], [$error], false)}, {prop: "Chmod", name: "Chmod", pkg: "", typ: $funcType([FileMode], [$error], false)}, {prop: "SetDeadline", name: "SetDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetReadDeadline", name: "SetReadDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "SetWriteDeadline", name: "SetWriteDeadline", pkg: "", typ: $funcType([time.Time], [$error], false)}, {prop: "chmod", name: "chmod", pkg: "os", typ: $funcType([FileMode], [$error], false)}, {prop: "Chown", name: "Chown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Sync", name: "Sync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "setDeadline", name: "setDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setReadDeadline", name: "setReadDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "setWriteDeadline", name: "setWriteDeadline", pkg: "os", typ: $funcType([time.Time], [$error], false)}, {prop: "checkValid", name: "checkValid", pkg: "os", typ: $funcType([$String], [$error], false)}, {prop: "Fd", name: "Fd", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "read", name: "read", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pread", name: "pread", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "os", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "pwrite", name: "pwrite", pkg: "os", typ: $funcType([sliceType$2, $Int64], [$Int, $error], false)}, {prop: "seek", name: "seek", pkg: "os", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([], [FileInfo, $error], false)}]; FileMode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsRegular", name: "IsRegular", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([], [FileMode], false)}]; ptrType$16.methods = [{prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]; timeout.init([{prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]); PathError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); SyscallError.init("", [{prop: "Syscall", name: "Syscall", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); Process.init("os", [{prop: "Pid", name: "Pid", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "handle", name: "handle", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "isdone", name: "isdone", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "sigMu", name: "sigMu", embedded: false, exported: false, typ: sync.RWMutex, tag: ""}]); ProcAttr.init("", [{prop: "Dir", name: "Dir", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Env", name: "Env", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "Files", name: "Files", embedded: false, exported: true, typ: sliceType$8, tag: ""}, {prop: "Sys", name: "Sys", embedded: false, exported: true, typ: ptrType$8, tag: ""}]); Signal.init([{prop: "Signal", name: "Signal", pkg: "", typ: $funcType([], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); ProcessState.init("os", [{prop: "pid", name: "pid", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "status", name: "status", embedded: false, exported: false, typ: syscall.WaitStatus, tag: ""}, {prop: "rusage", name: "rusage", embedded: false, exported: false, typ: ptrType$11, tag: ""}]); LinkError.init("", [{prop: "Op", name: "Op", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Old", name: "Old", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "New", name: "New", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); file.init("os", [{prop: "pfd", name: "pfd", embedded: false, exported: false, typ: poll.FD, tag: ""}, {prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "dirinfo", name: "dirinfo", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "nonblock", name: "nonblock", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "stdoutOrErr", name: "stdoutOrErr", embedded: false, exported: false, typ: $Bool, tag: ""}]); dirInfo.init("os", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "nbuf", name: "nbuf", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bufp", name: "bufp", embedded: false, exported: false, typ: $Int, tag: ""}]); File.init("os", [{prop: "file", name: "file", embedded: true, exported: false, typ: ptrType$13, tag: ""}]); FileInfo.init([{prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]); fileStat.init("os", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "mode", name: "mode", embedded: false, exported: false, typ: FileMode, tag: ""}, {prop: "modTime", name: "modTime", embedded: false, exported: false, typ: time.Time, tag: ""}, {prop: "sys", name: "sys", embedded: false, exported: false, typ: syscall.Stat_t, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = poll.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unix.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = testlog.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } getwdCache = new structType.ptr(new sync.Mutex.ptr(0, 0), ""); $pkg.Args = sliceType.nil; $pkg.ErrInvalid = errors.New("invalid argument"); $pkg.ErrPermission = errors.New("permission denied"); $pkg.ErrExist = errors.New("file already exists"); $pkg.ErrNotExist = errors.New("file does not exist"); $pkg.ErrClosed = errors.New("file already closed"); $pkg.Kill = new syscall.Signal(9); errFinished = errors.New("os: process already finished"); $pkg.Stdin = NewFile(((syscall.Stdin >>> 0)), "/dev/stdin"); $pkg.Stdout = NewFile(((syscall.Stdout >>> 0)), "/dev/stdout"); $pkg.Stderr = NewFile(((syscall.Stderr >>> 0)), "/dev/stderr"); useSyscallwd = (function(param) { var param; return true; }); lstat = Lstat; init(); init$1(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["math/bits"] = (function() { var $pkg = {}, $init, deBruijn32tab, deBruijn64tab, len8tab, LeadingZeros64, TrailingZeros, TrailingZeros32, TrailingZeros64, Len64; LeadingZeros64 = function(x) { var x; return 64 - Len64(x) >> 0; }; $pkg.LeadingZeros64 = LeadingZeros64; TrailingZeros = function(x) { var x; if (true) { return TrailingZeros32(((x >>> 0))); } return TrailingZeros64((new $Uint64(0, x))); }; $pkg.TrailingZeros = TrailingZeros; TrailingZeros32 = function(x) { var x, x$1; if (x === 0) { return 32; } return (((x$1 = ($imul((((x & (-x >>> 0)) >>> 0)), 125613361) >>> 0) >>> 27 >>> 0, ((x$1 < 0 || x$1 >= deBruijn32tab.length) ? ($throwRuntimeError("index out of range"), undefined) : deBruijn32tab[x$1])) >> 0)); }; $pkg.TrailingZeros32 = TrailingZeros32; TrailingZeros64 = function(x) { var x, x$1, x$2; if ((x.$high === 0 && x.$low === 0)) { return 64; } return (((x$1 = $shiftRightUint64($mul64(((x$2 = new $Uint64(-x.$high, -x.$low), new $Uint64(x.$high & x$2.$high, (x.$low & x$2.$low) >>> 0))), new $Uint64(66559345, 3033172745)), 58), (($flatten64(x$1) < 0 || $flatten64(x$1) >= deBruijn64tab.length) ? ($throwRuntimeError("index out of range"), undefined) : deBruijn64tab[$flatten64(x$1)])) >> 0)); }; $pkg.TrailingZeros64 = TrailingZeros64; Len64 = function(x) { var n, x; n = 0; if ((x.$high > 1 || (x.$high === 1 && x.$low >= 0))) { x = $shiftRightUint64(x, (32)); n = 32; } if ((x.$high > 0 || (x.$high === 0 && x.$low >= 65536))) { x = $shiftRightUint64(x, (16)); n = n + (16) >> 0; } if ((x.$high > 0 || (x.$high === 0 && x.$low >= 256))) { x = $shiftRightUint64(x, (8)); n = n + (8) >> 0; } n = n + (((($flatten64(x) < 0 || $flatten64(x) >= len8tab.length) ? ($throwRuntimeError("index out of range"), undefined) : len8tab[$flatten64(x)]) >> 0)) >> 0; return n; }; $pkg.Len64 = Len64; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: deBruijn32tab = $toNativeArray($kindUint8, [0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9]); deBruijn64tab = $toNativeArray($kindUint8, [0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6]); len8tab = $toNativeArray($kindUint8, [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["strconv"] = (function() { var $pkg = {}, $init, errors, math, bits, utf8, NumError, decimal, leftCheat, extFloat, floatInfo, decimalSlice, sliceType, sliceType$1, sliceType$2, sliceType$3, sliceType$4, sliceType$5, arrayType, sliceType$6, ptrType, arrayType$1, arrayType$2, ptrType$1, arrayType$3, arrayType$4, ptrType$2, ptrType$3, ptrType$4, optimize, powtab, float64pow10, float32pow10, leftcheats, smallPowersOfTen, powersOfTen, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, equalIgnoreCase, special, readFloat, atof64exact, atof32exact, atof32, atof64, ParseFloat, syntaxError, rangeError, baseError, bitSizeError, ParseUint, ParseInt, Atoi, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, frexp10Many, adjustLastDigitFixed, adjustLastDigit, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, min, max, FormatInt, Itoa, small, formatBits, isPowerOfTwo, quoteWith, appendQuotedWith, appendQuotedRuneWith, appendEscapedRune, Quote, AppendQuote, AppendQuoteToASCII, AppendQuoteRune, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, contains, bsearch16, bsearch32, IsPrint, isInGraphicList; errors = $packages["errors"]; math = $packages["math"]; bits = $packages["math/bits"]; utf8 = $packages["unicode/utf8"]; NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", true, "strconv", true, function(Func_, Num_, Err_) { this.$val = this; if (arguments.length === 0) { this.Func = ""; this.Num = ""; this.Err = $ifaceNil; return; } this.Func = Func_; this.Num = Num_; this.Err = Err_; }); decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", true, "strconv", false, function(d_, nd_, dp_, neg_, trunc_) { this.$val = this; if (arguments.length === 0) { this.d = arrayType.zero(); this.nd = 0; this.dp = 0; this.neg = false; this.trunc = false; return; } this.d = d_; this.nd = nd_; this.dp = dp_; this.neg = neg_; this.trunc = trunc_; }); leftCheat = $pkg.leftCheat = $newType(0, $kindStruct, "strconv.leftCheat", true, "strconv", false, function(delta_, cutoff_) { this.$val = this; if (arguments.length === 0) { this.delta = 0; this.cutoff = ""; return; } this.delta = delta_; this.cutoff = cutoff_; }); extFloat = $pkg.extFloat = $newType(0, $kindStruct, "strconv.extFloat", true, "strconv", false, function(mant_, exp_, neg_) { this.$val = this; if (arguments.length === 0) { this.mant = new $Uint64(0, 0); this.exp = 0; this.neg = false; return; } this.mant = mant_; this.exp = exp_; this.neg = neg_; }); floatInfo = $pkg.floatInfo = $newType(0, $kindStruct, "strconv.floatInfo", true, "strconv", false, function(mantbits_, expbits_, bias_) { this.$val = this; if (arguments.length === 0) { this.mantbits = 0; this.expbits = 0; this.bias = 0; return; } this.mantbits = mantbits_; this.expbits = expbits_; this.bias = bias_; }); decimalSlice = $pkg.decimalSlice = $newType(0, $kindStruct, "strconv.decimalSlice", true, "strconv", false, function(d_, nd_, dp_, neg_) { this.$val = this; if (arguments.length === 0) { this.d = sliceType$6.nil; this.nd = 0; this.dp = 0; this.neg = false; return; } this.d = d_; this.nd = nd_; this.dp = dp_; this.neg = neg_; }); sliceType = $sliceType($Int); sliceType$1 = $sliceType($Float64); sliceType$2 = $sliceType($Float32); sliceType$3 = $sliceType(leftCheat); sliceType$4 = $sliceType($Uint16); sliceType$5 = $sliceType($Uint32); arrayType = $arrayType($Uint8, 800); sliceType$6 = $sliceType($Uint8); ptrType = $ptrType(NumError); arrayType$1 = $arrayType($Uint8, 24); arrayType$2 = $arrayType($Uint8, 32); ptrType$1 = $ptrType(floatInfo); arrayType$3 = $arrayType($Uint8, 65); arrayType$4 = $arrayType($Uint8, 4); ptrType$2 = $ptrType(decimal); ptrType$3 = $ptrType(decimalSlice); ptrType$4 = $ptrType(extFloat); equalIgnoreCase = function(s1, s2) { var c1, c2, i, s1, s2; if (!((s1.length === s2.length))) { return false; } i = 0; while (true) { if (!(i < s1.length)) { break; } c1 = s1.charCodeAt(i); if (65 <= c1 && c1 <= 90) { c1 = c1 + (32) << 24 >>> 24; } c2 = s2.charCodeAt(i); if (65 <= c2 && c2 <= 90) { c2 = c2 + (32) << 24 >>> 24; } if (!((c1 === c2))) { return false; } i = i + (1) >> 0; } return true; }; special = function(s) { var _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, f, ok, s; f = 0; ok = false; if (s.length === 0) { return [f, ok]; } _1 = s.charCodeAt(0); if (_1 === (43)) { if (equalIgnoreCase(s, "+inf") || equalIgnoreCase(s, "+infinity")) { _tmp = math.Inf(1); _tmp$1 = true; f = _tmp; ok = _tmp$1; return [f, ok]; } } else if (_1 === (45)) { if (equalIgnoreCase(s, "-inf") || equalIgnoreCase(s, "-infinity")) { _tmp$2 = math.Inf(-1); _tmp$3 = true; f = _tmp$2; ok = _tmp$3; return [f, ok]; } } else if ((_1 === (110)) || (_1 === (78))) { if (equalIgnoreCase(s, "nan")) { _tmp$4 = math.NaN(); _tmp$5 = true; f = _tmp$4; ok = _tmp$5; return [f, ok]; } } else if ((_1 === (105)) || (_1 === (73))) { if (equalIgnoreCase(s, "inf") || equalIgnoreCase(s, "infinity")) { _tmp$6 = math.Inf(1); _tmp$7 = true; f = _tmp$6; ok = _tmp$7; return [f, ok]; } } else { return [f, ok]; } return [f, ok]; }; decimal.ptr.prototype.set = function(s) { var b, e, esign, i, ok, s, sawdigits, sawdot, x, x$1; ok = false; b = this; i = 0; b.neg = false; b.trunc = false; if (i >= s.length) { return ok; } if ((s.charCodeAt(i) === 43)) { i = i + (1) >> 0; } else if ((s.charCodeAt(i) === 45)) { b.neg = true; i = i + (1) >> 0; } sawdot = false; sawdigits = false; while (true) { if (!(i < s.length)) { break; } if ((s.charCodeAt(i) === 46)) { if (sawdot) { return ok; } sawdot = true; b.dp = b.nd; i = i + (1) >> 0; continue; } else if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57) { sawdigits = true; if ((s.charCodeAt(i) === 48) && (b.nd === 0)) { b.dp = b.dp - (1) >> 0; i = i + (1) >> 0; continue; } if (b.nd < 800) { (x = b.d, x$1 = b.nd, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1] = s.charCodeAt(i))); b.nd = b.nd + (1) >> 0; } else if (!((s.charCodeAt(i) === 48))) { b.trunc = true; } i = i + (1) >> 0; continue; } break; } if (!sawdigits) { return ok; } if (!sawdot) { b.dp = b.nd; } if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) { i = i + (1) >> 0; if (i >= s.length) { return ok; } esign = 1; if (s.charCodeAt(i) === 43) { i = i + (1) >> 0; } else if (s.charCodeAt(i) === 45) { i = i + (1) >> 0; esign = -1; } if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) { return ok; } e = 0; while (true) { if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } if (e < 10000) { e = (($imul(e, 10)) + ((s.charCodeAt(i) >> 0)) >> 0) - 48 >> 0; } i = i + (1) >> 0; } b.dp = b.dp + (($imul(e, esign))) >> 0; } if (!((i === s.length))) { return ok; } ok = true; return ok; }; decimal.prototype.set = function(s) { return this.$val.set(s); }; readFloat = function(s) { var _1, c, dp, e, esign, exp, i, mantissa, nd, ndMant, neg, ok, s, sawdigits, sawdot, trunc, x; mantissa = new $Uint64(0, 0); exp = 0; neg = false; trunc = false; ok = false; i = 0; if (i >= s.length) { return [mantissa, exp, neg, trunc, ok]; } if ((s.charCodeAt(i) === 43)) { i = i + (1) >> 0; } else if ((s.charCodeAt(i) === 45)) { neg = true; i = i + (1) >> 0; } sawdot = false; sawdigits = false; nd = 0; ndMant = 0; dp = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); _1 = true; if (_1 === ((c === 46))) { if (sawdot) { return [mantissa, exp, neg, trunc, ok]; } sawdot = true; dp = nd; i = i + (1) >> 0; continue; } else if (_1 === (48 <= c && c <= 57)) { sawdigits = true; if ((c === 48) && (nd === 0)) { dp = dp - (1) >> 0; i = i + (1) >> 0; continue; } nd = nd + (1) >> 0; if (ndMant < 19) { mantissa = $mul64(mantissa, (new $Uint64(0, 10))); mantissa = (x = (new $Uint64(0, (c - 48 << 24 >>> 24))), new $Uint64(mantissa.$high + x.$high, mantissa.$low + x.$low)); ndMant = ndMant + (1) >> 0; } else if (!((s.charCodeAt(i) === 48))) { trunc = true; } i = i + (1) >> 0; continue; } break; } if (!sawdigits) { return [mantissa, exp, neg, trunc, ok]; } if (!sawdot) { dp = nd; } if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) { i = i + (1) >> 0; if (i >= s.length) { return [mantissa, exp, neg, trunc, ok]; } esign = 1; if (s.charCodeAt(i) === 43) { i = i + (1) >> 0; } else if (s.charCodeAt(i) === 45) { i = i + (1) >> 0; esign = -1; } if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) { return [mantissa, exp, neg, trunc, ok]; } e = 0; while (true) { if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } if (e < 10000) { e = (($imul(e, 10)) + ((s.charCodeAt(i) >> 0)) >> 0) - 48 >> 0; } i = i + (1) >> 0; } dp = dp + (($imul(e, esign))) >> 0; } if (!((i === s.length))) { return [mantissa, exp, neg, trunc, ok]; } if (!((mantissa.$high === 0 && mantissa.$low === 0))) { exp = dp - ndMant >> 0; } ok = true; return [mantissa, exp, neg, trunc, ok]; }; decimal.ptr.prototype.floatBits = function(flt) { var _tmp, _tmp$1, b, bits$1, d, exp, flt, mant, n, n$1, n$2, overflow, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, y$1, y$2, y$3, $s; /* */ $s = 0; s: while (true) { switch ($s) { case 0: b = new $Uint64(0, 0); overflow = false; d = this; exp = 0; mant = new $Uint64(0, 0); /* */ if (d.nd === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (d.nd === 0) { */ case 1: mant = new $Uint64(0, 0); exp = flt.bias; /* goto out */ $s = 3; continue; /* } */ case 2: /* */ if (d.dp > 310) { $s = 4; continue; } /* */ $s = 5; continue; /* if (d.dp > 310) { */ case 4: /* goto overflow */ $s = 6; continue; /* } */ case 5: /* */ if (d.dp < -330) { $s = 7; continue; } /* */ $s = 8; continue; /* if (d.dp < -330) { */ case 7: mant = new $Uint64(0, 0); exp = flt.bias; /* goto out */ $s = 3; continue; /* } */ case 8: exp = 0; while (true) { if (!(d.dp > 0)) { break; } n = 0; if (d.dp >= powtab.$length) { n = 27; } else { n = (x = d.dp, ((x < 0 || x >= powtab.$length) ? ($throwRuntimeError("index out of range"), undefined) : powtab.$array[powtab.$offset + x])); } d.Shift(-n); exp = exp + (n) >> 0; } while (true) { if (!(d.dp < 0 || (d.dp === 0) && d.d[0] < 53)) { break; } n$1 = 0; if (-d.dp >= powtab.$length) { n$1 = 27; } else { n$1 = (x$1 = -d.dp, ((x$1 < 0 || x$1 >= powtab.$length) ? ($throwRuntimeError("index out of range"), undefined) : powtab.$array[powtab.$offset + x$1])); } d.Shift(n$1); exp = exp - (n$1) >> 0; } exp = exp - (1) >> 0; if (exp < (flt.bias + 1 >> 0)) { n$2 = (flt.bias + 1 >> 0) - exp >> 0; d.Shift(-n$2); exp = exp + (n$2) >> 0; } /* */ if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { */ case 9: /* goto overflow */ $s = 6; continue; /* } */ case 10: d.Shift((((1 + flt.mantbits >>> 0) >> 0))); mant = d.RoundedInteger(); /* */ if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { $s = 11; continue; } /* */ $s = 12; continue; /* if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { */ case 11: mant = $shiftRightUint64(mant, (1)); exp = exp + (1) >> 0; /* */ if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { */ case 13: /* goto overflow */ $s = 6; continue; /* } */ case 14: /* } */ case 12: if ((x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$4.$high, (mant.$low & x$4.$low) >>> 0)), (x$3.$high === 0 && x$3.$low === 0))) { exp = flt.bias; } /* goto out */ $s = 3; continue; /* overflow: */ case 6: mant = new $Uint64(0, 0); exp = (((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0) + flt.bias >> 0; overflow = true; /* out: */ case 3: bits$1 = (x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$6.$high - 0, x$6.$low - 1)), new $Uint64(mant.$high & x$5.$high, (mant.$low & x$5.$low) >>> 0)); bits$1 = (x$7 = $shiftLeft64((new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$3 = flt.expbits, y$3 < 32 ? (1 << y$3) : 0) >> 0) - 1 >> 0))))), flt.mantbits), new $Uint64(bits$1.$high | x$7.$high, (bits$1.$low | x$7.$low) >>> 0)); if (d.neg) { bits$1 = (x$8 = $shiftLeft64($shiftLeft64(new $Uint64(0, 1), flt.mantbits), flt.expbits), new $Uint64(bits$1.$high | x$8.$high, (bits$1.$low | x$8.$low) >>> 0)); } _tmp = bits$1; _tmp$1 = overflow; b = _tmp; overflow = _tmp$1; $s = -1; return [b, overflow]; /* */ } return; } }; decimal.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; atof64exact = function(mantissa, exp, neg) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2; f = 0; ok = false; if (!((x = $shiftRightUint64(mantissa, float64info.mantbits), (x.$high === 0 && x.$low === 0)))) { return [f, ok]; } f = ($flatten64(mantissa)); if (neg) { f = -f; } if ((exp === 0)) { _tmp = f; _tmp$1 = true; f = _tmp; ok = _tmp$1; return [f, ok]; } else if (exp > 0 && exp <= 37) { if (exp > 22) { f = f * ((x$1 = exp - 22 >> 0, ((x$1 < 0 || x$1 >= float64pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float64pow10.$array[float64pow10.$offset + x$1]))); exp = 22; } if (f > 1e+15 || f < -1e+15) { return [f, ok]; } _tmp$2 = f * ((exp < 0 || exp >= float64pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float64pow10.$array[float64pow10.$offset + exp]); _tmp$3 = true; f = _tmp$2; ok = _tmp$3; return [f, ok]; } else if (exp < 0 && exp >= -22) { _tmp$4 = f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float64pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float64pow10.$array[float64pow10.$offset + x$2])); _tmp$5 = true; f = _tmp$4; ok = _tmp$5; return [f, ok]; } return [f, ok]; }; atof32exact = function(mantissa, exp, neg) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2; f = 0; ok = false; if (!((x = $shiftRightUint64(mantissa, float32info.mantbits), (x.$high === 0 && x.$low === 0)))) { return [f, ok]; } f = ($flatten64(mantissa)); if (neg) { f = -f; } if ((exp === 0)) { _tmp = f; _tmp$1 = true; f = _tmp; ok = _tmp$1; return [f, ok]; } else if (exp > 0 && exp <= 17) { if (exp > 10) { f = $fround(f * ((x$1 = exp - 10 >> 0, ((x$1 < 0 || x$1 >= float32pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float32pow10.$array[float32pow10.$offset + x$1])))); exp = 10; } if (f > 1e+07 || f < -1e+07) { return [f, ok]; } _tmp$2 = $fround(f * ((exp < 0 || exp >= float32pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float32pow10.$array[float32pow10.$offset + exp])); _tmp$3 = true; f = _tmp$2; ok = _tmp$3; return [f, ok]; } else if (exp < 0 && exp >= -10) { _tmp$4 = $fround(f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float32pow10.$length) ? ($throwRuntimeError("index out of range"), undefined) : float32pow10.$array[float32pow10.$offset + x$2]))); _tmp$5 = true; f = _tmp$4; ok = _tmp$5; return [f, ok]; } return [f, ok]; }; atof32 = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val; f = 0; err = $ifaceNil; _tuple = special(s); val = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = ($fround(val)); _tmp$1 = $ifaceNil; f = _tmp; err = _tmp$1; return [f, err]; } if (optimize) { _tuple$1 = readFloat(s); mantissa = _tuple$1[0]; exp = _tuple$1[1]; neg = _tuple$1[2]; trunc = _tuple$1[3]; ok$1 = _tuple$1[4]; if (ok$1) { if (!trunc) { _tuple$2 = atof32exact(mantissa, exp, neg); f$1 = _tuple$2[0]; ok$2 = _tuple$2[1]; if (ok$2) { _tmp$2 = f$1; _tmp$3 = $ifaceNil; f = _tmp$2; err = _tmp$3; return [f, err]; } } ext = new extFloat.ptr(new $Uint64(0, 0), 0, false); ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float32info); if (ok$3) { _tuple$3 = ext.floatBits(float32info); b = _tuple$3[0]; ovf = _tuple$3[1]; f = math.Float32frombits(((b.$low >>> 0))); if (ovf) { err = rangeError("ParseFloat", s); } _tmp$4 = f; _tmp$5 = err; f = _tmp$4; err = _tmp$5; return [f, err]; } } } d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); if (!d.set(s)) { _tmp$6 = 0; _tmp$7 = syntaxError("ParseFloat", s); f = _tmp$6; err = _tmp$7; return [f, err]; } _tuple$4 = d.floatBits(float32info); b$1 = _tuple$4[0]; ovf$1 = _tuple$4[1]; f = math.Float32frombits(((b$1.$low >>> 0))); if (ovf$1) { err = rangeError("ParseFloat", s); } _tmp$8 = f; _tmp$9 = err; f = _tmp$8; err = _tmp$9; return [f, err]; }; atof64 = function(s) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val; f = 0; err = $ifaceNil; _tuple = special(s); val = _tuple[0]; ok = _tuple[1]; if (ok) { _tmp = val; _tmp$1 = $ifaceNil; f = _tmp; err = _tmp$1; return [f, err]; } if (optimize) { _tuple$1 = readFloat(s); mantissa = _tuple$1[0]; exp = _tuple$1[1]; neg = _tuple$1[2]; trunc = _tuple$1[3]; ok$1 = _tuple$1[4]; if (ok$1) { if (!trunc) { _tuple$2 = atof64exact(mantissa, exp, neg); f$1 = _tuple$2[0]; ok$2 = _tuple$2[1]; if (ok$2) { _tmp$2 = f$1; _tmp$3 = $ifaceNil; f = _tmp$2; err = _tmp$3; return [f, err]; } } ext = new extFloat.ptr(new $Uint64(0, 0), 0, false); ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float64info); if (ok$3) { _tuple$3 = ext.floatBits(float64info); b = _tuple$3[0]; ovf = _tuple$3[1]; f = math.Float64frombits(b); if (ovf) { err = rangeError("ParseFloat", s); } _tmp$4 = f; _tmp$5 = err; f = _tmp$4; err = _tmp$5; return [f, err]; } } } d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); if (!d.set(s)) { _tmp$6 = 0; _tmp$7 = syntaxError("ParseFloat", s); f = _tmp$6; err = _tmp$7; return [f, err]; } _tuple$4 = d.floatBits(float64info); b$1 = _tuple$4[0]; ovf$1 = _tuple$4[1]; f = math.Float64frombits(b$1); if (ovf$1) { err = rangeError("ParseFloat", s); } _tmp$8 = f; _tmp$9 = err; f = _tmp$8; err = _tmp$9; return [f, err]; }; ParseFloat = function(s, bitSize) { var _tuple, bitSize, err, f, s; if (bitSize === 32) { _tuple = atof32(s); f = _tuple[0]; err = _tuple[1]; return [(f), err]; } return atof64(s); }; $pkg.ParseFloat = ParseFloat; NumError.ptr.prototype.Error = function() { var _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r; /* */ } return; } if ($f === undefined) { $f = { $blk: NumError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; NumError.prototype.Error = function() { return this.$val.Error(); }; syntaxError = function(fn, str) { var fn, str; return new NumError.ptr(fn, str, $pkg.ErrSyntax); }; rangeError = function(fn, str) { var fn, str; return new NumError.ptr(fn, str, $pkg.ErrRange); }; baseError = function(fn, str, base) { var base, fn, str; return new NumError.ptr(fn, str, errors.New("invalid base " + Itoa(base))); }; bitSizeError = function(fn, str, bitSize) { var bitSize, fn, str; return new NumError.ptr(fn, str, errors.New("invalid bit size " + Itoa(bitSize))); }; ParseUint = function(s, base, bitSize) { var _1, _i, _ref, base, bitSize, c, cutoff, d, maxVal, n, n1, s, s0, x, x$1, x$2; if (s.length === 0) { return [new $Uint64(0, 0), syntaxError("ParseUint", s)]; } s0 = s; if (2 <= base && base <= 36) { } else if ((base === 0)) { if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) { if (s.length < 3) { return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } base = 16; s = $substring(s, 2); } else if ((s.charCodeAt(0) === 48)) { base = 8; s = $substring(s, 1); } else { base = 10; } } else { return [new $Uint64(0, 0), baseError("ParseUint", s0, base)]; } if (bitSize === 0) { bitSize = 32; } else if (bitSize < 0 || bitSize > 64) { return [new $Uint64(0, 0), bitSizeError("ParseUint", s0, bitSize)]; } cutoff = new $Uint64(0, 0); _1 = base; if (_1 === (10)) { cutoff = new $Uint64(429496729, 2576980378); } else if (_1 === (16)) { cutoff = new $Uint64(268435456, 0); } else { cutoff = (x = $div64(new $Uint64(4294967295, 4294967295), (new $Uint64(0, base)), false), new $Uint64(x.$high + 0, x.$low + 1)); } maxVal = (x$1 = $shiftLeft64(new $Uint64(0, 1), ((bitSize >>> 0))), new $Uint64(x$1.$high - 0, x$1.$low - 1)); n = new $Uint64(0, 0); _ref = (new sliceType$6($stringToBytes(s))); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); d = 0; if (48 <= c && c <= 57) { d = c - 48 << 24 >>> 24; } else if (97 <= c && c <= 122) { d = (c - 97 << 24 >>> 24) + 10 << 24 >>> 24; } else if (65 <= c && c <= 90) { d = (c - 65 << 24 >>> 24) + 10 << 24 >>> 24; } else { return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } if (d >= ((base << 24 >>> 24))) { return [new $Uint64(0, 0), syntaxError("ParseUint", s0)]; } if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { return [maxVal, rangeError("ParseUint", s0)]; } n = $mul64(n, ((new $Uint64(0, base)))); n1 = (x$2 = (new $Uint64(0, d)), new $Uint64(n.$high + x$2.$high, n.$low + x$2.$low)); if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { return [maxVal, rangeError("ParseUint", s0)]; } n = n1; _i++; } return [n, $ifaceNil]; }; $pkg.ParseUint = ParseUint; ParseInt = function(s, base, bitSize) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, base, bitSize, cutoff, err, i, n, neg, s, s0, un, x, x$1; i = new $Int64(0, 0); err = $ifaceNil; if (s.length === 0) { _tmp = new $Int64(0, 0); _tmp$1 = syntaxError("ParseInt", s); i = _tmp; err = _tmp$1; return [i, err]; } s0 = s; neg = false; if (s.charCodeAt(0) === 43) { s = $substring(s, 1); } else if (s.charCodeAt(0) === 45) { neg = true; s = $substring(s, 1); } un = new $Uint64(0, 0); _tuple = ParseUint(s, base, bitSize); un = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual($assertType(err, ptrType).Err, $pkg.ErrRange))) { $assertType(err, ptrType).Func = "ParseInt"; $assertType(err, ptrType).Num = s0; _tmp$2 = new $Int64(0, 0); _tmp$3 = err; i = _tmp$2; err = _tmp$3; return [i, err]; } if (bitSize === 0) { bitSize = 32; } cutoff = ($shiftLeft64(new $Uint64(0, 1), (((bitSize - 1 >> 0) >>> 0)))); if (!neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low >= cutoff.$low))) { _tmp$4 = ((x = new $Uint64(cutoff.$high - 0, cutoff.$low - 1), new $Int64(x.$high, x.$low))); _tmp$5 = rangeError("ParseInt", s0); i = _tmp$4; err = _tmp$5; return [i, err]; } if (neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low > cutoff.$low))) { _tmp$6 = (x$1 = (new $Int64(cutoff.$high, cutoff.$low)), new $Int64(-x$1.$high, -x$1.$low)); _tmp$7 = rangeError("ParseInt", s0); i = _tmp$6; err = _tmp$7; return [i, err]; } n = (new $Int64(un.$high, un.$low)); if (neg) { n = new $Int64(-n.$high, -n.$low); } _tmp$8 = n; _tmp$9 = $ifaceNil; i = _tmp$8; err = _tmp$9; return [i, err]; }; $pkg.ParseInt = ParseInt; Atoi = function(s) { var _i, _ref, _tuple, _tuple$1, ch, err, i64, n, nerr, ok, s, s0, sLen; sLen = s.length; if (true && (0 < sLen && sLen < 10) || false && (0 < sLen && sLen < 19)) { s0 = s; if ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43)) { s = $substring(s, 1); if (s.length < 1) { return [0, new NumError.ptr("Atoi", s0, $pkg.ErrSyntax)]; } } n = 0; _ref = (new sliceType$6($stringToBytes(s))); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } ch = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ch = ch - (48) << 24 >>> 24; if (ch > 9) { return [0, new NumError.ptr("Atoi", s0, $pkg.ErrSyntax)]; } n = ($imul(n, 10)) + ((ch >> 0)) >> 0; _i++; } if (s0.charCodeAt(0) === 45) { n = -n; } return [n, $ifaceNil]; } _tuple = ParseInt(s, 10, 0); i64 = _tuple[0]; err = _tuple[1]; _tuple$1 = $assertType(err, ptrType, true); nerr = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { nerr.Func = "Atoi"; } return [(((i64.$low + ((i64.$high >> 31) * 4294967296)) >> 0)), err]; }; $pkg.Atoi = Atoi; decimal.ptr.prototype.String = function() { var a, buf, n, w; a = this; n = 10 + a.nd >> 0; if (a.dp > 0) { n = n + (a.dp) >> 0; } if (a.dp < 0) { n = n + (-a.dp) >> 0; } buf = $makeSlice(sliceType$6, n); w = 0; if ((a.nd === 0)) { return "0"; } else if (a.dp <= 0) { ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = 48); w = w + (1) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = 46); w = w + (1) >> 0; w = w + (digitZero($subslice(buf, w, (w + -a.dp >> 0)))) >> 0; w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.nd))) >> 0; } else if (a.dp < a.nd) { w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.dp))) >> 0; ((w < 0 || w >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + w] = 46); w = w + (1) >> 0; w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), a.dp, a.nd))) >> 0; } else { w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.nd))) >> 0; w = w + (digitZero($subslice(buf, w, ((w + a.dp >> 0) - a.nd >> 0)))) >> 0; } return ($bytesToString($subslice(buf, 0, w))); }; decimal.prototype.String = function() { return this.$val.String(); }; digitZero = function(dst) { var _i, _ref, dst, i; _ref = dst; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= dst.$length) ? ($throwRuntimeError("index out of range"), undefined) : dst.$array[dst.$offset + i] = 48); _i++; } return dst.$length; }; trim = function(a) { var a, x, x$1; while (true) { if (!(a.nd > 0 && ((x = a.d, x$1 = a.nd - 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[x$1])) === 48))) { break; } a.nd = a.nd - (1) >> 0; } if (a.nd === 0) { a.dp = 0; } }; decimal.ptr.prototype.Assign = function(v) { var a, buf, n, v, v1, x, x$1, x$2; a = this; buf = arrayType$1.zero(); n = 0; while (true) { if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } v1 = $div64(v, new $Uint64(0, 10), false); v = (x = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x.$high, v.$low - x.$low)); ((n < 0 || n >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[n] = ((new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24))); n = n + (1) >> 0; v = v1; } a.nd = 0; n = n - (1) >> 0; while (true) { if (!(n >= 0)) { break; } (x$1 = a.d, x$2 = a.nd, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2] = ((n < 0 || n >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[n]))); a.nd = a.nd + (1) >> 0; n = n - (1) >> 0; } a.dp = a.nd; trim(a); }; decimal.prototype.Assign = function(v) { return this.$val.Assign(v); }; rightShift = function(a, k) { var a, c, c$1, dig, dig$1, k, mask, n, r, w, x, x$1, x$2, x$3, y, y$1, y$2, y$3, y$4; r = 0; w = 0; n = 0; while (true) { if (!(((y = k, y < 32 ? (n >>> y) : 0) >>> 0) === 0)) { break; } if (r >= a.nd) { if (n === 0) { a.nd = 0; return; } while (true) { if (!(((y$1 = k, y$1 < 32 ? (n >>> y$1) : 0) >>> 0) === 0)) { break; } n = n * 10 >>> 0; r = r + (1) >> 0; } break; } c = (((x = a.d, ((r < 0 || r >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[r])) >>> 0)); n = ((n * 10 >>> 0) + c >>> 0) - 48 >>> 0; r = r + (1) >> 0; } a.dp = a.dp - ((r - 1 >> 0)) >> 0; mask = (((y$2 = k, y$2 < 32 ? (1 << y$2) : 0) >>> 0)) - 1 >>> 0; while (true) { if (!(r < a.nd)) { break; } c$1 = (((x$1 = a.d, ((r < 0 || r >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[r])) >>> 0)); dig = (y$3 = k, y$3 < 32 ? (n >>> y$3) : 0) >>> 0; n = (n & (mask)) >>> 0; (x$2 = a.d, ((w < 0 || w >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[w] = (((dig + 48 >>> 0) << 24 >>> 24)))); w = w + (1) >> 0; n = ((n * 10 >>> 0) + c$1 >>> 0) - 48 >>> 0; r = r + (1) >> 0; } while (true) { if (!(n > 0)) { break; } dig$1 = (y$4 = k, y$4 < 32 ? (n >>> y$4) : 0) >>> 0; n = (n & (mask)) >>> 0; if (w < 800) { (x$3 = a.d, ((w < 0 || w >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[w] = (((dig$1 + 48 >>> 0) << 24 >>> 24)))); w = w + (1) >> 0; } else if (dig$1 > 0) { a.trunc = true; } n = n * 10 >>> 0; } a.nd = w; trim(a); }; prefixIsLessThan = function(b, s) { var b, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (i >= b.$length) { return true; } if (!((((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]) === s.charCodeAt(i)))) { return ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]) < s.charCodeAt(i); } i = i + (1) >> 0; } return false; }; leftShift = function(a, k) { var _q, _q$1, a, delta, k, n, quo, quo$1, r, rem, rem$1, w, x, x$1, x$2, y; delta = ((k < 0 || k >= leftcheats.$length) ? ($throwRuntimeError("index out of range"), undefined) : leftcheats.$array[leftcheats.$offset + k]).delta; if (prefixIsLessThan($subslice(new sliceType$6(a.d), 0, a.nd), ((k < 0 || k >= leftcheats.$length) ? ($throwRuntimeError("index out of range"), undefined) : leftcheats.$array[leftcheats.$offset + k]).cutoff)) { delta = delta - (1) >> 0; } r = a.nd; w = a.nd + delta >> 0; n = 0; r = r - (1) >> 0; while (true) { if (!(r >= 0)) { break; } n = n + (((y = k, y < 32 ? ((((((x = a.d, ((r < 0 || r >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[r])) >>> 0)) - 48 >>> 0)) << y) : 0) >>> 0)) >>> 0; quo = (_q = n / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); rem = n - (10 * quo >>> 0) >>> 0; w = w - (1) >> 0; if (w < 800) { (x$1 = a.d, ((w < 0 || w >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[w] = (((rem + 48 >>> 0) << 24 >>> 24)))); } else if (!((rem === 0))) { a.trunc = true; } n = quo; r = r - (1) >> 0; } while (true) { if (!(n > 0)) { break; } quo$1 = (_q$1 = n / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); rem$1 = n - (10 * quo$1 >>> 0) >>> 0; w = w - (1) >> 0; if (w < 800) { (x$2 = a.d, ((w < 0 || w >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[w] = (((rem$1 + 48 >>> 0) << 24 >>> 24)))); } else if (!((rem$1 === 0))) { a.trunc = true; } n = quo$1; } a.nd = a.nd + (delta) >> 0; if (a.nd >= 800) { a.nd = 800; } a.dp = a.dp + (delta) >> 0; trim(a); }; decimal.ptr.prototype.Shift = function(k) { var a, k; a = this; if ((a.nd === 0)) { } else if (k > 0) { while (true) { if (!(k > 28)) { break; } leftShift(a, 28); k = k - (28) >> 0; } leftShift(a, ((k >>> 0))); } else if (k < 0) { while (true) { if (!(k < -28)) { break; } rightShift(a, 28); k = k + (28) >> 0; } rightShift(a, ((-k >>> 0))); } }; decimal.prototype.Shift = function(k) { return this.$val.Shift(k); }; shouldRoundUp = function(a, nd) { var _r, a, nd, x, x$1, x$2, x$3; if (nd < 0 || nd >= a.nd) { return false; } if (((x = a.d, ((nd < 0 || nd >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[nd])) === 53) && ((nd + 1 >> 0) === a.nd)) { if (a.trunc) { return true; } return nd > 0 && !(((_r = (((x$1 = a.d, x$2 = nd - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])) - 48 << 24 >>> 24)) % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0)); } return (x$3 = a.d, ((nd < 0 || nd >= x$3.length) ? ($throwRuntimeError("index out of range"), undefined) : x$3[nd])) >= 53; }; decimal.ptr.prototype.Round = function(nd) { var a, nd; a = this; if (nd < 0 || nd >= a.nd) { return; } if (shouldRoundUp(a, nd)) { a.RoundUp(nd); } else { a.RoundDown(nd); } }; decimal.prototype.Round = function(nd) { return this.$val.Round(nd); }; decimal.ptr.prototype.RoundDown = function(nd) { var a, nd; a = this; if (nd < 0 || nd >= a.nd) { return; } a.nd = nd; trim(a); }; decimal.prototype.RoundDown = function(nd) { return this.$val.RoundDown(nd); }; decimal.ptr.prototype.RoundUp = function(nd) { var a, c, i, nd, x, x$1, x$2; a = this; if (nd < 0 || nd >= a.nd) { return; } i = nd - 1 >> 0; while (true) { if (!(i >= 0)) { break; } c = (x = a.d, ((i < 0 || i >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[i])); if (c < 57) { (x$2 = a.d, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i] = ((x$1 = a.d, ((i < 0 || i >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[i])) + (1) << 24 >>> 24))); a.nd = i + 1 >> 0; return; } i = i - (1) >> 0; } a.d[0] = 49; a.nd = 1; a.dp = a.dp + (1) >> 0; }; decimal.prototype.RoundUp = function(nd) { return this.$val.RoundUp(nd); }; decimal.ptr.prototype.RoundedInteger = function() { var a, i, n, x, x$1, x$2, x$3; a = this; if (a.dp > 20) { return new $Uint64(4294967295, 4294967295); } i = 0; n = new $Uint64(0, 0); i = 0; while (true) { if (!(i < a.dp && i < a.nd)) { break; } n = (x = $mul64(n, new $Uint64(0, 10)), x$1 = (new $Uint64(0, ((x$2 = a.d, ((i < 0 || i >= x$2.length) ? ($throwRuntimeError("index out of range"), undefined) : x$2[i])) - 48 << 24 >>> 24))), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); i = i + (1) >> 0; } while (true) { if (!(i < a.dp)) { break; } n = $mul64(n, (new $Uint64(0, 10))); i = i + (1) >> 0; } if (shouldRoundUp(a, a.dp)) { n = (x$3 = new $Uint64(0, 1), new $Uint64(n.$high + x$3.$high, n.$low + x$3.$low)); } return n; }; decimal.prototype.RoundedInteger = function() { return this.$val.RoundedInteger(); }; extFloat.ptr.prototype.floatBits = function(flt) { var bits$1, exp, f, flt, mant, n, overflow, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1, y$2; bits$1 = new $Uint64(0, 0); overflow = false; f = this; f.Normalize(); exp = f.exp + 63 >> 0; if (exp < (flt.bias + 1 >> 0)) { n = (flt.bias + 1 >> 0) - exp >> 0; f.mant = $shiftRightUint64(f.mant, (((n >>> 0)))); exp = exp + (n) >> 0; } mant = $shiftRightUint64(f.mant, ((63 - flt.mantbits >>> 0))); if (!((x = (x$1 = f.mant, x$2 = $shiftLeft64(new $Uint64(0, 1), ((62 - flt.mantbits >>> 0))), new $Uint64(x$1.$high & x$2.$high, (x$1.$low & x$2.$low) >>> 0)), (x.$high === 0 && x.$low === 0)))) { mant = (x$3 = new $Uint64(0, 1), new $Uint64(mant.$high + x$3.$high, mant.$low + x$3.$low)); } if ((x$4 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$4.$high && mant.$low === x$4.$low))) { mant = $shiftRightUint64(mant, (1)); exp = exp + (1) >> 0; } if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { mant = new $Uint64(0, 0); exp = (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0) + flt.bias >> 0; overflow = true; } else if ((x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$6.$high, (mant.$low & x$6.$low) >>> 0)), (x$5.$high === 0 && x$5.$low === 0))) { exp = flt.bias; } bits$1 = (x$7 = (x$8 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$8.$high - 0, x$8.$low - 1)), new $Uint64(mant.$high & x$7.$high, (mant.$low & x$7.$low) >>> 0)); bits$1 = (x$9 = $shiftLeft64((new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0))))), flt.mantbits), new $Uint64(bits$1.$high | x$9.$high, (bits$1.$low | x$9.$low) >>> 0)); if (f.neg) { bits$1 = (x$10 = $shiftLeft64(new $Uint64(0, 1), ((flt.mantbits + flt.expbits >>> 0))), new $Uint64(bits$1.$high | x$10.$high, (bits$1.$low | x$10.$low) >>> 0)); } return [bits$1, overflow]; }; extFloat.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; extFloat.ptr.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { var _tmp, _tmp$1, exp, expBiased, f, flt, lower, mant, neg, upper, x, x$1, x$2, x$3, x$4; lower = new extFloat.ptr(new $Uint64(0, 0), 0, false); upper = new extFloat.ptr(new $Uint64(0, 0), 0, false); f = this; f.mant = mant; f.exp = exp - ((flt.mantbits >> 0)) >> 0; f.neg = neg; if (f.exp <= 0 && (x = $shiftLeft64(($shiftRightUint64(mant, ((-f.exp >>> 0)))), ((-f.exp >>> 0))), (mant.$high === x.$high && mant.$low === x.$low))) { f.mant = $shiftRightUint64(f.mant, (((-f.exp >>> 0)))); f.exp = 0; _tmp = $clone(f, extFloat); _tmp$1 = $clone(f, extFloat); extFloat.copy(lower, _tmp); extFloat.copy(upper, _tmp$1); return [lower, upper]; } expBiased = exp - flt.bias >> 0; extFloat.copy(upper, new extFloat.ptr((x$1 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$1.$high + 0, x$1.$low + 1)), f.exp - 1 >> 0, f.neg)); if (!((x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) || (expBiased === 1)) { extFloat.copy(lower, new extFloat.ptr((x$3 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$3.$high - 0, x$3.$low - 1)), f.exp - 1 >> 0, f.neg)); } else { extFloat.copy(lower, new extFloat.ptr((x$4 = $mul64(new $Uint64(0, 4), f.mant), new $Uint64(x$4.$high - 0, x$4.$low - 1)), f.exp - 2 >> 0, f.neg)); } return [lower, upper]; }; extFloat.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { return this.$val.AssignComputeBounds(mant, exp, neg, flt); }; extFloat.ptr.prototype.Normalize = function() { var f, shift, x; f = this; if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { return 0; } shift = bits.LeadingZeros64(f.mant); f.mant = $shiftLeft64(f.mant, (((shift >>> 0)))); f.exp = f.exp - (shift) >> 0; return ((shift >>> 0)); }; extFloat.prototype.Normalize = function() { return this.$val.Normalize(); }; extFloat.ptr.prototype.Multiply = function(g) { var _tmp, _tmp$1, _tmp$2, _tmp$3, cross1, cross2, f, fhi, flo, g, ghi, glo, rem, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; f = this; _tmp = $shiftRightUint64(f.mant, 32); _tmp$1 = (new $Uint64(0, ((f.mant.$low >>> 0)))); fhi = _tmp; flo = _tmp$1; _tmp$2 = $shiftRightUint64(g.mant, 32); _tmp$3 = (new $Uint64(0, ((g.mant.$low >>> 0)))); ghi = _tmp$2; glo = _tmp$3; cross1 = $mul64(fhi, glo); cross2 = $mul64(flo, ghi); f.mant = (x = (x$1 = $mul64(fhi, ghi), x$2 = $shiftRightUint64(cross1, 32), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)), x$3 = $shiftRightUint64(cross2, 32), new $Uint64(x.$high + x$3.$high, x.$low + x$3.$low)); rem = (x$4 = (x$5 = (new $Uint64(0, ((cross1.$low >>> 0)))), x$6 = (new $Uint64(0, ((cross2.$low >>> 0)))), new $Uint64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)), x$7 = $shiftRightUint64(($mul64(flo, glo)), 32), new $Uint64(x$4.$high + x$7.$high, x$4.$low + x$7.$low)); rem = (x$8 = new $Uint64(0, 2147483648), new $Uint64(rem.$high + x$8.$high, rem.$low + x$8.$low)); f.mant = (x$9 = f.mant, x$10 = ($shiftRightUint64(rem, 32)), new $Uint64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); f.exp = (f.exp + g.exp >> 0) + 64 >> 0; }; extFloat.prototype.Multiply = function(g) { return this.$val.Multiply(g); }; extFloat.ptr.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { var _q, _r, adjExp, denormalExp, errors$1, exp10, extrabits, f, flt, halfway, i, mant_extra, mantissa, neg, ok, shift, trunc, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y; ok = false; f = this; errors$1 = 0; if (trunc) { errors$1 = errors$1 + (4) >> 0; } f.mant = mantissa; f.exp = 0; f.neg = neg; i = (_q = ((exp10 - -348 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); if (exp10 < -348 || i >= 87) { ok = false; return ok; } adjExp = (_r = ((exp10 - -348 >> 0)) % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); if (adjExp < 19 && (x = (x$1 = 19 - adjExp >> 0, ((x$1 < 0 || x$1 >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[x$1])), (mantissa.$high < x.$high || (mantissa.$high === x.$high && mantissa.$low < x.$low)))) { f.mant = $mul64(f.mant, (((adjExp < 0 || adjExp >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[adjExp]))); f.Normalize(); } else { f.Normalize(); f.Multiply($clone(((adjExp < 0 || adjExp >= smallPowersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : smallPowersOfTen[adjExp]), extFloat)); errors$1 = errors$1 + (4) >> 0; } f.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); if (errors$1 > 0) { errors$1 = errors$1 + (1) >> 0; } errors$1 = errors$1 + (4) >> 0; shift = f.Normalize(); errors$1 = (y = (shift), y < 32 ? (errors$1 << y) : 0) >> 0; denormalExp = flt.bias - 63 >> 0; extrabits = 0; if (f.exp <= denormalExp) { extrabits = ((63 - flt.mantbits >>> 0) + 1 >>> 0) + (((denormalExp - f.exp >> 0) >>> 0)) >>> 0; } else { extrabits = 63 - flt.mantbits >>> 0; } halfway = $shiftLeft64(new $Uint64(0, 1), ((extrabits - 1 >>> 0))); mant_extra = (x$2 = f.mant, x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), extrabits), new $Uint64(x$4.$high - 0, x$4.$low - 1)), new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); if ((x$5 = (x$6 = (new $Int64(halfway.$high, halfway.$low)), x$7 = (new $Int64(0, errors$1)), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)), x$8 = (new $Int64(mant_extra.$high, mant_extra.$low)), (x$5.$high < x$8.$high || (x$5.$high === x$8.$high && x$5.$low < x$8.$low))) && (x$9 = (new $Int64(mant_extra.$high, mant_extra.$low)), x$10 = (x$11 = (new $Int64(halfway.$high, halfway.$low)), x$12 = (new $Int64(0, errors$1)), new $Int64(x$11.$high + x$12.$high, x$11.$low + x$12.$low)), (x$9.$high < x$10.$high || (x$9.$high === x$10.$high && x$9.$low < x$10.$low)))) { ok = false; return ok; } ok = true; return ok; }; extFloat.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { return this.$val.AssignDecimal(mantissa, exp10, neg, trunc, flt); }; extFloat.ptr.prototype.frexp10 = function() { var _q, _q$1, _tmp, _tmp$1, approxExp10, exp, exp10, f, i, index; exp10 = 0; index = 0; f = this; approxExp10 = (_q = ($imul(((-46 - f.exp >> 0)), 28)) / 93, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); i = (_q$1 = ((approxExp10 - -348 >> 0)) / 8, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); Loop: while (true) { exp = (f.exp + ((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]).exp >> 0) + 64 >> 0; if (exp < -60) { i = i + (1) >> 0; } else if (exp > -32) { i = i - (1) >> 0; } else { break Loop; } } f.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); _tmp = -((-348 + ($imul(i, 8)) >> 0)); _tmp$1 = i; exp10 = _tmp; index = _tmp$1; return [exp10, index]; }; extFloat.prototype.frexp10 = function() { return this.$val.frexp10(); }; frexp10Many = function(a, b, c) { var _tuple, a, b, c, exp10, i; exp10 = 0; _tuple = c.frexp10(); exp10 = _tuple[0]; i = _tuple[1]; a.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); b.Multiply($clone(((i < 0 || i >= powersOfTen.length) ? ($throwRuntimeError("index out of range"), undefined) : powersOfTen[i]), extFloat)); return exp10; }; extFloat.ptr.prototype.FixedDecimal = function(d, n) { var $CE$B5, _q, _q$1, _tmp, _tmp$1, _tuple, buf, d, digit, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, n, nd, needed, ok, pos, pow, pow10, rest, shift, v, v1, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; f = this; if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { d.nd = 0; d.dp = 0; d.neg = f.neg; return true; } if (n === 0) { $panic(new $String("strconv: internal error: extFloat.FixedDecimal called with n == 0")); } f.Normalize(); _tuple = f.frexp10(); exp10 = _tuple[0]; shift = ((-f.exp >>> 0)); integer = (($shiftRightUint64(f.mant, shift).$low >>> 0)); fraction = (x$1 = f.mant, x$2 = $shiftLeft64((new $Uint64(0, integer)), shift), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); $CE$B5 = new $Uint64(0, 1); needed = n; integerDigits = 0; pow10 = new $Uint64(0, 1); _tmp = 0; _tmp$1 = new $Uint64(0, 1); i = _tmp; pow = _tmp$1; while (true) { if (!(i < 20)) { break; } if ((x$3 = (new $Uint64(0, integer)), (pow.$high > x$3.$high || (pow.$high === x$3.$high && pow.$low > x$3.$low)))) { integerDigits = i; break; } pow = $mul64(pow, (new $Uint64(0, 10))); i = i + (1) >> 0; } rest = integer; if (integerDigits > needed) { pow10 = (x$4 = integerDigits - needed >> 0, ((x$4 < 0 || x$4 >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[x$4])); integer = (_q = integer / (((pow10.$low >>> 0))), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); rest = rest - (($imul(integer, ((pow10.$low >>> 0))) >>> 0)) >>> 0; } else { rest = 0; } buf = arrayType$2.zero(); pos = 32; v = integer; while (true) { if (!(v > 0)) { break; } v1 = (_q$1 = v / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); v = v - (($imul(10, v1) >>> 0)) >>> 0; pos = pos - (1) >> 0; ((pos < 0 || pos >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[pos] = (((v + 48 >>> 0) << 24 >>> 24))); v = v1; } i$1 = pos; while (true) { if (!(i$1 < 32)) { break; } (x$5 = d.d, x$6 = i$1 - pos >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6] = ((i$1 < 0 || i$1 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[i$1]))); i$1 = i$1 + (1) >> 0; } nd = 32 - pos >> 0; d.nd = nd; d.dp = integerDigits + exp10 >> 0; needed = needed - (nd) >> 0; if (needed > 0) { if (!((rest === 0)) || !((pow10.$high === 0 && pow10.$low === 1))) { $panic(new $String("strconv: internal error, rest != 0 but needed > 0")); } while (true) { if (!(needed > 0)) { break; } fraction = $mul64(fraction, (new $Uint64(0, 10))); $CE$B5 = $mul64($CE$B5, (new $Uint64(0, 10))); if ((x$7 = $mul64(new $Uint64(0, 2), $CE$B5), x$8 = $shiftLeft64(new $Uint64(0, 1), shift), (x$7.$high > x$8.$high || (x$7.$high === x$8.$high && x$7.$low > x$8.$low)))) { return false; } digit = $shiftRightUint64(fraction, shift); (x$9 = d.d, ((nd < 0 || nd >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + nd] = ((new $Uint64(digit.$high + 0, digit.$low + 48).$low << 24 >>> 24)))); fraction = (x$10 = $shiftLeft64(digit, shift), new $Uint64(fraction.$high - x$10.$high, fraction.$low - x$10.$low)); nd = nd + (1) >> 0; needed = needed - (1) >> 0; } d.nd = nd; } ok = adjustLastDigitFixed(d, (x$11 = $shiftLeft64((new $Uint64(0, rest)), shift), new $Uint64(x$11.$high | fraction.$high, (x$11.$low | fraction.$low) >>> 0)), pow10, shift, $CE$B5); if (!ok) { return false; } i$2 = d.nd - 1 >> 0; while (true) { if (!(i$2 >= 0)) { break; } if (!(((x$12 = d.d, ((i$2 < 0 || i$2 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + i$2])) === 48))) { d.nd = i$2 + 1 >> 0; break; } i$2 = i$2 - (1) >> 0; } return true; }; extFloat.prototype.FixedDecimal = function(d, n) { return this.$val.FixedDecimal(d, n); }; adjustLastDigitFixed = function(d, num, den, shift, $CE$B5) { var $CE$B5, d, den, i, num, shift, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; if ((x = $shiftLeft64(den, shift), (num.$high > x.$high || (num.$high === x.$high && num.$low > x.$low)))) { $panic(new $String("strconv: num > den< x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { $panic(new $String("strconv: \xCE\xB5 > (den< x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low)))) { i = d.nd - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if ((x$7 = d.d, ((i < 0 || i >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + i])) === 57) { d.nd = d.nd - (1) >> 0; } else { break; } i = i - (1) >> 0; } if (i < 0) { (x$8 = d.d, (0 >= x$8.$length ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + 0] = 49)); d.nd = 1; d.dp = d.dp + (1) >> 0; } else { (x$10 = d.d, ((i < 0 || i >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + i] = ((x$9 = d.d, ((i < 0 || i >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + i])) + (1) << 24 >>> 24))); } return true; } return false; }; extFloat.ptr.prototype.ShortestDecimal = function(d, lower, upper) { var _q, _tmp, _tmp$1, _tmp$2, _tmp$3, allowance, buf, currentDiff, d, digit, digit$1, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, lower, multiplier, n, nd, pow, pow$1, shift, targetDiff, upper, v, v1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$3, x$4, x$5, x$6, x$7, x$8, x$9; f = this; if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { d.nd = 0; d.dp = 0; d.neg = f.neg; return true; } if ((f.exp === 0) && $equal(lower, f, extFloat) && $equal(lower, upper, extFloat)) { buf = arrayType$1.zero(); n = 23; v = f.mant; while (true) { if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } v1 = $div64(v, new $Uint64(0, 10), false); v = (x$1 = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x$1.$high, v.$low - x$1.$low)); ((n < 0 || n >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[n] = ((new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24))); n = n - (1) >> 0; v = v1; } nd = (24 - n >> 0) - 1 >> 0; i = 0; while (true) { if (!(i < nd)) { break; } (x$3 = d.d, ((i < 0 || i >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i] = (x$2 = (n + 1 >> 0) + i >> 0, ((x$2 < 0 || x$2 >= buf.length) ? ($throwRuntimeError("index out of range"), undefined) : buf[x$2])))); i = i + (1) >> 0; } _tmp = nd; _tmp$1 = nd; d.nd = _tmp; d.dp = _tmp$1; while (true) { if (!(d.nd > 0 && ((x$4 = d.d, x$5 = d.nd - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])) === 48))) { break; } d.nd = d.nd - (1) >> 0; } if (d.nd === 0) { d.dp = 0; } d.neg = f.neg; return true; } upper.Normalize(); if (f.exp > upper.exp) { f.mant = $shiftLeft64(f.mant, ((((f.exp - upper.exp >> 0) >>> 0)))); f.exp = upper.exp; } if (lower.exp > upper.exp) { lower.mant = $shiftLeft64(lower.mant, ((((lower.exp - upper.exp >> 0) >>> 0)))); lower.exp = upper.exp; } exp10 = frexp10Many(lower, f, upper); upper.mant = (x$6 = upper.mant, x$7 = new $Uint64(0, 1), new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); lower.mant = (x$8 = lower.mant, x$9 = new $Uint64(0, 1), new $Uint64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)); shift = ((-upper.exp >>> 0)); integer = (($shiftRightUint64(upper.mant, shift).$low >>> 0)); fraction = (x$10 = upper.mant, x$11 = $shiftLeft64((new $Uint64(0, integer)), shift), new $Uint64(x$10.$high - x$11.$high, x$10.$low - x$11.$low)); allowance = (x$12 = upper.mant, x$13 = lower.mant, new $Uint64(x$12.$high - x$13.$high, x$12.$low - x$13.$low)); targetDiff = (x$14 = upper.mant, x$15 = f.mant, new $Uint64(x$14.$high - x$15.$high, x$14.$low - x$15.$low)); integerDigits = 0; _tmp$2 = 0; _tmp$3 = new $Uint64(0, 1); i$1 = _tmp$2; pow = _tmp$3; while (true) { if (!(i$1 < 20)) { break; } if ((x$16 = (new $Uint64(0, integer)), (pow.$high > x$16.$high || (pow.$high === x$16.$high && pow.$low > x$16.$low)))) { integerDigits = i$1; break; } pow = $mul64(pow, (new $Uint64(0, 10))); i$1 = i$1 + (1) >> 0; } i$2 = 0; while (true) { if (!(i$2 < integerDigits)) { break; } pow$1 = (x$17 = (integerDigits - i$2 >> 0) - 1 >> 0, ((x$17 < 0 || x$17 >= uint64pow10.length) ? ($throwRuntimeError("index out of range"), undefined) : uint64pow10[x$17])); digit = (_q = integer / ((pow$1.$low >>> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); (x$18 = d.d, ((i$2 < 0 || i$2 >= x$18.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$18.$array[x$18.$offset + i$2] = (((digit + 48 >>> 0) << 24 >>> 24)))); integer = integer - (($imul(digit, ((pow$1.$low >>> 0))) >>> 0)) >>> 0; currentDiff = (x$19 = $shiftLeft64((new $Uint64(0, integer)), shift), new $Uint64(x$19.$high + fraction.$high, x$19.$low + fraction.$low)); if ((currentDiff.$high < allowance.$high || (currentDiff.$high === allowance.$high && currentDiff.$low < allowance.$low))) { d.nd = i$2 + 1 >> 0; d.dp = integerDigits + exp10 >> 0; d.neg = f.neg; return adjustLastDigit(d, currentDiff, targetDiff, allowance, $shiftLeft64(pow$1, shift), new $Uint64(0, 2)); } i$2 = i$2 + (1) >> 0; } d.nd = integerDigits; d.dp = d.nd + exp10 >> 0; d.neg = f.neg; digit$1 = 0; multiplier = new $Uint64(0, 1); while (true) { fraction = $mul64(fraction, (new $Uint64(0, 10))); multiplier = $mul64(multiplier, (new $Uint64(0, 10))); digit$1 = (($shiftRightUint64(fraction, shift).$low >> 0)); (x$20 = d.d, x$21 = d.nd, ((x$21 < 0 || x$21 >= x$20.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$20.$array[x$20.$offset + x$21] = (((digit$1 + 48 >> 0) << 24 >>> 24)))); d.nd = d.nd + (1) >> 0; fraction = (x$22 = $shiftLeft64((new $Uint64(0, digit$1)), shift), new $Uint64(fraction.$high - x$22.$high, fraction.$low - x$22.$low)); if ((x$23 = $mul64(allowance, multiplier), (fraction.$high < x$23.$high || (fraction.$high === x$23.$high && fraction.$low < x$23.$low)))) { return adjustLastDigit(d, fraction, $mul64(targetDiff, multiplier), $mul64(allowance, multiplier), $shiftLeft64(new $Uint64(0, 1), shift), $mul64(multiplier, new $Uint64(0, 2))); } } }; extFloat.prototype.ShortestDecimal = function(d, lower, upper) { return this.$val.ShortestDecimal(d, lower, upper); }; adjustLastDigit = function(d, currentDiff, targetDiff, maxDiff, ulpDecimal, ulpBinary) { var _index, currentDiff, d, maxDiff, targetDiff, ulpBinary, ulpDecimal, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; if ((x = $mul64(new $Uint64(0, 2), ulpBinary), (ulpDecimal.$high < x.$high || (ulpDecimal.$high === x.$high && ulpDecimal.$low < x.$low)))) { return false; } while (true) { if (!((x$1 = (x$2 = (x$3 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(currentDiff.$high + x$3.$high, currentDiff.$low + x$3.$low)), new $Uint64(x$2.$high + ulpBinary.$high, x$2.$low + ulpBinary.$low)), (x$1.$high < targetDiff.$high || (x$1.$high === targetDiff.$high && x$1.$low < targetDiff.$low))))) { break; } _index = d.nd - 1 >> 0; (x$5 = d.d, ((_index < 0 || _index >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + _index] = ((x$4 = d.d, ((_index < 0 || _index >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + _index])) - (1) << 24 >>> 24))); currentDiff = (x$6 = ulpDecimal, new $Uint64(currentDiff.$high + x$6.$high, currentDiff.$low + x$6.$low)); } if ((x$7 = new $Uint64(currentDiff.$high + ulpDecimal.$high, currentDiff.$low + ulpDecimal.$low), x$8 = (x$9 = (x$10 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(targetDiff.$high + x$10.$high, targetDiff.$low + x$10.$low)), new $Uint64(x$9.$high + ulpBinary.$high, x$9.$low + ulpBinary.$low)), (x$7.$high < x$8.$high || (x$7.$high === x$8.$high && x$7.$low <= x$8.$low)))) { return false; } if ((currentDiff.$high < ulpBinary.$high || (currentDiff.$high === ulpBinary.$high && currentDiff.$low < ulpBinary.$low)) || (x$11 = new $Uint64(maxDiff.$high - ulpBinary.$high, maxDiff.$low - ulpBinary.$low), (currentDiff.$high > x$11.$high || (currentDiff.$high === x$11.$high && currentDiff.$low > x$11.$low)))) { return false; } if ((d.nd === 1) && ((x$12 = d.d, (0 >= x$12.$length ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + 0])) === 48)) { d.nd = 0; d.dp = 0; } return true; }; AppendFloat = function(dst, f, fmt, prec, bitSize) { var bitSize, dst, f, fmt, prec; return genericFtoa(dst, f, fmt, prec, bitSize); }; $pkg.AppendFloat = AppendFloat; genericFtoa = function(dst, val, fmt, prec, bitSize) { var _1, _2, _3, _4, _tuple, bitSize, bits$1, buf, buf$1, digits, digs, dst, exp, f, f$1, flt, fmt, lower, mant, neg, ok, prec, s, shortest, upper, val, x, x$1, x$2, x$3, y, y$1; bits$1 = new $Uint64(0, 0); flt = ptrType$1.nil; _1 = bitSize; if (_1 === (32)) { bits$1 = (new $Uint64(0, math.Float32bits(($fround(val))))); flt = float32info; } else if (_1 === (64)) { bits$1 = math.Float64bits(val); flt = float64info; } else { $panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize")); } neg = !((x = $shiftRightUint64(bits$1, ((flt.expbits + flt.mantbits >>> 0))), (x.$high === 0 && x.$low === 0))); exp = (($shiftRightUint64(bits$1, flt.mantbits).$low >> 0)) & ((((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)); mant = (x$1 = (x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$2.$high - 0, x$2.$low - 1)), new $Uint64(bits$1.$high & x$1.$high, (bits$1.$low & x$1.$low) >>> 0)); _2 = exp; if (_2 === ((((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0))) { s = ""; if (!((mant.$high === 0 && mant.$low === 0))) { s = "NaN"; } else if (neg) { s = "-Inf"; } else { s = "+Inf"; } return $appendSlice(dst, s); } else if (_2 === (0)) { exp = exp + (1) >> 0; } else { mant = (x$3 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high | x$3.$high, (mant.$low | x$3.$low) >>> 0)); } exp = exp + (flt.bias) >> 0; if (fmt === 98) { return fmtB(dst, neg, mant, exp, flt); } if (!optimize) { return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); } digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); ok = false; shortest = prec < 0; if (shortest) { f = new extFloat.ptr(new $Uint64(0, 0), 0, false); _tuple = f.AssignComputeBounds(mant, exp, neg, flt); lower = $clone(_tuple[0], extFloat); upper = $clone(_tuple[1], extFloat); buf = arrayType$2.zero(); digs.d = new sliceType$6(buf); ok = f.ShortestDecimal(digs, lower, upper); if (!ok) { return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); } _3 = fmt; if ((_3 === (101)) || (_3 === (69))) { prec = max(digs.nd - 1 >> 0, 0); } else if (_3 === (102)) { prec = max(digs.nd - digs.dp >> 0, 0); } else if ((_3 === (103)) || (_3 === (71))) { prec = digs.nd; } } else if (!((fmt === 102))) { digits = prec; _4 = fmt; if ((_4 === (101)) || (_4 === (69))) { digits = digits + (1) >> 0; } else if ((_4 === (103)) || (_4 === (71))) { if (prec === 0) { prec = 1; } digits = prec; } if (digits <= 15) { buf$1 = arrayType$1.zero(); digs.d = new sliceType$6(buf$1); f$1 = new extFloat.ptr(mant, exp - ((flt.mantbits >> 0)) >> 0, neg); ok = f$1.FixedDecimal(digs, digits); } } if (!ok) { return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); } return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); }; bigFtoa = function(dst, prec, fmt, neg, mant, exp, flt) { var _1, _2, d, digs, dst, exp, flt, fmt, mant, neg, prec, shortest; d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); d.Assign(mant); d.Shift(exp - ((flt.mantbits >> 0)) >> 0); digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); shortest = prec < 0; if (shortest) { roundShortest(d, mant, exp, flt); decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); _1 = fmt; if ((_1 === (101)) || (_1 === (69))) { prec = digs.nd - 1 >> 0; } else if (_1 === (102)) { prec = max(digs.nd - digs.dp >> 0, 0); } else if ((_1 === (103)) || (_1 === (71))) { prec = digs.nd; } } else { _2 = fmt; if ((_2 === (101)) || (_2 === (69))) { d.Round(prec + 1 >> 0); } else if (_2 === (102)) { d.Round(d.dp + prec >> 0); } else if ((_2 === (103)) || (_2 === (71))) { if (prec === 0) { prec = 1; } d.Round(prec); } decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); } return formatDigits(dst, shortest, neg, $clone(digs, decimalSlice), prec, fmt); }; formatDigits = function(dst, shortest, neg, digs, prec, fmt) { var _1, digs, dst, eprec, exp, fmt, neg, prec, shortest; _1 = fmt; if ((_1 === (101)) || (_1 === (69))) { return fmtE(dst, neg, $clone(digs, decimalSlice), prec, fmt); } else if (_1 === (102)) { return fmtF(dst, neg, $clone(digs, decimalSlice), prec); } else if ((_1 === (103)) || (_1 === (71))) { eprec = prec; if (eprec > digs.nd && digs.nd >= digs.dp) { eprec = digs.nd; } if (shortest) { eprec = 6; } exp = digs.dp - 1 >> 0; if (exp < -4 || exp >= eprec) { if (prec > digs.nd) { prec = digs.nd; } return fmtE(dst, neg, $clone(digs, decimalSlice), prec - 1 >> 0, (fmt + 101 << 24 >>> 24) - 103 << 24 >>> 24); } if (prec > digs.dp) { prec = digs.nd; } return fmtF(dst, neg, $clone(digs, decimalSlice), max(prec - digs.dp >> 0, 0)); } return $append(dst, 37, fmt); }; roundShortest = function(d, mant, exp, flt) { var d, exp, explo, flt, i, inclusive, l, lower, m, mant, mantlo, minexp, okdown, okup, u, upper, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; if ((mant.$high === 0 && mant.$low === 0)) { d.nd = 0; return; } minexp = flt.bias + 1 >> 0; if (exp > minexp && ($imul(332, ((d.dp - d.nd >> 0)))) >= ($imul(100, ((exp - ((flt.mantbits >> 0)) >> 0))))) { return; } upper = new decimal.ptr(arrayType.zero(), 0, 0, false, false); upper.Assign((x = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x.$high + 0, x.$low + 1))); upper.Shift((exp - ((flt.mantbits >> 0)) >> 0) - 1 >> 0); mantlo = new $Uint64(0, 0); explo = 0; if ((x$1 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high > x$1.$high || (mant.$high === x$1.$high && mant.$low > x$1.$low))) || (exp === minexp)) { mantlo = new $Uint64(mant.$high - 0, mant.$low - 1); explo = exp; } else { mantlo = (x$2 = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x$2.$high - 0, x$2.$low - 1)); explo = exp - 1 >> 0; } lower = new decimal.ptr(arrayType.zero(), 0, 0, false, false); lower.Assign((x$3 = $mul64(mantlo, new $Uint64(0, 2)), new $Uint64(x$3.$high + 0, x$3.$low + 1))); lower.Shift((explo - ((flt.mantbits >> 0)) >> 0) - 1 >> 0); inclusive = (x$4 = $div64(mant, new $Uint64(0, 2), true), (x$4.$high === 0 && x$4.$low === 0)); i = 0; while (true) { if (!(i < d.nd)) { break; } l = 48; if (i < lower.nd) { l = (x$5 = lower.d, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i])); } m = (x$6 = d.d, ((i < 0 || i >= x$6.length) ? ($throwRuntimeError("index out of range"), undefined) : x$6[i])); u = 48; if (i < upper.nd) { u = (x$7 = upper.d, ((i < 0 || i >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[i])); } okdown = !((l === m)) || inclusive && ((i + 1 >> 0) === lower.nd); okup = !((m === u)) && (inclusive || (m + 1 << 24 >>> 24) < u || (i + 1 >> 0) < upper.nd); if (okdown && okup) { d.Round(i + 1 >> 0); return; } else if (okdown) { d.RoundDown(i + 1 >> 0); return; } else if (okup) { d.RoundUp(i + 1 >> 0); return; } i = i + (1) >> 0; } }; fmtE = function(dst, neg, d, prec, fmt) { var _q, _q$1, _q$2, _r, _r$1, _r$2, ch, d, dst, exp, fmt, i, m, neg, prec, x; if (neg) { dst = $append(dst, 45); } ch = 48; if (!((d.nd === 0))) { ch = (x = d.d, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); } dst = $append(dst, ch); if (prec > 0) { dst = $append(dst, 46); i = 1; m = min(d.nd, prec + 1 >> 0); if (i < m) { dst = $appendSlice(dst, $subslice(d.d, i, m)); i = m; } while (true) { if (!(i <= prec)) { break; } dst = $append(dst, 48); i = i + (1) >> 0; } } dst = $append(dst, fmt); exp = d.dp - 1 >> 0; if (d.nd === 0) { exp = 0; } if (exp < 0) { ch = 45; exp = -exp; } else { ch = 43; } dst = $append(dst, ch); if (exp < 10) { dst = $append(dst, 48, ((exp << 24 >>> 24)) + 48 << 24 >>> 24); } else if (exp < 100) { dst = $append(dst, (((_q = exp / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (((_r = exp % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); } else { dst = $append(dst, (((_q$1 = exp / 100, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24, (_r$1 = (((_q$2 = exp / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, (((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24)) + 48 << 24 >>> 24); } return dst; }; fmtF = function(dst, neg, d, prec) { var ch, d, dst, i, j, m, neg, prec, x; if (neg) { dst = $append(dst, 45); } if (d.dp > 0) { m = min(d.nd, d.dp); dst = $appendSlice(dst, $subslice(d.d, 0, m)); while (true) { if (!(m < d.dp)) { break; } dst = $append(dst, 48); m = m + (1) >> 0; } } else { dst = $append(dst, 48); } if (prec > 0) { dst = $append(dst, 46); i = 0; while (true) { if (!(i < prec)) { break; } ch = 48; j = d.dp + i >> 0; if (0 <= j && j < d.nd) { ch = (x = d.d, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])); } dst = $append(dst, ch); i = i + (1) >> 0; } } return dst; }; fmtB = function(dst, neg, mant, exp, flt) { var _tuple, _tuple$1, dst, exp, flt, mant, neg; if (neg) { dst = $append(dst, 45); } _tuple = formatBits(dst, mant, 10, false, true); dst = _tuple[0]; dst = $append(dst, 112); exp = exp - (((flt.mantbits >> 0))) >> 0; if (exp >= 0) { dst = $append(dst, 43); } _tuple$1 = formatBits(dst, (new $Uint64(0, exp)), 10, exp < 0, true); dst = _tuple$1[0]; return dst; }; min = function(a, b) { var a, b; if (a < b) { return a; } return b; }; max = function(a, b) { var a, b; if (a > b) { return a; } return b; }; FormatInt = function(i, base) { var _tuple, base, i, s; if (true && (0 < i.$high || (0 === i.$high && 0 <= i.$low)) && (i.$high < 0 || (i.$high === 0 && i.$low < 100)) && (base === 10)) { return small((((i.$low + ((i.$high >> 31) * 4294967296)) >> 0))); } _tuple = formatBits(sliceType$6.nil, (new $Uint64(i.$high, i.$low)), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), false); s = _tuple[1]; return s; }; $pkg.FormatInt = FormatInt; Itoa = function(i) { var i; return FormatInt((new $Int64(0, i)), 10); }; $pkg.Itoa = Itoa; small = function(i) { var i; if (i < 10) { return $substring("0123456789abcdefghijklmnopqrstuvwxyz", i, (i + 1 >> 0)); } return $substring("00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899", ($imul(i, 2)), (($imul(i, 2)) + 2 >> 0)); }; formatBits = function(dst, u, base, neg, append_) { var _q, _q$1, _r, _r$1, a, append_, b, b$1, base, d, dst, i, is, is$1, is$2, j, m, neg, q, q$1, s, shift, u, us, us$1, x, x$1, x$2, x$3, x$4, x$5; d = sliceType$6.nil; s = ""; if (base < 2 || base > 36) { $panic(new $String("strconv: illegal AppendInt/FormatInt base")); } a = arrayType$3.zero(); i = 65; if (neg) { u = new $Uint64(-u.$high, -u.$low); } if (base === 10) { if (true) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 1000000000)))) { break; } q = $div64(u, new $Uint64(0, 1000000000), false); us = (((x = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(u.$high - x.$high, u.$low - x.$low)).$low >>> 0)); j = 4; while (true) { if (!(j > 0)) { break; } is = (_r = us % 100, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; us = (_q = us / (100), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); i = i - (2) >> 0; (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$1] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 1 >>> 0)))); (x$2 = i + 0 >> 0, ((x$2 < 0 || x$2 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$2] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is + 0 >>> 0)))); j = j - (1) >> 0; } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(((us * 2 >>> 0) + 1 >>> 0))); u = q; } } us$1 = ((u.$low >>> 0)); while (true) { if (!(us$1 >= 100)) { break; } is$1 = (_r$1 = us$1 % 100, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) * 2 >>> 0; us$1 = (_q$1 = us$1 / (100), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); i = i - (2) >> 0; (x$3 = i + 1 >> 0, ((x$3 < 0 || x$3 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$3] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 1 >>> 0)))); (x$4 = i + 0 >> 0, ((x$4 < 0 || x$4 >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[x$4] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$1 + 0 >>> 0)))); } is$2 = us$1 * 2 >>> 0; i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt((is$2 + 1 >>> 0))); if (us$1 >= 10) { i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899".charCodeAt(is$2)); } } else if (isPowerOfTwo(base)) { shift = (((bits.TrailingZeros(((base >>> 0))) >>> 0)) & 31) >>> 0; b = (new $Uint64(0, base)); m = ((base >>> 0)) - 1 >>> 0; while (true) { if (!((u.$high > b.$high || (u.$high === b.$high && u.$low >= b.$low)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((((u.$low >>> 0)) & m) >>> 0))); u = $shiftRightUint64(u, (shift)); } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); } else { b$1 = (new $Uint64(0, base)); while (true) { if (!((u.$high > b$1.$high || (u.$high === b$1.$high && u.$low >= b$1.$low)))) { break; } i = i - (1) >> 0; q$1 = $div64(u, b$1, false); ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((x$5 = $mul64(q$1, b$1), new $Uint64(u.$high - x$5.$high, u.$low - x$5.$low)).$low >>> 0)))); u = q$1; } i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((u.$low >>> 0)))); } if (neg) { i = i - (1) >> 0; ((i < 0 || i >= a.length) ? ($throwRuntimeError("index out of range"), undefined) : a[i] = 45); } if (append_) { d = $appendSlice(dst, $subslice(new sliceType$6(a), i)); return [d, s]; } s = ($bytesToString($subslice(new sliceType$6(a), i))); return [d, s]; }; isPowerOfTwo = function(x) { var x; return (x & ((x - 1 >> 0))) === 0; }; quoteWith = function(s, quote, ASCIIonly, graphicOnly) { var ASCIIonly, _q, graphicOnly, quote, s; return ($bytesToString(appendQuotedWith($makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), s, quote, ASCIIonly, graphicOnly))); }; appendQuotedWith = function(buf, s, quote, ASCIIonly, graphicOnly) { var ASCIIonly, _tuple, buf, graphicOnly, quote, r, s, width; buf = $append(buf, quote); width = 0; while (true) { if (!(s.length > 0)) { break; } r = ((s.charCodeAt(0) >> 0)); width = 1; if (r >= 128) { _tuple = utf8.DecodeRuneInString(s); r = _tuple[0]; width = _tuple[1]; } if ((width === 1) && (r === 65533)) { buf = $appendSlice(buf, "\\x"); buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); s = $substring(s, width); continue; } buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); s = $substring(s, width); } buf = $append(buf, quote); return buf; }; appendQuotedRuneWith = function(buf, r, quote, ASCIIonly, graphicOnly) { var ASCIIonly, buf, graphicOnly, quote, r; buf = $append(buf, quote); if (!utf8.ValidRune(r)) { r = 65533; } buf = appendEscapedRune(buf, r, quote, ASCIIonly, graphicOnly); buf = $append(buf, quote); return buf; }; appendEscapedRune = function(buf, r, quote, ASCIIonly, graphicOnly) { var ASCIIonly, _1, buf, graphicOnly, n, quote, r, runeTmp, s, s$1; runeTmp = arrayType$4.zero(); if ((r === ((quote >> 0))) || (r === 92)) { buf = $append(buf, 92); buf = $append(buf, ((r << 24 >>> 24))); return buf; } if (ASCIIonly) { if (r < 128 && IsPrint(r)) { buf = $append(buf, ((r << 24 >>> 24))); return buf; } } else if (IsPrint(r) || graphicOnly && isInGraphicList(r)) { n = utf8.EncodeRune(new sliceType$6(runeTmp), r); buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n)); return buf; } _1 = r; if (_1 === (7)) { buf = $appendSlice(buf, "\\a"); } else if (_1 === (8)) { buf = $appendSlice(buf, "\\b"); } else if (_1 === (12)) { buf = $appendSlice(buf, "\\f"); } else if (_1 === (10)) { buf = $appendSlice(buf, "\\n"); } else if (_1 === (13)) { buf = $appendSlice(buf, "\\r"); } else if (_1 === (9)) { buf = $appendSlice(buf, "\\t"); } else if (_1 === (11)) { buf = $appendSlice(buf, "\\v"); } else { if (r < 32) { buf = $appendSlice(buf, "\\x"); buf = $append(buf, "0123456789abcdef".charCodeAt((((r << 24 >>> 24)) >>> 4 << 24 >>> 24))); buf = $append(buf, "0123456789abcdef".charCodeAt(((((r << 24 >>> 24)) & 15) >>> 0))); } else if (r > 1114111) { r = 65533; buf = $appendSlice(buf, "\\u"); s = 12; while (true) { if (!(s >= 0)) { break; } buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); s = s - (4) >> 0; } } else if (r < 65536) { buf = $appendSlice(buf, "\\u"); s = 12; while (true) { if (!(s >= 0)) { break; } buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s >>> 0)), 31)) >> 0) & 15))); s = s - (4) >> 0; } } else { buf = $appendSlice(buf, "\\U"); s$1 = 28; while (true) { if (!(s$1 >= 0)) { break; } buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min(((s$1 >>> 0)), 31)) >> 0) & 15))); s$1 = s$1 - (4) >> 0; } } } return buf; }; Quote = function(s) { var s; return quoteWith(s, 34, false, false); }; $pkg.Quote = Quote; AppendQuote = function(dst, s) { var dst, s; return appendQuotedWith(dst, s, 34, false, false); }; $pkg.AppendQuote = AppendQuote; AppendQuoteToASCII = function(dst, s) { var dst, s; return appendQuotedWith(dst, s, 34, true, false); }; $pkg.AppendQuoteToASCII = AppendQuoteToASCII; AppendQuoteRune = function(dst, r) { var dst, r; return appendQuotedRuneWith(dst, r, 39, false, false); }; $pkg.AppendQuoteRune = AppendQuoteRune; AppendQuoteRuneToASCII = function(dst, r) { var dst, r; return appendQuotedRuneWith(dst, r, 39, true, false); }; $pkg.AppendQuoteRuneToASCII = AppendQuoteRuneToASCII; CanBackquote = function(s) { var _tuple, r, s, wid; while (true) { if (!(s.length > 0)) { break; } _tuple = utf8.DecodeRuneInString(s); r = _tuple[0]; wid = _tuple[1]; s = $substring(s, wid); if (wid > 1) { if (r === 65279) { return false; } continue; } if (r === 65533) { return false; } if ((r < 32 && !((r === 9))) || (r === 96) || (r === 127)) { return false; } } return true; }; $pkg.CanBackquote = CanBackquote; unhex = function(b) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, c, ok, v; v = 0; ok = false; c = ((b >> 0)); if (48 <= c && c <= 57) { _tmp = c - 48 >> 0; _tmp$1 = true; v = _tmp; ok = _tmp$1; return [v, ok]; } else if (97 <= c && c <= 102) { _tmp$2 = (c - 97 >> 0) + 10 >> 0; _tmp$3 = true; v = _tmp$2; ok = _tmp$3; return [v, ok]; } else if (65 <= c && c <= 70) { _tmp$4 = (c - 65 >> 0) + 10 >> 0; _tmp$5 = true; v = _tmp$4; ok = _tmp$5; return [v, ok]; } return [v, ok]; }; UnquoteChar = function(s, quote) { var _1, _2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, c, c$1, err, j, j$1, multibyte, n, ok, quote, r, s, size, tail, v, v$1, value, x, x$1; value = 0; multibyte = false; tail = ""; err = $ifaceNil; if (s.length === 0) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } c = s.charCodeAt(0); if ((c === quote) && ((quote === 39) || (quote === 34))) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } else if (c >= 128) { _tuple = utf8.DecodeRuneInString(s); r = _tuple[0]; size = _tuple[1]; _tmp = r; _tmp$1 = true; _tmp$2 = $substring(s, size); _tmp$3 = $ifaceNil; value = _tmp; multibyte = _tmp$1; tail = _tmp$2; err = _tmp$3; return [value, multibyte, tail, err]; } else if (!((c === 92))) { _tmp$4 = ((s.charCodeAt(0) >> 0)); _tmp$5 = false; _tmp$6 = $substring(s, 1); _tmp$7 = $ifaceNil; value = _tmp$4; multibyte = _tmp$5; tail = _tmp$6; err = _tmp$7; return [value, multibyte, tail, err]; } if (s.length <= 1) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } c$1 = s.charCodeAt(1); s = $substring(s, 2); switch (0) { default: _1 = c$1; if (_1 === (97)) { value = 7; } else if (_1 === (98)) { value = 8; } else if (_1 === (102)) { value = 12; } else if (_1 === (110)) { value = 10; } else if (_1 === (114)) { value = 13; } else if (_1 === (116)) { value = 9; } else if (_1 === (118)) { value = 11; } else if ((_1 === (120)) || (_1 === (117)) || (_1 === (85))) { n = 0; _2 = c$1; if (_2 === (120)) { n = 2; } else if (_2 === (117)) { n = 4; } else if (_2 === (85)) { n = 8; } v = 0; if (s.length < n) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } j = 0; while (true) { if (!(j < n)) { break; } _tuple$1 = unhex(s.charCodeAt(j)); x = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } v = (v << 4 >> 0) | x; j = j + (1) >> 0; } s = $substring(s, n); if (c$1 === 120) { value = v; break; } if (v > 1114111) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } value = v; multibyte = true; } else if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55))) { v$1 = ((c$1 >> 0)) - 48 >> 0; if (s.length < 2) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } j$1 = 0; while (true) { if (!(j$1 < 2)) { break; } x$1 = ((s.charCodeAt(j$1) >> 0)) - 48 >> 0; if (x$1 < 0 || x$1 > 7) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } v$1 = ((v$1 << 3 >> 0)) | x$1; j$1 = j$1 + (1) >> 0; } s = $substring(s, 2); if (v$1 > 255) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } value = v$1; } else if (_1 === (92)) { value = 92; } else if ((_1 === (39)) || (_1 === (34))) { if (!((c$1 === quote))) { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } value = ((c$1 >> 0)); } else { err = $pkg.ErrSyntax; return [value, multibyte, tail, err]; } } tail = s; return [value, multibyte, tail, err]; }; $pkg.UnquoteChar = UnquoteChar; Unquote = function(s) { var _1, _q, _tuple, _tuple$1, buf, buf$1, c, err, i, multibyte, n, n$1, quote, r, runeTmp, s, size, ss; n = s.length; if (n < 2) { return ["", $pkg.ErrSyntax]; } quote = s.charCodeAt(0); if (!((quote === s.charCodeAt((n - 1 >> 0))))) { return ["", $pkg.ErrSyntax]; } s = $substring(s, 1, (n - 1 >> 0)); if (quote === 96) { if (contains(s, 96)) { return ["", $pkg.ErrSyntax]; } if (contains(s, 13)) { buf = $makeSlice(sliceType$6, 0, (s.length - 1 >> 0)); i = 0; while (true) { if (!(i < s.length)) { break; } if (!((s.charCodeAt(i) === 13))) { buf = $append(buf, s.charCodeAt(i)); } i = i + (1) >> 0; } return [($bytesToString(buf)), $ifaceNil]; } return [s, $ifaceNil]; } if (!((quote === 34)) && !((quote === 39))) { return ["", $pkg.ErrSyntax]; } if (contains(s, 10)) { return ["", $pkg.ErrSyntax]; } if (!contains(s, 92) && !contains(s, quote)) { _1 = quote; if (_1 === (34)) { if (utf8.ValidString(s)) { return [s, $ifaceNil]; } } else if (_1 === (39)) { _tuple = utf8.DecodeRuneInString(s); r = _tuple[0]; size = _tuple[1]; if ((size === s.length) && (!((r === 65533)) || !((size === 1)))) { return [s, $ifaceNil]; } } } runeTmp = arrayType$4.zero(); buf$1 = $makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); while (true) { if (!(s.length > 0)) { break; } _tuple$1 = UnquoteChar(s, quote); c = _tuple$1[0]; multibyte = _tuple$1[1]; ss = _tuple$1[2]; err = _tuple$1[3]; if (!($interfaceIsEqual(err, $ifaceNil))) { return ["", err]; } s = ss; if (c < 128 || !multibyte) { buf$1 = $append(buf$1, ((c << 24 >>> 24))); } else { n$1 = utf8.EncodeRune(new sliceType$6(runeTmp), c); buf$1 = $appendSlice(buf$1, $subslice(new sliceType$6(runeTmp), 0, n$1)); } if ((quote === 39) && !((s.length === 0))) { return ["", $pkg.ErrSyntax]; } } return [($bytesToString(buf$1)), $ifaceNil]; }; $pkg.Unquote = Unquote; contains = function(s, c) { var c, i, s; i = 0; while (true) { if (!(i < s.length)) { break; } if (s.charCodeAt(i) === c) { return true; } i = i + (1) >> 0; } return false; }; bsearch16 = function(a, x) { var _q, _tmp, _tmp$1, a, h, i, j, x; _tmp = 0; _tmp$1 = a.$length; i = _tmp; j = _tmp$1; while (true) { if (!(i < j)) { break; } h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { i = h + 1 >> 0; } else { j = h; } } return i; }; bsearch32 = function(a, x) { var _q, _tmp, _tmp$1, a, h, i, j, x; _tmp = 0; _tmp$1 = a.$length; i = _tmp; j = _tmp$1; while (true) { if (!(i < j)) { break; } h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; if (((h < 0 || h >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + h]) < x) { i = h + 1 >> 0; } else { j = h; } } return i; }; IsPrint = function(r) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, i, i$1, isNotPrint, isNotPrint$1, isPrint, isPrint$1, j, j$1, r, rr, rr$1, x, x$1, x$2, x$3; if (r <= 255) { if (32 <= r && r <= 126) { return true; } if (161 <= r && r <= 255) { return !((r === 173)); } return false; } if (0 <= r && r < 65536) { _tmp = ((r << 16 >>> 16)); _tmp$1 = isPrint16; _tmp$2 = isNotPrint16; rr = _tmp; isPrint = _tmp$1; isNotPrint = _tmp$2; i = bsearch16(isPrint, rr); if (i >= isPrint.$length || rr < (x = (i & ~1) >> 0, ((x < 0 || x >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint.$array[isPrint.$offset + x])) || (x$1 = i | 1, ((x$1 < 0 || x$1 >= isPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint.$array[isPrint.$offset + x$1])) < rr) { return false; } j = bsearch16(isNotPrint, rr); return j >= isNotPrint.$length || !((((j < 0 || j >= isNotPrint.$length) ? ($throwRuntimeError("index out of range"), undefined) : isNotPrint.$array[isNotPrint.$offset + j]) === rr)); } _tmp$3 = ((r >>> 0)); _tmp$4 = isPrint32; _tmp$5 = isNotPrint32; rr$1 = _tmp$3; isPrint$1 = _tmp$4; isNotPrint$1 = _tmp$5; i$1 = bsearch32(isPrint$1, rr$1); if (i$1 >= isPrint$1.$length || rr$1 < (x$2 = (i$1 & ~1) >> 0, ((x$2 < 0 || x$2 >= isPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint$1.$array[isPrint$1.$offset + x$2])) || (x$3 = i$1 | 1, ((x$3 < 0 || x$3 >= isPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isPrint$1.$array[isPrint$1.$offset + x$3])) < rr$1) { return false; } if (r >= 131072) { return true; } r = r - (65536) >> 0; j$1 = bsearch16(isNotPrint$1, ((r << 16 >>> 16))); return j$1 >= isNotPrint$1.$length || !((((j$1 < 0 || j$1 >= isNotPrint$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : isNotPrint$1.$array[isNotPrint$1.$offset + j$1]) === ((r << 16 >>> 16)))); }; $pkg.IsPrint = IsPrint; isInGraphicList = function(r) { var i, r, rr; if (r > 65535) { return false; } rr = ((r << 16 >>> 16)); i = bsearch16(isGraphic, rr); return i < isGraphic.$length && (rr === ((i < 0 || i >= isGraphic.$length) ? ($throwRuntimeError("index out of range"), undefined) : isGraphic.$array[isGraphic.$offset + i])); }; ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$2.methods = [{prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Assign", name: "Assign", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "Shift", name: "Shift", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundDown", name: "RoundDown", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundUp", name: "RoundUp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundedInteger", name: "RoundedInteger", pkg: "", typ: $funcType([], [$Uint64], false)}]; ptrType$4.methods = [{prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "AssignComputeBounds", name: "AssignComputeBounds", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, ptrType$1], [extFloat, extFloat], false)}, {prop: "Normalize", name: "Normalize", pkg: "", typ: $funcType([], [$Uint], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([extFloat], [], false)}, {prop: "AssignDecimal", name: "AssignDecimal", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, $Bool, ptrType$1], [$Bool], false)}, {prop: "frexp10", name: "frexp10", pkg: "strconv", typ: $funcType([], [$Int, $Int], false)}, {prop: "FixedDecimal", name: "FixedDecimal", pkg: "", typ: $funcType([ptrType$3, $Int], [$Bool], false)}, {prop: "ShortestDecimal", name: "ShortestDecimal", pkg: "", typ: $funcType([ptrType$3, ptrType$4, ptrType$4], [$Bool], false)}]; NumError.init("", [{prop: "Func", name: "Func", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Num", name: "Num", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); decimal.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: arrayType, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", embedded: false, exported: false, typ: $Bool, tag: ""}]); leftCheat.init("strconv", [{prop: "delta", name: "delta", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", embedded: false, exported: false, typ: $String, tag: ""}]); extFloat.init("strconv", [{prop: "mant", name: "mant", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "exp", name: "exp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}]); floatInfo.init("strconv", [{prop: "mantbits", name: "mantbits", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "expbits", name: "expbits", embedded: false, exported: false, typ: $Uint, tag: ""}, {prop: "bias", name: "bias", embedded: false, exported: false, typ: $Int, tag: ""}]); decimalSlice.init("strconv", [{prop: "d", name: "d", embedded: false, exported: false, typ: sliceType$6, tag: ""}, {prop: "nd", name: "nd", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "dp", name: "dp", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "neg", name: "neg", embedded: false, exported: false, typ: $Bool, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bits.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } optimize = true; powtab = new sliceType([1, 3, 6, 9, 13, 16, 19, 23, 26]); float64pow10 = new sliceType$1([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 1e+21, 1e+22]); float32pow10 = new sliceType$2([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10]); $pkg.ErrRange = errors.New("value out of range"); $pkg.ErrSyntax = errors.New("invalid syntax"); leftcheats = new sliceType$3([new leftCheat.ptr(0, ""), new leftCheat.ptr(1, "5"), new leftCheat.ptr(1, "25"), new leftCheat.ptr(1, "125"), new leftCheat.ptr(2, "625"), new leftCheat.ptr(2, "3125"), new leftCheat.ptr(2, "15625"), new leftCheat.ptr(3, "78125"), new leftCheat.ptr(3, "390625"), new leftCheat.ptr(3, "1953125"), new leftCheat.ptr(4, "9765625"), new leftCheat.ptr(4, "48828125"), new leftCheat.ptr(4, "244140625"), new leftCheat.ptr(4, "1220703125"), new leftCheat.ptr(5, "6103515625"), new leftCheat.ptr(5, "30517578125"), new leftCheat.ptr(5, "152587890625"), new leftCheat.ptr(6, "762939453125"), new leftCheat.ptr(6, "3814697265625"), new leftCheat.ptr(6, "19073486328125"), new leftCheat.ptr(7, "95367431640625"), new leftCheat.ptr(7, "476837158203125"), new leftCheat.ptr(7, "2384185791015625"), new leftCheat.ptr(7, "11920928955078125"), new leftCheat.ptr(8, "59604644775390625"), new leftCheat.ptr(8, "298023223876953125"), new leftCheat.ptr(8, "1490116119384765625"), new leftCheat.ptr(9, "7450580596923828125"), new leftCheat.ptr(9, "37252902984619140625"), new leftCheat.ptr(9, "186264514923095703125"), new leftCheat.ptr(10, "931322574615478515625"), new leftCheat.ptr(10, "4656612873077392578125"), new leftCheat.ptr(10, "23283064365386962890625"), new leftCheat.ptr(10, "116415321826934814453125"), new leftCheat.ptr(11, "582076609134674072265625"), new leftCheat.ptr(11, "2910383045673370361328125"), new leftCheat.ptr(11, "14551915228366851806640625"), new leftCheat.ptr(12, "72759576141834259033203125"), new leftCheat.ptr(12, "363797880709171295166015625"), new leftCheat.ptr(12, "1818989403545856475830078125"), new leftCheat.ptr(13, "9094947017729282379150390625"), new leftCheat.ptr(13, "45474735088646411895751953125"), new leftCheat.ptr(13, "227373675443232059478759765625"), new leftCheat.ptr(13, "1136868377216160297393798828125"), new leftCheat.ptr(14, "5684341886080801486968994140625"), new leftCheat.ptr(14, "28421709430404007434844970703125"), new leftCheat.ptr(14, "142108547152020037174224853515625"), new leftCheat.ptr(15, "710542735760100185871124267578125"), new leftCheat.ptr(15, "3552713678800500929355621337890625"), new leftCheat.ptr(15, "17763568394002504646778106689453125"), new leftCheat.ptr(16, "88817841970012523233890533447265625"), new leftCheat.ptr(16, "444089209850062616169452667236328125"), new leftCheat.ptr(16, "2220446049250313080847263336181640625"), new leftCheat.ptr(16, "11102230246251565404236316680908203125"), new leftCheat.ptr(17, "55511151231257827021181583404541015625"), new leftCheat.ptr(17, "277555756156289135105907917022705078125"), new leftCheat.ptr(17, "1387778780781445675529539585113525390625"), new leftCheat.ptr(18, "6938893903907228377647697925567626953125"), new leftCheat.ptr(18, "34694469519536141888238489627838134765625"), new leftCheat.ptr(18, "173472347597680709441192448139190673828125"), new leftCheat.ptr(19, "867361737988403547205962240695953369140625")]); smallPowersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(2147483648, 0), -63, false), new extFloat.ptr(new $Uint64(2684354560, 0), -60, false), new extFloat.ptr(new $Uint64(3355443200, 0), -57, false), new extFloat.ptr(new $Uint64(4194304000, 0), -54, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3276800000, 0), -47, false), new extFloat.ptr(new $Uint64(4096000000, 0), -44, false), new extFloat.ptr(new $Uint64(2560000000, 0), -40, false)]); powersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(4203730336, 136053384), -1220, false), new extFloat.ptr(new $Uint64(3132023167, 2722021238), -1193, false), new extFloat.ptr(new $Uint64(2333539104, 810921078), -1166, false), new extFloat.ptr(new $Uint64(3477244234, 1573795306), -1140, false), new extFloat.ptr(new $Uint64(2590748842, 1432697645), -1113, false), new extFloat.ptr(new $Uint64(3860516611, 1025131999), -1087, false), new extFloat.ptr(new $Uint64(2876309015, 3348809418), -1060, false), new extFloat.ptr(new $Uint64(4286034428, 3200048207), -1034, false), new extFloat.ptr(new $Uint64(3193344495, 1097586188), -1007, false), new extFloat.ptr(new $Uint64(2379227053, 2424306748), -980, false), new extFloat.ptr(new $Uint64(3545324584, 827693699), -954, false), new extFloat.ptr(new $Uint64(2641472655, 2913388981), -927, false), new extFloat.ptr(new $Uint64(3936100983, 602835915), -901, false), new extFloat.ptr(new $Uint64(2932623761, 1081627501), -874, false), new extFloat.ptr(new $Uint64(2184974969, 1572261463), -847, false), new extFloat.ptr(new $Uint64(3255866422, 1308317239), -821, false), new extFloat.ptr(new $Uint64(2425809519, 944281679), -794, false), new extFloat.ptr(new $Uint64(3614737867, 629291719), -768, false), new extFloat.ptr(new $Uint64(2693189581, 2545915892), -741, false), new extFloat.ptr(new $Uint64(4013165208, 388672741), -715, false), new extFloat.ptr(new $Uint64(2990041083, 708162190), -688, false), new extFloat.ptr(new $Uint64(2227754207, 3536207675), -661, false), new extFloat.ptr(new $Uint64(3319612455, 450088378), -635, false), new extFloat.ptr(new $Uint64(2473304014, 3139815830), -608, false), new extFloat.ptr(new $Uint64(3685510180, 2103616900), -582, false), new extFloat.ptr(new $Uint64(2745919064, 224385782), -555, false), new extFloat.ptr(new $Uint64(4091738259, 3737383206), -529, false), new extFloat.ptr(new $Uint64(3048582568, 2868871352), -502, false), new extFloat.ptr(new $Uint64(2271371013, 1820084875), -475, false), new extFloat.ptr(new $Uint64(3384606560, 885076051), -449, false), new extFloat.ptr(new $Uint64(2521728396, 2444895829), -422, false), new extFloat.ptr(new $Uint64(3757668132, 1881767613), -396, false), new extFloat.ptr(new $Uint64(2799680927, 3102062735), -369, false), new extFloat.ptr(new $Uint64(4171849679, 2289335700), -343, false), new extFloat.ptr(new $Uint64(3108270227, 2410191823), -316, false), new extFloat.ptr(new $Uint64(2315841784, 3205436779), -289, false), new extFloat.ptr(new $Uint64(3450873173, 1697722806), -263, false), new extFloat.ptr(new $Uint64(2571100870, 3497754540), -236, false), new extFloat.ptr(new $Uint64(3831238852, 707476230), -210, false), new extFloat.ptr(new $Uint64(2854495385, 1769181907), -183, false), new extFloat.ptr(new $Uint64(4253529586, 2197867022), -157, false), new extFloat.ptr(new $Uint64(3169126500, 2450594539), -130, false), new extFloat.ptr(new $Uint64(2361183241, 1867548876), -103, false), new extFloat.ptr(new $Uint64(3518437208, 3793315116), -77, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3906250000, 0), -24, false), new extFloat.ptr(new $Uint64(2910383045, 2892103680), 3, false), new extFloat.ptr(new $Uint64(2168404344, 4170451332), 30, false), new extFloat.ptr(new $Uint64(3231174267, 3372684723), 56, false), new extFloat.ptr(new $Uint64(2407412430, 2078956656), 83, false), new extFloat.ptr(new $Uint64(3587324068, 2884206696), 109, false), new extFloat.ptr(new $Uint64(2672764710, 395977285), 136, false), new extFloat.ptr(new $Uint64(3982729777, 3569679143), 162, false), new extFloat.ptr(new $Uint64(2967364920, 2361961896), 189, false), new extFloat.ptr(new $Uint64(2210859150, 447440347), 216, false), new extFloat.ptr(new $Uint64(3294436857, 1114709402), 242, false), new extFloat.ptr(new $Uint64(2454546732, 2786846552), 269, false), new extFloat.ptr(new $Uint64(3657559652, 443583978), 295, false), new extFloat.ptr(new $Uint64(2725094297, 2599384906), 322, false), new extFloat.ptr(new $Uint64(4060706939, 3028118405), 348, false), new extFloat.ptr(new $Uint64(3025462433, 2044532855), 375, false), new extFloat.ptr(new $Uint64(2254145170, 1536935362), 402, false), new extFloat.ptr(new $Uint64(3358938053, 3365297469), 428, false), new extFloat.ptr(new $Uint64(2502603868, 4204241075), 455, false), new extFloat.ptr(new $Uint64(3729170365, 2577424355), 481, false), new extFloat.ptr(new $Uint64(2778448436, 3677981733), 508, false), new extFloat.ptr(new $Uint64(4140210802, 2744688476), 534, false), new extFloat.ptr(new $Uint64(3084697427, 1424604878), 561, false), new extFloat.ptr(new $Uint64(2298278679, 4062331362), 588, false), new extFloat.ptr(new $Uint64(3424702107, 3546052773), 614, false), new extFloat.ptr(new $Uint64(2551601907, 2065781727), 641, false), new extFloat.ptr(new $Uint64(3802183132, 2535403578), 667, false), new extFloat.ptr(new $Uint64(2832847187, 1558426518), 694, false), new extFloat.ptr(new $Uint64(4221271257, 2762425404), 720, false), new extFloat.ptr(new $Uint64(3145092172, 2812560400), 747, false), new extFloat.ptr(new $Uint64(2343276271, 3057687578), 774, false), new extFloat.ptr(new $Uint64(3491753744, 2790753324), 800, false), new extFloat.ptr(new $Uint64(2601559269, 3918606633), 827, false), new extFloat.ptr(new $Uint64(3876625403, 2711358621), 853, false), new extFloat.ptr(new $Uint64(2888311001, 1648096297), 880, false), new extFloat.ptr(new $Uint64(2151959390, 2057817989), 907, false), new extFloat.ptr(new $Uint64(3206669376, 61660461), 933, false), new extFloat.ptr(new $Uint64(2389154863, 1581580175), 960, false), new extFloat.ptr(new $Uint64(3560118173, 2626467905), 986, false), new extFloat.ptr(new $Uint64(2652494738, 3034782633), 1013, false), new extFloat.ptr(new $Uint64(3952525166, 3135207385), 1039, false), new extFloat.ptr(new $Uint64(2944860731, 2616258155), 1066, false)]); uint64pow10 = $toNativeArray($kindUint64, [new $Uint64(0, 1), new $Uint64(0, 10), new $Uint64(0, 100), new $Uint64(0, 1000), new $Uint64(0, 10000), new $Uint64(0, 100000), new $Uint64(0, 1000000), new $Uint64(0, 10000000), new $Uint64(0, 100000000), new $Uint64(0, 1000000000), new $Uint64(2, 1410065408), new $Uint64(23, 1215752192), new $Uint64(232, 3567587328), new $Uint64(2328, 1316134912), new $Uint64(23283, 276447232), new $Uint64(232830, 2764472320), new $Uint64(2328306, 1874919424), new $Uint64(23283064, 1569325056), new $Uint64(232830643, 2808348672), new $Uint64(2328306436, 2313682944)]); float32info = new floatInfo.ptr(23, 8, -127); float64info = new floatInfo.ptr(52, 11, -1023); isPrint16 = new sliceType$4([32, 126, 161, 887, 890, 895, 900, 1366, 1369, 1418, 1421, 1479, 1488, 1514, 1520, 1524, 1542, 1563, 1566, 1805, 1808, 1866, 1869, 1969, 1984, 2042, 2048, 2093, 2096, 2139, 2142, 2154, 2208, 2237, 2260, 2444, 2447, 2448, 2451, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2531, 2534, 2557, 2561, 2570, 2575, 2576, 2579, 2617, 2620, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2654, 2662, 2677, 2689, 2745, 2748, 2765, 2768, 2768, 2784, 2787, 2790, 2801, 2809, 2828, 2831, 2832, 2835, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2915, 2918, 2935, 2946, 2954, 2958, 2965, 2969, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3021, 3024, 3024, 3031, 3031, 3046, 3066, 3072, 3129, 3133, 3149, 3157, 3162, 3168, 3171, 3174, 3183, 3192, 3257, 3260, 3277, 3285, 3286, 3294, 3299, 3302, 3314, 3328, 3407, 3412, 3427, 3430, 3455, 3458, 3478, 3482, 3517, 3520, 3526, 3530, 3530, 3535, 3551, 3558, 3567, 3570, 3572, 3585, 3642, 3647, 3675, 3713, 3716, 3719, 3722, 3725, 3725, 3732, 3751, 3754, 3773, 3776, 3789, 3792, 3801, 3804, 3807, 3840, 3948, 3953, 4058, 4096, 4295, 4301, 4301, 4304, 4685, 4688, 4701, 4704, 4749, 4752, 4789, 4792, 4805, 4808, 4885, 4888, 4954, 4957, 4988, 4992, 5017, 5024, 5109, 5112, 5117, 5120, 5788, 5792, 5880, 5888, 5908, 5920, 5942, 5952, 5971, 5984, 6003, 6016, 6109, 6112, 6121, 6128, 6137, 6144, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6443, 6448, 6459, 6464, 6464, 6468, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6622, 6683, 6686, 6780, 6783, 6793, 6800, 6809, 6816, 6829, 6832, 6846, 6912, 6987, 6992, 7036, 7040, 7155, 7164, 7223, 7227, 7241, 7245, 7304, 7360, 7367, 7376, 7417, 7424, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8061, 8064, 8147, 8150, 8175, 8178, 8190, 8208, 8231, 8240, 8286, 8304, 8305, 8308, 8348, 8352, 8383, 8400, 8432, 8448, 8587, 8592, 9254, 9280, 9290, 9312, 11123, 11126, 11157, 11160, 11193, 11197, 11218, 11244, 11247, 11264, 11507, 11513, 11559, 11565, 11565, 11568, 11623, 11631, 11632, 11647, 11670, 11680, 11849, 11904, 12019, 12032, 12245, 12272, 12283, 12289, 12438, 12441, 12543, 12549, 12590, 12593, 12730, 12736, 12771, 12784, 19893, 19904, 40938, 40960, 42124, 42128, 42182, 42192, 42539, 42560, 42743, 42752, 42935, 42999, 43051, 43056, 43065, 43072, 43127, 43136, 43205, 43214, 43225, 43232, 43261, 43264, 43347, 43359, 43388, 43392, 43481, 43486, 43574, 43584, 43597, 43600, 43609, 43612, 43714, 43739, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43877, 43888, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64449, 64467, 64831, 64848, 64911, 64914, 64967, 65008, 65021, 65024, 65049, 65056, 65131, 65136, 65276, 65281, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65504, 65518, 65532, 65533]); isNotPrint16 = new sliceType$4([173, 907, 909, 930, 1328, 1376, 1416, 1424, 1757, 2111, 2143, 2229, 2274, 2436, 2473, 2481, 2526, 2564, 2601, 2609, 2612, 2615, 2621, 2653, 2692, 2702, 2706, 2729, 2737, 2740, 2758, 2762, 2816, 2820, 2857, 2865, 2868, 2910, 2948, 2961, 2971, 2973, 3017, 3076, 3085, 3089, 3113, 3141, 3145, 3159, 3204, 3213, 3217, 3241, 3252, 3269, 3273, 3295, 3312, 3332, 3341, 3345, 3397, 3401, 3460, 3506, 3516, 3541, 3543, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3770, 3781, 3783, 3912, 3992, 4029, 4045, 4294, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6001, 6431, 6751, 7674, 8024, 8026, 8028, 8030, 8117, 8133, 8156, 8181, 8335, 11209, 11311, 11359, 11558, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 11743, 11930, 12352, 12687, 12831, 13055, 42927, 43470, 43519, 43815, 43823, 64311, 64317, 64319, 64322, 64325, 65107, 65127, 65141, 65511]); isPrint32 = new sliceType$5([65536, 65613, 65616, 65629, 65664, 65786, 65792, 65794, 65799, 65843, 65847, 65947, 65952, 65952, 66000, 66045, 66176, 66204, 66208, 66256, 66272, 66299, 66304, 66339, 66349, 66378, 66384, 66426, 66432, 66499, 66504, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66927, 66927, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67640, 67644, 67644, 67647, 67742, 67751, 67759, 67808, 67829, 67835, 67867, 67871, 67897, 67903, 67903, 67968, 68023, 68028, 68047, 68050, 68102, 68108, 68147, 68152, 68154, 68159, 68167, 68176, 68184, 68192, 68255, 68288, 68326, 68331, 68342, 68352, 68405, 68409, 68437, 68440, 68466, 68472, 68497, 68505, 68508, 68521, 68527, 68608, 68680, 68736, 68786, 68800, 68850, 68858, 68863, 69216, 69246, 69632, 69709, 69714, 69743, 69759, 69825, 69840, 69864, 69872, 69881, 69888, 69955, 69968, 70006, 70016, 70093, 70096, 70132, 70144, 70206, 70272, 70313, 70320, 70378, 70384, 70393, 70400, 70412, 70415, 70416, 70419, 70457, 70460, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70749, 70784, 70855, 70864, 70873, 71040, 71093, 71096, 71133, 71168, 71236, 71248, 71257, 71264, 71276, 71296, 71351, 71360, 71369, 71424, 71449, 71453, 71467, 71472, 71487, 71840, 71922, 71935, 71935, 72192, 72263, 72272, 72323, 72326, 72354, 72384, 72440, 72704, 72773, 72784, 72812, 72816, 72847, 72850, 72886, 72960, 73014, 73018, 73031, 73040, 73049, 73728, 74649, 74752, 74868, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92777, 92782, 92783, 92880, 92909, 92912, 92917, 92928, 92997, 93008, 93047, 93053, 93071, 93952, 94020, 94032, 94078, 94095, 94111, 94176, 94177, 94208, 100332, 100352, 101106, 110592, 110878, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113820, 113823, 118784, 119029, 119040, 119078, 119081, 119154, 119163, 119272, 119296, 119365, 119552, 119638, 119648, 119665, 119808, 119967, 119970, 119970, 119973, 119974, 119977, 120074, 120077, 120134, 120138, 120485, 120488, 120779, 120782, 121483, 121499, 121519, 122880, 122904, 122907, 122922, 124928, 125124, 125127, 125142, 125184, 125258, 125264, 125273, 125278, 125279, 126464, 126500, 126503, 126523, 126530, 126530, 126535, 126548, 126551, 126564, 126567, 126619, 126625, 126651, 126704, 126705, 126976, 127019, 127024, 127123, 127136, 127150, 127153, 127221, 127232, 127244, 127248, 127339, 127344, 127404, 127462, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 128724, 128736, 128748, 128752, 128760, 128768, 128883, 128896, 128980, 129024, 129035, 129040, 129095, 129104, 129113, 129120, 129159, 129168, 129197, 129280, 129291, 129296, 129356, 129360, 129387, 129408, 129431, 129472, 129472, 129488, 129510, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]); isNotPrint32 = new sliceType$4([12, 39, 59, 62, 399, 926, 2057, 2102, 2134, 2291, 2564, 2580, 2584, 4285, 4405, 4576, 4626, 4743, 4745, 4750, 4766, 4868, 4905, 4913, 4916, 5210, 5212, 6813, 7177, 7223, 7336, 7431, 7434, 7483, 7486, 9327, 27231, 27482, 27490, 54357, 54429, 54445, 54458, 54460, 54468, 54534, 54549, 54557, 54586, 54591, 54597, 54609, 55968, 57351, 57378, 57381, 60932, 60960, 60963, 60968, 60979, 60984, 60986, 61000, 61002, 61004, 61008, 61011, 61016, 61018, 61020, 61022, 61024, 61027, 61035, 61043, 61048, 61053, 61055, 61066, 61092, 61098, 61632, 61648, 61743, 63807]); isGraphic = new sliceType$4([160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288]); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["reflect"] = (function() { var $pkg = {}, $init, errors, js, math, runtime, strconv, sync, unicode, utf8, uncommonType, funcType, name, nameData, mapIter, Type, Kind, tflag, rtype, typeAlg, method, ChanDir, arrayType, chanType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, nameOff, typeOff, textOff, StructField, StructTag, fieldScan, Value, flag, ValueError, StringHeader, SliceHeader, sliceType$1, ptrType$1, sliceType$2, sliceType$3, ptrType$2, funcType$1, sliceType$4, ptrType$3, ptrType$4, sliceType$5, sliceType$6, sliceType$7, ptrType$5, ptrType$6, structType$3, sliceType$8, sliceType$9, sliceType$10, sliceType$11, ptrType$7, ptrType$8, ptrType$9, sliceType$13, sliceType$14, ptrType$10, sliceType$15, ptrType$16, sliceType$17, funcType$3, funcType$4, funcType$5, ptrType$17, arrayType$12, ptrType$18, initialized, uncommonTypeMap, nameMap, nameOffList, typeOffList, callHelper, jsObjectPtr, selectHelper, kindNames, uint8Type, init, jsType, reflectType, setKindType, newName, newNameOff, newTypeOff, internalStr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, FuncOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiternext, maplen, cvtDirect, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, methodReceiver, PtrTo, implements$1, directlyAssignable, haveIdenticalType, haveIdenticalUnderlyingType, toType, ifaceIndir, overflowFloat32, New, convertOp, makeFloat, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; math = $packages["math"]; runtime = $packages["runtime"]; strconv = $packages["strconv"]; sync = $packages["sync"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflect.uncommonType", true, "reflect", false, function(pkgPath_, mcount_, xcount_, moff_, _methods_) { this.$val = this; if (arguments.length === 0) { this.pkgPath = 0; this.mcount = 0; this.xcount = 0; this.moff = 0; this._methods = sliceType$5.nil; return; } this.pkgPath = pkgPath_; this.mcount = mcount_; this.xcount = xcount_; this.moff = moff_; this._methods = _methods_; }); funcType = $pkg.funcType = $newType(0, $kindStruct, "reflect.funcType", true, "reflect", false, function(rtype_, inCount_, outCount_, _in_, _out_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.inCount = 0; this.outCount = 0; this._in = sliceType$2.nil; this._out = sliceType$2.nil; return; } this.rtype = rtype_; this.inCount = inCount_; this.outCount = outCount_; this._in = _in_; this._out = _out_; }); name = $pkg.name = $newType(0, $kindStruct, "reflect.name", true, "reflect", false, function(bytes_) { this.$val = this; if (arguments.length === 0) { this.bytes = ptrType$4.nil; return; } this.bytes = bytes_; }); nameData = $pkg.nameData = $newType(0, $kindStruct, "reflect.nameData", true, "reflect", false, function(name_, tag_, exported_) { this.$val = this; if (arguments.length === 0) { this.name = ""; this.tag = ""; this.exported = false; return; } this.name = name_; this.tag = tag_; this.exported = exported_; }); mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflect.mapIter", true, "reflect", false, function(t_, m_, keys_, i_) { this.$val = this; if (arguments.length === 0) { this.t = $ifaceNil; this.m = null; this.keys = null; this.i = 0; return; } this.t = t_; this.m = m_; this.keys = keys_; this.i = i_; }); Type = $pkg.Type = $newType(8, $kindInterface, "reflect.Type", true, "reflect", true, null); Kind = $pkg.Kind = $newType(4, $kindUint, "reflect.Kind", true, "reflect", true, null); tflag = $pkg.tflag = $newType(1, $kindUint8, "reflect.tflag", true, "reflect", false, null); rtype = $pkg.rtype = $newType(0, $kindStruct, "reflect.rtype", true, "reflect", false, function(size_, ptrdata_, hash_, tflag_, align_, fieldAlign_, kind_, alg_, gcdata_, str_, ptrToThis_) { this.$val = this; if (arguments.length === 0) { this.size = 0; this.ptrdata = 0; this.hash = 0; this.tflag = 0; this.align = 0; this.fieldAlign = 0; this.kind = 0; this.alg = ptrType$3.nil; this.gcdata = ptrType$4.nil; this.str = 0; this.ptrToThis = 0; return; } this.size = size_; this.ptrdata = ptrdata_; this.hash = hash_; this.tflag = tflag_; this.align = align_; this.fieldAlign = fieldAlign_; this.kind = kind_; this.alg = alg_; this.gcdata = gcdata_; this.str = str_; this.ptrToThis = ptrToThis_; }); typeAlg = $pkg.typeAlg = $newType(0, $kindStruct, "reflect.typeAlg", true, "reflect", false, function(hash_, equal_) { this.$val = this; if (arguments.length === 0) { this.hash = $throwNilPointerError; this.equal = $throwNilPointerError; return; } this.hash = hash_; this.equal = equal_; }); method = $pkg.method = $newType(0, $kindStruct, "reflect.method", true, "reflect", false, function(name_, mtyp_, ifn_, tfn_) { this.$val = this; if (arguments.length === 0) { this.name = 0; this.mtyp = 0; this.ifn = 0; this.tfn = 0; return; } this.name = name_; this.mtyp = mtyp_; this.ifn = ifn_; this.tfn = tfn_; }); ChanDir = $pkg.ChanDir = $newType(4, $kindInt, "reflect.ChanDir", true, "reflect", true, null); arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflect.arrayType", true, "reflect", false, function(rtype_, elem_, slice_, len_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.elem = ptrType$1.nil; this.slice = ptrType$1.nil; this.len = 0; return; } this.rtype = rtype_; this.elem = elem_; this.slice = slice_; this.len = len_; }); chanType = $pkg.chanType = $newType(0, $kindStruct, "reflect.chanType", true, "reflect", false, function(rtype_, elem_, dir_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.elem = ptrType$1.nil; this.dir = 0; return; } this.rtype = rtype_; this.elem = elem_; this.dir = dir_; }); imethod = $pkg.imethod = $newType(0, $kindStruct, "reflect.imethod", true, "reflect", false, function(name_, typ_) { this.$val = this; if (arguments.length === 0) { this.name = 0; this.typ = 0; return; } this.name = name_; this.typ = typ_; }); interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflect.interfaceType", true, "reflect", false, function(rtype_, pkgPath_, methods_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.pkgPath = new name.ptr(ptrType$4.nil); this.methods = sliceType$6.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.methods = methods_; }); mapType = $pkg.mapType = $newType(0, $kindStruct, "reflect.mapType", true, "reflect", false, function(rtype_, key_, elem_, bucket_, keysize_, indirectkey_, valuesize_, indirectvalue_, bucketsize_, reflexivekey_, needkeyupdate_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.key = ptrType$1.nil; this.elem = ptrType$1.nil; this.bucket = ptrType$1.nil; this.keysize = 0; this.indirectkey = 0; this.valuesize = 0; this.indirectvalue = 0; this.bucketsize = 0; this.reflexivekey = false; this.needkeyupdate = false; return; } this.rtype = rtype_; this.key = key_; this.elem = elem_; this.bucket = bucket_; this.keysize = keysize_; this.indirectkey = indirectkey_; this.valuesize = valuesize_; this.indirectvalue = indirectvalue_; this.bucketsize = bucketsize_; this.reflexivekey = reflexivekey_; this.needkeyupdate = needkeyupdate_; }); ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflect.ptrType", true, "reflect", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.elem = ptrType$1.nil; return; } this.rtype = rtype_; this.elem = elem_; }); sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflect.sliceType", true, "reflect", false, function(rtype_, elem_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.elem = ptrType$1.nil; return; } this.rtype = rtype_; this.elem = elem_; }); structField = $pkg.structField = $newType(0, $kindStruct, "reflect.structField", true, "reflect", false, function(name_, typ_, offsetEmbed_) { this.$val = this; if (arguments.length === 0) { this.name = new name.ptr(ptrType$4.nil); this.typ = ptrType$1.nil; this.offsetEmbed = 0; return; } this.name = name_; this.typ = typ_; this.offsetEmbed = offsetEmbed_; }); structType = $pkg.structType = $newType(0, $kindStruct, "reflect.structType", true, "reflect", false, function(rtype_, pkgPath_, fields_) { this.$val = this; if (arguments.length === 0) { this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); this.pkgPath = new name.ptr(ptrType$4.nil); this.fields = sliceType$7.nil; return; } this.rtype = rtype_; this.pkgPath = pkgPath_; this.fields = fields_; }); Method = $pkg.Method = $newType(0, $kindStruct, "reflect.Method", true, "reflect", true, function(Name_, PkgPath_, Type_, Func_, Index_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.PkgPath = ""; this.Type = $ifaceNil; this.Func = new Value.ptr(ptrType$1.nil, 0, 0); this.Index = 0; return; } this.Name = Name_; this.PkgPath = PkgPath_; this.Type = Type_; this.Func = Func_; this.Index = Index_; }); nameOff = $pkg.nameOff = $newType(4, $kindInt32, "reflect.nameOff", true, "reflect", false, null); typeOff = $pkg.typeOff = $newType(4, $kindInt32, "reflect.typeOff", true, "reflect", false, null); textOff = $pkg.textOff = $newType(4, $kindInt32, "reflect.textOff", true, "reflect", false, null); StructField = $pkg.StructField = $newType(0, $kindStruct, "reflect.StructField", true, "reflect", true, function(Name_, PkgPath_, Type_, Tag_, Offset_, Index_, Anonymous_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.PkgPath = ""; this.Type = $ifaceNil; this.Tag = ""; this.Offset = 0; this.Index = sliceType$13.nil; this.Anonymous = false; return; } this.Name = Name_; this.PkgPath = PkgPath_; this.Type = Type_; this.Tag = Tag_; this.Offset = Offset_; this.Index = Index_; this.Anonymous = Anonymous_; }); StructTag = $pkg.StructTag = $newType(8, $kindString, "reflect.StructTag", true, "reflect", true, null); fieldScan = $pkg.fieldScan = $newType(0, $kindStruct, "reflect.fieldScan", true, "reflect", false, function(typ_, index_) { this.$val = this; if (arguments.length === 0) { this.typ = ptrType$10.nil; this.index = sliceType$13.nil; return; } this.typ = typ_; this.index = index_; }); Value = $pkg.Value = $newType(0, $kindStruct, "reflect.Value", true, "reflect", true, function(typ_, ptr_, flag_) { this.$val = this; if (arguments.length === 0) { this.typ = ptrType$1.nil; this.ptr = 0; this.flag = 0; return; } this.typ = typ_; this.ptr = ptr_; this.flag = flag_; }); flag = $pkg.flag = $newType(4, $kindUintptr, "reflect.flag", true, "reflect", false, null); ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflect.ValueError", true, "reflect", true, function(Method_, Kind_) { this.$val = this; if (arguments.length === 0) { this.Method = ""; this.Kind = 0; return; } this.Method = Method_; this.Kind = Kind_; }); StringHeader = $pkg.StringHeader = $newType(0, $kindStruct, "reflect.StringHeader", true, "reflect", true, function(Data_, Len_) { this.$val = this; if (arguments.length === 0) { this.Data = 0; this.Len = 0; return; } this.Data = Data_; this.Len = Len_; }); SliceHeader = $pkg.SliceHeader = $newType(0, $kindStruct, "reflect.SliceHeader", true, "reflect", true, function(Data_, Len_, Cap_) { this.$val = this; if (arguments.length === 0) { this.Data = 0; this.Len = 0; this.Cap = 0; return; } this.Data = Data_; this.Len = Len_; this.Cap = Cap_; }); sliceType$1 = $sliceType(name); ptrType$1 = $ptrType(rtype); sliceType$2 = $sliceType(ptrType$1); sliceType$3 = $sliceType($emptyInterface); ptrType$2 = $ptrType(js.Object); funcType$1 = $funcType([sliceType$3], [ptrType$2], true); sliceType$4 = $sliceType($String); ptrType$3 = $ptrType(typeAlg); ptrType$4 = $ptrType($Uint8); sliceType$5 = $sliceType(method); sliceType$6 = $sliceType(imethod); sliceType$7 = $sliceType(structField); ptrType$5 = $ptrType(uncommonType); ptrType$6 = $ptrType(nameData); structType$3 = $structType("reflect", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}]); sliceType$8 = $sliceType(ptrType$2); sliceType$9 = $sliceType(Value); sliceType$10 = $sliceType(Type); sliceType$11 = $sliceType(sliceType$8); ptrType$7 = $ptrType(funcType); ptrType$8 = $ptrType(interfaceType); ptrType$9 = $ptrType(imethod); sliceType$13 = $sliceType($Int); sliceType$14 = $sliceType(fieldScan); ptrType$10 = $ptrType(structType); sliceType$15 = $sliceType($Uint8); ptrType$16 = $ptrType($UnsafePointer); sliceType$17 = $sliceType($Int32); funcType$3 = $funcType([$String], [$Bool], false); funcType$4 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); funcType$5 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); ptrType$17 = $ptrType(structField); arrayType$12 = $arrayType($Uintptr, 2); ptrType$18 = $ptrType(ValueError); init = function() { var used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; used = $f.used; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: used = (function(i) { var i; }); $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$1 = new uncommonType.ptr(0, 0, 0, 0, sliceType$5.nil), new x$1.constructor.elem(x$1))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$2 = new method.ptr(0, 0, 0, 0), new x$2.constructor.elem(x$2))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$3 = new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, 0), new x$3.constructor.elem(x$3))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$4 = new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil, 0), new x$4.constructor.elem(x$4))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$5 = new funcType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), 0, 0, sliceType$2.nil, sliceType$2.nil), new x$5.constructor.elem(x$5))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$6 = new interfaceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), new name.ptr(ptrType$4.nil), sliceType$6.nil), new x$6.constructor.elem(x$6))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$7 = new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, 0, 0, 0, 0, false, false), new x$7.constructor.elem(x$7))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$8 = new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil), new x$8.constructor.elem(x$8))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$9 = new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), ptrType$1.nil), new x$9.constructor.elem(x$9))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$10 = new structType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), new name.ptr(ptrType$4.nil), sliceType$7.nil), new x$10.constructor.elem(x$10))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$11 = new imethod.ptr(0, 0), new x$11.constructor.elem(x$11))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = used((x$12 = new structField.ptr(new name.ptr(ptrType$4.nil), ptrType$1.nil, 0), new x$12.constructor.elem(x$12))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } initialized = true; uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: init }; } $f.used = used; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; }; jsType = function(typ) { var typ; return typ.jsType; }; reflectType = function(typ) { var _1, _i, _i$1, _i$2, _i$3, _key, _ref, _ref$1, _ref$2, _ref$3, dir, exported, exported$1, f, fields, i, i$1, i$2, i$3, i$4, i$5, imethods, in$1, m, m$1, m$2, methodSet, methods, offsetEmbed, out, outCount, params, reflectFields, reflectMethods, results, rt, typ, ut, xcount; if (typ.reflectType === undefined) { rt = new rtype.ptr(((($parseInt(typ.size) >> 0) >>> 0)), 0, 0, 0, 0, 0, ((($parseInt(typ.kind) >> 0) << 24 >>> 24)), ptrType$3.nil, ptrType$4.nil, newNameOff($clone(newName(internalStr(typ.string), "", !!(typ.exported)), name)), 0); rt.jsType = typ; typ.reflectType = rt; methodSet = $methodSet(typ); if (!(($parseInt(methodSet.length) === 0)) || !!(typ.named)) { rt.tflag = (rt.tflag | (1)) >>> 0; if (!!(typ.named)) { rt.tflag = (rt.tflag | (4)) >>> 0; } reflectMethods = sliceType$5.nil; i = 0; while (true) { if (!(i < $parseInt(methodSet.length))) { break; } m = methodSet[i]; exported = internalStr(m.pkg) === ""; if (!exported) { i = i + (1) >> 0; continue; } reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m.name), "", exported), name)), newTypeOff(reflectType(m.typ)), 0, 0)); i = i + (1) >> 0; } xcount = ((reflectMethods.$length << 16 >>> 16)); i$1 = 0; while (true) { if (!(i$1 < $parseInt(methodSet.length))) { break; } m$1 = methodSet[i$1]; exported$1 = internalStr(m$1.pkg) === ""; if (exported$1) { i$1 = i$1 + (1) >> 0; continue; } reflectMethods = $append(reflectMethods, new method.ptr(newNameOff($clone(newName(internalStr(m$1.name), "", exported$1), name)), newTypeOff(reflectType(m$1.typ)), 0, 0)); i$1 = i$1 + (1) >> 0; } ut = new uncommonType.ptr(newNameOff($clone(newName(internalStr(typ.pkg), "", false), name)), (($parseInt(methodSet.length) << 16 >>> 16)), xcount, 0, reflectMethods); _key = rt; (uncommonTypeMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: ut }; ut.jsType = typ; } _1 = rt.Kind(); if (_1 === (17)) { setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem), ptrType$1.nil, ((($parseInt(typ.len) >> 0) >>> 0)))); } else if (_1 === (18)) { dir = 3; if (!!(typ.sendOnly)) { dir = 2; } if (!!(typ.recvOnly)) { dir = 1; } setKindType(rt, new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem), ((dir >>> 0)))); } else if (_1 === (19)) { params = typ.params; in$1 = $makeSlice(sliceType$2, $parseInt(params.length)); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i$2 = _i; ((i$2 < 0 || i$2 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i$2] = reflectType(params[i$2])); _i++; } results = typ.results; out = $makeSlice(sliceType$2, $parseInt(results.length)); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$3 = _i$1; ((i$3 < 0 || i$3 >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i$3] = reflectType(results[i$3])); _i$1++; } outCount = (($parseInt(results.length) << 16 >>> 16)); if (!!(typ.variadic)) { outCount = (outCount | (32768)) >>> 0; } setKindType(rt, new funcType.ptr($clone(rt, rtype), (($parseInt(params.length) << 16 >>> 16)), outCount, in$1, out)); } else if (_1 === (20)) { methods = typ.methods; imethods = $makeSlice(sliceType$6, $parseInt(methods.length)); _ref$2 = imethods; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } i$4 = _i$2; m$2 = methods[i$4]; imethod.copy(((i$4 < 0 || i$4 >= imethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : imethods.$array[imethods.$offset + i$4]), new imethod.ptr(newNameOff($clone(newName(internalStr(m$2.name), "", internalStr(m$2.pkg) === ""), name)), newTypeOff(reflectType(m$2.typ)))); _i$2++; } setKindType(rt, new interfaceType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkg), "", false), name), imethods)); } else if (_1 === (21)) { setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, 0, 0, 0, 0, 0, false, false)); } else if (_1 === (22)) { setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem))); } else if (_1 === (23)) { setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0), reflectType(typ.elem))); } else if (_1 === (25)) { fields = typ.fields; reflectFields = $makeSlice(sliceType$7, $parseInt(fields.length)); _ref$3 = reflectFields; _i$3 = 0; while (true) { if (!(_i$3 < _ref$3.$length)) { break; } i$5 = _i$3; f = fields[i$5]; offsetEmbed = ((i$5 >>> 0)) << 1 >>> 0; if (!!(f.embedded)) { offsetEmbed = (offsetEmbed | (1)) >>> 0; } structField.copy(((i$5 < 0 || i$5 >= reflectFields.$length) ? ($throwRuntimeError("index out of range"), undefined) : reflectFields.$array[reflectFields.$offset + i$5]), new structField.ptr($clone(newName(internalStr(f.name), internalStr(f.tag), !!(f.exported)), name), reflectType(f.typ), offsetEmbed)); _i$3++; } setKindType(rt, new structType.ptr($clone(rt, rtype), $clone(newName(internalStr(typ.pkgPath), "", false), name), reflectFields)); } } return ((typ.reflectType)); }; setKindType = function(rt, kindType) { var kindType, rt; rt.kindType = kindType; kindType.rtype = rt; }; uncommonType.ptr.prototype.methods = function() { var t; t = this; return t._methods; }; uncommonType.prototype.methods = function() { return this.$val.methods(); }; uncommonType.ptr.prototype.exportedMethods = function() { var t; t = this; return $subslice(t._methods, 0, t.xcount, t.xcount); }; uncommonType.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; rtype.ptr.prototype.uncommon = function() { var _entry, t; t = this; return (_entry = uncommonTypeMap[ptrType$1.keyFor(t)], _entry !== undefined ? _entry.v : ptrType$5.nil); }; rtype.prototype.uncommon = function() { return this.$val.uncommon(); }; funcType.ptr.prototype.in$ = function() { var t; t = this; return t._in; }; funcType.prototype.in$ = function() { return this.$val.in$(); }; funcType.ptr.prototype.out = function() { var t; t = this; return t._out; }; funcType.prototype.out = function() { return this.$val.out(); }; name.ptr.prototype.name = function() { var _entry, n, s; s = ""; n = this; s = (_entry = nameMap[ptrType$4.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$6.nil).name; return s; }; name.prototype.name = function() { return this.$val.name(); }; name.ptr.prototype.tag = function() { var _entry, n, s; s = ""; n = this; s = (_entry = nameMap[ptrType$4.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$6.nil).tag; return s; }; name.prototype.tag = function() { return this.$val.tag(); }; name.ptr.prototype.pkgPath = function() { var n; n = this; return ""; }; name.prototype.pkgPath = function() { return this.$val.pkgPath(); }; name.ptr.prototype.isExported = function() { var _entry, n; n = this; return (_entry = nameMap[ptrType$4.keyFor(n.bytes)], _entry !== undefined ? _entry.v : ptrType$6.nil).exported; }; name.prototype.isExported = function() { return this.$val.isExported(); }; newName = function(n, tag, exported) { var _key, b, exported, n, tag; b = $newDataPointer(0, ptrType$4); _key = b; (nameMap || $throwRuntimeError("assignment to entry in nil map"))[ptrType$4.keyFor(_key)] = { k: _key, v: new nameData.ptr(n, tag, exported) }; return new name.ptr(b); }; rtype.ptr.prototype.nameOff = function(off) { var off, t, x; t = this; return (x = ((off >> 0)), ((x < 0 || x >= nameOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : nameOffList.$array[nameOffList.$offset + x])); }; rtype.prototype.nameOff = function(off) { return this.$val.nameOff(off); }; newNameOff = function(n) { var i, n; i = nameOffList.$length; nameOffList = $append(nameOffList, n); return ((i >> 0)); }; rtype.ptr.prototype.typeOff = function(off) { var off, t, x; t = this; return (x = ((off >> 0)), ((x < 0 || x >= typeOffList.$length) ? ($throwRuntimeError("index out of range"), undefined) : typeOffList.$array[typeOffList.$offset + x])); }; rtype.prototype.typeOff = function(off) { return this.$val.typeOff(off); }; newTypeOff = function(t) { var i, t; i = typeOffList.$length; typeOffList = $append(typeOffList, t); return ((i >> 0)); }; internalStr = function(strObj) { var c, strObj; c = new structType$3.ptr(""); c.str = strObj; return c.str; }; isWrapped = function(typ) { var typ; return !!(jsType(typ).wrapped); }; copyStruct = function(dst, src, typ) { var dst, fields, i, prop, src, typ; fields = jsType(typ).fields; i = 0; while (true) { if (!(i < $parseInt(fields.length))) { break; } prop = $internalize(fields[i].prop, $String); dst[$externalize(prop, $String)] = src[$externalize(prop, $String)]; i = i + (1) >> 0; } }; makeValue = function(t, v, fl) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _v = $f._v; _v$1 = $f._v$1; fl = $f.fl; rt = $f.rt; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rt = _r; _r$1 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (_r$1 === 17) { _v$1 = true; $s = 5; continue s; } _r$2 = t.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$1 = _r$2 === 25; case 5: if (_v$1) { _v = true; $s = 4; continue s; } _r$3 = t.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = _r$3 === 22; case 4: /* */ if (_v) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_v) { */ case 2: _r$4 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $s = -1; return new Value.ptr(rt, (v), (fl | ((_r$4 >>> 0))) >>> 0); /* } */ case 3: _r$5 = t.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $s = -1; return new Value.ptr(rt, ($newDataPointer(v, jsType(rt.ptrTo()))), (((fl | ((_r$5 >>> 0))) >>> 0) | 128) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeValue }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._v = _v; $f._v$1 = _v$1; $f.fl = fl; $f.rt = rt; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; MakeSlice = function(typ, len, cap) { var _r, _r$1, cap, len, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; len = $f.len; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: typ = [typ]; _r = typ[0].Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 23))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 23))) { */ case 1: $panic(new $String("reflect.MakeSlice of non-slice type")); /* } */ case 2: if (len < 0) { $panic(new $String("reflect.MakeSlice: negative len")); } if (cap < 0) { $panic(new $String("reflect.MakeSlice: negative cap")); } if (len > cap) { $panic(new $String("reflect.MakeSlice: len > cap")); } _r$1 = makeValue(typ[0], $makeSlice(jsType(typ[0]), len, cap, (function(typ) { return function $b() { var _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = typ[0].Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = jsType(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2.zero(); /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; })(typ)), 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: MakeSlice }; } $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.len = len; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.MakeSlice = MakeSlice; TypeOf = function(i) { var i; if (!initialized) { return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$3.nil, ptrType$4.nil, 0, 0); } if ($interfaceIsEqual(i, $ifaceNil)) { return $ifaceNil; } return reflectType(i.constructor); }; $pkg.TypeOf = TypeOf; ValueOf = function(i) { var _r, i, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if ($interfaceIsEqual(i, $ifaceNil)) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } _r = makeValue(reflectType(i.constructor), i.$val, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ValueOf }; } $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ValueOf = ValueOf; FuncOf = function(in$1, out, variadic) { var _i, _i$1, _r, _ref, _ref$1, _v, _v$1, i, i$1, in$1, jsIn, jsOut, out, v, v$1, variadic, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; _v$1 = $f._v$1; i = $f.i; i$1 = $f.i$1; in$1 = $f.in$1; jsIn = $f.jsIn; jsOut = $f.jsOut; out = $f.out; v = $f.v; v$1 = $f.v$1; variadic = $f.variadic; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (!(variadic)) { _v = false; $s = 3; continue s; } if (in$1.$length === 0) { _v$1 = true; $s = 4; continue s; } _r = (x = in$1.$length - 1 >> 0, ((x < 0 || x >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x])).Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v$1 = !((_r === 23)); case 4: _v = _v$1; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $panic(new $String("reflect.FuncOf: last arg of variadic func must be slice")); /* } */ case 2: jsIn = $makeSlice(sliceType$8, in$1.$length); _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= jsIn.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsIn.$array[jsIn.$offset + i] = jsType(v)); _i++; } jsOut = $makeSlice(sliceType$8, out.$length); _ref$1 = out; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; v$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); ((i$1 < 0 || i$1 >= jsOut.$length) ? ($throwRuntimeError("index out of range"), undefined) : jsOut.$array[jsOut.$offset + i$1] = jsType(v$1)); _i$1++; } $s = -1; return reflectType($funcType($externalize(jsIn, sliceType$8), $externalize(jsOut, sliceType$8), $externalize(variadic, $Bool))); /* */ } return; } if ($f === undefined) { $f = { $blk: FuncOf }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f._v$1 = _v$1; $f.i = i; $f.i$1 = i$1; $f.in$1 = in$1; $f.jsIn = jsIn; $f.jsOut = jsOut; $f.out = out; $f.v = v; $f.v$1 = v$1; $f.variadic = variadic; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.FuncOf = FuncOf; rtype.ptr.prototype.ptrTo = function() { var t; t = this; return reflectType($ptrType(jsType(t))); }; rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; SliceOf = function(t) { var t; return reflectType($sliceType(jsType(t))); }; $pkg.SliceOf = SliceOf; Zero = function(typ) { var _r, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeValue(typ, jsType(typ).zero(), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Zero }; } $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Zero = Zero; unsafe_New = function(typ) { var _1, typ; _1 = typ.Kind(); if (_1 === (25)) { return (new (jsType(typ).ptr)()); } else if (_1 === (17)) { return (jsType(typ).zero()); } else { return ($newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo()))); } }; makeInt = function(f, bits, t) { var _1, _r, bits, f, ptr, t, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; bits = $f.bits; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } typ = _r; ptr = unsafe_New(typ); _1 = typ.Kind(); if (_1 === (3)) { (ptr).$set(((bits.$low << 24 >> 24))); } else if (_1 === (4)) { (ptr).$set(((bits.$low << 16 >> 16))); } else if ((_1 === (2)) || (_1 === (5))) { (ptr).$set(((bits.$low >> 0))); } else if (_1 === (6)) { (ptr).$set((new $Int64(bits.$high, bits.$low))); } else if (_1 === (8)) { (ptr).$set(((bits.$low << 24 >>> 24))); } else if (_1 === (9)) { (ptr).$set(((bits.$low << 16 >>> 16))); } else if ((_1 === (7)) || (_1 === (10)) || (_1 === (12))) { (ptr).$set(((bits.$low >>> 0))); } else if (_1 === (11)) { (ptr).$set((bits)); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeInt }; } $f._1 = _1; $f._r = _r; $f.bits = bits; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; typedmemmove = function(t, dst, src) { var dst, src, t; dst.$set(src.$get()); }; keyFor = function(t, key) { var k, key, kv, t; kv = key; if (!(kv.$get === undefined)) { kv = kv.$get(); } k = $internalize(jsType(t.Key()).keyFor(kv), $String); return [kv, k]; }; mapaccess = function(t, m, key) { var _tuple, entry, k, key, m, t; _tuple = keyFor(t, key); k = _tuple[1]; entry = m[$externalize(k, $String)]; if (entry === undefined) { return 0; } return ($newDataPointer(entry.v, jsType(PtrTo(t.Elem())))); }; mapassign = function(t, m, key, val) { var _r, _tuple, entry, et, jsVal, k, key, kv, m, newVal, t, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; entry = $f.entry; et = $f.et; jsVal = $f.jsVal; k = $f.k; key = $f.key; kv = $f.kv; m = $f.m; newVal = $f.newVal; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = keyFor(t, key); kv = _tuple[0]; k = _tuple[1]; jsVal = val.$get(); et = t.Elem(); _r = et.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === 25) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r === 25) { */ case 1: newVal = jsType(et).zero(); copyStruct(newVal, jsVal, et); jsVal = newVal; /* } */ case 2: entry = new ($global.Object)(); entry.k = kv; entry.v = jsVal; m[$externalize(k, $String)] = entry; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: mapassign }; } $f._r = _r; $f._tuple = _tuple; $f.entry = entry; $f.et = et; $f.jsVal = jsVal; $f.k = k; $f.key = key; $f.kv = kv; $f.m = m; $f.newVal = newVal; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; mapdelete = function(t, m, key) { var _tuple, k, key, m, t; _tuple = keyFor(t, key); k = _tuple[1]; delete m[$externalize(k, $String)]; }; mapiterinit = function(t, m) { var m, t; return ((new mapIter.ptr(t, m, $keys(m), 0))); }; mapiterkey = function(it) { var _r, _r$1, _r$2, it, iter, k, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: iter = ((it)); k = iter.keys[iter.i]; _r = iter.t.Key(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return ($newDataPointer(iter.m[$externalize($internalize(k, $String), $String)].k, _r$2)); /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterkey }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.$s = $s; $f.$r = $r; return $f; }; mapiternext = function(it) { var it, iter; iter = ((it)); iter.i = iter.i + (1) >> 0; }; maplen = function(m) { var m; return $parseInt($keys(m).length); }; cvtDirect = function(v, typ) { var _1, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, k, slice, srcVal, typ, v, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; k = $f.k; slice = $f.slice; srcVal = $f.srcVal; typ = $f.typ; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: srcVal = $clone(v, Value).object(); /* */ if (srcVal === jsType(v.typ).nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (srcVal === jsType(v.typ).nil) { */ case 1: _r = makeValue(typ, jsType(typ).nil, v.flag); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: val = null; _r$1 = typ.Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } k = _r$1; _1 = k; /* */ if (_1 === (23)) { $s = 6; continue; } /* */ if (_1 === (22)) { $s = 7; continue; } /* */ if (_1 === (25)) { $s = 8; continue; } /* */ if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_1 === (23)) { */ case 6: slice = new (jsType(typ))(srcVal.$array); slice.$offset = srcVal.$offset; slice.$length = srcVal.$length; slice.$capacity = srcVal.$capacity; val = $newDataPointer(slice, jsType(PtrTo(typ))); $s = 11; continue; /* } else if (_1 === (22)) { */ case 7: _r$2 = typ.Elem(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = _r$2.Kind(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 25) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_r$3 === 25) { */ case 12: _r$4 = typ.Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_r$4, v.typ.Elem())) { $s = 16; continue; } /* */ $s = 17; continue; /* if ($interfaceIsEqual(_r$4, v.typ.Elem())) { */ case 16: val = srcVal; /* break; */ $s = 4; continue; /* } */ case 17: val = new (jsType(typ))(); _arg = val; _arg$1 = srcVal; _r$5 = typ.Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$2 = _r$5; $r = copyStruct(_arg, _arg$1, _arg$2); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* break; */ $s = 4; continue; /* } */ case 13: val = new (jsType(typ))(srcVal.$get, srcVal.$set); $s = 11; continue; /* } else if (_1 === (25)) { */ case 8: val = new (jsType(typ).ptr)(); copyStruct(val, srcVal, typ); $s = 11; continue; /* } else if ((_1 === (17)) || (_1 === (1)) || (_1 === (18)) || (_1 === (19)) || (_1 === (20)) || (_1 === (21)) || (_1 === (24))) { */ case 9: val = v.ptr; $s = 11; continue; /* } else { */ case 10: $panic(new ValueError.ptr("reflect.Convert", k)); /* } */ case 11: case 4: _r$6 = typ.common(); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = typ.Kind(); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $s = -1; return new Value.ptr(_r$6, (val), (((new flag(v.flag).ro() | ((v.flag & 128) >>> 0)) >>> 0) | ((_r$7 >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: cvtDirect }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.k = k; $f.slice = slice; $f.srcVal = srcVal; $f.typ = typ; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; valueInterface = function(v, safe) { var _r, safe, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; safe = $f.safe; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (v.flag === 0) { $panic(new ValueError.ptr("reflect.Value.Interface", 0)); } if (safe && !((((v.flag & 96) >>> 0) === 0))) { $panic(new $String("reflect.Value.Interface: cannot return value obtained from unexported field or method")); } /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: _r = makeMethodValue("Interface", $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; /* } */ case 2: if (isWrapped(v.typ)) { $s = -1; return ((new (jsType(v.typ))($clone(v, Value).object()))); } $s = -1; return (($clone(v, Value).object())); /* */ } return; } if ($f === undefined) { $f = { $blk: valueInterface }; } $f._r = _r; $f.safe = safe; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; ifaceE2I = function(t, src, dst) { var dst, src, t; dst.$set(src); }; methodName = function() { return "?FIXME?"; }; makeMethodValue = function(op, v) { var _r, _tuple, fn, fv, op, rcvr, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; fn = $f.fn; fv = $f.fv; op = $f.op; rcvr = $f.rcvr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fn = [fn]; rcvr = [rcvr]; if (((v.flag & 512) >>> 0) === 0) { $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); } _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); fn[0] = _tuple[2]; rcvr[0] = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr[0] = new (jsType(v.typ))(rcvr[0]); } fv = js.MakeFunc((function(fn, rcvr) { return function(this$1, arguments$1) { var arguments$1, this$1; return new $jsObjectPtr(fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$8))); }; })(fn, rcvr)); _r = $clone(v, Value).Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return new Value.ptr(_r, (fv), (new flag(v.flag).ro() | 19) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeMethodValue }; } $f._r = _r; $f._tuple = _tuple; $f.fn = fn; $f.fv = fv; $f.op = op; $f.rcvr = rcvr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; rtype.ptr.prototype.pointers = function() { var _1, t; t = this; _1 = t.Kind(); if ((_1 === (22)) || (_1 === (21)) || (_1 === (18)) || (_1 === (19)) || (_1 === (25)) || (_1 === (17))) { return true; } else { return false; } }; rtype.prototype.pointers = function() { return this.$val.pointers(); }; rtype.ptr.prototype.Comparable = function() { var _1, _r, _r$1, i, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; i = $f.i; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _1 = t.Kind(); /* */ if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { $s = 2; continue; } /* */ if (_1 === (17)) { $s = 3; continue; } /* */ if (_1 === (25)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_1 === (19)) || (_1 === (23)) || (_1 === (21))) { */ case 2: $s = -1; return false; /* } else if (_1 === (17)) { */ case 3: _r = t.Elem().Comparable(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else if (_1 === (25)) { */ case 4: i = 0; /* while (true) { */ case 7: /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 8; continue; } _r$1 = t.Field(i).Type.Comparable(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!_r$1) { */ case 9: $s = -1; return false; /* } */ case 10: i = i + (1) >> 0; /* } */ $s = 7; continue; case 8: /* } */ case 5: case 1: $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Comparable }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; rtype.ptr.prototype.Method = function(i) { var _i, _i$1, _r, _ref, _ref$1, arg, fl, fn, ft, i, in$1, m, methods, mt, mtyp, out, p, pname, prop, ret, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; arg = $f.arg; fl = $f.fl; fn = $f.fn; ft = $f.ft; i = $f.i; in$1 = $f.in$1; m = $f.m; methods = $f.methods; mt = $f.mt; mtyp = $f.mtyp; out = $f.out; p = $f.p; pname = $f.pname; prop = $f.prop; ret = $f.ret; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: prop = [prop]; m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); t = this; if (t.Kind() === 20) { tt = (t.kindType); Method.copy(m, tt.Method(i)); $s = -1; return m; } methods = t.exportedMethods(); if (i < 0 || i >= methods.$length) { $panic(new $String("reflect: Method index out of range")); } p = $clone(((i < 0 || i >= methods.$length) ? ($throwRuntimeError("index out of range"), undefined) : methods.$array[methods.$offset + i]), method); pname = $clone(t.nameOff(p.name), name); m.Name = $clone(pname, name).name(); fl = 19; mtyp = t.typeOff(p.mtyp); ft = (mtyp.kindType); in$1 = $makeSlice(sliceType$10, 0, (1 + ft.in$().$length >> 0)); in$1 = $append(in$1, t); _ref = ft.in$(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); in$1 = $append(in$1, arg); _i++; } out = $makeSlice(sliceType$10, 0, ft.out().$length); _ref$1 = ft.out(); _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } ret = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); out = $append(out, ret); _i$1++; } _r = FuncOf(in$1, out, ft.rtype.IsVariadic()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mt = _r; m.Type = mt; prop[0] = $internalize($methodSet(t.jsType)[i].prop, $String); fn = js.MakeFunc((function(prop) { return function(this$1, arguments$1) { var arguments$1, rcvr, this$1; rcvr = (0 >= arguments$1.$length ? ($throwRuntimeError("index out of range"), undefined) : arguments$1.$array[arguments$1.$offset + 0]); return new $jsObjectPtr(rcvr[$externalize(prop[0], $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$8))); }; })(prop)); m.Func = new Value.ptr($assertType(mt, ptrType$1), (fn), fl); m.Index = i; Method.copy(m, m); $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Method }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.arg = arg; $f.fl = fl; $f.fn = fn; $f.ft = ft; $f.i = i; $f.in$1 = in$1; $f.m = m; $f.methods = methods; $f.mt = mt; $f.mtyp = mtyp; $f.out = out; $f.p = p; $f.pname = pname; $f.prop = prop; $f.ret = ret; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Method = function(i) { return this.$val.Method(i); }; Value.ptr.prototype.object = function() { var _1, newVal, v, val; v = this; if ((v.typ.Kind() === 17) || (v.typ.Kind() === 25)) { return v.ptr; } if (!((((v.flag & 128) >>> 0) === 0))) { val = v.ptr.$get(); if (!(val === $ifaceNil) && !(val.constructor === jsType(v.typ))) { switch (0) { default: _1 = v.typ.Kind(); if ((_1 === (11)) || (_1 === (6))) { val = new (jsType(v.typ))(val.$high, val.$low); } else if ((_1 === (15)) || (_1 === (16))) { val = new (jsType(v.typ))(val.$real, val.$imag); } else if (_1 === (23)) { if (val === val.constructor.nil) { val = jsType(v.typ).nil; break; } newVal = new (jsType(v.typ))(val.$array); newVal.$offset = val.$offset; newVal.$length = val.$length; newVal.$capacity = val.$capacity; val = newVal; } } } return val; } return v.ptr; }; Value.prototype.object = function() { return this.$val.object(); }; Value.ptr.prototype.assignTo = function(context, dst, target) { var _r, _r$1, _r$2, context, dst, fl, target, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; context = $f.context; dst = $f.dst; fl = $f.fl; target = $f.target; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: _r = makeMethodValue(context, $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; /* } */ case 2: _r$1 = directlyAssignable(dst, v.typ); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 5; continue; } /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$1) { */ case 5: fl = (((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0; fl = (fl | (((dst.Kind() >>> 0)))) >>> 0; $s = -1; return new Value.ptr(dst, v.ptr, fl); /* } else if (implements$1(dst, v.typ)) { */ case 6: if (target === 0) { target = unsafe_New(dst); } _r$2 = valueInterface($clone(v, Value), false); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } x = _r$2; if (dst.NumMethod() === 0) { (target).$set(x); } else { ifaceE2I(dst, x, target); } $s = -1; return new Value.ptr(dst, target, 148); /* } */ case 7: case 4: $panic(new $String(context + ": value of type " + v.typ.String() + " is not assignable to type " + dst.String())); $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.assignTo }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.context = context; $f.dst = dst; $f.fl = fl; $f.target = target; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.assignTo = function(context, dst, target) { return this.$val.assignTo(context, dst, target); }; Value.ptr.prototype.Cap = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (17)) { return v.typ.Len(); } else if ((_1 === (18)) || (_1 === (23))) { return $parseInt($clone(v, Value).object().$capacity) >> 0; } $panic(new ValueError.ptr("reflect.Value.Cap", k)); }; Value.prototype.Cap = function() { return this.$val.Cap(); }; wrapJsObject = function(typ, val) { var typ, val; if ($interfaceIsEqual(typ, jsObjectPtr)) { return new (jsType(jsObjectPtr))(val); } return val; }; unwrapJsObject = function(typ, val) { var typ, val; if ($interfaceIsEqual(typ, jsObjectPtr)) { return val.object; } return val; }; Value.ptr.prototype.Elem = function() { var _1, _r, fl, k, tt, typ, v, val, val$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; fl = $f.fl; k = $f.k; tt = $f.tt; typ = $f.typ; v = $f.v; val = $f.val; val$1 = $f.val$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; k = new flag(v.flag).kind(); _1 = k; /* */ if (_1 === (20)) { $s = 2; continue; } /* */ if (_1 === (22)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (20)) { */ case 2: val = $clone(v, Value).object(); if (val === $ifaceNil) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = reflectType(val.constructor); _r = makeValue(typ, val.$val, new flag(v.flag).ro()); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else if (_1 === (22)) { */ case 3: if ($clone(v, Value).IsNil()) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } val$1 = $clone(v, Value).object(); tt = (v.typ.kindType); fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; fl = (fl | (((tt.elem.Kind() >>> 0)))) >>> 0; $s = -1; return new Value.ptr(tt.elem, (wrapJsObject(tt.elem, val$1)), fl); /* } else { */ case 4: $panic(new ValueError.ptr("reflect.Value.Elem", k)); /* } */ case 5: case 1: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Elem }; } $f._1 = _1; $f._r = _r; $f.fl = fl; $f.k = k; $f.tt = tt; $f.typ = typ; $f.v = v; $f.val = val; $f.val$1 = val$1; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Elem = function() { return this.$val.Elem(); }; Value.ptr.prototype.Field = function(i) { var _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; field = $f.field; fl = $f.fl; i = $f.i; jsTag = $f.jsTag; o = $f.o; prop = $f.prop; s = $f.s; tag = $f.tag; tt = $f.tt; typ = $f.typ; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: jsTag = [jsTag]; prop = [prop]; s = [s]; typ = [typ]; v = this; if (!((new flag(v.flag).kind() === 25))) { $panic(new ValueError.ptr("reflect.Value.Field", new flag(v.flag).kind())); } tt = (v.typ.kindType); if (((i >>> 0)) >= ((tt.fields.$length >>> 0))) { $panic(new $String("reflect: Field index out of range")); } prop[0] = $internalize(jsType(v.typ).fields[i].prop, $String); field = (x = tt.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); typ[0] = field.typ; fl = (((v.flag & 416) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; if (!$clone(field.name, name).isExported()) { if (field.embedded()) { fl = (fl | (64)) >>> 0; } else { fl = (fl | (32)) >>> 0; } } tag = $clone((x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).name, name).tag(); /* */ if (!(tag === "") && !((i === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(tag === "") && !((i === 0))) { */ case 1: jsTag[0] = getJsTag(tag); /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(jsTag[0] === "")) { */ case 3: /* while (true) { */ case 5: o = [o]; _r = $clone(v, Value).Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } /* */ $s = 9; continue; /* if (v.typ === jsObjectPtr) { */ case 8: o[0] = $clone(v, Value).object().object; $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { return $internalize(o[0][$externalize(jsTag[0], $String)], jsType(typ[0])); }; })(jsTag, o, prop, s, typ), (function(jsTag, o, prop, s, typ) { return function(x$2) { var x$2; o[0][$externalize(jsTag[0], $String)] = $externalize(x$2, jsType(typ[0])); }; })(jsTag, o, prop, s, typ))), fl); /* } */ case 9: /* */ if (v.typ.Kind() === 22) { $s = 10; continue; } /* */ $s = 11; continue; /* if (v.typ.Kind() === 22) { */ case 10: _r$1 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; /* } */ case 11: /* } */ $s = 5; continue; case 6: /* } */ case 4: /* } */ case 2: s[0] = v.ptr; /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 13: $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { var x$2; s[0][$externalize(prop[0], $String)] = unwrapJsObject(typ[0], x$2); }; })(jsTag, prop, s, typ))), fl); /* } */ case 14: _r$2 = makeValue(typ[0], wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]), fl); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Field }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.field = field; $f.fl = fl; $f.i = i; $f.jsTag = jsTag; $f.o = o; $f.prop = prop; $f.s = s; $f.tag = tag; $f.tt = tt; $f.typ = typ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Field = function(i) { return this.$val.Field(i); }; getJsTag = function(tag) { var _tuple, i, name$1, qvalue, tag, value; while (true) { if (!(!(tag === ""))) { break; } i = 0; while (true) { if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } i = i + (1) >> 0; } tag = $substring(tag, i); if (tag === "") { break; } i = 0; while (true) { if (!(i < tag.length && !((tag.charCodeAt(i) === 32)) && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)))) { break; } i = i + (1) >> 0; } if ((i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { break; } name$1 = ($substring(tag, 0, i)); tag = $substring(tag, (i + 1 >> 0)); i = 1; while (true) { if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } if (tag.charCodeAt(i) === 92) { i = i + (1) >> 0; } i = i + (1) >> 0; } if (i >= tag.length) { break; } qvalue = ($substring(tag, 0, (i + 1 >> 0))); tag = $substring(tag, (i + 1 >> 0)); if (name$1 === "js") { _tuple = strconv.Unquote(qvalue); value = _tuple[0]; return value; } } return ""; }; Value.ptr.prototype.Index = function(i) { var _1, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; a = $f.a; a$1 = $f.a$1; c = $f.c; fl = $f.fl; fl$1 = $f.fl$1; fl$2 = $f.fl$2; i = $f.i; k = $f.k; s = $f.s; str = $f.str; tt = $f.tt; tt$1 = $f.tt$1; typ = $f.typ; typ$1 = $f.typ$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = [a]; a$1 = [a$1]; c = [c]; i = [i]; typ = [typ]; typ$1 = [typ$1]; v = this; k = new flag(v.flag).kind(); _1 = k; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (23)) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (17)) { */ case 2: tt = (v.typ.kindType); if (i[0] < 0 || i[0] > ((tt.len >> 0))) { $panic(new $String("reflect: array index out of range")); } typ[0] = tt.elem; fl = (((((v.flag & 384) >>> 0) | new flag(v.flag).ro()) >>> 0) | ((typ[0].Kind() >>> 0))) >>> 0; a[0] = v.ptr; /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 7: $s = -1; return new Value.ptr(typ[0], (new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { return wrapJsObject(typ[0], a[0][i[0]]); }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { var x; a[0][i[0]] = unwrapJsObject(typ[0], x); }; })(a, a$1, c, i, typ, typ$1))), fl); /* } */ case 8: _r = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else if (_1 === (23)) { */ case 3: s = $clone(v, Value).object(); if (i[0] < 0 || i[0] >= ($parseInt(s.$length) >> 0)) { $panic(new $String("reflect: slice index out of range")); } tt$1 = (v.typ.kindType); typ$1[0] = tt$1.elem; fl$1 = (((384 | new flag(v.flag).ro()) >>> 0) | ((typ$1[0].Kind() >>> 0))) >>> 0; i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; a$1[0] = s.$array; /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 10: $s = -1; return new Value.ptr(typ$1[0], (new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { return wrapJsObject(typ$1[0], a$1[0][i[0]]); }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { var x; a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); }; })(a, a$1, c, i, typ, typ$1))), fl$1); /* } */ case 11: _r$1 = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[0][i[0]]), fl$1); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } else if (_1 === (24)) { */ case 4: str = (v.ptr).$get(); if (i[0] < 0 || i[0] >= str.length) { $panic(new $String("reflect: string index out of range")); } fl$2 = (((new flag(v.flag).ro() | 8) >>> 0) | 128) >>> 0; c[0] = str.charCodeAt(i[0]); $s = -1; return new Value.ptr(uint8Type, ((c.$ptr || (c.$ptr = new ptrType$4(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))), fl$2); /* } else { */ case 5: $panic(new ValueError.ptr("reflect.Value.Index", k)); /* } */ case 6: case 1: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Index }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.a$1 = a$1; $f.c = c; $f.fl = fl; $f.fl$1 = fl$1; $f.fl$2 = fl$2; $f.i = i; $f.k = k; $f.s = s; $f.str = str; $f.tt = tt; $f.tt$1 = tt$1; $f.typ = typ; $f.typ$1 = typ$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Index = function(i) { return this.$val.Index(i); }; Value.ptr.prototype.InterfaceData = function() { var v; v = this; $panic(errors.New("InterfaceData is not supported by GopherJS")); }; Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; Value.ptr.prototype.IsNil = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (22)) || (_1 === (23))) { return $clone(v, Value).object() === jsType(v.typ).nil; } else if (_1 === (18)) { return $clone(v, Value).object() === $chanNil; } else if (_1 === (19)) { return $clone(v, Value).object() === $throwNilPointerError; } else if (_1 === (21)) { return $clone(v, Value).object() === false; } else if (_1 === (20)) { return $clone(v, Value).object() === $ifaceNil; } else { $panic(new ValueError.ptr("reflect.Value.IsNil", k)); } }; Value.prototype.IsNil = function() { return this.$val.IsNil(); }; Value.ptr.prototype.Len = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (17)) || (_1 === (24))) { return $parseInt($clone(v, Value).object().length); } else if (_1 === (23)) { return $parseInt($clone(v, Value).object().$length) >> 0; } else if (_1 === (18)) { return $parseInt($clone(v, Value).object().$buffer.length) >> 0; } else if (_1 === (21)) { return $parseInt($keys($clone(v, Value).object()).length); } else { $panic(new ValueError.ptr("reflect.Value.Len", k)); } }; Value.prototype.Len = function() { return this.$val.Len(); }; Value.ptr.prototype.Pointer = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (18)) || (_1 === (21)) || (_1 === (22)) || (_1 === (26))) { if ($clone(v, Value).IsNil()) { return 0; } return $clone(v, Value).object(); } else if (_1 === (19)) { if ($clone(v, Value).IsNil()) { return 0; } return 1; } else if (_1 === (23)) { if ($clone(v, Value).IsNil()) { return 0; } return $clone(v, Value).object().$array; } else { $panic(new ValueError.ptr("reflect.Value.Pointer", k)); } }; Value.prototype.Pointer = function() { return this.$val.Pointer(); }; Value.ptr.prototype.Set = function(x) { var _1, _r, _r$1, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBeAssignable(); new flag(x.flag).mustBeExported(); _r = $clone(x, Value).assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x = _r; /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: _1 = v.typ.Kind(); /* */ if (_1 === (17)) { $s = 5; continue; } /* */ if (_1 === (20)) { $s = 6; continue; } /* */ if (_1 === (25)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_1 === (17)) { */ case 5: jsType(v.typ).copy(v.ptr, x.ptr); $s = 9; continue; /* } else if (_1 === (20)) { */ case 6: _r$1 = valueInterface($clone(x, Value), false); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v.ptr.$set(_r$1); $s = 9; continue; /* } else if (_1 === (25)) { */ case 7: copyStruct(v.ptr, x.ptr, v.typ); $s = 9; continue; /* } else { */ case 8: v.ptr.$set($clone(x, Value).object()); /* } */ case 9: case 4: $s = -1; return; /* } */ case 3: v.ptr = x.ptr; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Set }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Set = function(x) { return this.$val.Set(x); }; Value.ptr.prototype.SetBytes = function(x) { var _r, _r$1, _v, slice, typedSlice, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; slice = $f.slice; typedSlice = $f.typedSlice; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(23); _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 8))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 8))) { */ case 1: $panic(new $String("reflect.Value.SetBytes of non-byte slice")); /* } */ case 2: slice = x; if (!(v.typ.Name() === "")) { _v = true; $s = 6; continue s; } _r$1 = v.typ.Elem().Name(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = !(_r$1 === ""); case 6: /* */ if (_v) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 4: typedSlice = new (jsType(v.typ))(slice.$array); typedSlice.$offset = slice.$offset; typedSlice.$length = slice.$length; typedSlice.$capacity = slice.$capacity; slice = typedSlice; /* } */ case 5: v.ptr.$set(slice); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetBytes }; } $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.slice = slice; $f.typedSlice = typedSlice; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; Value.ptr.prototype.SetCap = function(n) { var n, newSlice, s, v; v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(23); s = v.ptr.$get(); if (n < ($parseInt(s.$length) >> 0) || n > ($parseInt(s.$capacity) >> 0)) { $panic(new $String("reflect: slice capacity out of range in SetCap")); } newSlice = new (jsType(v.typ))(s.$array); newSlice.$offset = s.$offset; newSlice.$length = s.$length; newSlice.$capacity = n; v.ptr.$set(newSlice); }; Value.prototype.SetCap = function(n) { return this.$val.SetCap(n); }; Value.ptr.prototype.SetLen = function(n) { var n, newSlice, s, v; v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(23); s = v.ptr.$get(); if (n < 0 || n > ($parseInt(s.$capacity) >> 0)) { $panic(new $String("reflect: slice length out of range in SetLen")); } newSlice = new (jsType(v.typ))(s.$array); newSlice.$offset = s.$offset; newSlice.$length = n; newSlice.$capacity = s.$capacity; v.ptr.$set(newSlice); }; Value.prototype.SetLen = function(n) { return this.$val.SetLen(n); }; Value.ptr.prototype.Slice = function(i, j) { var _1, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; i = $f.i; j = $f.j; kind = $f.kind; s = $f.s; str = $f.str; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; cap = 0; typ = $ifaceNil; s = null; kind = new flag(v.flag).kind(); _1 = kind; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (23)) { $s = 3; continue; } /* */ if (_1 === (24)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (17)) { */ case 2: if (((v.flag & 256) >>> 0) === 0) { $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); } tt = (v.typ.kindType); cap = ((tt.len >> 0)); typ = SliceOf(tt.elem); s = new (jsType(typ))($clone(v, Value).object()); $s = 6; continue; /* } else if (_1 === (23)) { */ case 3: typ = v.typ; s = $clone(v, Value).object(); cap = $parseInt(s.$capacity) >> 0; $s = 6; continue; /* } else if (_1 === (24)) { */ case 4: str = (v.ptr).$get(); if (i < 0 || j < i || j > str.length) { $panic(new $String("reflect.Value.Slice: string slice index out of bounds")); } _r = ValueOf(new $String($substring(str, i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else { */ case 5: $panic(new ValueError.ptr("reflect.Value.Slice", kind)); /* } */ case 6: case 1: if (i < 0 || j < i || j > cap) { $panic(new $String("reflect.Value.Slice: slice index out of bounds")); } _r$1 = makeValue(typ, $subslice(s, i, j), new flag(v.flag).ro()); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.i = i; $f.j = j; $f.kind = kind; $f.s = s; $f.str = str; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Slice = function(i, j) { return this.$val.Slice(i, j); }; Value.ptr.prototype.Slice3 = function(i, j, k) { var _1, _r, cap, i, j, k, kind, s, tt, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; cap = $f.cap; i = $f.i; j = $f.j; k = $f.k; kind = $f.kind; s = $f.s; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; cap = 0; typ = $ifaceNil; s = null; kind = new flag(v.flag).kind(); _1 = kind; if (_1 === (17)) { if (((v.flag & 256) >>> 0) === 0) { $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); } tt = (v.typ.kindType); cap = ((tt.len >> 0)); typ = SliceOf(tt.elem); s = new (jsType(typ))($clone(v, Value).object()); } else if (_1 === (23)) { typ = v.typ; s = $clone(v, Value).object(); cap = $parseInt(s.$capacity) >> 0; } else { $panic(new ValueError.ptr("reflect.Value.Slice3", kind)); } if (i < 0 || j < i || k < j || k > cap) { $panic(new $String("reflect.Value.Slice3: slice index out of bounds")); } _r = makeValue(typ, $subslice(s, i, j, k), new flag(v.flag).ro()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice3 }; } $f._1 = _1; $f._r = _r; $f.cap = cap; $f.i = i; $f.j = j; $f.k = k; $f.kind = kind; $f.s = s; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Slice3 = function(i, j, k) { return this.$val.Slice3(i, j, k); }; Value.ptr.prototype.Close = function() { var v; v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); $close($clone(v, Value).object()); }; Value.prototype.Close = function() { return this.$val.Close(); }; chanrecv = function(ch, nb, val) { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; ch = $f.ch; comms = $f.comms; nb = $f.nb; received = $f.received; recvRes = $f.recvRes; selectRes = $f.selectRes; selected = $f.selected; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: selected = false; received = false; comms = new sliceType$11([new sliceType$8([ch])]); if (nb) { comms = $append(comms, new sliceType$8([])); } _r = selectHelper(new sliceType$3([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } selectRes = _r; if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { _tmp = false; _tmp$1 = false; selected = _tmp; received = _tmp$1; $s = -1; return [selected, received]; } recvRes = selectRes[1]; val.$set(recvRes[0]); _tmp$2 = true; _tmp$3 = !!(recvRes[1]); selected = _tmp$2; received = _tmp$3; $s = -1; return [selected, received]; /* */ } return; } if ($f === undefined) { $f = { $blk: chanrecv }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.received = received; $f.recvRes = recvRes; $f.selectRes = selectRes; $f.selected = selected; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; chansend = function(ch, val, nb) { var _r, ch, comms, nb, selectRes, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ch = $f.ch; comms = $f.comms; nb = $f.nb; selectRes = $f.selectRes; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: comms = new sliceType$11([new sliceType$8([ch, val.$get()])]); if (nb) { comms = $append(comms, new sliceType$8([])); } _r = selectHelper(new sliceType$3([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } selectRes = _r; if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { $s = -1; return false; } $s = -1; return true; /* */ } return; } if ($f === undefined) { $f = { $blk: chansend }; } $f._r = _r; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.selectRes = selectRes; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; methodReceiver = function(op, v, i) { var _$38, fn, i, m, m$1, ms, op, prop, rcvr, t, tt, v, x; _$38 = ptrType$1.nil; t = ptrType$7.nil; fn = 0; prop = ""; if (v.typ.Kind() === 20) { tt = (v.typ.kindType); if (i < 0 || i >= tt.methods.$length) { $panic(new $String("reflect: internal error: invalid method index")); } m = (x = tt.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if (!$clone(tt.rtype.nameOff(m.name), name).isExported()) { $panic(new $String("reflect: " + op + " of unexported method")); } t = (tt.rtype.typeOff(m.typ).kindType); prop = $clone(tt.rtype.nameOff(m.name), name).name(); } else { ms = v.typ.exportedMethods(); if (((i >>> 0)) >= ((ms.$length >>> 0))) { $panic(new $String("reflect: internal error: invalid method index")); } m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); if (!$clone(v.typ.nameOff(m$1.name), name).isExported()) { $panic(new $String("reflect: " + op + " of unexported method")); } t = (v.typ.typeOff(m$1.mtyp).kindType); prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); } rcvr = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr = new (jsType(v.typ))(rcvr); } fn = (rcvr[$externalize(prop, $String)]); return [_$38, t, fn]; }; Value.ptr.prototype.call = function(op, in$1) { var _1, _arg, _arg$1, _arg$2, _arg$3, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, arg, argsArray, elem, fn, i, i$1, i$2, i$3, in$1, isSlice, m, n, nin, nout, op, origIn, rcvr, results, ret, slice, t, targ, v, x, x$1, x$2, xt, xt$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; arg = $f.arg; argsArray = $f.argsArray; elem = $f.elem; fn = $f.fn; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; in$1 = $f.in$1; isSlice = $f.isSlice; m = $f.m; n = $f.n; nin = $f.nin; nout = $f.nout; op = $f.op; origIn = $f.origIn; rcvr = $f.rcvr; results = $f.results; ret = $f.ret; slice = $f.slice; t = $f.t; targ = $f.targ; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; xt = $f.xt; xt$1 = $f.xt$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; t = ptrType$7.nil; fn = 0; rcvr = null; if (!((((v.flag & 512) >>> 0) === 0))) { _tuple = methodReceiver(op, $clone(v, Value), ((v.flag >> 0)) >> 10 >> 0); t = _tuple[1]; fn = _tuple[2]; rcvr = $clone(v, Value).object(); if (isWrapped(v.typ)) { rcvr = new (jsType(v.typ))(rcvr); } } else { t = (v.typ.kindType); fn = ($clone(v, Value).object()); rcvr = undefined; } if (fn === 0) { $panic(new $String("reflect.Value.Call: call of nil function")); } isSlice = op === "CallSlice"; n = t.rtype.NumIn(); if (isSlice) { if (!t.rtype.IsVariadic()) { $panic(new $String("reflect: CallSlice of non-variadic function")); } if (in$1.$length < n) { $panic(new $String("reflect: CallSlice with too few input arguments")); } if (in$1.$length > n) { $panic(new $String("reflect: CallSlice with too many input arguments")); } } else { if (t.rtype.IsVariadic()) { n = n - (1) >> 0; } if (in$1.$length < n) { $panic(new $String("reflect: Call with too few input arguments")); } if (!t.rtype.IsVariadic() && in$1.$length > n) { $panic(new $String("reflect: Call with too many input arguments")); } } _ref = in$1; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if ($clone(x, Value).Kind() === 0) { $panic(new $String("reflect: " + op + " using zero Value argument")); } _i++; } i = 0; /* while (true) { */ case 1: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } _tmp = $clone(((i < 0 || i >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + i]), Value).Type(); _tmp$1 = t.rtype.In(i); xt = _tmp; targ = _tmp$1; _r = xt.AssignableTo(targ); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!_r) { */ case 3: _r$1 = xt.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = targ.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $panic(new $String("reflect: " + op + " using " + _r$1 + " as type " + _r$2)); /* } */ case 4: i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: /* */ if (!isSlice && t.rtype.IsVariadic()) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!isSlice && t.rtype.IsVariadic()) { */ case 8: m = in$1.$length - n >> 0; _r$3 = MakeSlice(t.rtype.In(n), m, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } slice = _r$3; _r$4 = t.rtype.In(n).Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } elem = _r$4; i$1 = 0; /* while (true) { */ case 12: /* if (!(i$1 < m)) { break; } */ if(!(i$1 < m)) { $s = 13; continue; } x$2 = (x$1 = n + i$1 >> 0, ((x$1 < 0 || x$1 >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + x$1])); xt$1 = $clone(x$2, Value).Type(); _r$5 = xt$1.AssignableTo(elem); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (!_r$5) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!_r$5) { */ case 14: _r$6 = xt$1.String(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = elem.String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $panic(new $String("reflect: cannot use " + _r$6 + " as type " + _r$7 + " in " + op)); /* } */ case 15: _r$8 = $clone(slice, Value).Index(i$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $r = $clone(_r$8, Value).Set($clone(x$2, Value)); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$1 = i$1 + (1) >> 0; /* } */ $s = 12; continue; case 13: origIn = in$1; in$1 = $makeSlice(sliceType$9, (n + 1 >> 0)); $copySlice($subslice(in$1, 0, n), origIn); ((n < 0 || n >= in$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : in$1.$array[in$1.$offset + n] = slice); /* } */ case 9: nin = in$1.$length; if (!((nin === t.rtype.NumIn()))) { $panic(new $String("reflect.Value.Call: wrong argument count")); } nout = t.rtype.NumOut(); argsArray = new ($global.Array)(t.rtype.NumIn()); _ref$1 = in$1; _i$1 = 0; /* while (true) { */ case 21: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 22; continue; } i$2 = _i$1; arg = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _arg = t.rtype.In(i$2); _r$9 = t.rtype.In(i$2).common(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$1 = _r$9; _arg$2 = 0; _r$10 = $clone(arg, Value).assignTo("reflect.Value.Call", _arg$1, _arg$2); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = $clone(_r$10, Value).object(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$3 = _r$11; _r$12 = unwrapJsObject(_arg, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } argsArray[i$2] = _r$12; _i$1++; /* } */ $s = 21; continue; case 22: _r$13 = callHelper(new sliceType$3([new $jsObjectPtr(fn), new $jsObjectPtr(rcvr), new $jsObjectPtr(argsArray)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } results = _r$13; _1 = nout; /* */ if (_1 === (0)) { $s = 29; continue; } /* */ if (_1 === (1)) { $s = 30; continue; } /* */ $s = 31; continue; /* if (_1 === (0)) { */ case 29: $s = -1; return sliceType$9.nil; /* } else if (_1 === (1)) { */ case 30: _r$14 = makeValue(t.rtype.Out(0), wrapJsObject(t.rtype.Out(0), results), 0); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } $s = -1; return new sliceType$9([$clone(_r$14, Value)]); /* } else { */ case 31: ret = $makeSlice(sliceType$9, nout); _ref$2 = ret; _i$2 = 0; /* while (true) { */ case 34: /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 35; continue; } i$3 = _i$2; _r$15 = makeValue(t.rtype.Out(i$3), wrapJsObject(t.rtype.Out(i$3), results[i$3]), 0); /* */ $s = 36; case 36: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } ((i$3 < 0 || i$3 >= ret.$length) ? ($throwRuntimeError("index out of range"), undefined) : ret.$array[ret.$offset + i$3] = _r$15); _i$2++; /* } */ $s = 34; continue; case 35: $s = -1; return ret; /* } */ case 32: case 28: $s = -1; return sliceType$9.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.call }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.arg = arg; $f.argsArray = argsArray; $f.elem = elem; $f.fn = fn; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.in$1 = in$1; $f.isSlice = isSlice; $f.m = m; $f.n = n; $f.nin = nin; $f.nout = nout; $f.op = op; $f.origIn = origIn; $f.rcvr = rcvr; $f.results = results; $f.ret = ret; $f.slice = slice; $f.t = t; $f.targ = targ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.xt = xt; $f.xt$1 = xt$1; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.call = function(op, in$1) { return this.$val.call(op, in$1); }; structField.ptr.prototype.offset = function() { var f; f = this; return f.offsetEmbed >>> 1 >>> 0; }; structField.prototype.offset = function() { return this.$val.offset(); }; structField.ptr.prototype.embedded = function() { var f; f = this; return !((((f.offsetEmbed & 1) >>> 0) === 0)); }; structField.prototype.embedded = function() { return this.$val.embedded(); }; Kind.prototype.String = function() { var k; k = this.$val; if (((k >> 0)) < kindNames.$length) { return ((k < 0 || k >= kindNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : kindNames.$array[kindNames.$offset + k]); } return "kind" + strconv.Itoa(((k >> 0))); }; $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; rtype.ptr.prototype.String = function() { var s, t; t = this; s = $clone(t.nameOff(t.str), name).name(); if (!((((t.tflag & 2) >>> 0) === 0))) { return $substring(s, 1); } return s; }; rtype.prototype.String = function() { return this.$val.String(); }; rtype.ptr.prototype.Size = function() { var t; t = this; return t.size; }; rtype.prototype.Size = function() { return this.$val.Size(); }; rtype.ptr.prototype.Bits = function() { var k, t; t = this; if (t === ptrType$1.nil) { $panic(new $String("reflect: Bits of nil Type")); } k = t.Kind(); if (k < 2 || k > 16) { $panic(new $String("reflect: Bits of non-arithmetic Type " + t.String())); } return $imul(((t.size >> 0)), 8); }; rtype.prototype.Bits = function() { return this.$val.Bits(); }; rtype.ptr.prototype.Align = function() { var t; t = this; return ((t.align >> 0)); }; rtype.prototype.Align = function() { return this.$val.Align(); }; rtype.ptr.prototype.FieldAlign = function() { var t; t = this; return ((t.fieldAlign >> 0)); }; rtype.prototype.FieldAlign = function() { return this.$val.FieldAlign(); }; rtype.ptr.prototype.Kind = function() { var t; t = this; return ((((t.kind & 31) >>> 0) >>> 0)); }; rtype.prototype.Kind = function() { return this.$val.Kind(); }; rtype.ptr.prototype.common = function() { var t; t = this; return t; }; rtype.prototype.common = function() { return this.$val.common(); }; rtype.ptr.prototype.exportedMethods = function() { var t, ut; t = this; ut = t.uncommon(); if (ut === ptrType$5.nil) { return sliceType$5.nil; } return ut.exportedMethods(); }; rtype.prototype.exportedMethods = function() { return this.$val.exportedMethods(); }; rtype.ptr.prototype.NumMethod = function() { var t, tt; t = this; if (t.Kind() === 20) { tt = (t.kindType); return tt.NumMethod(); } return t.exportedMethods().$length; }; rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; rtype.ptr.prototype.MethodByName = function(name$1) { var _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, i, m, name$1, ok, p, t, tt, ut, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; i = $f.i; m = $f.m; name$1 = $f.name$1; ok = $f.ok; p = $f.p; t = $f.t; tt = $f.tt; ut = $f.ut; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); ok = false; t = this; if (t.Kind() === 20) { tt = (t.kindType); _tuple = tt.MethodByName(name$1); Method.copy(m, _tuple[0]); ok = _tuple[1]; $s = -1; return [m, ok]; } ut = t.uncommon(); if (ut === ptrType$5.nil) { _tmp = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); _tmp$1 = false; Method.copy(m, _tmp); ok = _tmp$1; $s = -1; return [m, ok]; } _ref = ut.exportedMethods(); _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; p = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), method); /* */ if ($clone(t.nameOff(p.name), name).name() === name$1) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($clone(t.nameOff(p.name), name).name() === name$1) { */ case 3: _r = t.Method(i); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tmp$2 = $clone(_r, Method); _tmp$3 = true; Method.copy(m, _tmp$2); ok = _tmp$3; $s = -1; return [m, ok]; /* } */ case 4: _i++; /* } */ $s = 1; continue; case 2: _tmp$4 = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); _tmp$5 = false; Method.copy(m, _tmp$4); ok = _tmp$5; $s = -1; return [m, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.MethodByName }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.i = i; $f.m = m; $f.name$1 = name$1; $f.ok = ok; $f.p = p; $f.t = t; $f.tt = tt; $f.ut = ut; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; rtype.ptr.prototype.PkgPath = function() { var t, ut; t = this; if (((t.tflag & 4) >>> 0) === 0) { return ""; } ut = t.uncommon(); if (ut === ptrType$5.nil) { return ""; } return $clone(t.nameOff(ut.pkgPath), name).name(); }; rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; rtype.ptr.prototype.Name = function() { var i, s, t; t = this; if (((t.tflag & 4) >>> 0) === 0) { return ""; } s = t.String(); i = s.length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if (s.charCodeAt(i) === 46) { break; } i = i - (1) >> 0; } return $substring(s, (i + 1 >> 0)); }; rtype.prototype.Name = function() { return this.$val.Name(); }; rtype.ptr.prototype.ChanDir = function() { var t, tt; t = this; if (!((t.Kind() === 18))) { $panic(new $String("reflect: ChanDir of non-chan type")); } tt = (t.kindType); return ((tt.dir >> 0)); }; rtype.prototype.ChanDir = function() { return this.$val.ChanDir(); }; rtype.ptr.prototype.IsVariadic = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: IsVariadic of non-func type")); } tt = (t.kindType); return !((((tt.outCount & 32768) >>> 0) === 0)); }; rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; rtype.ptr.prototype.Elem = function() { var _1, t, tt, tt$1, tt$2, tt$3, tt$4; t = this; _1 = t.Kind(); if (_1 === (17)) { tt = (t.kindType); return toType(tt.elem); } else if (_1 === (18)) { tt$1 = (t.kindType); return toType(tt$1.elem); } else if (_1 === (21)) { tt$2 = (t.kindType); return toType(tt$2.elem); } else if (_1 === (22)) { tt$3 = (t.kindType); return toType(tt$3.elem); } else if (_1 === (23)) { tt$4 = (t.kindType); return toType(tt$4.elem); } $panic(new $String("reflect: Elem of invalid type")); }; rtype.prototype.Elem = function() { return this.$val.Elem(); }; rtype.ptr.prototype.Field = function(i) { var i, t, tt; t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: Field of non-struct type")); } tt = (t.kindType); return tt.Field(i); }; rtype.prototype.Field = function(i) { return this.$val.Field(i); }; rtype.ptr.prototype.FieldByIndex = function(index) { var _r, index, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; index = $f.index; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: FieldByIndex of non-struct type")); } tt = (t.kindType); _r = tt.FieldByIndex(index); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByIndex }; } $f._r = _r; $f.index = index; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; rtype.ptr.prototype.FieldByName = function(name$1) { var _r, name$1, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; name$1 = $f.name$1; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: FieldByName of non-struct type")); } tt = (t.kindType); _r = tt.FieldByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByName }; } $f._r = _r; $f.name$1 = name$1; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; rtype.ptr.prototype.FieldByNameFunc = function(match) { var _r, match, t, tt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; match = $f.match; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: FieldByNameFunc of non-struct type")); } tt = (t.kindType); _r = tt.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByNameFunc }; } $f._r = _r; $f.match = match; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; rtype.ptr.prototype.In = function(i) { var i, t, tt, x; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: In of non-func type")); } tt = (t.kindType); return toType((x = tt.in$(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); }; rtype.prototype.In = function(i) { return this.$val.In(i); }; rtype.ptr.prototype.Key = function() { var t, tt; t = this; if (!((t.Kind() === 21))) { $panic(new $String("reflect: Key of non-map type")); } tt = (t.kindType); return toType(tt.key); }; rtype.prototype.Key = function() { return this.$val.Key(); }; rtype.ptr.prototype.Len = function() { var t, tt; t = this; if (!((t.Kind() === 17))) { $panic(new $String("reflect: Len of non-array type")); } tt = (t.kindType); return ((tt.len >> 0)); }; rtype.prototype.Len = function() { return this.$val.Len(); }; rtype.ptr.prototype.NumField = function() { var t, tt; t = this; if (!((t.Kind() === 25))) { $panic(new $String("reflect: NumField of non-struct type")); } tt = (t.kindType); return tt.fields.$length; }; rtype.prototype.NumField = function() { return this.$val.NumField(); }; rtype.ptr.prototype.NumIn = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: NumIn of non-func type")); } tt = (t.kindType); return ((tt.inCount >> 0)); }; rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; rtype.ptr.prototype.NumOut = function() { var t, tt; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: NumOut of non-func type")); } tt = (t.kindType); return tt.out().$length; }; rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; rtype.ptr.prototype.Out = function(i) { var i, t, tt, x; t = this; if (!((t.Kind() === 19))) { $panic(new $String("reflect: Out of non-func type")); } tt = (t.kindType); return toType((x = tt.out(), ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); }; rtype.prototype.Out = function(i) { return this.$val.Out(i); }; ChanDir.prototype.String = function() { var _1, d; d = this.$val; _1 = d; if (_1 === (2)) { return "chan<-"; } else if (_1 === (1)) { return "<-chan"; } else if (_1 === (3)) { return "chan"; } return "ChanDir" + strconv.Itoa(((d >> 0))); }; $ptrType(ChanDir).prototype.String = function() { return new ChanDir(this.$get()).String(); }; interfaceType.ptr.prototype.Method = function(i) { var i, m, p, pname, t, x; m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); t = this; if (i < 0 || i >= t.methods.$length) { return m; } p = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); pname = $clone(t.rtype.nameOff(p.name), name); m.Name = $clone(pname, name).name(); if (!$clone(pname, name).isExported()) { m.PkgPath = $clone(pname, name).pkgPath(); if (m.PkgPath === "") { m.PkgPath = $clone(t.pkgPath, name).name(); } } m.Type = toType(t.rtype.typeOff(p.typ)); m.Index = i; return m; }; interfaceType.prototype.Method = function(i) { return this.$val.Method(i); }; interfaceType.ptr.prototype.NumMethod = function() { var t; t = this; return t.methods.$length; }; interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; interfaceType.ptr.prototype.MethodByName = function(name$1) { var _i, _ref, _tmp, _tmp$1, i, m, name$1, ok, p, t, x; m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); ok = false; t = this; if (t === ptrType$8.nil) { return [m, ok]; } p = ptrType$9.nil; _ref = t.methods; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; p = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if ($clone(t.rtype.nameOff(p.name), name).name() === name$1) { _tmp = $clone(t.Method(i), Method); _tmp$1 = true; Method.copy(m, _tmp); ok = _tmp$1; return [m, ok]; } _i++; } return [m, ok]; }; interfaceType.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; StructTag.prototype.Get = function(key) { var _tuple, key, tag, v; tag = this.$val; _tuple = new StructTag(tag).Lookup(key); v = _tuple[0]; return v; }; $ptrType(StructTag).prototype.Get = function(key) { return new StructTag(this.$get()).Get(key); }; StructTag.prototype.Lookup = function(key) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, err, i, key, name$1, ok, qvalue, tag, value, value$1; value = ""; ok = false; tag = this.$val; while (true) { if (!(!(tag === ""))) { break; } i = 0; while (true) { if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } i = i + (1) >> 0; } tag = $substring(tag, i); if (tag === "") { break; } i = 0; while (true) { if (!(i < tag.length && tag.charCodeAt(i) > 32 && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)) && !((tag.charCodeAt(i) === 127)))) { break; } i = i + (1) >> 0; } if ((i === 0) || (i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { break; } name$1 = ($substring(tag, 0, i)); tag = $substring(tag, (i + 1 >> 0)); i = 1; while (true) { if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } if (tag.charCodeAt(i) === 92) { i = i + (1) >> 0; } i = i + (1) >> 0; } if (i >= tag.length) { break; } qvalue = ($substring(tag, 0, (i + 1 >> 0))); tag = $substring(tag, (i + 1 >> 0)); if (key === name$1) { _tuple = strconv.Unquote(qvalue); value$1 = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { break; } _tmp = value$1; _tmp$1 = true; value = _tmp; ok = _tmp$1; return [value, ok]; } } _tmp$2 = ""; _tmp$3 = false; value = _tmp$2; ok = _tmp$3; return [value, ok]; }; $ptrType(StructTag).prototype.Lookup = function(key) { return new StructTag(this.$get()).Lookup(key); }; structType.ptr.prototype.Field = function(i) { var f, i, p, t, tag, x; f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); t = this; if (i < 0 || i >= t.fields.$length) { $panic(new $String("reflect: Field index out of bounds")); } p = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); f.Type = toType(p.typ); f.Name = $clone(p.name, name).name(); f.Anonymous = p.embedded(); if (!$clone(p.name, name).isExported()) { f.PkgPath = $clone(t.pkgPath, name).name(); } tag = $clone(p.name, name).tag(); if (!(tag === "")) { f.Tag = (tag); } f.Offset = p.offset(); f.Index = new sliceType$13([i]); return f; }; structType.prototype.Field = function(i) { return this.$val.Field(i); }; structType.ptr.prototype.FieldByIndex = function(index) { var _i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _v, f, ft, i, index, t, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _v = $f._v; f = $f.f; ft = $f.ft; i = $f.i; index = $f.index; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); t = this; f.Type = toType(t.rtype); _ref = index; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (i > 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (i > 0) { */ case 3: ft = f.Type; _r = ft.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } if (!(_r === 22)) { _v = false; $s = 7; continue s; } _r$1 = ft.Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = _r$1.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2 === 25; case 7: /* */ if (_v) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_v) { */ case 5: _r$3 = ft.Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } ft = _r$3; /* } */ case 6: f.Type = ft; /* } */ case 4: _r$4 = f.Type.Field(x); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } StructField.copy(f, _r$4); _i++; /* } */ $s = 1; continue; case 2: $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByIndex }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._v = _v; $f.f = f; $f.ft = ft; $f.i = i; $f.index = index; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; structType.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; structType.ptr.prototype.FieldByNameFunc = function(match) { var _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, count, current, f, fname, i, index, match, next, nextCount, ntyp, ok, result, scan, styp, t, t$1, visited, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _key$3 = $f._key$3; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; count = $f.count; current = $f.current; f = $f.f; fname = $f.fname; i = $f.i; index = $f.index; match = $f.match; next = $f.next; nextCount = $f.nextCount; ntyp = $f.ntyp; ok = $f.ok; result = $f.result; scan = $f.scan; styp = $f.styp; t = $f.t; t$1 = $f.t$1; visited = $f.visited; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: result = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); ok = false; t = this; current = new sliceType$14([]); next = new sliceType$14([new fieldScan.ptr(t, sliceType$13.nil)]); nextCount = false; visited = $makeMap(ptrType$10.keyFor, []); /* while (true) { */ case 1: /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } _tmp = next; _tmp$1 = $subslice(current, 0, 0); current = _tmp; next = _tmp$1; count = nextCount; nextCount = false; _ref = current; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } scan = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), fieldScan); t$1 = scan.typ; /* */ if ((_entry = visited[ptrType$10.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { $s = 5; continue; } /* */ $s = 6; continue; /* if ((_entry = visited[ptrType$10.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { */ case 5: _i++; /* continue; */ $s = 3; continue; /* } */ case 6: _key = t$1; (visited || $throwRuntimeError("assignment to entry in nil map"))[ptrType$10.keyFor(_key)] = { k: _key, v: true }; _ref$1 = t$1.fields; _i$1 = 0; /* while (true) { */ case 7: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 8; continue; } i = _i$1; f = (x = t$1.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); fname = $clone(f.name, name).name(); ntyp = ptrType$1.nil; /* */ if (f.embedded()) { $s = 9; continue; } /* */ $s = 10; continue; /* if (f.embedded()) { */ case 9: ntyp = f.typ; /* */ if (ntyp.Kind() === 22) { $s = 11; continue; } /* */ $s = 12; continue; /* if (ntyp.Kind() === 22) { */ case 11: _r = ntyp.Elem().common(); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ntyp = _r; /* } */ case 12: /* } */ case 10: _r$1 = match(fname); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 14; continue; } /* */ $s = 15; continue; /* if (_r$1) { */ case 14: if ((_entry$1 = count[ptrType$10.keyFor(t$1)], _entry$1 !== undefined ? _entry$1.v : 0) > 1 || ok) { _tmp$2 = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); _tmp$3 = false; StructField.copy(result, _tmp$2); ok = _tmp$3; $s = -1; return [result, ok]; } StructField.copy(result, t$1.Field(i)); result.Index = sliceType$13.nil; result.Index = $appendSlice(result.Index, scan.index); result.Index = $append(result.Index, i); ok = true; _i$1++; /* continue; */ $s = 7; continue; /* } */ case 15: if (ok || ntyp === ptrType$1.nil || !((ntyp.Kind() === 25))) { _i$1++; /* continue; */ $s = 7; continue; } styp = (ntyp.kindType); if ((_entry$2 = nextCount[ptrType$10.keyFor(styp)], _entry$2 !== undefined ? _entry$2.v : 0) > 0) { _key$1 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$10.keyFor(_key$1)] = { k: _key$1, v: 2 }; _i$1++; /* continue; */ $s = 7; continue; } if (nextCount === false) { nextCount = $makeMap(ptrType$10.keyFor, []); } _key$2 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$10.keyFor(_key$2)] = { k: _key$2, v: 1 }; if ((_entry$3 = count[ptrType$10.keyFor(t$1)], _entry$3 !== undefined ? _entry$3.v : 0) > 1) { _key$3 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$10.keyFor(_key$3)] = { k: _key$3, v: 2 }; } index = sliceType$13.nil; index = $appendSlice(index, scan.index); index = $append(index, i); next = $append(next, new fieldScan.ptr(styp, index)); _i$1++; /* } */ $s = 7; continue; case 8: _i++; /* } */ $s = 3; continue; case 4: if (ok) { /* break; */ $s = 2; continue; } /* } */ $s = 1; continue; case 2: $s = -1; return [result, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByNameFunc }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._key$3 = _key$3; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.count = count; $f.current = current; $f.f = f; $f.fname = fname; $f.i = i; $f.index = index; $f.match = match; $f.next = next; $f.nextCount = nextCount; $f.ntyp = ntyp; $f.ok = ok; $f.result = result; $f.scan = scan; $f.styp = styp; $f.t = t; $f.t$1 = t$1; $f.visited = visited; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; structType.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; structType.ptr.prototype.FieldByName = function(name$1) { var _i, _r, _ref, _tmp, _tmp$1, _tuple, f, hasEmbeds, i, name$1, present, t, tf, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; f = $f.f; hasEmbeds = $f.hasEmbeds; i = $f.i; name$1 = $f.name$1; present = $f.present; t = $f.t; tf = $f.tf; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name$1 = [name$1]; f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$13.nil, false); present = false; t = this; hasEmbeds = false; if (!(name$1[0] === "")) { _ref = t.fields; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; tf = (x = t.fields, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if ($clone(tf.name, name).name() === name$1[0]) { _tmp = $clone(t.Field(i), StructField); _tmp$1 = true; StructField.copy(f, _tmp); present = _tmp$1; $s = -1; return [f, present]; } if (tf.embedded()) { hasEmbeds = true; } _i++; } } if (!hasEmbeds) { $s = -1; return [f, present]; } _r = t.FieldByNameFunc((function(name$1) { return function(s) { var s; return s === name$1[0]; }; })(name$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; StructField.copy(f, _tuple[0]); present = _tuple[1]; $s = -1; return [f, present]; /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByName }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.f = f; $f.hasEmbeds = hasEmbeds; $f.i = i; $f.name$1 = name$1; $f.present = present; $f.t = t; $f.tf = tf; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; structType.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; PtrTo = function(t) { var t; return $assertType(t, ptrType$1).ptrTo(); }; $pkg.PtrTo = PtrTo; rtype.ptr.prototype.Implements = function(u) { var _r, t, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if ($interfaceIsEqual(u, $ifaceNil)) { $panic(new $String("reflect: nil type passed to Type.Implements")); } _r = u.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 20))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 20))) { */ case 1: $panic(new $String("reflect: non-interface type passed to Type.Implements")); /* } */ case 2: $s = -1; return implements$1($assertType(u, ptrType$1), t); /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Implements }; } $f._r = _r; $f.t = t; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.Implements = function(u) { return this.$val.Implements(u); }; rtype.ptr.prototype.AssignableTo = function(u) { var _r, t, u, uu, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; u = $f.u; uu = $f.uu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if ($interfaceIsEqual(u, $ifaceNil)) { $panic(new $String("reflect: nil type passed to Type.AssignableTo")); } uu = $assertType(u, ptrType$1); _r = directlyAssignable(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r || implements$1(uu, t); /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.AssignableTo }; } $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; rtype.ptr.prototype.ConvertibleTo = function(u) { var _r, t, u, uu, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; u = $f.u; uu = $f.uu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; if ($interfaceIsEqual(u, $ifaceNil)) { $panic(new $String("reflect: nil type passed to Type.ConvertibleTo")); } uu = $assertType(u, ptrType$1); _r = convertOp(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return !(_r === $throwNilPointerError); /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.ConvertibleTo }; } $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; }; rtype.prototype.ConvertibleTo = function(u) { return this.$val.ConvertibleTo(u); }; implements$1 = function(T, V) { var T, V, i, i$1, j, j$1, t, tm, tm$1, tmName, tmName$1, tmPkgPath, tmPkgPath$1, v, v$1, vm, vm$1, vmName, vmName$1, vmPkgPath, vmPkgPath$1, vmethods, x, x$1, x$2; if (!((T.Kind() === 20))) { return false; } t = (T.kindType); if (t.methods.$length === 0) { return true; } if (V.Kind() === 20) { v = (V.kindType); i = 0; j = 0; while (true) { if (!(j < v.methods.$length)) { break; } tm = (x = t.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); tmName = $clone(t.rtype.nameOff(tm.name), name); vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j])); vmName = $clone(V.nameOff(vm.name), name); if ($clone(vmName, name).name() === $clone(tmName, name).name() && V.typeOff(vm.typ) === t.rtype.typeOff(tm.typ)) { if (!$clone(tmName, name).isExported()) { tmPkgPath = $clone(tmName, name).pkgPath(); if (tmPkgPath === "") { tmPkgPath = $clone(t.pkgPath, name).name(); } vmPkgPath = $clone(vmName, name).pkgPath(); if (vmPkgPath === "") { vmPkgPath = $clone(v.pkgPath, name).name(); } if (!(tmPkgPath === vmPkgPath)) { j = j + (1) >> 0; continue; } } i = i + (1) >> 0; if (i >= t.methods.$length) { return true; } } j = j + (1) >> 0; } return false; } v$1 = V.uncommon(); if (v$1 === ptrType$5.nil) { return false; } i$1 = 0; vmethods = v$1.methods(); j$1 = 0; while (true) { if (!(j$1 < ((v$1.mcount >> 0)))) { break; } tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i$1])); tmName$1 = $clone(t.rtype.nameOff(tm$1.name), name); vm$1 = $clone(((j$1 < 0 || j$1 >= vmethods.$length) ? ($throwRuntimeError("index out of range"), undefined) : vmethods.$array[vmethods.$offset + j$1]), method); vmName$1 = $clone(V.nameOff(vm$1.name), name); if ($clone(vmName$1, name).name() === $clone(tmName$1, name).name() && V.typeOff(vm$1.mtyp) === t.rtype.typeOff(tm$1.typ)) { if (!$clone(tmName$1, name).isExported()) { tmPkgPath$1 = $clone(tmName$1, name).pkgPath(); if (tmPkgPath$1 === "") { tmPkgPath$1 = $clone(t.pkgPath, name).name(); } vmPkgPath$1 = $clone(vmName$1, name).pkgPath(); if (vmPkgPath$1 === "") { vmPkgPath$1 = $clone(V.nameOff(v$1.pkgPath), name).name(); } if (!(tmPkgPath$1 === vmPkgPath$1)) { j$1 = j$1 + (1) >> 0; continue; } } i$1 = i$1 + (1) >> 0; if (i$1 >= t.methods.$length) { return true; } } j$1 = j$1 + (1) >> 0; } return false; }; directlyAssignable = function(T, V) { var T, V, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; T = $f.T; V = $f.V; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (T === V) { $s = -1; return true; } if (!(T.Name() === "") && !(V.Name() === "") || !((T.Kind() === V.Kind()))) { $s = -1; return false; } _r = haveIdenticalUnderlyingType(T, V, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: directlyAssignable }; } $f.T = T; $f.V = V; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; haveIdenticalType = function(T, V, cmpTags) { var T, V, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, cmpTags, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; T = $f.T; V = $f.V; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _v = $f._v; cmpTags = $f.cmpTags; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (cmpTags) { $s = -1; return $interfaceIsEqual(T, V); } _r = T.Name(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = V.Name(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!(_r === _r$1)) { _v = true; $s = 3; continue s; } _r$2 = T.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = V.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = !((_r$2 === _r$3)); case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return false; /* } */ case 2: _r$4 = T.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = _r$4; _r$5 = V.common(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = _r$5; _r$6 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $s = -1; return _r$6; /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalType }; } $f.T = T; $f.V = V; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._v = _v; $f.cmpTags = cmpTags; $f.$s = $s; $f.$r = $r; return $f; }; haveIdenticalUnderlyingType = function(T, V, cmpTags) { var T, V, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _v, _v$1, _v$2, _v$3, cmpTags, i, i$1, i$2, kind, t, t$1, t$2, tf, v, v$1, v$2, vf, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; T = $f.T; V = $f.V; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; cmpTags = $f.cmpTags; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; kind = $f.kind; t = $f.t; t$1 = $f.t$1; t$2 = $f.t$2; tf = $f.tf; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; vf = $f.vf; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (T === V) { $s = -1; return true; } kind = T.Kind(); if (!((kind === V.Kind()))) { $s = -1; return false; } if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { $s = -1; return true; } _1 = kind; /* */ if (_1 === (17)) { $s = 2; continue; } /* */ if (_1 === (18)) { $s = 3; continue; } /* */ if (_1 === (19)) { $s = 4; continue; } /* */ if (_1 === (20)) { $s = 5; continue; } /* */ if (_1 === (21)) { $s = 6; continue; } /* */ if ((_1 === (22)) || (_1 === (23))) { $s = 7; continue; } /* */ if (_1 === (25)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_1 === (17)) { */ case 2: if (!(T.Len() === V.Len())) { _v = false; $s = 10; continue s; } _r = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 10: $s = -1; return _v; /* } else if (_1 === (18)) { */ case 3: if (!(V.ChanDir() === 3)) { _v$1 = false; $s = 14; continue s; } _r$1 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v$1 = _r$1; case 14: /* */ if (_v$1) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_v$1) { */ case 12: $s = -1; return true; /* } */ case 13: if (!(V.ChanDir() === T.ChanDir())) { _v$2 = false; $s = 16; continue s; } _r$2 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$2 = _r$2; case 16: $s = -1; return _v$2; /* } else if (_1 === (19)) { */ case 4: t = (T.kindType); v = (V.kindType); if (!((t.outCount === v.outCount)) || !((t.inCount === v.inCount))) { $s = -1; return false; } i = 0; /* while (true) { */ case 18: /* if (!(i < t.rtype.NumIn())) { break; } */ if(!(i < t.rtype.NumIn())) { $s = 19; continue; } _r$3 = haveIdenticalType(t.rtype.In(i), v.rtype.In(i), cmpTags); /* */ $s = 22; case 22: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!_r$3) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!_r$3) { */ case 20: $s = -1; return false; /* } */ case 21: i = i + (1) >> 0; /* } */ $s = 18; continue; case 19: i$1 = 0; /* while (true) { */ case 23: /* if (!(i$1 < t.rtype.NumOut())) { break; } */ if(!(i$1 < t.rtype.NumOut())) { $s = 24; continue; } _r$4 = haveIdenticalType(t.rtype.Out(i$1), v.rtype.Out(i$1), cmpTags); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 25; continue; } /* */ $s = 26; continue; /* if (!_r$4) { */ case 25: $s = -1; return false; /* } */ case 26: i$1 = i$1 + (1) >> 0; /* } */ $s = 23; continue; case 24: $s = -1; return true; /* } else if (_1 === (20)) { */ case 5: t$1 = (T.kindType); v$1 = (V.kindType); if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { $s = -1; return true; } $s = -1; return false; /* } else if (_1 === (21)) { */ case 6: _r$5 = haveIdenticalType(T.Key(), V.Key(), cmpTags); /* */ $s = 29; case 29: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } if (!(_r$5)) { _v$3 = false; $s = 28; continue s; } _r$6 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 30; case 30: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$3 = _r$6; case 28: $s = -1; return _v$3; /* } else if ((_1 === (22)) || (_1 === (23))) { */ case 7: _r$7 = haveIdenticalType(T.Elem(), V.Elem(), cmpTags); /* */ $s = 31; case 31: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $s = -1; return _r$7; /* } else if (_1 === (25)) { */ case 8: t$2 = (T.kindType); v$2 = (V.kindType); if (!((t$2.fields.$length === v$2.fields.$length))) { $s = -1; return false; } if (!($clone(t$2.pkgPath, name).name() === $clone(v$2.pkgPath, name).name())) { $s = -1; return false; } _ref = t$2.fields; _i = 0; /* while (true) { */ case 32: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 33; continue; } i$2 = _i; tf = (x = t$2.fields, ((i$2 < 0 || i$2 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i$2])); vf = (x$1 = v$2.fields, ((i$2 < 0 || i$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$2])); if (!($clone(tf.name, name).name() === $clone(vf.name, name).name())) { $s = -1; return false; } _r$8 = haveIdenticalType(tf.typ, vf.typ, cmpTags); /* */ $s = 36; case 36: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if (!_r$8) { $s = 34; continue; } /* */ $s = 35; continue; /* if (!_r$8) { */ case 34: $s = -1; return false; /* } */ case 35: if (cmpTags && !($clone(tf.name, name).tag() === $clone(vf.name, name).tag())) { $s = -1; return false; } if (!((tf.offsetEmbed === vf.offsetEmbed))) { $s = -1; return false; } _i++; /* } */ $s = 32; continue; case 33: $s = -1; return true; /* } */ case 9: case 1: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: haveIdenticalUnderlyingType }; } $f.T = T; $f.V = V; $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f.cmpTags = cmpTags; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.kind = kind; $f.t = t; $f.t$1 = t$1; $f.t$2 = t$2; $f.tf = tf; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.vf = vf; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; toType = function(t) { var t; if (t === ptrType$1.nil) { return $ifaceNil; } return t; }; ifaceIndir = function(t) { var t; return ((t.kind & 32) >>> 0) === 0; }; flag.prototype.kind = function() { var f; f = this.$val; return ((((f & 31) >>> 0) >>> 0)); }; $ptrType(flag).prototype.kind = function() { return new flag(this.$get()).kind(); }; flag.prototype.ro = function() { var f; f = this.$val; if (!((((f & 96) >>> 0) === 0))) { return 32; } return 0; }; $ptrType(flag).prototype.ro = function() { return new flag(this.$get()).ro(); }; Value.ptr.prototype.pointer = function() { var v; v = this; if (!((v.typ.size === 4)) || !v.typ.pointers()) { $panic(new $String("can't call pointer on a non-pointer Value")); } if (!((((v.flag & 128) >>> 0) === 0))) { return (v.ptr).$get(); } return v.ptr; }; Value.prototype.pointer = function() { return this.$val.pointer(); }; ValueError.ptr.prototype.Error = function() { var e; e = this; if (e.Kind === 0) { return "reflect: call of " + e.Method + " on zero Value"; } return "reflect: call of " + e.Method + " on " + new Kind(e.Kind).String() + " Value"; }; ValueError.prototype.Error = function() { return this.$val.Error(); }; flag.prototype.mustBe = function(expected) { var expected, f; f = this.$val; if (!((new flag(f).kind() === expected))) { $panic(new ValueError.ptr(methodName(), new flag(f).kind())); } }; $ptrType(flag).prototype.mustBe = function(expected) { return new flag(this.$get()).mustBe(expected); }; flag.prototype.mustBeExported = function() { var f; f = this.$val; if (f === 0) { $panic(new ValueError.ptr(methodName(), 0)); } if (!((((f & 96) >>> 0) === 0))) { $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); } }; $ptrType(flag).prototype.mustBeExported = function() { return new flag(this.$get()).mustBeExported(); }; flag.prototype.mustBeAssignable = function() { var f; f = this.$val; if (f === 0) { $panic(new ValueError.ptr(methodName(), 0)); } if (!((((f & 96) >>> 0) === 0))) { $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); } if (((f & 256) >>> 0) === 0) { $panic(new $String("reflect: " + methodName() + " using unaddressable value")); } }; $ptrType(flag).prototype.mustBeAssignable = function() { return new flag(this.$get()).mustBeAssignable(); }; Value.ptr.prototype.Addr = function() { var v; v = this; if (((v.flag & 256) >>> 0) === 0) { $panic(new $String("reflect.Value.Addr of unaddressable value")); } return new Value.ptr(v.typ.ptrTo(), v.ptr, (new flag(v.flag).ro() | 22) >>> 0); }; Value.prototype.Addr = function() { return this.$val.Addr(); }; Value.ptr.prototype.Bool = function() { var v; v = this; new flag(v.flag).mustBe(1); return (v.ptr).$get(); }; Value.prototype.Bool = function() { return this.$val.Bool(); }; Value.ptr.prototype.Bytes = function() { var _r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(23); _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 8))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 8))) { */ case 1: $panic(new $String("reflect.Value.Bytes of non-byte slice")); /* } */ case 2: $s = -1; return (v.ptr).$get(); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Bytes }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Bytes = function() { return this.$val.Bytes(); }; Value.ptr.prototype.runes = function() { var _r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(23); _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 5))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 5))) { */ case 1: $panic(new $String("reflect.Value.Bytes of non-rune slice")); /* } */ case 2: $s = -1; return (v.ptr).$get(); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.runes }; } $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.runes = function() { return this.$val.runes(); }; Value.ptr.prototype.CanAddr = function() { var v; v = this; return !((((v.flag & 256) >>> 0) === 0)); }; Value.prototype.CanAddr = function() { return this.$val.CanAddr(); }; Value.ptr.prototype.CanSet = function() { var v; v = this; return ((v.flag & 352) >>> 0) === 256; }; Value.prototype.CanSet = function() { return this.$val.CanSet(); }; Value.ptr.prototype.Call = function(in$1) { var _r, in$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(19); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).call("Call", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Call }; } $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Call = function(in$1) { return this.$val.Call(in$1); }; Value.ptr.prototype.CallSlice = function(in$1) { var _r, in$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(19); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).call("CallSlice", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.CallSlice }; } $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.CallSlice = function(in$1) { return this.$val.CallSlice(in$1); }; Value.ptr.prototype.Complex = function() { var _1, k, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (15)) { return ((x = (v.ptr).$get(), new $Complex128(x.$real, x.$imag))); } else if (_1 === (16)) { return (v.ptr).$get(); } $panic(new ValueError.ptr("reflect.Value.Complex", new flag(v.flag).kind())); }; Value.prototype.Complex = function() { return this.$val.Complex(); }; Value.ptr.prototype.FieldByIndex = function(index) { var _i, _r, _r$1, _r$2, _r$3, _ref, _v, i, index, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _v = $f._v; i = $f.i; index = $f.index; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; /* */ if (index.$length === 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (index.$length === 1) { */ case 1: _r = $clone(v, Value).Field((0 >= index.$length ? ($throwRuntimeError("index out of range"), undefined) : index.$array[index.$offset + 0])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: new flag(v.flag).mustBe(25); _ref = index; _i = 0; /* while (true) { */ case 4: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 5; continue; } i = _i; x = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (i > 0) { $s = 6; continue; } /* */ $s = 7; continue; /* if (i > 0) { */ case 6: if (!($clone(v, Value).Kind() === 22)) { _v = false; $s = 10; continue s; } _r$1 = v.typ.Elem().Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1 === 25; case 10: /* */ if (_v) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_v) { */ case 8: if ($clone(v, Value).IsNil()) { $panic(new $String("reflect: indirection through nil pointer to embedded struct")); } _r$2 = $clone(v, Value).Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v = _r$2; /* } */ case 9: /* } */ case 7: _r$3 = $clone(v, Value).Field(x); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } v = _r$3; _i++; /* } */ $s = 4; continue; case 5: $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByIndex }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._v = _v; $f.i = i; $f.index = index; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; Value.ptr.prototype.FieldByName = function(name$1) { var _r, _r$1, _tuple, f, name$1, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; name$1 = $f.name$1; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(25); _r = v.typ.FieldByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = $clone(_tuple[0], StructField); ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = $clone(v, Value).FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 3: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByName }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.name$1 = name$1; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.FieldByName = function(name$1) { return this.$val.FieldByName(name$1); }; Value.ptr.prototype.FieldByNameFunc = function(match) { var _r, _r$1, _tuple, f, match, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; match = $f.match; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; _r = v.typ.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = $clone(_tuple[0], StructField); ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = $clone(v, Value).FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 3: $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByNameFunc }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.match = match; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; Value.ptr.prototype.Float = function() { var _1, k, v; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (13)) { return ((v.ptr).$get()); } else if (_1 === (14)) { return (v.ptr).$get(); } $panic(new ValueError.ptr("reflect.Value.Float", new flag(v.flag).kind())); }; Value.prototype.Float = function() { return this.$val.Float(); }; Value.ptr.prototype.Int = function() { var _1, k, p, v; v = this; k = new flag(v.flag).kind(); p = v.ptr; _1 = k; if (_1 === (2)) { return (new $Int64(0, (p).$get())); } else if (_1 === (3)) { return (new $Int64(0, (p).$get())); } else if (_1 === (4)) { return (new $Int64(0, (p).$get())); } else if (_1 === (5)) { return (new $Int64(0, (p).$get())); } else if (_1 === (6)) { return (p).$get(); } $panic(new ValueError.ptr("reflect.Value.Int", new flag(v.flag).kind())); }; Value.prototype.Int = function() { return this.$val.Int(); }; Value.ptr.prototype.CanInterface = function() { var v; v = this; if (v.flag === 0) { $panic(new ValueError.ptr("reflect.Value.CanInterface", 0)); } return ((v.flag & 96) >>> 0) === 0; }; Value.prototype.CanInterface = function() { return this.$val.CanInterface(); }; Value.ptr.prototype.Interface = function() { var _r, i, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = $ifaceNil; v = this; _r = valueInterface($clone(v, Value), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Interface }; } $f._r = _r; $f.i = i; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Interface = function() { return this.$val.Interface(); }; Value.ptr.prototype.IsValid = function() { var v; v = this; return !((v.flag === 0)); }; Value.prototype.IsValid = function() { return this.$val.IsValid(); }; Value.ptr.prototype.Kind = function() { var v; v = this; return new flag(v.flag).kind(); }; Value.prototype.Kind = function() { return this.$val.Kind(); }; Value.ptr.prototype.MapIndex = function(key) { var _r, c, e, fl, k, key, tt, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; e = $f.e; fl = $f.fl; k = $f.k; key = $f.key; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(21); tt = (v.typ.kindType); _r = $clone(key, Value).assignTo("reflect.Value.MapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } key = _r; k = 0; if (!((((key.flag & 128) >>> 0) === 0))) { k = key.ptr; } else { k = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$16(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); } e = mapaccess(v.typ, $clone(v, Value).pointer(), k); if (e === 0) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } typ = tt.elem; fl = new flag((((v.flag | key.flag) >>> 0))).ro(); fl = (fl | (((typ.Kind() >>> 0)))) >>> 0; if (!ifaceIndir(typ)) { $s = -1; return new Value.ptr(typ, (e).$get(), fl); } c = unsafe_New(typ); typedmemmove(typ, c, e); $s = -1; return new Value.ptr(typ, c, (fl | 128) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapIndex }; } $f._r = _r; $f.c = c; $f.e = e; $f.fl = fl; $f.k = k; $f.key = key; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.MapIndex = function(key) { return this.$val.MapIndex(key); }; Value.ptr.prototype.MapKeys = function() { var _r, a, c, fl, i, it, key, keyType, m, mlen, tt, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; c = $f.c; fl = $f.fl; i = $f.i; it = $f.it; key = $f.key; keyType = $f.keyType; m = $f.m; mlen = $f.mlen; tt = $f.tt; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(21); tt = (v.typ.kindType); keyType = tt.key; fl = (new flag(v.flag).ro() | ((keyType.Kind() >>> 0))) >>> 0; m = $clone(v, Value).pointer(); mlen = 0; if (!(m === 0)) { mlen = maplen(m); } it = mapiterinit(v.typ, m); a = $makeSlice(sliceType$9, mlen); i = 0; i = 0; /* while (true) { */ case 1: /* if (!(i < a.$length)) { break; } */ if(!(i < a.$length)) { $s = 2; continue; } _r = mapiterkey(it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } key = _r; if (key === 0) { /* break; */ $s = 2; continue; } if (ifaceIndir(keyType)) { c = unsafe_New(keyType); typedmemmove(keyType, c, key); ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = new Value.ptr(keyType, c, (fl | 128) >>> 0)); } else { ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = new Value.ptr(keyType, (key).$get(), fl)); } mapiternext(it); i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $s = -1; return $subslice(a, 0, i); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapKeys }; } $f._r = _r; $f.a = a; $f.c = c; $f.fl = fl; $f.i = i; $f.it = it; $f.key = key; $f.keyType = keyType; $f.m = m; $f.mlen = mlen; $f.tt = tt; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.MapKeys = function() { return this.$val.MapKeys(); }; Value.ptr.prototype.Method = function(i) { var fl, i, v; v = this; if (v.typ === ptrType$1.nil) { $panic(new ValueError.ptr("reflect.Value.Method", 0)); } if (!((((v.flag & 512) >>> 0) === 0)) || ((i >>> 0)) >= ((v.typ.NumMethod() >>> 0))) { $panic(new $String("reflect: Method index out of range")); } if ((v.typ.Kind() === 20) && $clone(v, Value).IsNil()) { $panic(new $String("reflect: Method on nil interface value")); } fl = (v.flag & 160) >>> 0; fl = (fl | (19)) >>> 0; fl = (fl | ((((((i >>> 0)) << 10 >>> 0) | 512) >>> 0))) >>> 0; return new Value.ptr(v.typ, v.ptr, fl); }; Value.prototype.Method = function(i) { return this.$val.Method(i); }; Value.ptr.prototype.NumMethod = function() { var v; v = this; if (v.typ === ptrType$1.nil) { $panic(new ValueError.ptr("reflect.Value.NumMethod", 0)); } if (!((((v.flag & 512) >>> 0) === 0))) { return 0; } return v.typ.NumMethod(); }; Value.prototype.NumMethod = function() { return this.$val.NumMethod(); }; Value.ptr.prototype.MethodByName = function(name$1) { var _r, _tuple, m, name$1, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; m = $f.m; name$1 = $f.name$1; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; if (v.typ === ptrType$1.nil) { $panic(new ValueError.ptr("reflect.Value.MethodByName", 0)); } if (!((((v.flag & 512) >>> 0) === 0))) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } _r = v.typ.MethodByName(name$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = $clone(_tuple[0], Method); ok = _tuple[1]; if (!ok) { $s = -1; return new Value.ptr(ptrType$1.nil, 0, 0); } $s = -1; return $clone(v, Value).Method(m.Index); /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MethodByName }; } $f._r = _r; $f._tuple = _tuple; $f.m = m; $f.name$1 = name$1; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.MethodByName = function(name$1) { return this.$val.MethodByName(name$1); }; Value.ptr.prototype.NumField = function() { var tt, v; v = this; new flag(v.flag).mustBe(25); tt = (v.typ.kindType); return tt.fields.$length; }; Value.prototype.NumField = function() { return this.$val.NumField(); }; Value.ptr.prototype.OverflowComplex = function(x) { var _1, k, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (15)) { return overflowFloat32(x.$real) || overflowFloat32(x.$imag); } else if (_1 === (16)) { return false; } $panic(new ValueError.ptr("reflect.Value.OverflowComplex", new flag(v.flag).kind())); }; Value.prototype.OverflowComplex = function(x) { return this.$val.OverflowComplex(x); }; Value.ptr.prototype.OverflowFloat = function(x) { var _1, k, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (13)) { return overflowFloat32(x); } else if (_1 === (14)) { return false; } $panic(new ValueError.ptr("reflect.Value.OverflowFloat", new flag(v.flag).kind())); }; Value.prototype.OverflowFloat = function(x) { return this.$val.OverflowFloat(x); }; overflowFloat32 = function(x) { var x; if (x < 0) { x = -x; } return 3.4028234663852886e+38 < x && x <= 1.7976931348623157e+308; }; Value.ptr.prototype.OverflowInt = function(x) { var _1, bitSize, k, trunc, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { bitSize = $imul(v.typ.size, 8) >>> 0; trunc = $shiftRightInt64(($shiftLeft64(x, ((64 - bitSize >>> 0)))), ((64 - bitSize >>> 0))); return !((x.$high === trunc.$high && x.$low === trunc.$low)); } $panic(new ValueError.ptr("reflect.Value.OverflowInt", new flag(v.flag).kind())); }; Value.prototype.OverflowInt = function(x) { return this.$val.OverflowInt(x); }; Value.ptr.prototype.OverflowUint = function(x) { var _1, bitSize, k, trunc, v, x; v = this; k = new flag(v.flag).kind(); _1 = k; if ((_1 === (7)) || (_1 === (12)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11))) { bitSize = $imul(v.typ.size, 8) >>> 0; trunc = $shiftRightUint64(($shiftLeft64(x, ((64 - bitSize >>> 0)))), ((64 - bitSize >>> 0))); return !((x.$high === trunc.$high && x.$low === trunc.$low)); } $panic(new ValueError.ptr("reflect.Value.OverflowUint", new flag(v.flag).kind())); }; Value.prototype.OverflowUint = function(x) { return this.$val.OverflowUint(x); }; Value.ptr.prototype.Recv = function() { var _r, _tuple, ok, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = new Value.ptr(ptrType$1.nil, 0, 0); ok = false; v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).recv(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; x = _tuple[0]; ok = _tuple[1]; $s = -1; return [x, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Recv }; } $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Recv = function() { return this.$val.Recv(); }; Value.ptr.prototype.recv = function(nb) { var _r, _tuple, nb, ok, p, selected, t, tt, v, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; nb = $f.nb; ok = $f.ok; p = $f.p; selected = $f.selected; t = $f.t; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: val = new Value.ptr(ptrType$1.nil, 0, 0); ok = false; v = this; tt = (v.typ.kindType); if ((((tt.dir >> 0)) & 1) === 0) { $panic(new $String("reflect: recv on send-only channel")); } t = tt.elem; val = new Value.ptr(t, 0, ((t.Kind() >>> 0))); p = 0; if (ifaceIndir(t)) { p = unsafe_New(t); val.ptr = p; val.flag = (val.flag | (128)) >>> 0; } else { p = ((val.$ptr_ptr || (val.$ptr_ptr = new ptrType$16(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val)))); } _r = chanrecv($clone(v, Value).pointer(), nb, p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; selected = _tuple[0]; ok = _tuple[1]; if (!selected) { val = new Value.ptr(ptrType$1.nil, 0, 0); } $s = -1; return [val, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.recv }; } $f._r = _r; $f._tuple = _tuple; $f.nb = nb; $f.ok = ok; $f.p = p; $f.selected = selected; $f.t = t; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.recv = function(nb) { return this.$val.recv(nb); }; Value.ptr.prototype.Send = function(x) { var _r, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).send($clone(x, Value), false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Send }; } $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Send = function(x) { return this.$val.Send(x); }; Value.ptr.prototype.send = function(x, nb) { var _r, _r$1, nb, p, selected, tt, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; nb = $f.nb; p = $f.p; selected = $f.selected; tt = $f.tt; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: selected = false; v = this; tt = (v.typ.kindType); if ((((tt.dir >> 0)) & 2) === 0) { $panic(new $String("reflect: send on recv-only channel")); } new flag(x.flag).mustBeExported(); _r = $clone(x, Value).assignTo("reflect.Value.Send", tt.elem, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } x = _r; p = 0; if (!((((x.flag & 128) >>> 0) === 0))) { p = x.ptr; } else { p = ((x.$ptr_ptr || (x.$ptr_ptr = new ptrType$16(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, x)))); } _r$1 = chansend($clone(v, Value).pointer(), p, nb); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } selected = _r$1; $s = -1; return selected; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.send }; } $f._r = _r; $f._r$1 = _r$1; $f.nb = nb; $f.p = p; $f.selected = selected; $f.tt = tt; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.send = function(x, nb) { return this.$val.send(x, nb); }; Value.ptr.prototype.SetBool = function(x) { var v, x; v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(1); (v.ptr).$set(x); }; Value.prototype.SetBool = function(x) { return this.$val.SetBool(x); }; Value.ptr.prototype.setRunes = function(x) { var _r, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(23); _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 5))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === 5))) { */ case 1: $panic(new $String("reflect.Value.setRunes of non-rune slice")); /* } */ case 2: (v.ptr).$set(x); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.setRunes }; } $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.setRunes = function(x) { return this.$val.setRunes(x); }; Value.ptr.prototype.SetComplex = function(x) { var _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (15)) { (v.ptr).$set((new $Complex64(x.$real, x.$imag))); } else if (_1 === (16)) { (v.ptr).$set(x); } else { $panic(new ValueError.ptr("reflect.Value.SetComplex", new flag(v.flag).kind())); } }; Value.prototype.SetComplex = function(x) { return this.$val.SetComplex(x); }; Value.ptr.prototype.SetFloat = function(x) { var _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (13)) { (v.ptr).$set(($fround(x))); } else if (_1 === (14)) { (v.ptr).$set(x); } else { $panic(new ValueError.ptr("reflect.Value.SetFloat", new flag(v.flag).kind())); } }; Value.prototype.SetFloat = function(x) { return this.$val.SetFloat(x); }; Value.ptr.prototype.SetInt = function(x) { var _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (2)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) >> 0))); } else if (_1 === (3)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) << 24 >> 24))); } else if (_1 === (4)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) << 16 >> 16))); } else if (_1 === (5)) { (v.ptr).$set((((x.$low + ((x.$high >> 31) * 4294967296)) >> 0))); } else if (_1 === (6)) { (v.ptr).$set(x); } else { $panic(new ValueError.ptr("reflect.Value.SetInt", new flag(v.flag).kind())); } }; Value.prototype.SetInt = function(x) { return this.$val.SetInt(x); }; Value.ptr.prototype.SetMapIndex = function(key, val) { var _r, _r$1, e, k, key, tt, v, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; e = $f.e; k = $f.k; key = $f.key; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(21); new flag(v.flag).mustBeExported(); new flag(key.flag).mustBeExported(); tt = (v.typ.kindType); _r = $clone(key, Value).assignTo("reflect.Value.SetMapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } key = _r; k = 0; if (!((((key.flag & 128) >>> 0) === 0))) { k = key.ptr; } else { k = ((key.$ptr_ptr || (key.$ptr_ptr = new ptrType$16(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key)))); } if (val.typ === ptrType$1.nil) { mapdelete(v.typ, $clone(v, Value).pointer(), k); $s = -1; return; } new flag(val.flag).mustBeExported(); _r$1 = $clone(val, Value).assignTo("reflect.Value.SetMapIndex", tt.elem, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } val = _r$1; e = 0; if (!((((val.flag & 128) >>> 0) === 0))) { e = val.ptr; } else { e = ((val.$ptr_ptr || (val.$ptr_ptr = new ptrType$16(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val)))); } $r = mapassign(v.typ, $clone(v, Value).pointer(), k, e); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetMapIndex }; } $f._r = _r; $f._r$1 = _r$1; $f.e = e; $f.k = k; $f.key = key; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.SetMapIndex = function(key, val) { return this.$val.SetMapIndex(key, val); }; Value.ptr.prototype.SetUint = function(x) { var _1, k, v, x; v = this; new flag(v.flag).mustBeAssignable(); k = new flag(v.flag).kind(); _1 = k; if (_1 === (7)) { (v.ptr).$set(((x.$low >>> 0))); } else if (_1 === (8)) { (v.ptr).$set(((x.$low << 24 >>> 24))); } else if (_1 === (9)) { (v.ptr).$set(((x.$low << 16 >>> 16))); } else if (_1 === (10)) { (v.ptr).$set(((x.$low >>> 0))); } else if (_1 === (11)) { (v.ptr).$set(x); } else if (_1 === (12)) { (v.ptr).$set(((x.$low >>> 0))); } else { $panic(new ValueError.ptr("reflect.Value.SetUint", new flag(v.flag).kind())); } }; Value.prototype.SetUint = function(x) { return this.$val.SetUint(x); }; Value.ptr.prototype.SetPointer = function(x) { var v, x; v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(26); (v.ptr).$set(x); }; Value.prototype.SetPointer = function(x) { return this.$val.SetPointer(x); }; Value.ptr.prototype.SetString = function(x) { var v, x; v = this; new flag(v.flag).mustBeAssignable(); new flag(v.flag).mustBe(24); (v.ptr).$set(x); }; Value.prototype.SetString = function(x) { return this.$val.SetString(x); }; Value.ptr.prototype.String = function() { var _1, _r, k, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; k = $f.k; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; k = new flag(v.flag).kind(); _1 = k; if (_1 === (0)) { $s = -1; return ""; } else if (_1 === (24)) { $s = -1; return (v.ptr).$get(); } _r = $clone(v, Value).Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return "<" + _r + " Value>"; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.String }; } $f._1 = _1; $f._r = _r; $f.k = k; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.String = function() { return this.$val.String(); }; Value.ptr.prototype.TryRecv = function() { var _r, _tuple, ok, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: x = new Value.ptr(ptrType$1.nil, 0, 0); ok = false; v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).recv(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; x = _tuple[0]; ok = _tuple[1]; $s = -1; return [x, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TryRecv }; } $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.TryRecv = function() { return this.$val.TryRecv(); }; Value.ptr.prototype.TrySend = function(x) { var _r, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; new flag(v.flag).mustBe(18); new flag(v.flag).mustBeExported(); _r = $clone(v, Value).send($clone(x, Value), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TrySend }; } $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.TrySend = function(x) { return this.$val.TrySend(x); }; Value.ptr.prototype.Type = function() { var f, i, m, m$1, ms, tt, v, x; v = this; f = v.flag; if (f === 0) { $panic(new ValueError.ptr("reflect.Value.Type", 0)); } if (((f & 512) >>> 0) === 0) { return v.typ; } i = ((v.flag >> 0)) >> 10 >> 0; if (v.typ.Kind() === 20) { tt = (v.typ.kindType); if (((i >>> 0)) >= ((tt.methods.$length >>> 0))) { $panic(new $String("reflect: internal error: invalid method index")); } m = (x = tt.methods, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); return v.typ.typeOff(m.typ); } ms = v.typ.exportedMethods(); if (((i >>> 0)) >= ((ms.$length >>> 0))) { $panic(new $String("reflect: internal error: invalid method index")); } m$1 = $clone(((i < 0 || i >= ms.$length) ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + i]), method); return v.typ.typeOff(m$1.mtyp); }; Value.prototype.Type = function() { return this.$val.Type(); }; Value.ptr.prototype.Uint = function() { var _1, k, p, v, x; v = this; k = new flag(v.flag).kind(); p = v.ptr; _1 = k; if (_1 === (7)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (8)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (9)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (10)) { return (new $Uint64(0, (p).$get())); } else if (_1 === (11)) { return (p).$get(); } else if (_1 === (12)) { return ((x = (p).$get(), new $Uint64(0, x.constructor === Number ? x : 1))); } $panic(new ValueError.ptr("reflect.Value.Uint", new flag(v.flag).kind())); }; Value.prototype.Uint = function() { return this.$val.Uint(); }; Value.ptr.prototype.UnsafeAddr = function() { var v; v = this; if (v.typ === ptrType$1.nil) { $panic(new ValueError.ptr("reflect.Value.UnsafeAddr", 0)); } if (((v.flag & 256) >>> 0) === 0) { $panic(new $String("reflect.Value.UnsafeAddr of unaddressable value")); } return (v.ptr); }; Value.prototype.UnsafeAddr = function() { return this.$val.UnsafeAddr(); }; New = function(typ) { var fl, ptr, t, typ; if ($interfaceIsEqual(typ, $ifaceNil)) { $panic(new $String("reflect: New(nil)")); } t = $assertType(typ, ptrType$1); ptr = unsafe_New(t); fl = 22; return new Value.ptr(t.ptrTo(), ptr, fl); }; $pkg.New = New; Value.ptr.prototype.Convert = function(t) { var _r, _r$1, _r$2, _r$3, _r$4, op, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; op = $f.op; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: v = this; /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: _r = makeMethodValue("Convert", $clone(v, Value)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; /* } */ case 2: _r$1 = t.common(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = convertOp(_r$1, v.typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } op = _r$2; /* */ if (op === $throwNilPointerError) { $s = 6; continue; } /* */ $s = 7; continue; /* if (op === $throwNilPointerError) { */ case 6: _r$3 = t.String(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $panic(new $String("reflect.Value.Convert: value of type " + v.typ.String() + " cannot be converted to type " + _r$3)); /* } */ case 7: _r$4 = op($clone(v, Value), t); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $s = -1; return _r$4; /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Convert }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.op = op; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Value.prototype.Convert = function(t) { return this.$val.Convert(t); }; convertOp = function(dst, src) { var _1, _2, _3, _4, _5, _6, _7, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _v, _v$1, _v$2, dst, src, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _5 = $f._5; _6 = $f._6; _7 = $f._7; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; dst = $f.dst; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = src.Kind(); /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 2; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 3; continue; } /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 4; continue; } /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 5; continue; } /* */ if (_1 === (24)) { $s = 6; continue; } /* */ if (_1 === (23)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 2: _2 = dst.Kind(); if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6)) || (_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { $s = -1; return cvtInt; } else if ((_2 === (13)) || (_2 === (14))) { $s = -1; return cvtIntFloat; } else if (_2 === (24)) { $s = -1; return cvtIntString; } $s = 8; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 3: _3 = dst.Kind(); if ((_3 === (2)) || (_3 === (3)) || (_3 === (4)) || (_3 === (5)) || (_3 === (6)) || (_3 === (7)) || (_3 === (8)) || (_3 === (9)) || (_3 === (10)) || (_3 === (11)) || (_3 === (12))) { $s = -1; return cvtUint; } else if ((_3 === (13)) || (_3 === (14))) { $s = -1; return cvtUintFloat; } else if (_3 === (24)) { $s = -1; return cvtUintString; } $s = 8; continue; /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 4: _4 = dst.Kind(); if ((_4 === (2)) || (_4 === (3)) || (_4 === (4)) || (_4 === (5)) || (_4 === (6))) { $s = -1; return cvtFloatInt; } else if ((_4 === (7)) || (_4 === (8)) || (_4 === (9)) || (_4 === (10)) || (_4 === (11)) || (_4 === (12))) { $s = -1; return cvtFloatUint; } else if ((_4 === (13)) || (_4 === (14))) { $s = -1; return cvtFloat; } $s = 8; continue; /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 5: _5 = dst.Kind(); if ((_5 === (15)) || (_5 === (16))) { $s = -1; return cvtComplex; } $s = 8; continue; /* } else if (_1 === (24)) { */ case 6: if (!(dst.Kind() === 23)) { _v = false; $s = 11; continue s; } _r = dst.Elem().PkgPath(); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r === ""; case 11: /* */ if (_v) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 9: _r$1 = dst.Elem().Kind(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _6 = _r$1; if (_6 === (8)) { $s = -1; return cvtStringBytes; } else if (_6 === (5)) { $s = -1; return cvtStringRunes; } case 13: /* } */ case 10: $s = 8; continue; /* } else if (_1 === (23)) { */ case 7: if (!(dst.Kind() === 24)) { _v$1 = false; $s = 17; continue s; } _r$2 = src.Elem().PkgPath(); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$1 = _r$2 === ""; case 17: /* */ if (_v$1) { $s = 15; continue; } /* */ $s = 16; continue; /* if (_v$1) { */ case 15: _r$3 = src.Elem().Kind(); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _7 = _r$3; if (_7 === (8)) { $s = -1; return cvtBytesString; } else if (_7 === (5)) { $s = -1; return cvtRunesString; } case 19: /* } */ case 16: /* } */ case 8: case 1: _r$4 = haveIdenticalUnderlyingType(dst, src, false); /* */ $s = 23; case 23: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_r$4) { */ case 21: $s = -1; return cvtDirect; /* } */ case 22: if (!((dst.Kind() === 22) && dst.Name() === "" && (src.Kind() === 22) && src.Name() === "")) { _v$2 = false; $s = 26; continue s; } _r$5 = dst.Elem().common(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = _r$5; _r$6 = src.Elem().common(); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$1 = _r$6; _r$7 = haveIdenticalUnderlyingType(_arg, _arg$1, false); /* */ $s = 29; case 29: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v$2 = _r$7; case 26: /* */ if (_v$2) { $s = 24; continue; } /* */ $s = 25; continue; /* if (_v$2) { */ case 24: $s = -1; return cvtDirect; /* } */ case 25: if (implements$1(dst, src)) { if (src.Kind() === 20) { $s = -1; return cvtI2I; } $s = -1; return cvtT2I; } $s = -1; return $throwNilPointerError; /* */ } return; } if ($f === undefined) { $f = { $blk: convertOp }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._6 = _6; $f._7 = _7; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.dst = dst; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; }; makeFloat = function(f, v, t) { var _1, _r, f, ptr, t, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } typ = _r; ptr = unsafe_New(typ); _1 = typ.size; if (_1 === (4)) { (ptr).$set(($fround(v))); } else if (_1 === (8)) { (ptr).$set(v); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeFloat }; } $f._1 = _1; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; makeComplex = function(f, v, t) { var _1, _r, f, ptr, t, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } typ = _r; ptr = unsafe_New(typ); _1 = typ.size; if (_1 === (8)) { (ptr).$set((new $Complex64(v.$real, v.$imag))); } else if (_1 === (16)) { (ptr).$set(v); } $s = -1; return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | ((typ.Kind() >>> 0))) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: makeComplex }; } $f._1 = _1; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; makeString = function(f, v, t) { var _r, f, ret, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $clone(ret, Value).SetString(v); ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: makeString }; } $f._r = _r; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; makeBytes = function(f, v, t) { var _r, f, ret, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $r = $clone(ret, Value).SetBytes(v); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: makeBytes }; } $f._r = _r; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; makeRunes = function(f, v, t) { var _r, f, ret, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(New(t), Value).Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; $r = $clone(ret, Value).setRunes(v); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: makeRunes }; } $f._r = _r; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtInt = function(v, t) { var _r, t, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), ((x = $clone(v, Value).Int(), new $Uint64(x.$high, x.$low))), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtInt }; } $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; cvtUint = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), $clone(v, Value).Uint(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUint }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtFloatInt = function(v, t) { var _r, t, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), ((x = (new $Int64(0, $clone(v, Value).Float())), new $Uint64(x.$high, x.$low))), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatInt }; } $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; cvtFloatUint = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeInt(new flag(v.flag).ro(), (new $Uint64(0, $clone(v, Value).Float())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatUint }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtIntFloat = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), ($flatten64($clone(v, Value).Int())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntFloat }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtUintFloat = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), ($flatten64($clone(v, Value).Uint())), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintFloat }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtFloat = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeFloat(new flag(v.flag).ro(), $clone(v, Value).Float(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloat }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtComplex = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeComplex(new flag(v.flag).ro(), $clone(v, Value).Complex(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtComplex }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtIntString = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeString(new flag(v.flag).ro(), ($encodeRune($clone(v, Value).Int().$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntString }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtUintString = function(v, t) { var _r, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = makeString(new flag(v.flag).ro(), ($encodeRune($clone(v, Value).Uint().$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintString }; } $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtBytesString = function(v, t) { var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).Bytes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = ($bytesToString(_r)); _arg$2 = t; _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtBytesString }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtStringBytes = function(v, t) { var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = (new sliceType$15($stringToBytes(_r))); _arg$2 = t; _r$1 = makeBytes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringBytes }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtRunesString = function(v, t) { var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).runes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = ($runesToString(_r)); _arg$2 = t; _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtRunesString }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtStringRunes = function(v, t) { var _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = new flag(v.flag).ro(); _r = $clone(v, Value).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = (new sliceType$17($stringToRunes(_r))); _arg$2 = t; _r$1 = makeRunes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringRunes }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; cvtT2I = function(v, typ) { var _r, _r$1, _r$2, _r$3, _r$4, target, typ, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; target = $f.target; typ = $f.typ; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = typ.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = unsafe_New(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } target = _r$1; _r$2 = valueInterface($clone(v, Value), false); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } x = _r$2; _r$3 = typ.NumMethod(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$3 === 0) { */ case 4: (target).$set(x); $s = 6; continue; /* } else { */ case 5: ifaceE2I($assertType(typ, ptrType$1), x, target); /* } */ case 6: _r$4 = typ.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $s = -1; return new Value.ptr(_r$4, target, (((new flag(v.flag).ro() | 128) >>> 0) | 20) >>> 0); /* */ } return; } if ($f === undefined) { $f = { $blk: cvtT2I }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.target = target; $f.typ = typ; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; cvtI2I = function(v, typ) { var _r, _r$1, _r$2, ret, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; ret = $f.ret; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ($clone(v, Value).IsNil()) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($clone(v, Value).IsNil()) { */ case 1: _r = Zero(typ); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; ret.flag = (ret.flag | (new flag(v.flag).ro())) >>> 0; $s = -1; return ret; /* } */ case 2: _r$1 = $clone(v, Value).Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = cvtT2I($clone(_r$1, Value), typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: cvtI2I }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ret = ret; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; ptrType$5.methods = [{prop: "methods", name: "methods", pkg: "reflect", typ: $funcType([], [sliceType$5], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$5], false)}]; ptrType$7.methods = [{prop: "in$", name: "in", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}, {prop: "out", name: "out", pkg: "reflect", typ: $funcType([], [sliceType$2], false)}]; name.methods = [{prop: "name", name: "name", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "tag", name: "tag", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: $funcType([], [$String], false)}, {prop: "isExported", name: "isExported", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "data", name: "data", pkg: "reflect", typ: $funcType([$Int, $String], [ptrType$4], false)}, {prop: "nameLen", name: "nameLen", pkg: "reflect", typ: $funcType([], [$Int], false)}, {prop: "tagLen", name: "tagLen", pkg: "reflect", typ: $funcType([], [$Int], false)}]; Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$1.methods = [{prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$5], false)}, {prop: "nameOff", name: "nameOff", pkg: "reflect", typ: $funcType([nameOff], [name], false)}, {prop: "typeOff", name: "typeOff", pkg: "reflect", typ: $funcType([typeOff], [ptrType$1], false)}, {prop: "ptrTo", name: "ptrTo", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "pointers", name: "pointers", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "textOff", name: "textOff", pkg: "reflect", typ: $funcType([textOff], [$UnsafePointer], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "exportedMethods", name: "exportedMethods", pkg: "reflect", typ: $funcType([], [sliceType$5], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}]; ChanDir.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$8.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; ptrType$17.methods = [{prop: "offset", name: "offset", pkg: "reflect", typ: $funcType([], [$Uintptr], false)}, {prop: "embedded", name: "embedded", pkg: "reflect", typ: $funcType([], [$Bool], false)}]; ptrType$10.methods = [{prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [StructField], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}]; StructTag.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "Lookup", name: "Lookup", pkg: "", typ: $funcType([$String], [$String, $Bool], false)}]; Value.methods = [{prop: "object", name: "object", pkg: "reflect", typ: $funcType([], [ptrType$2], false)}, {prop: "assignTo", name: "assignTo", pkg: "reflect", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$12], false)}, {prop: "IsNil", name: "IsNil", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Pointer", name: "Pointer", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([Value], [], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$15], [], false)}, {prop: "SetCap", name: "SetCap", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([$Int, $Int], [Value], false)}, {prop: "Slice3", name: "Slice3", pkg: "", typ: $funcType([$Int, $Int, $Int], [Value], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "call", name: "call", pkg: "reflect", typ: $funcType([$String, sliceType$9], [sliceType$9], false)}, {prop: "pointer", name: "pointer", pkg: "reflect", typ: $funcType([], [$UnsafePointer], false)}, {prop: "Addr", name: "Addr", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$15], false)}, {prop: "runes", name: "runes", pkg: "reflect", typ: $funcType([], [sliceType$17], false)}, {prop: "CanAddr", name: "CanAddr", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([sliceType$9], [sliceType$9], false)}, {prop: "CallSlice", name: "CallSlice", pkg: "", typ: $funcType([sliceType$9], [sliceType$9], false)}, {prop: "Complex", name: "Complex", pkg: "", typ: $funcType([], [$Complex128], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [Value], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [Value], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "CanInterface", name: "CanInterface", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$9], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "OverflowComplex", name: "OverflowComplex", pkg: "", typ: $funcType([$Complex128], [$Bool], false)}, {prop: "OverflowFloat", name: "OverflowFloat", pkg: "", typ: $funcType([$Float64], [$Bool], false)}, {prop: "OverflowInt", name: "OverflowInt", pkg: "", typ: $funcType([$Int64], [$Bool], false)}, {prop: "OverflowUint", name: "OverflowUint", pkg: "", typ: $funcType([$Uint64], [$Bool], false)}, {prop: "Recv", name: "Recv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "recv", name: "recv", pkg: "reflect", typ: $funcType([$Bool], [Value, $Bool], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([Value], [], false)}, {prop: "send", name: "send", pkg: "reflect", typ: $funcType([Value, $Bool], [$Bool], false)}, {prop: "SetBool", name: "SetBool", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "setRunes", name: "setRunes", pkg: "reflect", typ: $funcType([sliceType$17], [], false)}, {prop: "SetComplex", name: "SetComplex", pkg: "", typ: $funcType([$Complex128], [], false)}, {prop: "SetFloat", name: "SetFloat", pkg: "", typ: $funcType([$Float64], [], false)}, {prop: "SetInt", name: "SetInt", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "SetMapIndex", name: "SetMapIndex", pkg: "", typ: $funcType([Value, Value], [], false)}, {prop: "SetUint", name: "SetUint", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "SetPointer", name: "SetPointer", pkg: "", typ: $funcType([$UnsafePointer], [], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TryRecv", name: "TryRecv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "TrySend", name: "TrySend", pkg: "", typ: $funcType([Value], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "UnsafeAddr", name: "UnsafeAddr", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Convert", name: "Convert", pkg: "", typ: $funcType([Type], [Value], false)}]; flag.methods = [{prop: "kind", name: "kind", pkg: "reflect", typ: $funcType([], [Kind], false)}, {prop: "ro", name: "ro", pkg: "reflect", typ: $funcType([], [flag], false)}, {prop: "mustBe", name: "mustBe", pkg: "reflect", typ: $funcType([Kind], [], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "reflect", typ: $funcType([], [], false)}]; ptrType$18.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; uncommonType.init("reflect", [{prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mcount", name: "mcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "xcount", name: "xcount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "moff", name: "moff", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "_methods", name: "_methods", embedded: false, exported: false, typ: sliceType$5, tag: ""}]); funcType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: "reflect:\"func\""}, {prop: "inCount", name: "inCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "outCount", name: "outCount", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "_in", name: "_in", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "_out", name: "_out", embedded: false, exported: false, typ: sliceType$2, tag: ""}]); name.init("reflect", [{prop: "bytes", name: "bytes", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); nameData.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "tag", name: "tag", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "exported", name: "exported", embedded: false, exported: false, typ: $Bool, tag: ""}]); mapIter.init("reflect", [{prop: "t", name: "t", embedded: false, exported: false, typ: Type, tag: ""}, {prop: "m", name: "m", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int, tag: ""}]); Type.init([{prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$13], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$5], false)}]); rtype.init("reflect", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", embedded: false, exported: false, typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", embedded: false, exported: false, typ: $Uint32, tag: ""}, {prop: "tflag", name: "tflag", embedded: false, exported: false, typ: tflag, tag: ""}, {prop: "align", name: "align", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "alg", name: "alg", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "gcdata", name: "gcdata", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", embedded: false, exported: false, typ: typeOff, tag: ""}]); typeAlg.init("reflect", [{prop: "hash", name: "hash", embedded: false, exported: false, typ: funcType$4, tag: ""}, {prop: "equal", name: "equal", embedded: false, exported: false, typ: funcType$5, tag: ""}]); method.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "mtyp", name: "mtyp", embedded: false, exported: false, typ: typeOff, tag: ""}, {prop: "ifn", name: "ifn", embedded: false, exported: false, typ: textOff, tag: ""}, {prop: "tfn", name: "tfn", embedded: false, exported: false, typ: textOff, tag: ""}]); arrayType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "len", name: "len", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); chanType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); imethod.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: nameOff, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: typeOff, tag: ""}]); interfaceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "methods", name: "methods", embedded: false, exported: false, typ: sliceType$6, tag: ""}]); mapType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "keysize", name: "keysize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "indirectkey", name: "indirectkey", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "indirectvalue", name: "indirectvalue", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "reflexivekey", name: "reflexivekey", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "needkeyupdate", name: "needkeyupdate", embedded: false, exported: false, typ: $Bool, tag: ""}]); ptrType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); sliceType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "elem", name: "elem", embedded: false, exported: false, typ: ptrType$1, tag: ""}]); structField.init("reflect", [{prop: "name", name: "name", embedded: false, exported: false, typ: name, tag: ""}, {prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "offsetEmbed", name: "offsetEmbed", embedded: false, exported: false, typ: $Uintptr, tag: ""}]); structType.init("reflect", [{prop: "rtype", name: "rtype", embedded: true, exported: false, typ: rtype, tag: ""}, {prop: "pkgPath", name: "pkgPath", embedded: false, exported: false, typ: name, tag: ""}, {prop: "fields", name: "fields", embedded: false, exported: false, typ: sliceType$7, tag: ""}]); Method.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: Value, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}]); StructField.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: Type, tag: ""}, {prop: "Tag", name: "Tag", embedded: false, exported: true, typ: StructTag, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Index", name: "Index", embedded: false, exported: true, typ: sliceType$13, tag: ""}, {prop: "Anonymous", name: "Anonymous", embedded: false, exported: true, typ: $Bool, tag: ""}]); fieldScan.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: sliceType$13, tag: ""}]); Value.init("reflect", [{prop: "typ", name: "typ", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "flag", embedded: true, exported: false, typ: flag, tag: ""}]); ValueError.init("", [{prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Kind", name: "Kind", embedded: false, exported: true, typ: Kind, tag: ""}]); StringHeader.init("", [{prop: "Data", name: "Data", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Int, tag: ""}]); SliceHeader.init("", [{prop: "Data", name: "Data", embedded: false, exported: true, typ: $Uintptr, tag: ""}, {prop: "Len", name: "Len", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Cap", name: "Cap", embedded: false, exported: true, typ: $Int, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } nameOffList = sliceType$1.nil; typeOffList = sliceType$2.nil; initialized = false; uncommonTypeMap = {}; nameMap = {}; callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); jsObjectPtr = reflectType($jsObjectPtr); kindNames = new sliceType$4(["invalid", "bool", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64", "complex64", "complex128", "array", "chan", "func", "interface", "map", "ptr", "slice", "string", "struct", "unsafe.Pointer"]); uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); $r = init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["fmt"] = (function() { var $pkg = {}, $init, errors, io, math, os, reflect, strconv, sync, utf8, fmtFlags, fmt, State, Formatter, Stringer, GoStringer, buffer, pp, ScanState, Scanner, scanError, ss, ssave, readRune, sliceType, ptrType, ptrType$1, arrayType, arrayType$1, sliceType$1, sliceType$2, arrayType$2, ptrType$2, ptrType$4, ptrType$5, arrayType$3, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, ptrType$23, ptrType$24, ptrType$25, funcType, ptrType$26, ppFree, space, ssFree, complexError, boolError, newPrinter, Fprintf, Printf, Sprintf, Fprint, Print, Sprint, Fprintln, Println, getField, tooLarge, parsenum, intFromArg, parseArgNumber, Fscanf, isSpace, notSpace, newScanState, indexRune, hexDigit, errorHandler; errors = $packages["errors"]; io = $packages["io"]; math = $packages["math"]; os = $packages["os"]; reflect = $packages["reflect"]; strconv = $packages["strconv"]; sync = $packages["sync"]; utf8 = $packages["unicode/utf8"]; fmtFlags = $pkg.fmtFlags = $newType(0, $kindStruct, "fmt.fmtFlags", true, "fmt", false, function(widPresent_, precPresent_, minus_, plus_, sharp_, space_, zero_, plusV_, sharpV_) { this.$val = this; if (arguments.length === 0) { this.widPresent = false; this.precPresent = false; this.minus = false; this.plus = false; this.sharp = false; this.space = false; this.zero = false; this.plusV = false; this.sharpV = false; return; } this.widPresent = widPresent_; this.precPresent = precPresent_; this.minus = minus_; this.plus = plus_; this.sharp = sharp_; this.space = space_; this.zero = zero_; this.plusV = plusV_; this.sharpV = sharpV_; }); fmt = $pkg.fmt = $newType(0, $kindStruct, "fmt.fmt", true, "fmt", false, function(buf_, fmtFlags_, wid_, prec_, intbuf_) { this.$val = this; if (arguments.length === 0) { this.buf = ptrType$1.nil; this.fmtFlags = new fmtFlags.ptr(false, false, false, false, false, false, false, false, false); this.wid = 0; this.prec = 0; this.intbuf = arrayType.zero(); return; } this.buf = buf_; this.fmtFlags = fmtFlags_; this.wid = wid_; this.prec = prec_; this.intbuf = intbuf_; }); State = $pkg.State = $newType(8, $kindInterface, "fmt.State", true, "fmt", true, null); Formatter = $pkg.Formatter = $newType(8, $kindInterface, "fmt.Formatter", true, "fmt", true, null); Stringer = $pkg.Stringer = $newType(8, $kindInterface, "fmt.Stringer", true, "fmt", true, null); GoStringer = $pkg.GoStringer = $newType(8, $kindInterface, "fmt.GoStringer", true, "fmt", true, null); buffer = $pkg.buffer = $newType(12, $kindSlice, "fmt.buffer", true, "fmt", false, null); pp = $pkg.pp = $newType(0, $kindStruct, "fmt.pp", true, "fmt", false, function(buf_, arg_, value_, fmt_, reordered_, goodArgNum_, panicking_, erroring_) { this.$val = this; if (arguments.length === 0) { this.buf = buffer.nil; this.arg = $ifaceNil; this.value = new reflect.Value.ptr(ptrType.nil, 0, 0); this.fmt = new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType.zero()); this.reordered = false; this.goodArgNum = false; this.panicking = false; this.erroring = false; return; } this.buf = buf_; this.arg = arg_; this.value = value_; this.fmt = fmt_; this.reordered = reordered_; this.goodArgNum = goodArgNum_; this.panicking = panicking_; this.erroring = erroring_; }); ScanState = $pkg.ScanState = $newType(8, $kindInterface, "fmt.ScanState", true, "fmt", true, null); Scanner = $pkg.Scanner = $newType(8, $kindInterface, "fmt.Scanner", true, "fmt", true, null); scanError = $pkg.scanError = $newType(0, $kindStruct, "fmt.scanError", true, "fmt", false, function(err_) { this.$val = this; if (arguments.length === 0) { this.err = $ifaceNil; return; } this.err = err_; }); ss = $pkg.ss = $newType(0, $kindStruct, "fmt.ss", true, "fmt", false, function(rs_, buf_, count_, atEOF_, ssave_) { this.$val = this; if (arguments.length === 0) { this.rs = $ifaceNil; this.buf = buffer.nil; this.count = 0; this.atEOF = false; this.ssave = new ssave.ptr(false, false, false, 0, 0, 0); return; } this.rs = rs_; this.buf = buf_; this.count = count_; this.atEOF = atEOF_; this.ssave = ssave_; }); ssave = $pkg.ssave = $newType(0, $kindStruct, "fmt.ssave", true, "fmt", false, function(validSave_, nlIsEnd_, nlIsSpace_, argLimit_, limit_, maxWid_) { this.$val = this; if (arguments.length === 0) { this.validSave = false; this.nlIsEnd = false; this.nlIsSpace = false; this.argLimit = 0; this.limit = 0; this.maxWid = 0; return; } this.validSave = validSave_; this.nlIsEnd = nlIsEnd_; this.nlIsSpace = nlIsSpace_; this.argLimit = argLimit_; this.limit = limit_; this.maxWid = maxWid_; }); readRune = $pkg.readRune = $newType(0, $kindStruct, "fmt.readRune", true, "fmt", false, function(reader_, buf_, pending_, pendBuf_, peekRune_) { this.$val = this; if (arguments.length === 0) { this.reader = $ifaceNil; this.buf = arrayType$3.zero(); this.pending = 0; this.pendBuf = arrayType$3.zero(); this.peekRune = 0; return; } this.reader = reader_; this.buf = buf_; this.pending = pending_; this.pendBuf = pendBuf_; this.peekRune = peekRune_; }); sliceType = $sliceType($emptyInterface); ptrType = $ptrType(reflect.rtype); ptrType$1 = $ptrType(buffer); arrayType = $arrayType($Uint8, 68); arrayType$1 = $arrayType($Uint16, 2); sliceType$1 = $sliceType(arrayType$1); sliceType$2 = $sliceType($Uint8); arrayType$2 = $arrayType($Uint8, 5); ptrType$2 = $ptrType(pp); ptrType$4 = $ptrType($String); ptrType$5 = $ptrType(ss); arrayType$3 = $arrayType($Uint8, 4); ptrType$6 = $ptrType(strconv.NumError); ptrType$7 = $ptrType($Bool); ptrType$8 = $ptrType($Complex64); ptrType$9 = $ptrType($Complex128); ptrType$10 = $ptrType($Int); ptrType$11 = $ptrType($Int8); ptrType$12 = $ptrType($Int16); ptrType$13 = $ptrType($Int32); ptrType$14 = $ptrType($Int64); ptrType$15 = $ptrType($Uint); ptrType$16 = $ptrType($Uint8); ptrType$17 = $ptrType($Uint16); ptrType$18 = $ptrType($Uint32); ptrType$19 = $ptrType($Uint64); ptrType$20 = $ptrType($Uintptr); ptrType$21 = $ptrType($Float32); ptrType$22 = $ptrType($Float64); ptrType$23 = $ptrType(sliceType$2); ptrType$24 = $ptrType($error); ptrType$25 = $ptrType(fmt); funcType = $funcType([$Int32], [$Bool], false); ptrType$26 = $ptrType(readRune); fmt.ptr.prototype.clearflags = function() { var f; f = this; fmtFlags.copy(f.fmtFlags, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false)); }; fmt.prototype.clearflags = function() { return this.$val.clearflags(); }; fmt.ptr.prototype.init = function(buf) { var buf, f; f = this; f.buf = buf; f.clearflags(); }; fmt.prototype.init = function(buf) { return this.$val.init(buf); }; fmt.ptr.prototype.writePadding = function(n) { var _i, _ref, buf, f, i, n, newLen, oldLen, padByte, padding; f = this; if (n <= 0) { return; } buf = f.buf.$get(); oldLen = buf.$length; newLen = oldLen + n >> 0; if (newLen > buf.$capacity) { buf = $makeSlice(buffer, (($imul(buf.$capacity, 2)) + n >> 0)); $copySlice(buf, f.buf.$get()); } padByte = 32; if (f.fmtFlags.zero) { padByte = 48; } padding = $subslice(buf, oldLen, newLen); _ref = padding; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; ((i < 0 || i >= padding.$length) ? ($throwRuntimeError("index out of range"), undefined) : padding.$array[padding.$offset + i] = padByte); _i++; } f.buf.$set($subslice(buf, 0, newLen)); }; fmt.prototype.writePadding = function(n) { return this.$val.writePadding(n); }; fmt.ptr.prototype.pad = function(b) { var b, f, width; f = this; if (!f.fmtFlags.widPresent || (f.wid === 0)) { f.buf.Write(b); return; } width = f.wid - utf8.RuneCount(b) >> 0; if (!f.fmtFlags.minus) { f.writePadding(width); f.buf.Write(b); } else { f.buf.Write(b); f.writePadding(width); } }; fmt.prototype.pad = function(b) { return this.$val.pad(b); }; fmt.ptr.prototype.padString = function(s) { var f, s, width; f = this; if (!f.fmtFlags.widPresent || (f.wid === 0)) { f.buf.WriteString(s); return; } width = f.wid - utf8.RuneCountInString(s) >> 0; if (!f.fmtFlags.minus) { f.writePadding(width); f.buf.WriteString(s); } else { f.buf.WriteString(s); f.writePadding(width); } }; fmt.prototype.padString = function(s) { return this.$val.padString(s); }; fmt.ptr.prototype.fmtBoolean = function(v) { var f, v; f = this; if (v) { f.padString("true"); } else { f.padString("false"); } }; fmt.prototype.fmtBoolean = function(v) { return this.$val.fmtBoolean(v); }; fmt.ptr.prototype.fmtUnicode = function(u) { var buf, f, i, oldZero, prec, u, width; f = this; buf = $subslice(new sliceType$2(f.intbuf), 0); prec = 4; if (f.fmtFlags.precPresent && f.prec > 4) { prec = f.prec; width = (((2 + prec >> 0) + 2 >> 0) + 4 >> 0) + 1 >> 0; if (width > buf.$length) { buf = $makeSlice(sliceType$2, width); } } i = buf.$length; if (f.fmtFlags.sharp && (u.$high < 0 || (u.$high === 0 && u.$low <= 1114111)) && strconv.IsPrint(((u.$low >> 0)))) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); i = i - (utf8.RuneLen(((u.$low >> 0)))) >> 0; utf8.EncodeRune($subslice(buf, i), ((u.$low >> 0))); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 39); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); } while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); prec = prec - (1) >> 0; u = $shiftRightUint64(u, (4)); } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = "0123456789ABCDEFX".charCodeAt($flatten64(u))); prec = prec - (1) >> 0; while (true) { if (!(prec > 0)) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); prec = prec - (1) >> 0; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 85); oldZero = f.fmtFlags.zero; f.fmtFlags.zero = false; f.pad($subslice(buf, i)); f.fmtFlags.zero = oldZero; }; fmt.prototype.fmtUnicode = function(u) { return this.$val.fmtUnicode(u); }; fmt.ptr.prototype.fmtInteger = function(u, base, isSigned, digits) { var _1, _2, base, buf, digits, f, i, isSigned, negative, next, oldZero, oldZero$1, prec, u, width, x, x$1, x$2, x$3, x$4; f = this; negative = isSigned && (x = (new $Int64(u.$high, u.$low)), (x.$high < 0 || (x.$high === 0 && x.$low < 0))); if (negative) { u = new $Uint64(-u.$high, -u.$low); } buf = $subslice(new sliceType$2(f.intbuf), 0); if (f.fmtFlags.widPresent || f.fmtFlags.precPresent) { width = (3 + f.wid >> 0) + f.prec >> 0; if (width > buf.$length) { buf = $makeSlice(sliceType$2, width); } } prec = 0; if (f.fmtFlags.precPresent) { prec = f.prec; if ((prec === 0) && (u.$high === 0 && u.$low === 0)) { oldZero = f.fmtFlags.zero; f.fmtFlags.zero = false; f.writePadding(f.wid); f.fmtFlags.zero = oldZero; return; } } else if (f.fmtFlags.zero && f.fmtFlags.widPresent) { prec = f.wid; if (negative || f.fmtFlags.plus || f.fmtFlags.space) { prec = prec - (1) >> 0; } } i = buf.$length; _1 = base; if (_1 === (10)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 10)))) { break; } i = i - (1) >> 0; next = $div64(u, new $Uint64(0, 10), false); ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$1 = new $Uint64(0 + u.$high, 48 + u.$low), x$2 = $mul64(next, new $Uint64(0, 10)), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)).$low << 24 >>> 24))); u = next; } } else if (_1 === (16)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 16)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(new $Uint64(u.$high & 0, (u.$low & 15) >>> 0)))); u = $shiftRightUint64(u, (4)); } } else if (_1 === (8)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 8)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$3 = new $Uint64(u.$high & 0, (u.$low & 7) >>> 0), new $Uint64(0 + x$3.$high, 48 + x$3.$low)).$low << 24 >>> 24))); u = $shiftRightUint64(u, (3)); } } else if (_1 === (2)) { while (true) { if (!((u.$high > 0 || (u.$high === 0 && u.$low >= 2)))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = (((x$4 = new $Uint64(u.$high & 0, (u.$low & 1) >>> 0), new $Uint64(0 + x$4.$high, 48 + x$4.$low)).$low << 24 >>> 24))); u = $shiftRightUint64(u, (1)); } } else { $panic(new $String("fmt: unknown base; can't happen")); } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(u))); while (true) { if (!(i > 0 && prec > (buf.$length - i >> 0))) { break; } i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } if (f.fmtFlags.sharp) { _2 = base; if (_2 === (8)) { if (!((((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i]) === 48))) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } } else if (_2 === (16)) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = digits.charCodeAt(16)); i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 48); } } if (negative) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 45); } else if (f.fmtFlags.plus) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 43); } else if (f.fmtFlags.space) { i = i - (1) >> 0; ((i < 0 || i >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + i] = 32); } oldZero$1 = f.fmtFlags.zero; f.fmtFlags.zero = false; f.pad($subslice(buf, i)); f.fmtFlags.zero = oldZero$1; }; fmt.prototype.fmtInteger = function(u, base, isSigned, digits) { return this.$val.fmtInteger(u, base, isSigned, digits); }; fmt.ptr.prototype.truncate = function(s) { var _i, _ref, _rune, f, i, n, s; f = this; if (f.fmtFlags.precPresent) { n = f.prec; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; n = n - (1) >> 0; if (n < 0) { return $substring(s, 0, i); } _i += _rune[1]; } } return s; }; fmt.prototype.truncate = function(s) { return this.$val.truncate(s); }; fmt.ptr.prototype.fmtS = function(s) { var f, s; f = this; s = f.truncate(s); f.padString(s); }; fmt.prototype.fmtS = function(s) { return this.$val.fmtS(s); }; fmt.ptr.prototype.fmtSbx = function(s, b, digits) { var b, buf, c, digits, f, i, length, s, width; f = this; length = b.$length; if (b === sliceType$2.nil) { length = s.length; } if (f.fmtFlags.precPresent && f.prec < length) { length = f.prec; } width = $imul(2, length); if (width > 0) { if (f.fmtFlags.space) { if (f.fmtFlags.sharp) { width = $imul(width, (2)); } width = width + ((length - 1 >> 0)) >> 0; } else if (f.fmtFlags.sharp) { width = width + (2) >> 0; } } else { if (f.fmtFlags.widPresent) { f.writePadding(f.wid); } return; } if (f.fmtFlags.widPresent && f.wid > width && !f.fmtFlags.minus) { f.writePadding(f.wid - width >> 0); } buf = f.buf.$get(); if (f.fmtFlags.sharp) { buf = $append(buf, 48, digits.charCodeAt(16)); } c = 0; i = 0; while (true) { if (!(i < length)) { break; } if (f.fmtFlags.space && i > 0) { buf = $append(buf, 32); if (f.fmtFlags.sharp) { buf = $append(buf, 48, digits.charCodeAt(16)); } } if (!(b === sliceType$2.nil)) { c = ((i < 0 || i >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i]); } else { c = s.charCodeAt(i); } buf = $append(buf, digits.charCodeAt((c >>> 4 << 24 >>> 24)), digits.charCodeAt(((c & 15) >>> 0))); i = i + (1) >> 0; } f.buf.$set(buf); if (f.fmtFlags.widPresent && f.wid > width && f.fmtFlags.minus) { f.writePadding(f.wid - width >> 0); } }; fmt.prototype.fmtSbx = function(s, b, digits) { return this.$val.fmtSbx(s, b, digits); }; fmt.ptr.prototype.fmtSx = function(s, digits) { var digits, f, s; f = this; f.fmtSbx(s, sliceType$2.nil, digits); }; fmt.prototype.fmtSx = function(s, digits) { return this.$val.fmtSx(s, digits); }; fmt.ptr.prototype.fmtBx = function(b, digits) { var b, digits, f; f = this; f.fmtSbx("", b, digits); }; fmt.prototype.fmtBx = function(b, digits) { return this.$val.fmtBx(b, digits); }; fmt.ptr.prototype.fmtQ = function(s) { var buf, f, s; f = this; s = f.truncate(s); if (f.fmtFlags.sharp && strconv.CanBackquote(s)) { f.padString("`" + s + "`"); return; } buf = $subslice(new sliceType$2(f.intbuf), 0, 0); if (f.fmtFlags.plus) { f.pad(strconv.AppendQuoteToASCII(buf, s)); } else { f.pad(strconv.AppendQuote(buf, s)); } }; fmt.prototype.fmtQ = function(s) { return this.$val.fmtQ(s); }; fmt.ptr.prototype.fmtC = function(c) { var buf, c, f, r, w; f = this; r = ((c.$low >> 0)); if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { r = 65533; } buf = $subslice(new sliceType$2(f.intbuf), 0, 0); w = utf8.EncodeRune($subslice(buf, 0, 4), r); f.pad($subslice(buf, 0, w)); }; fmt.prototype.fmtC = function(c) { return this.$val.fmtC(c); }; fmt.ptr.prototype.fmtQc = function(c) { var buf, c, f, r; f = this; r = ((c.$low >> 0)); if ((c.$high > 0 || (c.$high === 0 && c.$low > 1114111))) { r = 65533; } buf = $subslice(new sliceType$2(f.intbuf), 0, 0); if (f.fmtFlags.plus) { f.pad(strconv.AppendQuoteRuneToASCII(buf, r)); } else { f.pad(strconv.AppendQuoteRune(buf, r)); } }; fmt.prototype.fmtQc = function(c) { return this.$val.fmtQc(c); }; fmt.ptr.prototype.fmtFloat = function(v, size, verb, prec) { var _1, _2, digits, f, hasDecimalPoint, i, num, oldZero, prec, size, tail, tailBuf, v, verb; f = this; if (f.fmtFlags.precPresent) { prec = f.prec; } num = strconv.AppendFloat($subslice(new sliceType$2(f.intbuf), 0, 1), v, ((verb << 24 >>> 24)), prec, size); if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 45) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 43)) { num = $subslice(num, 1); } else { (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 43); } if (f.fmtFlags.space && ((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43) && !f.fmtFlags.plus) { (0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0] = 32); } if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 73) || ((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78)) { oldZero = f.fmtFlags.zero; f.fmtFlags.zero = false; if (((1 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 1]) === 78) && !f.fmtFlags.space && !f.fmtFlags.plus) { num = $subslice(num, 1); } f.pad(num); f.fmtFlags.zero = oldZero; return; } if (f.fmtFlags.sharp && !((verb === 98))) { digits = 0; _1 = verb; if ((_1 === (118)) || (_1 === (103)) || (_1 === (71))) { digits = prec; if (digits === -1) { digits = 6; } } tailBuf = arrayType$2.zero(); tail = $subslice(new sliceType$2(tailBuf), 0, 0); hasDecimalPoint = false; i = 1; while (true) { if (!(i < num.$length)) { break; } _2 = ((i < 0 || i >= num.$length) ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + i]); if (_2 === (46)) { hasDecimalPoint = true; } else if ((_2 === (101)) || (_2 === (69))) { tail = $appendSlice(tail, $subslice(num, i)); num = $subslice(num, 0, i); } else { digits = digits - (1) >> 0; } i = i + (1) >> 0; } if (!hasDecimalPoint) { num = $append(num, 46); } while (true) { if (!(digits > 0)) { break; } num = $append(num, 48); digits = digits - (1) >> 0; } num = $appendSlice(num, tail); } if (f.fmtFlags.plus || !(((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0]) === 43))) { if (f.fmtFlags.zero && f.fmtFlags.widPresent && f.wid > num.$length) { f.buf.WriteByte((0 >= num.$length ? ($throwRuntimeError("index out of range"), undefined) : num.$array[num.$offset + 0])); f.writePadding(f.wid - num.$length >> 0); f.buf.Write($subslice(num, 1)); return; } f.pad(num); return; } f.pad($subslice(num, 1)); }; fmt.prototype.fmtFloat = function(v, size, verb, prec) { return this.$val.fmtFloat(v, size, verb, prec); }; $ptrType(buffer).prototype.Write = function(p) { var b, p; b = this; b.$set($appendSlice(b.$get(), p)); }; $ptrType(buffer).prototype.WriteString = function(s) { var b, s; b = this; b.$set($appendSlice(b.$get(), s)); }; $ptrType(buffer).prototype.WriteByte = function(c) { var b, c; b = this; b.$set($append(b.$get(), c)); }; $ptrType(buffer).prototype.WriteRune = function(r) { var b, bp, n, r, w, x; bp = this; if (r < 128) { bp.$set($append(bp.$get(), ((r << 24 >>> 24)))); return; } b = bp.$get(); n = b.$length; while (true) { if (!((n + 4 >> 0) > b.$capacity)) { break; } b = $append(b, 0); } w = utf8.EncodeRune((x = $subslice(b, n, (n + 4 >> 0)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)), r); bp.$set($subslice(b, 0, (n + w >> 0))); }; newPrinter = function() { var _r, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = ppFree.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = $assertType(_r, ptrType$2); p.panicking = false; p.erroring = false; p.fmt.init((p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p)))); $s = -1; return p; /* */ } return; } if ($f === undefined) { $f = { $blk: newPrinter }; } $f._r = _r; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; pp.ptr.prototype.free = function() { var p; p = this; p.buf = $subslice(p.buf, 0, 0); p.arg = $ifaceNil; p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); ppFree.Put(p); }; pp.prototype.free = function() { return this.$val.free(); }; pp.ptr.prototype.Width = function() { var _tmp, _tmp$1, ok, p, wid; wid = 0; ok = false; p = this; _tmp = p.fmt.wid; _tmp$1 = p.fmt.fmtFlags.widPresent; wid = _tmp; ok = _tmp$1; return [wid, ok]; }; pp.prototype.Width = function() { return this.$val.Width(); }; pp.ptr.prototype.Precision = function() { var _tmp, _tmp$1, ok, p, prec; prec = 0; ok = false; p = this; _tmp = p.fmt.prec; _tmp$1 = p.fmt.fmtFlags.precPresent; prec = _tmp; ok = _tmp$1; return [prec, ok]; }; pp.prototype.Precision = function() { return this.$val.Precision(); }; pp.ptr.prototype.Flag = function(b) { var _1, b, p; p = this; _1 = b; if (_1 === (45)) { return p.fmt.fmtFlags.minus; } else if (_1 === (43)) { return p.fmt.fmtFlags.plus || p.fmt.fmtFlags.plusV; } else if (_1 === (35)) { return p.fmt.fmtFlags.sharp || p.fmt.fmtFlags.sharpV; } else if (_1 === (32)) { return p.fmt.fmtFlags.space; } else if (_1 === (48)) { return p.fmt.fmtFlags.zero; } return false; }; pp.prototype.Flag = function(b) { return this.$val.Flag(b); }; pp.ptr.prototype.Write = function(b) { var _tmp, _tmp$1, b, err, p, ret; ret = 0; err = $ifaceNil; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(b); _tmp = b.$length; _tmp$1 = $ifaceNil; ret = _tmp; err = _tmp$1; return [ret, err]; }; pp.prototype.Write = function(b) { return this.$val.Write(b); }; pp.ptr.prototype.WriteString = function(s) { var _tmp, _tmp$1, err, p, ret, s; ret = 0; err = $ifaceNil; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(s); _tmp = s.length; _tmp$1 = $ifaceNil; ret = _tmp; err = _tmp$1; return [ret, err]; }; pp.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; Fprintf = function(w, format, a) { var _r, _r$1, _tuple, a, err, format, n, p, w, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; format = $f.format; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = w.Write((x = p.buf, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; p.free(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintf }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.format = format; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fprintf = Fprintf; Printf = function(format, a) { var _r, _tuple, a, err, format, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; a = $f.a; err = $f.err; format = $f.format; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = Fprintf(os.Stdout, format, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Printf }; } $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.format = format; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Printf = Printf; Sprintf = function(format, a) { var _r, a, format, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; format = $f.format; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s = ($bytesToString(p.buf)); p.free(); $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintf }; } $f._r = _r; $f.a = a; $f.format = format; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sprintf = Sprintf; Fprint = function(w, a) { var _r, _r$1, _tuple, a, err, n, p, w, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrint(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = w.Write((x = p.buf, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; p.free(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fprint }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fprint = Fprint; Print = function(a) { var _r, _tuple, a, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = Fprint(os.Stdout, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Print }; } $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Print = Print; Sprint = function(a) { var _r, a, p, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; a = $f.a; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrint(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } s = ($bytesToString(p.buf)); p.free(); $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: Sprint }; } $f._r = _r; $f.a = a; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sprint = Sprint; Fprintln = function(w, a) { var _r, _r$1, _tuple, a, err, n, p, w, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p = _r; $r = p.doPrintln(a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = w.Write((x = p.buf, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; n = _tuple[0]; err = _tuple[1]; p.free(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintln }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fprintln = Fprintln; Println = function(a) { var _r, _tuple, a, err, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = Fprintln(os.Stdout, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Println }; } $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Println = Println; getField = function(v, i) { var _r, _r$1, i, v, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; i = $f.i; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = $clone(v, reflect.Value).Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } val = _r; /* */ if (($clone(val, reflect.Value).Kind() === 20) && !$clone(val, reflect.Value).IsNil()) { $s = 2; continue; } /* */ $s = 3; continue; /* if (($clone(val, reflect.Value).Kind() === 20) && !$clone(val, reflect.Value).IsNil()) { */ case 2: _r$1 = $clone(val, reflect.Value).Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } val = _r$1; /* } */ case 3: $s = -1; return val; /* */ } return; } if ($f === undefined) { $f = { $blk: getField }; } $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; tooLarge = function(x) { var x; return x > 1000000 || x < -1000000; }; parsenum = function(s, start, end) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, end, isnum, newi, num, s, start; num = 0; isnum = false; newi = 0; if (start >= end) { _tmp = 0; _tmp$1 = false; _tmp$2 = end; num = _tmp; isnum = _tmp$1; newi = _tmp$2; return [num, isnum, newi]; } newi = start; while (true) { if (!(newi < end && 48 <= s.charCodeAt(newi) && s.charCodeAt(newi) <= 57)) { break; } if (tooLarge(num)) { _tmp$3 = 0; _tmp$4 = false; _tmp$5 = end; num = _tmp$3; isnum = _tmp$4; newi = _tmp$5; return [num, isnum, newi]; } num = ($imul(num, 10)) + (((s.charCodeAt(newi) - 48 << 24 >>> 24) >> 0)) >> 0; isnum = true; newi = newi + (1) >> 0; } return [num, isnum, newi]; }; pp.ptr.prototype.unknownType = function(v) { var _r, p, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; if (!$clone(v, reflect.Value).IsValid()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); _r = $clone(v, reflect.Value).Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.unknownType }; } $f._r = _r; $f.p = p; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.unknownType = function(v) { return this.$val.unknownType(v); }; pp.ptr.prototype.badVerb = function(verb) { var _r, _r$1, p, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; p.erroring = true; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(40); /* */ if (!($interfaceIsEqual(p.arg, $ifaceNil))) { $s = 2; continue; } /* */ if ($clone(p.value, reflect.Value).IsValid()) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(p.arg, $ifaceNil))) { */ case 2: _r = reflect.TypeOf(p.arg).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); $r = p.printArg(p.arg, 118); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if ($clone(p.value, reflect.Value).IsValid()) { */ case 3: _r$1 = $clone(p.value, reflect.Value).Type().String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); $r = p.printValue($clone(p.value, reflect.Value), 118, 0); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else { */ case 4: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); /* } */ case 5: case 1: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); p.erroring = false; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.badVerb }; } $f._r = _r; $f._r$1 = _r$1; $f.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.badVerb = function(verb) { return this.$val.badVerb(verb); }; pp.ptr.prototype.fmtBool = function(v, verb) { var _1, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (116)) || (_1 === (118))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (116)) || (_1 === (118))) { */ case 2: p.fmt.fmtBoolean(v); $s = 4; continue; /* } else { */ case 3: $r = p.badVerb(verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBool }; } $f._1 = _1; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtBool = function(v, verb) { return this.$val.fmtBool(v, verb); }; pp.ptr.prototype.fmt0x64 = function(v, leading0x) { var leading0x, p, sharp, v; p = this; sharp = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = leading0x; p.fmt.fmtInteger(v, 16, false, "0123456789abcdefx"); p.fmt.fmtFlags.sharp = sharp; }; pp.prototype.fmt0x64 = function(v, leading0x) { return this.$val.fmt0x64(v, leading0x); }; pp.ptr.prototype.fmtInteger = function(v, isSigned, verb) { var _1, isSigned, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; isSigned = $f.isSigned; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if (_1 === (100)) { $s = 3; continue; } /* */ if (_1 === (98)) { $s = 4; continue; } /* */ if (_1 === (111)) { $s = 5; continue; } /* */ if (_1 === (120)) { $s = 6; continue; } /* */ if (_1 === (88)) { $s = 7; continue; } /* */ if (_1 === (99)) { $s = 8; continue; } /* */ if (_1 === (113)) { $s = 9; continue; } /* */ if (_1 === (85)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (118)) { */ case 2: if (p.fmt.fmtFlags.sharpV && !isSigned) { p.fmt0x64(v, true); } else { p.fmt.fmtInteger(v, 10, isSigned, "0123456789abcdefx"); } $s = 12; continue; /* } else if (_1 === (100)) { */ case 3: p.fmt.fmtInteger(v, 10, isSigned, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (98)) { */ case 4: p.fmt.fmtInteger(v, 2, isSigned, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (111)) { */ case 5: p.fmt.fmtInteger(v, 8, isSigned, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (120)) { */ case 6: p.fmt.fmtInteger(v, 16, isSigned, "0123456789abcdefx"); $s = 12; continue; /* } else if (_1 === (88)) { */ case 7: p.fmt.fmtInteger(v, 16, isSigned, "0123456789ABCDEFX"); $s = 12; continue; /* } else if (_1 === (99)) { */ case 8: p.fmt.fmtC(v); $s = 12; continue; /* } else if (_1 === (113)) { */ case 9: /* */ if ((v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { */ case 13: p.fmt.fmtQc(v); $s = 15; continue; /* } else { */ case 14: $r = p.badVerb(verb); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 15: $s = 12; continue; /* } else if (_1 === (85)) { */ case 10: p.fmt.fmtUnicode(v); $s = 12; continue; /* } else { */ case 11: $r = p.badVerb(verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtInteger }; } $f._1 = _1; $f.isSigned = isSigned; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtInteger = function(v, isSigned, verb) { return this.$val.fmtInteger(v, isSigned, verb); }; pp.ptr.prototype.fmtFloat = function(v, size, verb) { var _1, p, size, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; size = $f.size; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if ((_1 === (98)) || (_1 === (103)) || (_1 === (71))) { $s = 3; continue; } /* */ if ((_1 === (102)) || (_1 === (101)) || (_1 === (69))) { $s = 4; continue; } /* */ if (_1 === (70)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (118)) { */ case 2: p.fmt.fmtFloat(v, size, 103, -1); $s = 7; continue; /* } else if ((_1 === (98)) || (_1 === (103)) || (_1 === (71))) { */ case 3: p.fmt.fmtFloat(v, size, verb, -1); $s = 7; continue; /* } else if ((_1 === (102)) || (_1 === (101)) || (_1 === (69))) { */ case 4: p.fmt.fmtFloat(v, size, verb, 6); $s = 7; continue; /* } else if (_1 === (70)) { */ case 5: p.fmt.fmtFloat(v, size, 102, 6); $s = 7; continue; /* } else { */ case 6: $r = p.badVerb(verb); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat }; } $f._1 = _1; $f.p = p; $f.size = size; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtFloat = function(v, size, verb) { return this.$val.fmtFloat(v, size, verb); }; pp.ptr.prototype.fmtComplex = function(v, size, verb) { var _1, _q, _q$1, oldPlus, p, size, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _q = $f._q; _q$1 = $f._q$1; oldPlus = $f.oldPlus; p = $f.p; size = $f.size; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (118)) || (_1 === (98)) || (_1 === (103)) || (_1 === (71)) || (_1 === (102)) || (_1 === (70)) || (_1 === (101)) || (_1 === (69))) { */ case 2: oldPlus = p.fmt.fmtFlags.plus; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(40); $r = p.fmtFloat(v.$real, (_q = size / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p.fmt.fmtFlags.plus = true; $r = p.fmtFloat(v.$imag, (_q$1 = size / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("i)"); p.fmt.fmtFlags.plus = oldPlus; $s = 4; continue; /* } else { */ case 3: $r = p.badVerb(verb); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex }; } $f._1 = _1; $f._q = _q; $f._q$1 = _q$1; $f.oldPlus = oldPlus; $f.p = p; $f.size = size; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtComplex = function(v, size, verb) { return this.$val.fmtComplex(v, size, verb); }; pp.ptr.prototype.fmtString = function(v, verb) { var _1, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if (_1 === (118)) { $s = 2; continue; } /* */ if (_1 === (115)) { $s = 3; continue; } /* */ if (_1 === (120)) { $s = 4; continue; } /* */ if (_1 === (88)) { $s = 5; continue; } /* */ if (_1 === (113)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_1 === (118)) { */ case 2: if (p.fmt.fmtFlags.sharpV) { p.fmt.fmtQ(v); } else { p.fmt.fmtS(v); } $s = 8; continue; /* } else if (_1 === (115)) { */ case 3: p.fmt.fmtS(v); $s = 8; continue; /* } else if (_1 === (120)) { */ case 4: p.fmt.fmtSx(v, "0123456789abcdefx"); $s = 8; continue; /* } else if (_1 === (88)) { */ case 5: p.fmt.fmtSx(v, "0123456789ABCDEFX"); $s = 8; continue; /* } else if (_1 === (113)) { */ case 6: p.fmt.fmtQ(v); $s = 8; continue; /* } else { */ case 7: $r = p.badVerb(verb); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtString }; } $f._1 = _1; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtString = function(v, verb) { return this.$val.fmtString(v, verb); }; pp.ptr.prototype.fmtBytes = function(v, verb, typeString) { var _1, _i, _i$1, _r, _ref, _ref$1, c, c$1, i, i$1, p, typeString, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _ref = $f._ref; _ref$1 = $f._ref$1; c = $f.c; c$1 = $f.c$1; i = $f.i; i$1 = $f.i$1; p = $f.p; typeString = $f.typeString; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _1 = verb; /* */ if ((_1 === (118)) || (_1 === (100))) { $s = 2; continue; } /* */ if (_1 === (115)) { $s = 3; continue; } /* */ if (_1 === (120)) { $s = 4; continue; } /* */ if (_1 === (88)) { $s = 5; continue; } /* */ if (_1 === (113)) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((_1 === (118)) || (_1 === (100))) { */ case 2: if (p.fmt.fmtFlags.sharpV) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(typeString); if (v === sliceType$2.nil) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); _ref = v; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; c = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); } p.fmt0x64((new $Uint64(0, c)), true); _i++; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); } else { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); _ref$1 = v; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } i$1 = _i$1; c$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); if (i$1 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); } p.fmt.fmtInteger((new $Uint64(0, c$1)), 10, false, "0123456789abcdefx"); _i$1++; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); } $s = 8; continue; /* } else if (_1 === (115)) { */ case 3: p.fmt.fmtS(($bytesToString(v))); $s = 8; continue; /* } else if (_1 === (120)) { */ case 4: p.fmt.fmtBx(v, "0123456789abcdefx"); $s = 8; continue; /* } else if (_1 === (88)) { */ case 5: p.fmt.fmtBx(v, "0123456789ABCDEFX"); $s = 8; continue; /* } else if (_1 === (113)) { */ case 6: p.fmt.fmtQ(($bytesToString(v))); $s = 8; continue; /* } else { */ case 7: _r = reflect.ValueOf(v); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = p.printValue($clone(_r, reflect.Value), verb, 0); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBytes }; } $f._1 = _1; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._ref = _ref; $f._ref$1 = _ref$1; $f.c = c; $f.c$1 = c$1; $f.i = i; $f.i$1 = i$1; $f.p = p; $f.typeString = typeString; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtBytes = function(v, verb, typeString) { return this.$val.fmtBytes(v, verb, typeString); }; pp.ptr.prototype.fmtPointer = function(value, verb) { var _1, _2, _r, p, u, value, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; p = $f.p; u = $f.u; value = $f.value; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; u = 0; _1 = $clone(value, reflect.Value).Kind(); /* */ if ((_1 === (18)) || (_1 === (19)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (18)) || (_1 === (19)) || (_1 === (21)) || (_1 === (22)) || (_1 === (23)) || (_1 === (26))) { */ case 2: u = $clone(value, reflect.Value).Pointer(); $s = 4; continue; /* } else { */ case 3: $r = p.badVerb(verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 4: case 1: _2 = verb; /* */ if (_2 === (118)) { $s = 7; continue; } /* */ if (_2 === (112)) { $s = 8; continue; } /* */ if ((_2 === (98)) || (_2 === (111)) || (_2 === (100)) || (_2 === (120)) || (_2 === (88))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_2 === (118)) { */ case 7: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 12; continue; } /* */ $s = 13; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 12: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(40); _r = $clone(value, reflect.Value).Type().String(); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(")("); if (u === 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("nil"); } else { p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), true); } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); $s = 14; continue; /* } else { */ case 13: if (u === 0) { p.fmt.padString(""); } else { p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), !p.fmt.fmtFlags.sharp); } /* } */ case 14: $s = 11; continue; /* } else if (_2 === (112)) { */ case 8: p.fmt0x64((new $Uint64(0, u.constructor === Number ? u : 1)), !p.fmt.fmtFlags.sharp); $s = 11; continue; /* } else if ((_2 === (98)) || (_2 === (111)) || (_2 === (100)) || (_2 === (120)) || (_2 === (88))) { */ case 9: $r = p.fmtInteger((new $Uint64(0, u.constructor === Number ? u : 1)), false, verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 11; continue; /* } else { */ case 10: $r = p.badVerb(verb); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtPointer }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f.p = p; $f.u = u; $f.value = value; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.fmtPointer = function(value, verb) { return this.$val.fmtPointer(value, verb); }; pp.ptr.prototype.catchPanic = function(arg, verb) { var _r, arg, err, oldFlags, p, v, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; arg = $f.arg; err = $f.err; oldFlags = $f.oldFlags; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; err = $recover(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: _r = reflect.ValueOf(arg); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if (($clone(v, reflect.Value).Kind() === 22) && $clone(v, reflect.Value).IsNil()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); $s = -1; return; } if (p.panicking) { $panic(err); } oldFlags = $clone(p.fmt.fmtFlags, fmtFlags); p.fmt.clearflags(); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(PANIC="); p.panicking = true; $r = p.printArg(err, 118); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } p.panicking = false; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); fmtFlags.copy(p.fmt.fmtFlags, oldFlags); /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.catchPanic }; } $f._r = _r; $f.arg = arg; $f.err = err; $f.oldFlags = oldFlags; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.catchPanic = function(arg, verb) { return this.$val.catchPanic(arg, verb); }; pp.ptr.prototype.handleMethods = function(verb) { var _1, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, formatter, handled, ok, ok$1, p, stringer, v, v$1, verb, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; formatter = $f.formatter; handled = $f.handled; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; stringer = $f.stringer; v = $f.v; v$1 = $f.v$1; verb = $f.verb; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); handled = false; p = this; if (p.erroring) { $s = -1; return handled; } _tuple = $assertType(p.arg, Formatter, true); formatter = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); $r = formatter.Format(p, verb); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return handled; /* } */ case 2: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 4; continue; } /* */ $s = 5; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 4: _tuple$1 = $assertType(p.arg, GoStringer, true); stringer = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 7; continue; } /* */ $s = 8; continue; /* if (ok$1) { */ case 7: handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); _r = stringer.GoString(); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = p.fmt.fmtS(_r); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return handled; /* } */ case 8: $s = 6; continue; /* } else { */ case 5: _1 = verb; /* */ if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { $s = 12; continue; } /* */ $s = 13; continue; /* if ((_1 === (118)) || (_1 === (115)) || (_1 === (120)) || (_1 === (88)) || (_1 === (113))) { */ case 12: _ref = p.arg; /* */ if ($assertType(_ref, $error, true)[1]) { $s = 14; continue; } /* */ if ($assertType(_ref, Stringer, true)[1]) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($assertType(_ref, $error, true)[1]) { */ case 14: v = _ref; handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); _r$1 = v.Error(); /* */ $s = 17; case 17: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = p.fmtString(_r$1, verb); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return handled; /* } else if ($assertType(_ref, Stringer, true)[1]) { */ case 15: v$1 = _ref; handled = true; $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); _r$2 = v$1.String(); /* */ $s = 19; case 19: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = p.fmtString(_r$2, verb); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return handled; /* } */ case 16: /* } */ case 13: case 11: /* } */ case 6: handled = false; $s = -1; return handled; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return handled; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: pp.ptr.prototype.handleMethods }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.formatter = formatter; $f.handled = handled; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.stringer = stringer; $f.v = v; $f.v$1 = v$1; $f.verb = verb; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; pp.prototype.handleMethods = function(verb) { return this.$val.handleMethods(verb); }; pp.ptr.prototype.printArg = function(arg, verb) { var _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, arg, f, f$1, f$10, f$11, f$12, f$13, f$14, f$15, f$16, f$17, f$18, f$19, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, p, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; arg = $f.arg; f = $f.f; f$1 = $f.f$1; f$10 = $f.f$10; f$11 = $f.f$11; f$12 = $f.f$12; f$13 = $f.f$13; f$14 = $f.f$14; f$15 = $f.f$15; f$16 = $f.f$16; f$17 = $f.f$17; f$18 = $f.f$18; f$19 = $f.f$19; f$2 = $f.f$2; f$3 = $f.f$3; f$4 = $f.f$4; f$5 = $f.f$5; f$6 = $f.f$6; f$7 = $f.f$7; f$8 = $f.f$8; f$9 = $f.f$9; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; p.arg = arg; p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); /* */ if ($interfaceIsEqual(arg, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(arg, $ifaceNil)) { */ case 1: _1 = verb; /* */ if ((_1 === (84)) || (_1 === (118))) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_1 === (84)) || (_1 === (118))) { */ case 4: p.fmt.padString(""); $s = 6; continue; /* } else { */ case 5: $r = p.badVerb(verb); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: case 3: $s = -1; return; /* } */ case 2: _2 = verb; /* */ if (_2 === (84)) { $s = 9; continue; } /* */ if (_2 === (112)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_2 === (84)) { */ case 9: _r = reflect.TypeOf(arg).String(); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = p.fmt.fmtS(_r); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else if (_2 === (112)) { */ case 10: _r$1 = reflect.ValueOf(arg); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = p.fmtPointer($clone(_r$1, reflect.Value), 112); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 11: case 8: _ref = arg; /* */ if ($assertType(_ref, $Bool, true)[1]) { $s = 16; continue; } /* */ if ($assertType(_ref, $Float32, true)[1]) { $s = 17; continue; } /* */ if ($assertType(_ref, $Float64, true)[1]) { $s = 18; continue; } /* */ if ($assertType(_ref, $Complex64, true)[1]) { $s = 19; continue; } /* */ if ($assertType(_ref, $Complex128, true)[1]) { $s = 20; continue; } /* */ if ($assertType(_ref, $Int, true)[1]) { $s = 21; continue; } /* */ if ($assertType(_ref, $Int8, true)[1]) { $s = 22; continue; } /* */ if ($assertType(_ref, $Int16, true)[1]) { $s = 23; continue; } /* */ if ($assertType(_ref, $Int32, true)[1]) { $s = 24; continue; } /* */ if ($assertType(_ref, $Int64, true)[1]) { $s = 25; continue; } /* */ if ($assertType(_ref, $Uint, true)[1]) { $s = 26; continue; } /* */ if ($assertType(_ref, $Uint8, true)[1]) { $s = 27; continue; } /* */ if ($assertType(_ref, $Uint16, true)[1]) { $s = 28; continue; } /* */ if ($assertType(_ref, $Uint32, true)[1]) { $s = 29; continue; } /* */ if ($assertType(_ref, $Uint64, true)[1]) { $s = 30; continue; } /* */ if ($assertType(_ref, $Uintptr, true)[1]) { $s = 31; continue; } /* */ if ($assertType(_ref, $String, true)[1]) { $s = 32; continue; } /* */ if ($assertType(_ref, sliceType$2, true)[1]) { $s = 33; continue; } /* */ if ($assertType(_ref, reflect.Value, true)[1]) { $s = 34; continue; } /* */ $s = 35; continue; /* if ($assertType(_ref, $Bool, true)[1]) { */ case 16: f = _ref.$val; $r = p.fmtBool(f, verb); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Float32, true)[1]) { */ case 17: f$1 = _ref.$val; $r = p.fmtFloat((f$1), 32, verb); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Float64, true)[1]) { */ case 18: f$2 = _ref.$val; $r = p.fmtFloat(f$2, 64, verb); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Complex64, true)[1]) { */ case 19: f$3 = _ref.$val; $r = p.fmtComplex((new $Complex128(f$3.$real, f$3.$imag)), 64, verb); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Complex128, true)[1]) { */ case 20: f$4 = _ref.$val; $r = p.fmtComplex(f$4, 128, verb); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int, true)[1]) { */ case 21: f$5 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$5)), true, verb); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int8, true)[1]) { */ case 22: f$6 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$6)), true, verb); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int16, true)[1]) { */ case 23: f$7 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$7)), true, verb); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int32, true)[1]) { */ case 24: f$8 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$8)), true, verb); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Int64, true)[1]) { */ case 25: f$9 = _ref.$val; $r = p.fmtInteger((new $Uint64(f$9.$high, f$9.$low)), true, verb); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint, true)[1]) { */ case 26: f$10 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$10)), false, verb); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint8, true)[1]) { */ case 27: f$11 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$11)), false, verb); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint16, true)[1]) { */ case 28: f$12 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$12)), false, verb); /* */ $s = 49; case 49: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint32, true)[1]) { */ case 29: f$13 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$13)), false, verb); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uint64, true)[1]) { */ case 30: f$14 = _ref.$val; $r = p.fmtInteger(f$14, false, verb); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $Uintptr, true)[1]) { */ case 31: f$15 = _ref.$val; $r = p.fmtInteger((new $Uint64(0, f$15.constructor === Number ? f$15 : 1)), false, verb); /* */ $s = 52; case 52: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, $String, true)[1]) { */ case 32: f$16 = _ref.$val; $r = p.fmtString(f$16, verb); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, sliceType$2, true)[1]) { */ case 33: f$17 = _ref.$val; $r = p.fmtBytes(f$17, verb, "[]byte"); /* */ $s = 54; case 54: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else if ($assertType(_ref, reflect.Value, true)[1]) { */ case 34: f$18 = _ref.$val; /* */ if ($clone(f$18, reflect.Value).IsValid() && $clone(f$18, reflect.Value).CanInterface()) { $s = 55; continue; } /* */ $s = 56; continue; /* if ($clone(f$18, reflect.Value).IsValid() && $clone(f$18, reflect.Value).CanInterface()) { */ case 55: _r$2 = $clone(f$18, reflect.Value).Interface(); /* */ $s = 57; case 57: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } p.arg = _r$2; _r$3 = p.handleMethods(verb); /* */ $s = 60; case 60: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3) { $s = 58; continue; } /* */ $s = 59; continue; /* if (_r$3) { */ case 58: $s = -1; return; /* } */ case 59: /* } */ case 56: $r = p.printValue($clone(f$18, reflect.Value), verb, 0); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 36; continue; /* } else { */ case 35: f$19 = _ref; _r$4 = p.handleMethods(verb); /* */ $s = 64; case 64: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 62; continue; } /* */ $s = 63; continue; /* if (!_r$4) { */ case 62: _r$5 = reflect.ValueOf(f$19); /* */ $s = 65; case 65: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$5, reflect.Value), verb, 0); /* */ $s = 66; case 66: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 63: /* } */ case 36: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printArg }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f.arg = arg; $f.f = f; $f.f$1 = f$1; $f.f$10 = f$10; $f.f$11 = f$11; $f.f$12 = f$12; $f.f$13 = f$13; $f.f$14 = f$14; $f.f$15 = f$15; $f.f$16 = f$16; $f.f$17 = f$17; $f.f$18 = f$18; $f.f$19 = f$19; $f.f$2 = f$2; $f.f$3 = f$3; $f.f$4 = f$4; $f.f$5 = f$5; $f.f$6 = f$6; $f.f$7 = f$7; $f.f$8 = f$8; $f.f$9 = f$9; $f.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.printArg = function(arg, verb) { return this.$val.printArg(arg, verb); }; pp.ptr.prototype.printValue = function(value, verb, depth) { var _1, _2, _3, _4, _arg, _arg$1, _arg$2, _i, _i$1, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, a, bytes, depth, f, i, i$1, i$2, i$3, i$4, key, keys, name, p, t, value, value$1, verb, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _3 = $f._3; _4 = $f._4; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; a = $f.a; bytes = $f.bytes; depth = $f.depth; f = $f.f; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; i$4 = $f.i$4; key = $f.key; keys = $f.keys; name = $f.name; p = $f.p; t = $f.t; value = $f.value; value$1 = $f.value$1; verb = $f.verb; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; /* */ if (depth > 0 && $clone(value, reflect.Value).IsValid() && $clone(value, reflect.Value).CanInterface()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (depth > 0 && $clone(value, reflect.Value).IsValid() && $clone(value, reflect.Value).CanInterface()) { */ case 1: _r = $clone(value, reflect.Value).Interface(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } p.arg = _r; _r$1 = p.handleMethods(verb); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_r$1) { */ case 4: $s = -1; return; /* } */ case 5: /* } */ case 2: p.arg = $ifaceNil; p.value = value; f = value; _1 = $clone(value, reflect.Value).Kind(); /* */ if (_1 === (0)) { $s = 8; continue; } /* */ if (_1 === (1)) { $s = 9; continue; } /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 10; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 11; continue; } /* */ if (_1 === (13)) { $s = 12; continue; } /* */ if (_1 === (14)) { $s = 13; continue; } /* */ if (_1 === (15)) { $s = 14; continue; } /* */ if (_1 === (16)) { $s = 15; continue; } /* */ if (_1 === (24)) { $s = 16; continue; } /* */ if (_1 === (21)) { $s = 17; continue; } /* */ if (_1 === (25)) { $s = 18; continue; } /* */ if (_1 === (20)) { $s = 19; continue; } /* */ if ((_1 === (17)) || (_1 === (23))) { $s = 20; continue; } /* */ if (_1 === (22)) { $s = 21; continue; } /* */ if ((_1 === (18)) || (_1 === (19)) || (_1 === (26))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (_1 === (0)) { */ case 8: /* */ if (depth === 0) { $s = 25; continue; } /* */ $s = 26; continue; /* if (depth === 0) { */ case 25: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); $s = 27; continue; /* } else { */ case 26: _2 = verb; /* */ if (_2 === (118)) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_2 === (118)) { */ case 29: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); $s = 31; continue; /* } else { */ case 30: $r = p.badVerb(verb); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 31: case 28: /* } */ case 27: $s = 24; continue; /* } else if (_1 === (1)) { */ case 9: $r = p.fmtBool($clone(f, reflect.Value).Bool(), verb); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 10: $r = p.fmtInteger(((x = $clone(f, reflect.Value).Int(), new $Uint64(x.$high, x.$low))), true, verb); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 11: $r = p.fmtInteger($clone(f, reflect.Value).Uint(), false, verb); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (13)) { */ case 12: $r = p.fmtFloat($clone(f, reflect.Value).Float(), 32, verb); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (14)) { */ case 13: $r = p.fmtFloat($clone(f, reflect.Value).Float(), 64, verb); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (15)) { */ case 14: $r = p.fmtComplex($clone(f, reflect.Value).Complex(), 64, verb); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (16)) { */ case 15: $r = p.fmtComplex($clone(f, reflect.Value).Complex(), 128, verb); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (24)) { */ case 16: _r$2 = $clone(f, reflect.Value).String(); /* */ $s = 40; case 40: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = p.fmtString(_r$2, verb); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if (_1 === (21)) { */ case 17: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 42; continue; } /* */ $s = 43; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 42: _r$3 = $clone(f, reflect.Value).Type().String(); /* */ $s = 45; case 45: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$3); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($clone(f, reflect.Value).IsNil()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); $s = 44; continue; /* } else { */ case 43: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("map["); /* } */ case 44: _r$4 = $clone(f, reflect.Value).MapKeys(); /* */ $s = 47; case 47: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } keys = _r$4; _ref = keys; _i = 0; /* while (true) { */ case 48: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 49; continue; } i = _i; key = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i > 0) { if (p.fmt.fmtFlags.sharpV) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); } else { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); } } $r = p.printValue($clone(key, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); _r$5 = $clone(f, reflect.Value).MapIndex($clone(key, reflect.Value)); /* */ $s = 51; case 51: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$5, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 52; case 52: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 48; continue; case 49: if (p.fmt.fmtFlags.sharpV) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); } else { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); } $s = 24; continue; /* } else if (_1 === (25)) { */ case 18: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 53; continue; } /* */ $s = 54; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 53: _r$6 = $clone(f, reflect.Value).Type().String(); /* */ $s = 55; case 55: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$6); /* */ $s = 56; case 56: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 54: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); i$1 = 0; /* while (true) { */ case 57: /* if (!(i$1 < $clone(f, reflect.Value).NumField())) { break; } */ if(!(i$1 < $clone(f, reflect.Value).NumField())) { $s = 58; continue; } if (i$1 > 0) { if (p.fmt.fmtFlags.sharpV) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); } else { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); } } /* */ if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { $s = 59; continue; } /* */ $s = 60; continue; /* if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { */ case 59: _r$7 = $clone(f, reflect.Value).Type().Field(i$1); /* */ $s = 61; case 61: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } name = _r$7.Name; if (!(name === "")) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(name); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); } /* } */ case 60: _r$8 = getField($clone(f, reflect.Value), i$1); /* */ $s = 62; case 62: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$8, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 63; case 63: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$1 = i$1 + (1) >> 0; /* } */ $s = 57; continue; case 58: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); $s = 24; continue; /* } else if (_1 === (20)) { */ case 19: _r$9 = $clone(f, reflect.Value).Elem(); /* */ $s = 64; case 64: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } value$1 = _r$9; /* */ if (!$clone(value$1, reflect.Value).IsValid()) { $s = 65; continue; } /* */ $s = 66; continue; /* if (!$clone(value$1, reflect.Value).IsValid()) { */ case 65: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 68; continue; } /* */ $s = 69; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 68: _r$10 = $clone(f, reflect.Value).Type().String(); /* */ $s = 71; case 71: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$10); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); $s = 70; continue; /* } else { */ case 69: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); /* } */ case 70: $s = 67; continue; /* } else { */ case 66: $r = p.printValue($clone(value$1, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 73; case 73: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 67: $s = 24; continue; /* } else if ((_1 === (17)) || (_1 === (23))) { */ case 20: _3 = verb; /* */ if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { $s = 75; continue; } /* */ $s = 76; continue; /* if ((_3 === (115)) || (_3 === (113)) || (_3 === (120)) || (_3 === (88))) { */ case 75: t = $clone(f, reflect.Value).Type(); _r$11 = t.Elem(); /* */ $s = 79; case 79: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$12 = _r$11.Kind(); /* */ $s = 80; case 80: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } /* */ if (_r$12 === 8) { $s = 77; continue; } /* */ $s = 78; continue; /* if (_r$12 === 8) { */ case 77: bytes = sliceType$2.nil; /* */ if ($clone(f, reflect.Value).Kind() === 23) { $s = 81; continue; } /* */ if ($clone(f, reflect.Value).CanAddr()) { $s = 82; continue; } /* */ $s = 83; continue; /* if ($clone(f, reflect.Value).Kind() === 23) { */ case 81: _r$13 = $clone(f, reflect.Value).Bytes(); /* */ $s = 85; case 85: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } bytes = _r$13; $s = 84; continue; /* } else if ($clone(f, reflect.Value).CanAddr()) { */ case 82: _r$14 = $clone(f, reflect.Value).Slice(0, $clone(f, reflect.Value).Len()); /* */ $s = 86; case 86: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$15 = $clone(_r$14, reflect.Value).Bytes(); /* */ $s = 87; case 87: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } bytes = _r$15; $s = 84; continue; /* } else { */ case 83: bytes = $makeSlice(sliceType$2, $clone(f, reflect.Value).Len()); _ref$1 = bytes; _i$1 = 0; /* while (true) { */ case 88: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 89; continue; } i$2 = _i$1; _r$16 = $clone(f, reflect.Value).Index(i$2); /* */ $s = 90; case 90: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$17 = $clone(_r$16, reflect.Value).Uint(); /* */ $s = 91; case 91: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } ((i$2 < 0 || i$2 >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + i$2] = ((_r$17.$low << 24 >>> 24))); _i$1++; /* } */ $s = 88; continue; case 89: /* } */ case 84: _arg = bytes; _arg$1 = verb; _r$18 = t.String(); /* */ $s = 92; case 92: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _arg$2 = _r$18; $r = p.fmtBytes(_arg, _arg$1, _arg$2); /* */ $s = 93; case 93: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 78: /* } */ case 76: case 74: /* */ if (p.fmt.fmtFlags.sharpV) { $s = 94; continue; } /* */ $s = 95; continue; /* if (p.fmt.fmtFlags.sharpV) { */ case 94: _r$19 = $clone(f, reflect.Value).Type().String(); /* */ $s = 97; case 97: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$19); /* */ $s = 98; case 98: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (($clone(f, reflect.Value).Kind() === 23) && $clone(f, reflect.Value).IsNil()) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); $s = -1; return; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); i$3 = 0; /* while (true) { */ case 99: /* if (!(i$3 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$3 < $clone(f, reflect.Value).Len())) { $s = 100; continue; } if (i$3 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); } _r$20 = $clone(f, reflect.Value).Index(i$3); /* */ $s = 101; case 101: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$20, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 102; case 102: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$3 = i$3 + (1) >> 0; /* } */ $s = 99; continue; case 100: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); $s = 96; continue; /* } else { */ case 95: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); i$4 = 0; /* while (true) { */ case 103: /* if (!(i$4 < $clone(f, reflect.Value).Len())) { break; } */ if(!(i$4 < $clone(f, reflect.Value).Len())) { $s = 104; continue; } if (i$4 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); } _r$21 = $clone(f, reflect.Value).Index(i$4); /* */ $s = 105; case 105: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } $r = p.printValue($clone(_r$21, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 106; case 106: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$4 = i$4 + (1) >> 0; /* } */ $s = 103; continue; case 104: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); /* } */ case 96: $s = 24; continue; /* } else if (_1 === (22)) { */ case 21: /* */ if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { $s = 107; continue; } /* */ $s = 108; continue; /* if ((depth === 0) && !(($clone(f, reflect.Value).Pointer() === 0))) { */ case 107: _r$22 = $clone(f, reflect.Value).Elem(); /* */ $s = 110; case 110: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } a = _r$22; _4 = $clone(a, reflect.Value).Kind(); /* */ if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { $s = 111; continue; } /* */ $s = 112; continue; /* if ((_4 === (17)) || (_4 === (23)) || (_4 === (25)) || (_4 === (21))) { */ case 111: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); $r = p.printValue($clone(a, reflect.Value), verb, depth + 1 >> 0); /* */ $s = 113; case 113: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 112: case 109: /* } */ case 108: $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 114; case 114: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else if ((_1 === (18)) || (_1 === (19)) || (_1 === (26))) { */ case 22: $r = p.fmtPointer($clone(f, reflect.Value), verb); /* */ $s = 115; case 115: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 24; continue; /* } else { */ case 23: $r = p.unknownType($clone(f, reflect.Value)); /* */ $s = 116; case 116: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 24: case 7: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printValue }; } $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._4 = _4; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f.a = a; $f.bytes = bytes; $f.depth = depth; $f.f = f; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.i$4 = i$4; $f.key = key; $f.keys = keys; $f.name = name; $f.p = p; $f.t = t; $f.value = value; $f.value$1 = value$1; $f.verb = verb; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.printValue = function(value, verb, depth) { return this.$val.printValue(value, verb, depth); }; intFromArg = function(a, argNum) { var _1, _r, _tuple, a, argNum, isInt, n, n$1, newArgNum, num, v, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; a = $f.a; argNum = $f.argNum; isInt = $f.isInt; n = $f.n; n$1 = $f.n$1; newArgNum = $f.newArgNum; num = $f.num; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: num = 0; isInt = false; newArgNum = 0; newArgNum = argNum; /* */ if (argNum < a.$length) { $s = 1; continue; } /* */ $s = 2; continue; /* if (argNum < a.$length) { */ case 1: _tuple = $assertType(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), $Int, true); num = _tuple[0]; isInt = _tuple[1]; /* */ if (!isInt) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!isInt) { */ case 3: _r = reflect.ValueOf(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; _1 = $clone(v, reflect.Value).Kind(); if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { n = $clone(v, reflect.Value).Int(); if ((x = (new $Int64(0, (((n.$low + ((n.$high >> 31) * 4294967296)) >> 0)))), (x.$high === n.$high && x.$low === n.$low))) { num = (((n.$low + ((n.$high >> 31) * 4294967296)) >> 0)); isInt = true; } } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { n$1 = $clone(v, reflect.Value).Uint(); if ((x$1 = (new $Int64(n$1.$high, n$1.$low)), (x$1.$high > 0 || (x$1.$high === 0 && x$1.$low >= 0))) && (x$2 = (new $Uint64(0, ((n$1.$low >> 0)))), (x$2.$high === n$1.$high && x$2.$low === n$1.$low))) { num = ((n$1.$low >> 0)); isInt = true; } } case 5: /* } */ case 4: newArgNum = argNum + 1 >> 0; if (tooLarge(num)) { num = 0; isInt = false; } /* } */ case 2: $s = -1; return [num, isInt, newArgNum]; /* */ } return; } if ($f === undefined) { $f = { $blk: intFromArg }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.a = a; $f.argNum = argNum; $f.isInt = isInt; $f.n = n; $f.n$1 = n$1; $f.newArgNum = newArgNum; $f.num = num; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; parseArgNumber = function(format) { var _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, format, i, index, newi, ok, ok$1, wid, width; index = 0; wid = 0; ok = false; if (format.length < 3) { _tmp = 0; _tmp$1 = 1; _tmp$2 = false; index = _tmp; wid = _tmp$1; ok = _tmp$2; return [index, wid, ok]; } i = 1; while (true) { if (!(i < format.length)) { break; } if (format.charCodeAt(i) === 93) { _tuple = parsenum(format, 1, i); width = _tuple[0]; ok$1 = _tuple[1]; newi = _tuple[2]; if (!ok$1 || !((newi === i))) { _tmp$3 = 0; _tmp$4 = i + 1 >> 0; _tmp$5 = false; index = _tmp$3; wid = _tmp$4; ok = _tmp$5; return [index, wid, ok]; } _tmp$6 = width - 1 >> 0; _tmp$7 = i + 1 >> 0; _tmp$8 = true; index = _tmp$6; wid = _tmp$7; ok = _tmp$8; return [index, wid, ok]; } i = i + (1) >> 0; } _tmp$9 = 0; _tmp$10 = 1; _tmp$11 = false; index = _tmp$9; wid = _tmp$10; ok = _tmp$11; return [index, wid, ok]; }; pp.ptr.prototype.argNumber = function(argNum, format, i, numArgs) { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, argNum, format, found, i, index, newArgNum, newi, numArgs, ok, p, wid; newArgNum = 0; newi = 0; found = false; p = this; if (format.length <= i || !((format.charCodeAt(i) === 91))) { _tmp = argNum; _tmp$1 = i; _tmp$2 = false; newArgNum = _tmp; newi = _tmp$1; found = _tmp$2; return [newArgNum, newi, found]; } p.reordered = true; _tuple = parseArgNumber($substring(format, i)); index = _tuple[0]; wid = _tuple[1]; ok = _tuple[2]; if (ok && 0 <= index && index < numArgs) { _tmp$3 = index; _tmp$4 = i + wid >> 0; _tmp$5 = true; newArgNum = _tmp$3; newi = _tmp$4; found = _tmp$5; return [newArgNum, newi, found]; } p.goodArgNum = false; _tmp$6 = argNum; _tmp$7 = i + wid >> 0; _tmp$8 = ok; newArgNum = _tmp$6; newi = _tmp$7; found = _tmp$8; return [newArgNum, newi, found]; }; pp.prototype.argNumber = function(argNum, format, i, numArgs) { return this.$val.argNumber(argNum, format, i, numArgs); }; pp.ptr.prototype.badArgNum = function(verb) { var p, verb; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(BADINDEX)"); }; pp.prototype.badArgNum = function(verb) { return this.$val.badArgNum(verb); }; pp.ptr.prototype.missingArg = function(verb) { var p, verb; p = this; (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!"); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(verb); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(MISSING)"); }; pp.prototype.missingArg = function(verb) { return this.$val.missingArg(verb); }; pp.ptr.prototype.doPrintf = function(format, a) { var _1, _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, argNum, c, end, format, i, i$1, lasti, p, size, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; a = $f.a; afterIndex = $f.afterIndex; arg = $f.arg; argNum = $f.argNum; c = $f.c; end = $f.end; format = $f.format; i = $f.i; i$1 = $f.i$1; lasti = $f.lasti; p = $f.p; size = $f.size; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; end = format.length; argNum = 0; afterIndex = false; p.reordered = false; i = 0; /* while (true) { */ case 1: /* if (!(i < end)) { break; } */ if(!(i < end)) { $s = 2; continue; } p.goodArgNum = true; lasti = i; while (true) { if (!(i < end && !((format.charCodeAt(i) === 37)))) { break; } i = i + (1) >> 0; } if (i > lasti) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString($substring(format, lasti, i)); } if (i >= end) { /* break; */ $s = 2; continue; } i = i + (1) >> 0; p.fmt.clearflags(); /* while (true) { */ case 3: /* if (!(i < end)) { break; } */ if(!(i < end)) { $s = 4; continue; } c = format.charCodeAt(i); _1 = c; /* */ if (_1 === (35)) { $s = 6; continue; } /* */ if (_1 === (48)) { $s = 7; continue; } /* */ if (_1 === (43)) { $s = 8; continue; } /* */ if (_1 === (45)) { $s = 9; continue; } /* */ if (_1 === (32)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (35)) { */ case 6: p.fmt.fmtFlags.sharp = true; $s = 12; continue; /* } else if (_1 === (48)) { */ case 7: p.fmt.fmtFlags.zero = !p.fmt.fmtFlags.minus; $s = 12; continue; /* } else if (_1 === (43)) { */ case 8: p.fmt.fmtFlags.plus = true; $s = 12; continue; /* } else if (_1 === (45)) { */ case 9: p.fmt.fmtFlags.minus = true; p.fmt.fmtFlags.zero = false; $s = 12; continue; /* } else if (_1 === (32)) { */ case 10: p.fmt.fmtFlags.space = true; $s = 12; continue; /* } else { */ case 11: /* */ if (97 <= c && c <= 122 && argNum < a.$length) { $s = 13; continue; } /* */ $s = 14; continue; /* if (97 <= c && c <= 122 && argNum < a.$length) { */ case 13: if (c === 118) { p.fmt.fmtFlags.sharpV = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = false; p.fmt.fmtFlags.plusV = p.fmt.fmtFlags.plus; p.fmt.fmtFlags.plus = false; } $r = p.printArg(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), ((c >> 0))); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } argNum = argNum + (1) >> 0; i = i + (1) >> 0; /* continue formatLoop; */ $s = 1; continue s; /* } */ case 14: /* break simpleFormat; */ $s = 4; continue s; /* } */ case 12: case 5: i = i + (1) >> 0; /* } */ $s = 3; continue; case 4: _tuple = p.argNumber(argNum, format, i, a.$length); argNum = _tuple[0]; i = _tuple[1]; afterIndex = _tuple[2]; /* */ if (i < end && (format.charCodeAt(i) === 42)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 16: i = i + (1) >> 0; _r = intFromArg(a, argNum); /* */ $s = 19; case 19: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; p.fmt.wid = _tuple$1[0]; p.fmt.fmtFlags.widPresent = _tuple$1[1]; argNum = _tuple$1[2]; if (!p.fmt.fmtFlags.widPresent) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(BADWIDTH)"); } if (p.fmt.wid < 0) { p.fmt.wid = -p.fmt.wid; p.fmt.fmtFlags.minus = true; p.fmt.fmtFlags.zero = false; } afterIndex = false; $s = 18; continue; /* } else { */ case 17: _tuple$2 = parsenum(format, i, end); p.fmt.wid = _tuple$2[0]; p.fmt.fmtFlags.widPresent = _tuple$2[1]; i = _tuple$2[2]; if (afterIndex && p.fmt.fmtFlags.widPresent) { p.goodArgNum = false; } /* } */ case 18: /* */ if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { $s = 20; continue; } /* */ $s = 21; continue; /* if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { */ case 20: i = i + (1) >> 0; if (afterIndex) { p.goodArgNum = false; } _tuple$3 = p.argNumber(argNum, format, i, a.$length); argNum = _tuple$3[0]; i = _tuple$3[1]; afterIndex = _tuple$3[2]; /* */ if (i < end && (format.charCodeAt(i) === 42)) { $s = 22; continue; } /* */ $s = 23; continue; /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 22: i = i + (1) >> 0; _r$1 = intFromArg(a, argNum); /* */ $s = 25; case 25: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$4 = _r$1; p.fmt.prec = _tuple$4[0]; p.fmt.fmtFlags.precPresent = _tuple$4[1]; argNum = _tuple$4[2]; if (p.fmt.prec < 0) { p.fmt.prec = 0; p.fmt.fmtFlags.precPresent = false; } if (!p.fmt.fmtFlags.precPresent) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(BADPREC)"); } afterIndex = false; $s = 24; continue; /* } else { */ case 23: _tuple$5 = parsenum(format, i, end); p.fmt.prec = _tuple$5[0]; p.fmt.fmtFlags.precPresent = _tuple$5[1]; i = _tuple$5[2]; if (!p.fmt.fmtFlags.precPresent) { p.fmt.prec = 0; p.fmt.fmtFlags.precPresent = true; } /* } */ case 24: /* } */ case 21: if (!afterIndex) { _tuple$6 = p.argNumber(argNum, format, i, a.$length); argNum = _tuple$6[0]; i = _tuple$6[1]; afterIndex = _tuple$6[2]; } if (i >= end) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(NOVERB)"); /* break; */ $s = 2; continue; } _tmp = ((format.charCodeAt(i) >> 0)); _tmp$1 = 1; verb = _tmp; size = _tmp$1; if (verb >= 128) { _tuple$7 = utf8.DecodeRuneInString($substring(format, i)); verb = _tuple$7[0]; size = _tuple$7[1]; } i = i + (size) >> 0; /* */ if ((verb === 37)) { $s = 27; continue; } /* */ if (!p.goodArgNum) { $s = 28; continue; } /* */ if (argNum >= a.$length) { $s = 29; continue; } /* */ if ((verb === 118)) { $s = 30; continue; } /* */ $s = 31; continue; /* if ((verb === 37)) { */ case 27: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(37); $s = 32; continue; /* } else if (!p.goodArgNum) { */ case 28: p.badArgNum(verb); $s = 32; continue; /* } else if (argNum >= a.$length) { */ case 29: p.missingArg(verb); $s = 32; continue; /* } else if ((verb === 118)) { */ case 30: p.fmt.fmtFlags.sharpV = p.fmt.fmtFlags.sharp; p.fmt.fmtFlags.sharp = false; p.fmt.fmtFlags.plusV = p.fmt.fmtFlags.plus; p.fmt.fmtFlags.plus = false; $r = p.printArg(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), verb); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } argNum = argNum + (1) >> 0; $s = 32; continue; /* } else { */ case 31: $r = p.printArg(((argNum < 0 || argNum >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + argNum]), verb); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } argNum = argNum + (1) >> 0; /* } */ case 32: case 26: /* } */ $s = 1; continue; case 2: /* */ if (!p.reordered && argNum < a.$length) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!p.reordered && argNum < a.$length) { */ case 35: p.fmt.clearflags(); (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("%!(EXTRA "); _ref = $subslice(a, argNum); _i = 0; /* while (true) { */ case 37: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 38; continue; } i$1 = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (i$1 > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(", "); } /* */ if ($interfaceIsEqual(arg, $ifaceNil)) { $s = 39; continue; } /* */ $s = 40; continue; /* if ($interfaceIsEqual(arg, $ifaceNil)) { */ case 39: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); $s = 41; continue; /* } else { */ case 40: _r$2 = reflect.TypeOf(arg).String(); /* */ $s = 42; case 42: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); $r = p.printArg(arg, 118); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 41: _i++; /* } */ $s = 37; continue; case 38: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); /* } */ case 36: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintf }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.a = a; $f.afterIndex = afterIndex; $f.arg = arg; $f.argNum = argNum; $f.c = c; $f.end = end; $f.format = format; $f.i = i; $f.i$1 = i$1; $f.lasti = lasti; $f.p = p; $f.size = size; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.doPrintf = function(format, a) { return this.$val.doPrintf(format, a); }; pp.ptr.prototype.doPrint = function(a) { var _i, _r, _ref, _v, a, arg, argNum, isString, p, prevString, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _v = $f._v; a = $f.a; arg = $f.arg; argNum = $f.argNum; isString = $f.isString; p = $f.p; prevString = $f.prevString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; prevString = false; _ref = a; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } argNum = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(!($interfaceIsEqual(arg, $ifaceNil)))) { _v = false; $s = 3; continue s; } _r = reflect.TypeOf(arg).Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r === 24; case 3: isString = _v; if (argNum > 0 && !isString && !prevString) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); } $r = p.printArg(arg, 118); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } prevString = isString; _i++; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrint }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._v = _v; $f.a = a; $f.arg = arg; $f.argNum = argNum; $f.isString = isString; $f.p = p; $f.prevString = prevString; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.doPrint = function(a) { return this.$val.doPrint(a); }; pp.ptr.prototype.doPrintln = function(a) { var _i, _ref, a, arg, argNum, p, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; a = $f.a; arg = $f.arg; argNum = $f.argNum; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: p = this; _ref = a; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } argNum = _i; arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (argNum > 0) { (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); } $r = p.printArg(arg, 118); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 1; continue; case 2: (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(10); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintln }; } $f._i = _i; $f._ref = _ref; $f.a = a; $f.arg = arg; $f.argNum = argNum; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; }; pp.prototype.doPrintln = function(a) { return this.$val.doPrintln(a); }; Fscanf = function(r, format, a) { var _r, _r$1, _tuple, _tuple$1, a, err, format, n, old, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; err = $f.err; format = $f.format; n = $f.n; old = $f.old; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; _r = newScanState(r, false, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; s = _tuple[0]; old = $clone(_tuple[1], ssave); _r$1 = s.doScanf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; n = _tuple$1[0]; err = _tuple$1[1]; s.free($clone(old, ssave)); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Fscanf }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.err = err; $f.format = format; $f.n = n; $f.old = old; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Fscanf = Fscanf; ss.ptr.prototype.Read = function(buf) { var _tmp, _tmp$1, buf, err, n, s; n = 0; err = $ifaceNil; s = this; _tmp = 0; _tmp$1 = errors.New("ScanState's Read should not be called. Use ReadRune"); n = _tmp; err = _tmp$1; return [n, err]; }; ss.prototype.Read = function(buf) { return this.$val.Read(buf); }; ss.ptr.prototype.ReadRune = function() { var _r, _tuple, err, r, s, size, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = 0; size = 0; err = $ifaceNil; s = this; if (s.atEOF || s.count >= s.ssave.argLimit) { err = io.EOF; $s = -1; return [r, size, err]; } _r = s.rs.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; size = _tuple[1]; err = _tuple[2]; if ($interfaceIsEqual(err, $ifaceNil)) { s.count = s.count + (1) >> 0; if (s.ssave.nlIsEnd && (r === 10)) { s.atEOF = true; } } else if ($interfaceIsEqual(err, io.EOF)) { s.atEOF = true; } $s = -1; return [r, size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.ReadRune }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.ReadRune = function() { return this.$val.ReadRune(); }; ss.ptr.prototype.Width = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, ok, s, wid; wid = 0; ok = false; s = this; if (s.ssave.maxWid === 1073741824) { _tmp = 0; _tmp$1 = false; wid = _tmp; ok = _tmp$1; return [wid, ok]; } _tmp$2 = s.ssave.maxWid; _tmp$3 = true; wid = _tmp$2; ok = _tmp$3; return [wid, ok]; }; ss.prototype.Width = function() { return this.$val.Width(); }; ss.ptr.prototype.getRune = function() { var _r, _tuple, err, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = 0; s = this; _r = s.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r = _tuple[0]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { r = -1; $s = -1; return r; } s.error(err); } $s = -1; return r; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.getRune }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.getRune = function() { return this.$val.getRune(); }; ss.ptr.prototype.mustReadRune = function() { var _r, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = 0; s = this; _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { s.error(io.ErrUnexpectedEOF); } $s = -1; return r; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.mustReadRune }; } $f._r = _r; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.mustReadRune = function() { return this.$val.mustReadRune(); }; ss.ptr.prototype.UnreadRune = function() { var _r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = s.rs.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; s.atEOF = false; s.count = s.count - (1) >> 0; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.UnreadRune }; } $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; ss.ptr.prototype.error = function(err) { var err, s, x; s = this; $panic((x = new scanError.ptr(err), new x.constructor.elem(x))); }; ss.prototype.error = function(err) { return this.$val.error(err); }; ss.ptr.prototype.errorString = function(err) { var err, s, x; s = this; $panic((x = new scanError.ptr(errors.New(err)), new x.constructor.elem(x))); }; ss.prototype.errorString = function(err) { return this.$val.errorString(err); }; ss.ptr.prototype.Token = function(skipSpace, f) { var _r, err, f, s, skipSpace, tok, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; f = $f.f; s = $f.s; skipSpace = $f.skipSpace; tok = $f.tok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = [err]; tok = sliceType$2.nil; err[0] = $ifaceNil; s = this; $deferred.push([(function(err) { return function() { var _tuple, e, ok, se; e = $recover(); if (!($interfaceIsEqual(e, $ifaceNil))) { _tuple = $assertType(e, scanError, true); se = $clone(_tuple[0], scanError); ok = _tuple[1]; if (ok) { err[0] = se.err; } else { $panic(e); } } }; })(err), []]); if (f === $throwNilPointerError) { f = notSpace; } s.buf = $subslice(s.buf, 0, 0); _r = s.token(skipSpace, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tok = _r; $s = -1; return [tok, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [tok, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ss.ptr.prototype.Token }; } $f._r = _r; $f.err = err; $f.f = f; $f.s = s; $f.skipSpace = skipSpace; $f.tok = tok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ss.prototype.Token = function(skipSpace, f) { return this.$val.Token(skipSpace, f); }; isSpace = function(r) { var _i, _ref, r, rng, rx; if (r >= 65536) { return false; } rx = ((r << 16 >>> 16)); _ref = space; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } rng = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), arrayType$1); if (rx < rng[0]) { return false; } if (rx <= rng[1]) { return true; } _i++; } return false; }; notSpace = function(r) { var r; return !isSpace(r); }; readRune.ptr.prototype.readByte = function() { var _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, err, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = 0; err = $ifaceNil; r = this; if (r.pending > 0) { b = r.pendBuf[0]; $copySlice($subslice(new sliceType$2(r.pendBuf), 0), $subslice(new sliceType$2(r.pendBuf), 1)); r.pending = r.pending - (1) >> 0; $s = -1; return [b, err]; } _r = io.ReadFull(r.reader, $subslice(new sliceType$2(r.pendBuf), 0, 1)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (!((n === 1))) { _tmp = 0; _tmp$1 = err; b = _tmp; err = _tmp$1; $s = -1; return [b, err]; } _tmp$2 = r.pendBuf[0]; _tmp$3 = err; b = _tmp$2; err = _tmp$3; $s = -1; return [b, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: readRune.ptr.prototype.readByte }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; readRune.prototype.readByte = function() { return this.$val.readByte(); }; readRune.ptr.prototype.ReadRune = function() { var _r, _r$1, _tuple, _tuple$1, _tuple$2, err, n, r, rr, size, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; n = $f.n; r = $f.r; rr = $f.rr; size = $f.size; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rr = 0; size = 0; err = $ifaceNil; r = this; if (r.peekRune >= 0) { rr = r.peekRune; r.peekRune = ~r.peekRune >> 0; size = utf8.RuneLen(rr); $s = -1; return [rr, size, err]; } _r = r.readByte(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; r.buf[0] = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [rr, size, err]; } if (r.buf[0] < 128) { rr = ((r.buf[0] >> 0)); size = 1; r.peekRune = ~rr >> 0; $s = -1; return [rr, size, err]; } n = 0; n = 1; /* while (true) { */ case 2: /* if (!(!utf8.FullRune($subslice(new sliceType$2(r.buf), 0, n)))) { break; } */ if(!(!utf8.FullRune($subslice(new sliceType$2(r.buf), 0, n)))) { $s = 3; continue; } _r$1 = r.readByte(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; (x = r.buf, ((n < 0 || n >= x.length) ? ($throwRuntimeError("index out of range"), undefined) : x[n] = _tuple$1[0])); err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = $ifaceNil; /* break; */ $s = 3; continue; } $s = -1; return [rr, size, err]; } n = n + (1) >> 0; /* } */ $s = 2; continue; case 3: _tuple$2 = utf8.DecodeRune($subslice(new sliceType$2(r.buf), 0, n)); rr = _tuple$2[0]; size = _tuple$2[1]; if (size < n) { $copySlice($subslice(new sliceType$2(r.pendBuf), r.pending), $subslice(new sliceType$2(r.buf), size, n)); r.pending = r.pending + ((n - size >> 0)) >> 0; } r.peekRune = ~rr >> 0; $s = -1; return [rr, size, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: readRune.ptr.prototype.ReadRune }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.n = n; $f.r = r; $f.rr = rr; $f.size = size; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; readRune.prototype.ReadRune = function() { return this.$val.ReadRune(); }; readRune.ptr.prototype.UnreadRune = function() { var r; r = this; if (r.peekRune >= 0) { return errors.New("fmt: scanning called UnreadRune with no rune available"); } r.peekRune = ~r.peekRune >> 0; return $ifaceNil; }; readRune.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; newScanState = function(r, nlIsSpace, nlIsEnd) { var _r, _tuple, nlIsEnd, nlIsSpace, ok, old, r, rs, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; nlIsEnd = $f.nlIsEnd; nlIsSpace = $f.nlIsSpace; ok = $f.ok; old = $f.old; r = $f.r; rs = $f.rs; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = ptrType$5.nil; old = new ssave.ptr(false, false, false, 0, 0, 0); _r = ssFree.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = $assertType(_r, ptrType$5); _tuple = $assertType(r, io.RuneScanner, true); rs = _tuple[0]; ok = _tuple[1]; if (ok) { s.rs = rs; } else { s.rs = new readRune.ptr(r, arrayType$3.zero(), 0, arrayType$3.zero(), -1); } s.ssave.nlIsSpace = nlIsSpace; s.ssave.nlIsEnd = nlIsEnd; s.atEOF = false; s.ssave.limit = 1073741824; s.ssave.argLimit = 1073741824; s.ssave.maxWid = 1073741824; s.ssave.validSave = true; s.count = 0; $s = -1; return [s, old]; /* */ } return; } if ($f === undefined) { $f = { $blk: newScanState }; } $f._r = _r; $f._tuple = _tuple; $f.nlIsEnd = nlIsEnd; $f.nlIsSpace = nlIsSpace; $f.ok = ok; $f.old = old; $f.r = r; $f.rs = rs; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.ptr.prototype.free = function(old) { var old, s; s = this; if (old.validSave) { ssave.copy(s.ssave, old); return; } if (s.buf.$capacity > 1024) { return; } s.buf = $subslice(s.buf, 0, 0); s.rs = $ifaceNil; ssFree.Put(s); }; ss.prototype.free = function(old) { return this.$val.free(old); }; ss.ptr.prototype.SkipSpace = function() { var _r, _r$1, _r$2, _v, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _v = $f._v; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* while (true) { */ case 1: _r = s.getRune(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { $s = -1; return; } if (!(r === 13)) { _v = false; $s = 6; continue s; } _r$1 = s.peek("\n"); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1; case 6: /* */ if (_v) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 4: /* continue; */ $s = 1; continue; /* } */ case 5: /* */ if (r === 10) { $s = 8; continue; } /* */ $s = 9; continue; /* if (r === 10) { */ case 8: if (s.ssave.nlIsSpace) { /* continue; */ $s = 1; continue; } s.errorString("unexpected newline"); $s = -1; return; /* } */ case 9: /* */ if (!isSpace(r)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!isSpace(r)) { */ case 10: _r$2 = s.UnreadRune(); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* break; */ $s = 2; continue; /* } */ case 11: /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.SkipSpace }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._v = _v; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.SkipSpace = function() { return this.$val.SkipSpace(); }; ss.ptr.prototype.token = function(skipSpace, f) { var _r, _r$1, _r$2, f, r, s, skipSpace, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; f = $f.f; r = $f.r; s = $f.s; skipSpace = $f.skipSpace; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (skipSpace) { $s = 1; continue; } /* */ $s = 2; continue; /* if (skipSpace) { */ case 1: $r = s.SkipSpace(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* while (true) { */ case 4: _r = s.getRune(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { /* break; */ $s = 5; continue; } _r$1 = f(r); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!_r$1) { */ case 7: _r$2 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* break; */ $s = 5; continue; /* } */ case 8: (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r); /* } */ $s = 4; continue; case 5: $s = -1; return (x = s.buf, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.token }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.f = f; $f.r = r; $f.s = s; $f.skipSpace = skipSpace; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.token = function(skipSpace, f) { return this.$val.token(skipSpace, f); }; indexRune = function(s, r) { var _i, _ref, _rune, c, i, r, s; _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; c = _rune[0]; if (c === r) { return i; } _i += _rune[1]; } return -1; }; ss.ptr.prototype.consume = function(ok, accept) { var _r, _r$1, accept, ok, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; accept = $f.accept; ok = $f.ok; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { $s = -1; return false; } if (indexRune(ok, r) >= 0) { if (accept) { (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r); } $s = -1; return true; } /* */ if (!((r === -1)) && accept) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((r === -1)) && accept) { */ case 2: _r$1 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 3: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.consume }; } $f._r = _r; $f._r$1 = _r$1; $f.accept = accept; $f.ok = ok; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.consume = function(ok, accept) { return this.$val.consume(ok, accept); }; ss.ptr.prototype.peek = function(ok) { var _r, _r$1, ok, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; ok = $f.ok; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; /* */ if (!((r === -1))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((r === -1))) { */ case 2: _r$1 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 3: $s = -1; return indexRune(ok, r) >= 0; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.peek }; } $f._r = _r; $f._r$1 = _r$1; $f.ok = ok; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.peek = function(ok) { return this.$val.peek(ok); }; ss.ptr.prototype.notEOF = function() { var _r, _r$1, r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === -1) { $panic(io.EOF); } _r$1 = s.UnreadRune(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.notEOF }; } $f._r = _r; $f._r$1 = _r$1; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.notEOF = function() { return this.$val.notEOF(); }; ss.ptr.prototype.accept = function(ok) { var _r, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; _r = s.consume(ok, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.accept }; } $f._r = _r; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.accept = function(ok) { return this.$val.accept(ok); }; ss.ptr.prototype.okVerb = function(verb, okVerbs, typ) { var _i, _ref, _rune, okVerbs, s, typ, v, verb; s = this; _ref = okVerbs; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); v = _rune[0]; if (v === verb) { return true; } _i += _rune[1]; } s.errorString("bad verb '%" + ($encodeRune(verb)) + "' for " + typ); return false; }; ss.prototype.okVerb = function(verb, okVerbs, typ) { return this.$val.okVerb(verb, okVerbs, typ); }; ss.ptr.prototype.scanBool = function(verb) { var _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _v, _v$1, _v$2, _v$3, _v$4, s, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; s = $f.s; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; $r = s.SkipSpace(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!s.okVerb(verb, "tv", "boolean")) { $s = -1; return false; } _r = s.getRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _1 = _r; /* */ if (_1 === (48)) { $s = 5; continue; } /* */ if (_1 === (49)) { $s = 6; continue; } /* */ if ((_1 === (116)) || (_1 === (84))) { $s = 7; continue; } /* */ if ((_1 === (102)) || (_1 === (70))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_1 === (48)) { */ case 5: $s = -1; return false; /* } else if (_1 === (49)) { */ case 6: $s = -1; return true; /* } else if ((_1 === (116)) || (_1 === (84))) { */ case 7: _r$1 = s.accept("rR"); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!(_r$1)) { _v = false; $s = 12; continue s; } _r$2 = s.accept("uU"); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } if (!_r$2) { _v$1 = true; $s = 14; continue s; } _r$3 = s.accept("eE"); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v$1 = !_r$3; case 14: _v = _v$1; case 12: /* */ if (_v) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_v) { */ case 10: s.error(boolError); /* } */ case 11: $s = -1; return true; /* } else if ((_1 === (102)) || (_1 === (70))) { */ case 8: _r$4 = s.accept("aA"); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } if (!(_r$4)) { _v$2 = false; $s = 19; continue s; } _r$5 = s.accept("lL"); /* */ $s = 23; case 23: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } if (!_r$5) { _v$4 = true; $s = 22; continue s; } _r$6 = s.accept("sS"); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$4 = !_r$6; case 22: if (_v$4) { _v$3 = true; $s = 21; continue s; } _r$7 = s.accept("eE"); /* */ $s = 25; case 25: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v$3 = !_r$7; case 21: _v$2 = _v$3; case 19: /* */ if (_v$2) { $s = 17; continue; } /* */ $s = 18; continue; /* if (_v$2) { */ case 17: s.error(boolError); /* } */ case 18: $s = -1; return false; /* } */ case 9: case 3: $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanBool }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f.s = s; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanBool = function(verb) { return this.$val.scanBool(verb); }; ss.ptr.prototype.getBase = function(verb) { var _1, base, digits, s, verb; base = 0; digits = ""; s = this; s.okVerb(verb, "bdoUxXv", "integer"); base = 10; digits = "0123456789"; _1 = verb; if (_1 === (98)) { base = 2; digits = "01"; } else if (_1 === (111)) { base = 8; digits = "01234567"; } else if ((_1 === (120)) || (_1 === (88)) || (_1 === (85))) { base = 16; digits = "0123456789aAbBcCdDeEfF"; } return [base, digits]; }; ss.prototype.getBase = function(verb) { return this.$val.getBase(verb); }; ss.ptr.prototype.scanNumber = function(digits, haveDigits) { var _r, _r$1, digits, haveDigits, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; digits = $f.digits; haveDigits = $f.haveDigits; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (!haveDigits) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!haveDigits) { */ case 1: $r = s.notEOF(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = s.accept(digits); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!_r) { */ case 4: s.errorString("expected integer"); /* } */ case 5: /* } */ case 2: /* while (true) { */ case 7: _r$1 = s.accept(digits); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* if (!(_r$1)) { break; } */ if(!(_r$1)) { $s = 8; continue; } /* } */ $s = 7; continue; case 8: $s = -1; return ($bytesToString(s.buf)); /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanNumber }; } $f._r = _r; $f._r$1 = _r$1; $f.digits = digits; $f.haveDigits = haveDigits; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanNumber = function(digits, haveDigits) { return this.$val.scanNumber(digits, haveDigits); }; ss.ptr.prototype.scanRune = function(bitSize) { var _r, bitSize, n, r, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; bitSize = $f.bitSize; n = $f.n; r = $f.r; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; $r = s.notEOF(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = s.getRune(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = (new $Int64(0, _r)); n = ((bitSize >>> 0)); x = $shiftRightInt64(($shiftLeft64(r, ((64 - n >>> 0)))), ((64 - n >>> 0))); if (!((x.$high === r.$high && x.$low === r.$low))) { s.errorString("overflow on character value " + ($encodeRune(r.$low))); } $s = -1; return r; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanRune }; } $f._r = _r; $f.bitSize = bitSize; $f.n = n; $f.r = r; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanRune = function(bitSize) { return this.$val.scanRune(bitSize); }; ss.ptr.prototype.scanBasePrefix = function() { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, base, digits, found, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; base = $f.base; digits = $f.digits; found = $f.found; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: base = 0; digits = ""; found = false; s = this; _r = s.peek("0"); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!_r) { */ case 1: _tmp = 10; _tmp$1 = "0123456789"; _tmp$2 = false; base = _tmp; digits = _tmp$1; found = _tmp$2; $s = -1; return [base, digits, found]; /* } */ case 2: _r$1 = s.accept("0"); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; found = true; _tmp$3 = 8; _tmp$4 = "01234567"; base = _tmp$3; digits = _tmp$4; _r$2 = s.peek("xX"); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_r$2) { */ case 5: _r$3 = s.consume("xX", false); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _tmp$5 = 16; _tmp$6 = "0123456789aAbBcCdDeEfF"; base = _tmp$5; digits = _tmp$6; /* } */ case 6: $s = -1; return [base, digits, found]; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanBasePrefix }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f.base = base; $f.digits = digits; $f.found = found; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanBasePrefix = function() { return this.$val.scanBasePrefix(); }; ss.ptr.prototype.scanInt = function(verb, bitSize) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, _v, base, bitSize, digits, err, haveDigits, i, n, s, tok, verb, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; base = $f.base; bitSize = $f.bitSize; digits = $f.digits; err = $f.err; haveDigits = $f.haveDigits; i = $f.i; n = $f.n; s = $f.s; tok = $f.tok; verb = $f.verb; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (verb === 99) { $s = 1; continue; } /* */ $s = 2; continue; /* if (verb === 99) { */ case 1: _r = s.scanRune(bitSize); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: $r = s.SkipSpace(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = s.getBase(verb); base = _tuple[0]; digits = _tuple[1]; haveDigits = false; /* */ if (verb === 85) { $s = 6; continue; } /* */ $s = 7; continue; /* if (verb === 85) { */ case 6: _r$1 = s.consume("U", false); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!_r$1) { _v = true; $s = 11; continue s; } _r$2 = s.consume("+", false); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = !_r$2; case 11: /* */ if (_v) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 9: s.errorString("bad unicode format "); /* } */ case 10: $s = 8; continue; /* } else { */ case 7: _r$3 = s.accept("+-"); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* */ if (verb === 118) { $s = 15; continue; } /* */ $s = 16; continue; /* if (verb === 118) { */ case 15: _r$4 = s.scanBasePrefix(); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; base = _tuple$1[0]; digits = _tuple$1[1]; haveDigits = _tuple$1[2]; /* } */ case 16: /* } */ case 8: _r$5 = s.scanNumber(digits, haveDigits); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } tok = _r$5; _tuple$2 = strconv.ParseInt(tok, base, 64); i = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { s.error(err); } n = ((bitSize >>> 0)); x = $shiftRightInt64(($shiftLeft64(i, ((64 - n >>> 0)))), ((64 - n >>> 0))); if (!((x.$high === i.$high && x.$low === i.$low))) { s.errorString("integer overflow on token " + tok); } $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanInt }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f.base = base; $f.bitSize = bitSize; $f.digits = digits; $f.err = err; $f.haveDigits = haveDigits; $f.i = i; $f.n = n; $f.s = s; $f.tok = tok; $f.verb = verb; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanInt = function(verb, bitSize) { return this.$val.scanInt(verb, bitSize); }; ss.ptr.prototype.scanUint = function(verb, bitSize) { var _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, _v, base, bitSize, digits, err, haveDigits, i, n, s, tok, verb, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _v = $f._v; base = $f.base; bitSize = $f.bitSize; digits = $f.digits; err = $f.err; haveDigits = $f.haveDigits; i = $f.i; n = $f.n; s = $f.s; tok = $f.tok; verb = $f.verb; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; /* */ if (verb === 99) { $s = 1; continue; } /* */ $s = 2; continue; /* if (verb === 99) { */ case 1: _r = s.scanRune(bitSize); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return ((x = _r, new $Uint64(x.$high, x.$low))); /* } */ case 2: $r = s.SkipSpace(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = s.getBase(verb); base = _tuple[0]; digits = _tuple[1]; haveDigits = false; /* */ if (verb === 85) { $s = 6; continue; } /* */ if (verb === 118) { $s = 7; continue; } /* */ $s = 8; continue; /* if (verb === 85) { */ case 6: _r$1 = s.consume("U", false); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } if (!_r$1) { _v = true; $s = 11; continue s; } _r$2 = s.consume("+", false); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = !_r$2; case 11: /* */ if (_v) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v) { */ case 9: s.errorString("bad unicode format "); /* } */ case 10: $s = 8; continue; /* } else if (verb === 118) { */ case 7: _r$3 = s.scanBasePrefix(); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; base = _tuple$1[0]; digits = _tuple$1[1]; haveDigits = _tuple$1[2]; /* } */ case 8: _r$4 = s.scanNumber(digits, haveDigits); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } tok = _r$4; _tuple$2 = strconv.ParseUint(tok, base, 64); i = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { s.error(err); } n = ((bitSize >>> 0)); x$1 = $shiftRightUint64(($shiftLeft64(i, ((64 - n >>> 0)))), ((64 - n >>> 0))); if (!((x$1.$high === i.$high && x$1.$low === i.$low))) { s.errorString("unsigned integer overflow on token " + tok); } $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanUint }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._v = _v; $f.base = base; $f.bitSize = bitSize; $f.digits = digits; $f.err = err; $f.haveDigits = haveDigits; $f.i = i; $f.n = n; $f.s = s; $f.tok = tok; $f.verb = verb; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanUint = function(verb, bitSize) { return this.$val.scanUint(verb, bitSize); }; ss.ptr.prototype.floatToken = function() { var _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, _v$1, _v$2, _v$3, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; s.buf = $subslice(s.buf, 0, 0); _r = s.accept("nN"); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } if (!(_r)) { _v$1 = false; $s = 4; continue s; } _r$1 = s.accept("aA"); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v$1 = _r$1; case 4: if (!(_v$1)) { _v = false; $s = 3; continue s; } _r$2 = s.accept("nN"); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2; case 3: /* */ if (_v) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_v) { */ case 1: $s = -1; return ($bytesToString(s.buf)); /* } */ case 2: _r$3 = s.accept("+-"); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _r$4 = s.accept("iI"); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } if (!(_r$4)) { _v$3 = false; $s = 12; continue s; } _r$5 = s.accept("nN"); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v$3 = _r$5; case 12: if (!(_v$3)) { _v$2 = false; $s = 11; continue s; } _r$6 = s.accept("fF"); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$2 = _r$6; case 11: /* */ if (_v$2) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_v$2) { */ case 9: $s = -1; return ($bytesToString(s.buf)); /* } */ case 10: /* while (true) { */ case 16: _r$7 = s.accept("0123456789"); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* if (!(_r$7)) { break; } */ if(!(_r$7)) { $s = 17; continue; } /* } */ $s = 16; continue; case 17: _r$8 = s.accept("."); /* */ $s = 21; case 21: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } /* */ if (_r$8) { $s = 19; continue; } /* */ $s = 20; continue; /* if (_r$8) { */ case 19: /* while (true) { */ case 22: _r$9 = s.accept("0123456789"); /* */ $s = 24; case 24: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } /* if (!(_r$9)) { break; } */ if(!(_r$9)) { $s = 23; continue; } /* } */ $s = 22; continue; case 23: /* } */ case 20: _r$10 = s.accept("eEp"); /* */ $s = 27; case 27: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } /* */ if (_r$10) { $s = 25; continue; } /* */ $s = 26; continue; /* if (_r$10) { */ case 25: _r$11 = s.accept("+-"); /* */ $s = 28; case 28: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; /* while (true) { */ case 29: _r$12 = s.accept("0123456789"); /* */ $s = 31; case 31: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } /* if (!(_r$12)) { break; } */ if(!(_r$12)) { $s = 30; continue; } /* } */ $s = 29; continue; case 30: /* } */ case 26: $s = -1; return ($bytesToString(s.buf)); /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.floatToken }; } $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.floatToken = function() { return this.$val.floatToken(); }; ss.ptr.prototype.complexTokens = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _v, imag, imagSign, parens, real, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _v = $f._v; imag = $f.imag; imagSign = $f.imagSign; parens = $f.parens; real = $f.real; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: real = ""; imag = ""; s = this; _r = s.accept("("); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } parens = _r; _r$1 = s.floatToken(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } real = _r$1; s.buf = $subslice(s.buf, 0, 0); _r$2 = s.accept("+-"); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!_r$2) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!_r$2) { */ case 3: s.error(complexError); /* } */ case 4: imagSign = ($bytesToString(s.buf)); _r$3 = s.floatToken(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } imag = _r$3; _r$4 = s.accept("i"); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!_r$4) { */ case 7: s.error(complexError); /* } */ case 8: if (!(parens)) { _v = false; $s = 12; continue s; } _r$5 = s.accept(")"); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _v = !_r$5; case 12: /* */ if (_v) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_v) { */ case 10: s.error(complexError); /* } */ case 11: _tmp = real; _tmp$1 = imagSign + imag; real = _tmp; imag = _tmp$1; $s = -1; return [real, imag]; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.complexTokens }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._v = _v; $f.imag = imag; $f.imagSign = imagSign; $f.parens = parens; $f.real = real; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.complexTokens = function() { return this.$val.complexTokens(); }; ss.ptr.prototype.convertFloat = function(str, n) { var _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, e, e$1, err, err$1, f, f$1, m, n, ok, ok$1, p, s, str; s = this; p = indexRune(str, 112); if (p >= 0) { _tuple = strconv.ParseFloat($substring(str, 0, p), n); f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tuple$1 = $assertType(err, ptrType$6, true); e = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { e.Num = str; } s.error(err); } _tuple$2 = strconv.Atoi($substring(str, (p + 1 >> 0))); m = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tuple$3 = $assertType(err, ptrType$6, true); e$1 = _tuple$3[0]; ok$1 = _tuple$3[1]; if (ok$1) { e$1.Num = str; } s.error(err); } return math.Ldexp(f, m); } _tuple$4 = strconv.ParseFloat(str, n); f$1 = _tuple$4[0]; err$1 = _tuple$4[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { s.error(err$1); } return f$1; }; ss.prototype.convertFloat = function(str, n) { return this.$val.convertFloat(str, n); }; ss.ptr.prototype.scanComplex = function(verb, n) { var _q, _q$1, _r, _tuple, imag, n, real, s, simag, sreal, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _q$1 = $f._q$1; _r = $f._r; _tuple = $f._tuple; imag = $f.imag; n = $f.n; real = $f.real; s = $f.s; simag = $f.simag; sreal = $f.sreal; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; if (!s.okVerb(verb, "beEfFgGv", "complex")) { $s = -1; return new $Complex128(0, 0); } $r = s.SkipSpace(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = s.complexTokens(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; sreal = _tuple[0]; simag = _tuple[1]; real = s.convertFloat(sreal, (_q = n / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); imag = s.convertFloat(simag, (_q$1 = n / 2, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero"))); $s = -1; return new $Complex128(real, imag); /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanComplex }; } $f._q = _q; $f._q$1 = _q$1; $f._r = _r; $f._tuple = _tuple; $f.imag = imag; $f.n = n; $f.real = real; $f.s = s; $f.simag = simag; $f.sreal = sreal; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanComplex = function(verb, n) { return this.$val.scanComplex(verb, n); }; ss.ptr.prototype.convertString = function(verb) { var _1, _r, _r$1, _r$2, s, str, verb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; s = $f.s; str = $f.str; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: str = ""; s = this; if (!s.okVerb(verb, "svqxX", "string")) { str = ""; $s = -1; return str; } $r = s.SkipSpace(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _1 = verb; /* */ if (_1 === (113)) { $s = 4; continue; } /* */ if ((_1 === (120)) || (_1 === (88))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (113)) { */ case 4: _r = s.quotedString(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; $s = 7; continue; /* } else if ((_1 === (120)) || (_1 === (88))) { */ case 5: _r$1 = s.hexString(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } str = _r$1; $s = 7; continue; /* } else { */ case 6: _r$2 = s.token(true, notSpace); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } str = ($bytesToString(_r$2)); /* } */ case 7: case 3: $s = -1; return str; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.convertString }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.s = s; $f.str = str; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.convertString = function(verb) { return this.$val.convertString(verb); }; ss.ptr.prototype.quotedString = function() { var _1, _r, _r$1, _r$2, _r$3, _tuple, err, quote, r, r$1, result, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; quote = $f.quote; r = $f.r; r$1 = $f.r$1; result = $f.result; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; $r = s.notEOF(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = s.getRune(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } quote = _r; _1 = quote; /* */ if (_1 === (96)) { $s = 4; continue; } /* */ if (_1 === (34)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (96)) { */ case 4: /* while (true) { */ case 8: _r$1 = s.mustReadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } r = _r$1; if (r === quote) { /* break; */ $s = 9; continue; } (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r); /* } */ $s = 8; continue; case 9: $s = -1; return ($bytesToString(s.buf)); /* } else if (_1 === (34)) { */ case 5: (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteByte(34); /* while (true) { */ case 11: _r$2 = s.mustReadRune(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } r$1 = _r$2; (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r$1); /* */ if (r$1 === 92) { $s = 14; continue; } /* */ if (r$1 === 34) { $s = 15; continue; } /* */ $s = 16; continue; /* if (r$1 === 92) { */ case 14: _r$3 = s.mustReadRune(); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(_r$3); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 16; continue; /* } else if (r$1 === 34) { */ case 15: /* break; */ $s = 12; continue; /* } */ case 16: /* } */ $s = 11; continue; case 12: _tuple = strconv.Unquote(($bytesToString(s.buf))); result = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { s.error(err); } $s = -1; return result; /* } else { */ case 6: s.errorString("expected quoted string"); /* } */ case 7: case 3: $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.quotedString }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.quote = quote; $f.r = r; $f.r$1 = r$1; $f.result = result; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.quotedString = function() { return this.$val.quotedString(); }; hexDigit = function(d) { var _1, d, digit; digit = ((d >> 0)); _1 = digit; if ((_1 === (48)) || (_1 === (49)) || (_1 === (50)) || (_1 === (51)) || (_1 === (52)) || (_1 === (53)) || (_1 === (54)) || (_1 === (55)) || (_1 === (56)) || (_1 === (57))) { return [digit - 48 >> 0, true]; } else if ((_1 === (97)) || (_1 === (98)) || (_1 === (99)) || (_1 === (100)) || (_1 === (101)) || (_1 === (102))) { return [(10 + digit >> 0) - 97 >> 0, true]; } else if ((_1 === (65)) || (_1 === (66)) || (_1 === (67)) || (_1 === (68)) || (_1 === (69)) || (_1 === (70))) { return [(10 + digit >> 0) - 65 >> 0, true]; } return [-1, false]; }; ss.ptr.prototype.hexByte = function() { var _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tuple, _tuple$1, b, ok, rune1, s, value1, value2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; ok = $f.ok; rune1 = $f.rune1; s = $f.s; value1 = $f.value1; value2 = $f.value2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = 0; ok = false; s = this; _r = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rune1 = _r; if (rune1 === -1) { $s = -1; return [b, ok]; } _tuple = hexDigit(rune1); value1 = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!ok) { */ case 2: _r$1 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = -1; return [b, ok]; /* } */ case 3: _r$2 = s.mustReadRune(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = hexDigit(_r$2); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; value2 = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { s.errorString("illegal hex digit"); $s = -1; return [b, ok]; } _tmp = ((((value1 << 4 >> 0) | value2) << 24 >>> 24)); _tmp$1 = true; b = _tmp; ok = _tmp$1; $s = -1; return [b, ok]; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.hexByte }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.ok = ok; $f.rune1 = rune1; $f.s = s; $f.value1 = value1; $f.value2 = value2; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.hexByte = function() { return this.$val.hexByte(); }; ss.ptr.prototype.hexString = function() { var _r, _tuple, b, ok, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; b = $f.b; ok = $f.ok; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; $r = s.notEOF(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* while (true) { */ case 2: _r = s.hexByte(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; b = _tuple[0]; ok = _tuple[1]; if (!ok) { /* break; */ $s = 3; continue; } (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteByte(b); /* } */ $s = 2; continue; case 3: if (s.buf.$length === 0) { s.errorString("no hex data for %x string"); $s = -1; return ""; } $s = -1; return ($bytesToString(s.buf)); /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.hexString }; } $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.ok = ok; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.hexString = function() { return this.$val.hexString(); }; ss.ptr.prototype.scanOne = function(verb, arg) { var _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, arg, err, i, ok, ptr, s, str, typ, v, v$1, v$10, v$11, v$12, v$13, v$14, v$15, v$16, v$17, v$18, v$19, v$2, v$20, v$3, v$4, v$5, v$6, v$7, v$8, v$9, val, verb, x, x$1, x$2, x$3, x$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$24 = $f._r$24; _r$25 = $f._r$25; _r$26 = $f._r$26; _r$27 = $f._r$27; _r$28 = $f._r$28; _r$29 = $f._r$29; _r$3 = $f._r$3; _r$30 = $f._r$30; _r$31 = $f._r$31; _r$32 = $f._r$32; _r$33 = $f._r$33; _r$34 = $f._r$34; _r$35 = $f._r$35; _r$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _r$41 = $f._r$41; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; arg = $f.arg; err = $f.err; i = $f.i; ok = $f.ok; ptr = $f.ptr; s = $f.s; str = $f.str; typ = $f.typ; v = $f.v; v$1 = $f.v$1; v$10 = $f.v$10; v$11 = $f.v$11; v$12 = $f.v$12; v$13 = $f.v$13; v$14 = $f.v$14; v$15 = $f.v$15; v$16 = $f.v$16; v$17 = $f.v$17; v$18 = $f.v$18; v$19 = $f.v$19; v$2 = $f.v$2; v$20 = $f.v$20; v$3 = $f.v$3; v$4 = $f.v$4; v$5 = $f.v$5; v$6 = $f.v$6; v$7 = $f.v$7; v$8 = $f.v$8; v$9 = $f.v$9; val = $f.val; verb = $f.verb; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = this; s.buf = $subslice(s.buf, 0, 0); err = $ifaceNil; _tuple = $assertType(arg, Scanner, true); v = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = v.Scan(s, verb); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { if ($interfaceIsEqual(err, io.EOF)) { err = io.ErrUnexpectedEOF; } s.error(err); } $s = -1; return; /* } */ case 2: _ref = arg; /* */ if ($assertType(_ref, ptrType$7, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$8, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$9, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref, ptrType$10, true)[1]) { $s = 7; continue; } /* */ if ($assertType(_ref, ptrType$11, true)[1]) { $s = 8; continue; } /* */ if ($assertType(_ref, ptrType$12, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref, ptrType$13, true)[1]) { $s = 10; continue; } /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 12; continue; } /* */ if ($assertType(_ref, ptrType$16, true)[1]) { $s = 13; continue; } /* */ if ($assertType(_ref, ptrType$17, true)[1]) { $s = 14; continue; } /* */ if ($assertType(_ref, ptrType$18, true)[1]) { $s = 15; continue; } /* */ if ($assertType(_ref, ptrType$19, true)[1]) { $s = 16; continue; } /* */ if ($assertType(_ref, ptrType$20, true)[1]) { $s = 17; continue; } /* */ if ($assertType(_ref, ptrType$21, true)[1]) { $s = 18; continue; } /* */ if ($assertType(_ref, ptrType$22, true)[1]) { $s = 19; continue; } /* */ if ($assertType(_ref, ptrType$4, true)[1]) { $s = 20; continue; } /* */ if ($assertType(_ref, ptrType$23, true)[1]) { $s = 21; continue; } /* */ $s = 22; continue; /* if ($assertType(_ref, ptrType$7, true)[1]) { */ case 4: v$1 = _ref.$val; _r$1 = s.scanBool(verb); /* */ $s = 24; case 24: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v$1.$set(_r$1); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$8, true)[1]) { */ case 5: v$2 = _ref.$val; _r$2 = s.scanComplex(verb, 64); /* */ $s = 25; case 25: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v$2.$set(((x = _r$2, new $Complex64(x.$real, x.$imag)))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$9, true)[1]) { */ case 6: v$3 = _ref.$val; _r$3 = s.scanComplex(verb, 128); /* */ $s = 26; case 26: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } v$3.$set(_r$3); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$10, true)[1]) { */ case 7: v$4 = _ref.$val; _r$4 = s.scanInt(verb, 32); /* */ $s = 27; case 27: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } v$4.$set((((x$1 = _r$4, x$1.$low + ((x$1.$high >> 31) * 4294967296)) >> 0))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$11, true)[1]) { */ case 8: v$5 = _ref.$val; _r$5 = s.scanInt(verb, 8); /* */ $s = 28; case 28: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } v$5.$set((((x$2 = _r$5, x$2.$low + ((x$2.$high >> 31) * 4294967296)) << 24 >> 24))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$12, true)[1]) { */ case 9: v$6 = _ref.$val; _r$6 = s.scanInt(verb, 16); /* */ $s = 29; case 29: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } v$6.$set((((x$3 = _r$6, x$3.$low + ((x$3.$high >> 31) * 4294967296)) << 16 >> 16))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$13, true)[1]) { */ case 10: v$7 = _ref.$val; _r$7 = s.scanInt(verb, 32); /* */ $s = 30; case 30: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } v$7.$set((((x$4 = _r$7, x$4.$low + ((x$4.$high >> 31) * 4294967296)) >> 0))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$14, true)[1]) { */ case 11: v$8 = _ref.$val; _r$8 = s.scanInt(verb, 64); /* */ $s = 31; case 31: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } v$8.$set(_r$8); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 12: v$9 = _ref.$val; _r$9 = s.scanUint(verb, 32); /* */ $s = 32; case 32: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } v$9.$set(((_r$9.$low >>> 0))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$16, true)[1]) { */ case 13: v$10 = _ref.$val; _r$10 = s.scanUint(verb, 8); /* */ $s = 33; case 33: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } v$10.$set(((_r$10.$low << 24 >>> 24))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$17, true)[1]) { */ case 14: v$11 = _ref.$val; _r$11 = s.scanUint(verb, 16); /* */ $s = 34; case 34: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } v$11.$set(((_r$11.$low << 16 >>> 16))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$18, true)[1]) { */ case 15: v$12 = _ref.$val; _r$12 = s.scanUint(verb, 32); /* */ $s = 35; case 35: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } v$12.$set(((_r$12.$low >>> 0))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$19, true)[1]) { */ case 16: v$13 = _ref.$val; _r$13 = s.scanUint(verb, 64); /* */ $s = 36; case 36: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } v$13.$set(_r$13); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$20, true)[1]) { */ case 17: v$14 = _ref.$val; _r$14 = s.scanUint(verb, 32); /* */ $s = 37; case 37: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } v$14.$set(((_r$14.$low >>> 0))); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$21, true)[1]) { */ case 18: v$15 = _ref.$val; /* */ if (s.okVerb(verb, "beEfFgGv", "float32")) { $s = 38; continue; } /* */ $s = 39; continue; /* if (s.okVerb(verb, "beEfFgGv", "float32")) { */ case 38: $r = s.SkipSpace(); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$15 = s.floatToken(); /* */ $s = 42; case 42: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _r$16 = s.convertFloat(_r$15, 32); /* */ $s = 43; case 43: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } v$15.$set(($fround(_r$16))); /* } */ case 39: $s = 23; continue; /* } else if ($assertType(_ref, ptrType$22, true)[1]) { */ case 19: v$16 = _ref.$val; /* */ if (s.okVerb(verb, "beEfFgGv", "float64")) { $s = 44; continue; } /* */ $s = 45; continue; /* if (s.okVerb(verb, "beEfFgGv", "float64")) { */ case 44: $r = s.SkipSpace(); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$17 = s.floatToken(); /* */ $s = 48; case 48: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$18 = s.convertFloat(_r$17, 64); /* */ $s = 49; case 49: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } v$16.$set(_r$18); /* } */ case 45: $s = 23; continue; /* } else if ($assertType(_ref, ptrType$4, true)[1]) { */ case 20: v$17 = _ref.$val; _r$19 = s.convertString(verb); /* */ $s = 50; case 50: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } v$17.$set(_r$19); $s = 23; continue; /* } else if ($assertType(_ref, ptrType$23, true)[1]) { */ case 21: v$18 = _ref.$val; _r$20 = s.convertString(verb); /* */ $s = 51; case 51: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } v$18.$set((new sliceType$2($stringToBytes(_r$20)))); $s = 23; continue; /* } else { */ case 22: v$19 = _ref; _r$21 = reflect.ValueOf(v$19); /* */ $s = 52; case 52: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } val = _r$21; ptr = val; /* */ if (!(($clone(ptr, reflect.Value).Kind() === 22))) { $s = 53; continue; } /* */ $s = 54; continue; /* if (!(($clone(ptr, reflect.Value).Kind() === 22))) { */ case 53: _r$22 = $clone(val, reflect.Value).Type().String(); /* */ $s = 55; case 55: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } $r = s.errorString("type not a pointer: " + _r$22); /* */ $s = 56; case 56: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 54: _r$23 = $clone(ptr, reflect.Value).Elem(); /* */ $s = 58; case 58: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } v$20 = _r$23; _1 = $clone(v$20, reflect.Value).Kind(); /* */ if (_1 === (1)) { $s = 59; continue; } /* */ if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { $s = 60; continue; } /* */ if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { $s = 61; continue; } /* */ if (_1 === (24)) { $s = 62; continue; } /* */ if (_1 === (23)) { $s = 63; continue; } /* */ if ((_1 === (13)) || (_1 === (14))) { $s = 64; continue; } /* */ if ((_1 === (15)) || (_1 === (16))) { $s = 65; continue; } /* */ $s = 66; continue; /* if (_1 === (1)) { */ case 59: _r$24 = s.scanBool(verb); /* */ $s = 68; case 68: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).SetBool(_r$24); /* */ $s = 69; case 69: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 67; continue; /* } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { */ case 60: _arg = verb; _r$25 = $clone(v$20, reflect.Value).Type().Bits(); /* */ $s = 70; case 70: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } _arg$1 = _r$25; _r$26 = s.scanInt(_arg, _arg$1); /* */ $s = 71; case 71: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).SetInt(_r$26); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 67; continue; /* } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { */ case 61: _arg$2 = verb; _r$27 = $clone(v$20, reflect.Value).Type().Bits(); /* */ $s = 73; case 73: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } _arg$3 = _r$27; _r$28 = s.scanUint(_arg$2, _arg$3); /* */ $s = 74; case 74: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).SetUint(_r$28); /* */ $s = 75; case 75: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 67; continue; /* } else if (_1 === (24)) { */ case 62: _r$29 = s.convertString(verb); /* */ $s = 76; case 76: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).SetString(_r$29); /* */ $s = 77; case 77: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 67; continue; /* } else if (_1 === (23)) { */ case 63: typ = $clone(v$20, reflect.Value).Type(); _r$30 = typ.Elem(); /* */ $s = 80; case 80: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } _r$31 = _r$30.Kind(); /* */ $s = 81; case 81: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } /* */ if (!((_r$31 === 8))) { $s = 78; continue; } /* */ $s = 79; continue; /* if (!((_r$31 === 8))) { */ case 78: _r$32 = $clone(val, reflect.Value).Type().String(); /* */ $s = 82; case 82: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } $r = s.errorString("can't scan type: " + _r$32); /* */ $s = 83; case 83: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 79: _r$33 = s.convertString(verb); /* */ $s = 84; case 84: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } str = _r$33; _r$34 = reflect.MakeSlice(typ, str.length, str.length); /* */ $s = 85; case 85: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).Set($clone(_r$34, reflect.Value)); /* */ $s = 86; case 86: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = 0; /* while (true) { */ case 87: /* if (!(i < str.length)) { break; } */ if(!(i < str.length)) { $s = 88; continue; } _r$35 = $clone(v$20, reflect.Value).Index(i); /* */ $s = 89; case 89: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } $r = $clone(_r$35, reflect.Value).SetUint((new $Uint64(0, str.charCodeAt(i)))); /* */ $s = 90; case 90: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (1) >> 0; /* } */ $s = 87; continue; case 88: $s = 67; continue; /* } else if ((_1 === (13)) || (_1 === (14))) { */ case 64: $r = s.SkipSpace(); /* */ $s = 91; case 91: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = s.notEOF(); /* */ $s = 92; case 92: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$36 = s.floatToken(); /* */ $s = 93; case 93: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } _arg$4 = _r$36; _r$37 = $clone(v$20, reflect.Value).Type().Bits(); /* */ $s = 94; case 94: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } _arg$5 = _r$37; _r$38 = s.convertFloat(_arg$4, _arg$5); /* */ $s = 95; case 95: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).SetFloat(_r$38); /* */ $s = 96; case 96: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 67; continue; /* } else if ((_1 === (15)) || (_1 === (16))) { */ case 65: _arg$6 = verb; _r$39 = $clone(v$20, reflect.Value).Type().Bits(); /* */ $s = 97; case 97: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } _arg$7 = _r$39; _r$40 = s.scanComplex(_arg$6, _arg$7); /* */ $s = 98; case 98: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; } $r = $clone(v$20, reflect.Value).SetComplex(_r$40); /* */ $s = 99; case 99: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 67; continue; /* } else { */ case 66: _r$41 = $clone(val, reflect.Value).Type().String(); /* */ $s = 100; case 100: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; } $r = s.errorString("can't scan type: " + _r$41); /* */ $s = 101; case 101: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 67: case 57: /* } */ case 23: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.scanOne }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$24 = _r$24; $f._r$25 = _r$25; $f._r$26 = _r$26; $f._r$27 = _r$27; $f._r$28 = _r$28; $f._r$29 = _r$29; $f._r$3 = _r$3; $f._r$30 = _r$30; $f._r$31 = _r$31; $f._r$32 = _r$32; $f._r$33 = _r$33; $f._r$34 = _r$34; $f._r$35 = _r$35; $f._r$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $f._r$41 = _r$41; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f.arg = arg; $f.err = err; $f.i = i; $f.ok = ok; $f.ptr = ptr; $f.s = s; $f.str = str; $f.typ = typ; $f.v = v; $f.v$1 = v$1; $f.v$10 = v$10; $f.v$11 = v$11; $f.v$12 = v$12; $f.v$13 = v$13; $f.v$14 = v$14; $f.v$15 = v$15; $f.v$16 = v$16; $f.v$17 = v$17; $f.v$18 = v$18; $f.v$19 = v$19; $f.v$2 = v$2; $f.v$20 = v$20; $f.v$3 = v$3; $f.v$4 = v$4; $f.v$5 = v$5; $f.v$6 = v$6; $f.v$7 = v$7; $f.v$8 = v$8; $f.v$9 = v$9; $f.val = val; $f.verb = verb; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.scanOne = function(verb, arg) { return this.$val.scanOne(verb, arg); }; errorHandler = function(errp) { var _tuple, _tuple$1, e, eof, errp, ok, ok$1, se; e = $recover(); if (!($interfaceIsEqual(e, $ifaceNil))) { _tuple = $assertType(e, scanError, true); se = $clone(_tuple[0], scanError); ok = _tuple[1]; if (ok) { errp.$set(se.err); } else { _tuple$1 = $assertType(e, $error, true); eof = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1 && $interfaceIsEqual(eof, io.EOF)) { errp.$set(eof); } else { $panic(e); } } } }; ss.ptr.prototype.advance = function(format) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, _tuple$2, fmtc, format, i, inputc, inputc$1, inputc$2, j, newlines, nextc, s, trailingSpace, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; fmtc = $f.fmtc; format = $f.format; i = $f.i; inputc = $f.inputc; inputc$1 = $f.inputc$1; inputc$2 = $f.inputc$2; j = $f.j; newlines = $f.newlines; nextc = $f.nextc; s = $f.s; trailingSpace = $f.trailingSpace; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = 0; s = this; /* while (true) { */ case 1: /* if (!(i < format.length)) { break; } */ if(!(i < format.length)) { $s = 2; continue; } _tuple = utf8.DecodeRuneInString($substring(format, i)); fmtc = _tuple[0]; w = _tuple[1]; /* */ if (isSpace(fmtc)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (isSpace(fmtc)) { */ case 3: newlines = 0; trailingSpace = false; while (true) { if (!(isSpace(fmtc) && i < format.length)) { break; } if (fmtc === 10) { newlines = newlines + (1) >> 0; trailingSpace = false; } else { trailingSpace = true; } i = i + (w) >> 0; _tuple$1 = utf8.DecodeRuneInString($substring(format, i)); fmtc = _tuple$1[0]; w = _tuple$1[1]; } j = 0; /* while (true) { */ case 5: /* if (!(j < newlines)) { break; } */ if(!(j < newlines)) { $s = 6; continue; } _r = s.getRune(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } inputc = _r; /* while (true) { */ case 8: /* if (!(isSpace(inputc) && !((inputc === 10)))) { break; } */ if(!(isSpace(inputc) && !((inputc === 10)))) { $s = 9; continue; } _r$1 = s.getRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } inputc = _r$1; /* } */ $s = 8; continue; case 9: if (!((inputc === 10)) && !((inputc === -1))) { s.errorString("newline in format does not match input"); } j = j + (1) >> 0; /* } */ $s = 5; continue; case 6: /* */ if (trailingSpace) { $s = 11; continue; } /* */ $s = 12; continue; /* if (trailingSpace) { */ case 11: _r$2 = s.getRune(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } inputc$1 = _r$2; if (newlines === 0) { if (!isSpace(inputc$1) && !((inputc$1 === -1))) { s.errorString("expected space in input to match format"); } if (inputc$1 === 10) { s.errorString("newline in input does not match format"); } } /* while (true) { */ case 14: /* if (!(isSpace(inputc$1) && !((inputc$1 === 10)))) { break; } */ if(!(isSpace(inputc$1) && !((inputc$1 === 10)))) { $s = 15; continue; } _r$3 = s.getRune(); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } inputc$1 = _r$3; /* } */ $s = 14; continue; case 15: /* */ if (!((inputc$1 === -1))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!((inputc$1 === -1))) { */ case 17: _r$4 = s.UnreadRune(); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 18: /* } */ case 12: /* continue; */ $s = 1; continue; /* } */ case 4: if (fmtc === 37) { if ((i + w >> 0) === format.length) { s.errorString("missing verb: % at end of format string"); } _tuple$2 = utf8.DecodeRuneInString($substring(format, (i + w >> 0))); nextc = _tuple$2[0]; if (!((nextc === 37))) { $s = -1; return i; } i = i + (w) >> 0; } _r$5 = s.mustReadRune(); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } inputc$2 = _r$5; /* */ if (!((fmtc === inputc$2))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (!((fmtc === inputc$2))) { */ case 21: _r$6 = s.UnreadRune(); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; i = -1; $s = -1; return i; /* } */ case 22: i = i + (w) >> 0; /* } */ $s = 1; continue; case 2: $s = -1; return i; /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.advance }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.fmtc = fmtc; $f.format = format; $f.i = i; $f.inputc = inputc; $f.inputc$1 = inputc$1; $f.inputc$2 = inputc$2; $f.j = j; $f.newlines = newlines; $f.nextc = nextc; $f.s = s; $f.trailingSpace = trailingSpace; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; ss.prototype.advance = function(format) { return this.$val.advance(format); }; ss.ptr.prototype.doScanf = function(format, a) { var _r, _tuple, _tuple$1, a, arg, c, end, err, f, format, i, numProcessed, s, w, widPresent, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; arg = $f.arg; c = $f.c; end = $f.end; err = $f.err; f = $f.f; format = $f.format; i = $f.i; numProcessed = $f.numProcessed; s = $f.s; w = $f.w; widPresent = $f.widPresent; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = [err]; numProcessed = 0; err[0] = $ifaceNil; s = this; $deferred.push([errorHandler, [(err.$ptr || (err.$ptr = new ptrType$24(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, err)))]]); end = format.length - 1 >> 0; i = 0; /* while (true) { */ case 1: /* if (!(i <= end)) { break; } */ if(!(i <= end)) { $s = 2; continue; } _r = s.advance($substring(format, i)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } w = _r; /* */ if (w > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (w > 0) { */ case 4: i = i + (w) >> 0; /* continue; */ $s = 1; continue; /* } */ case 5: if (!((format.charCodeAt(i) === 37))) { if (w < 0) { s.errorString("input does not match format"); } /* break; */ $s = 2; continue; } i = i + (1) >> 0; widPresent = false; _tuple = parsenum(format, i, end); s.ssave.maxWid = _tuple[0]; widPresent = _tuple[1]; i = _tuple[2]; if (!widPresent) { s.ssave.maxWid = 1073741824; } _tuple$1 = utf8.DecodeRuneInString($substring(format, i)); c = _tuple$1[0]; w = _tuple$1[1]; i = i + (w) >> 0; /* */ if (!((c === 99))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!((c === 99))) { */ case 6: $r = s.SkipSpace(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: s.ssave.argLimit = s.ssave.limit; f = s.count + s.ssave.maxWid >> 0; if (f < s.ssave.argLimit) { s.ssave.argLimit = f; } if (numProcessed >= a.$length) { s.errorString("too few operands for format '%" + $substring(format, (i - w >> 0)) + "'"); /* break; */ $s = 2; continue; } arg = ((numProcessed < 0 || numProcessed >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + numProcessed]); $r = s.scanOne(c, arg); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } numProcessed = numProcessed + (1) >> 0; s.ssave.argLimit = s.ssave.limit; /* } */ $s = 1; continue; case 2: if (numProcessed < a.$length) { s.errorString("too many operands"); } $s = -1; return [numProcessed, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [numProcessed, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ss.ptr.prototype.doScanf }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.arg = arg; $f.c = c; $f.end = end; $f.err = err; $f.f = f; $f.format = format; $f.i = i; $f.numProcessed = numProcessed; $f.s = s; $f.w = w; $f.widPresent = widPresent; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ss.prototype.doScanf = function(format, a) { return this.$val.doScanf(format, a); }; ptrType$25.methods = [{prop: "clearflags", name: "clearflags", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "init", name: "init", pkg: "fmt", typ: $funcType([ptrType$1], [], false)}, {prop: "writePadding", name: "writePadding", pkg: "fmt", typ: $funcType([$Int], [], false)}, {prop: "pad", name: "pad", pkg: "fmt", typ: $funcType([sliceType$2], [], false)}, {prop: "padString", name: "padString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtBoolean", name: "fmtBoolean", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "fmtUnicode", name: "fmtUnicode", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Int, $Bool, $String], [], false)}, {prop: "truncate", name: "truncate", pkg: "fmt", typ: $funcType([$String], [$String], false)}, {prop: "fmtS", name: "fmtS", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtSbx", name: "fmtSbx", pkg: "fmt", typ: $funcType([$String, sliceType$2, $String], [], false)}, {prop: "fmtSx", name: "fmtSx", pkg: "fmt", typ: $funcType([$String, $String], [], false)}, {prop: "fmtBx", name: "fmtBx", pkg: "fmt", typ: $funcType([sliceType$2, $String], [], false)}, {prop: "fmtQ", name: "fmtQ", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmtC", name: "fmtC", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtQc", name: "fmtQc", pkg: "fmt", typ: $funcType([$Uint64], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32, $Int], [], false)}]; ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [], false)}]; ptrType$2.methods = [{prop: "free", name: "free", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "unknownType", name: "unknownType", pkg: "fmt", typ: $funcType([reflect.Value], [], false)}, {prop: "badVerb", name: "badVerb", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "fmtBool", name: "fmtBool", pkg: "fmt", typ: $funcType([$Bool, $Int32], [], false)}, {prop: "fmt0x64", name: "fmt0x64", pkg: "fmt", typ: $funcType([$Uint64, $Bool], [], false)}, {prop: "fmtInteger", name: "fmtInteger", pkg: "fmt", typ: $funcType([$Uint64, $Bool, $Int32], [], false)}, {prop: "fmtFloat", name: "fmtFloat", pkg: "fmt", typ: $funcType([$Float64, $Int, $Int32], [], false)}, {prop: "fmtComplex", name: "fmtComplex", pkg: "fmt", typ: $funcType([$Complex128, $Int, $Int32], [], false)}, {prop: "fmtString", name: "fmtString", pkg: "fmt", typ: $funcType([$String, $Int32], [], false)}, {prop: "fmtBytes", name: "fmtBytes", pkg: "fmt", typ: $funcType([sliceType$2, $Int32, $String], [], false)}, {prop: "fmtPointer", name: "fmtPointer", pkg: "fmt", typ: $funcType([reflect.Value, $Int32], [], false)}, {prop: "catchPanic", name: "catchPanic", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "handleMethods", name: "handleMethods", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "printArg", name: "printArg", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "printValue", name: "printValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [], false)}, {prop: "argNumber", name: "argNumber", pkg: "fmt", typ: $funcType([$Int, $String, $Int, $Int], [$Int, $Int, $Bool], false)}, {prop: "badArgNum", name: "badArgNum", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "missingArg", name: "missingArg", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "doPrintf", name: "doPrintf", pkg: "fmt", typ: $funcType([$String, sliceType], [], false)}, {prop: "doPrint", name: "doPrint", pkg: "fmt", typ: $funcType([sliceType], [], false)}, {prop: "doPrintln", name: "doPrintln", pkg: "fmt", typ: $funcType([sliceType], [], false)}]; ptrType$5.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "getRune", name: "getRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "mustReadRune", name: "mustReadRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "error", name: "error", pkg: "fmt", typ: $funcType([$error], [], false)}, {prop: "errorString", name: "errorString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType$2, $error], false)}, {prop: "free", name: "free", pkg: "fmt", typ: $funcType([ssave], [], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "token", name: "token", pkg: "fmt", typ: $funcType([$Bool, funcType], [sliceType$2], false)}, {prop: "consume", name: "consume", pkg: "fmt", typ: $funcType([$String, $Bool], [$Bool], false)}, {prop: "peek", name: "peek", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "notEOF", name: "notEOF", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "accept", name: "accept", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "okVerb", name: "okVerb", pkg: "fmt", typ: $funcType([$Int32, $String, $String], [$Bool], false)}, {prop: "scanBool", name: "scanBool", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "getBase", name: "getBase", pkg: "fmt", typ: $funcType([$Int32], [$Int, $String], false)}, {prop: "scanNumber", name: "scanNumber", pkg: "fmt", typ: $funcType([$String, $Bool], [$String], false)}, {prop: "scanRune", name: "scanRune", pkg: "fmt", typ: $funcType([$Int], [$Int64], false)}, {prop: "scanBasePrefix", name: "scanBasePrefix", pkg: "fmt", typ: $funcType([], [$Int, $String, $Bool], false)}, {prop: "scanInt", name: "scanInt", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Int64], false)}, {prop: "scanUint", name: "scanUint", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Uint64], false)}, {prop: "floatToken", name: "floatToken", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "complexTokens", name: "complexTokens", pkg: "fmt", typ: $funcType([], [$String, $String], false)}, {prop: "convertFloat", name: "convertFloat", pkg: "fmt", typ: $funcType([$String, $Int], [$Float64], false)}, {prop: "scanComplex", name: "scanComplex", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Complex128], false)}, {prop: "convertString", name: "convertString", pkg: "fmt", typ: $funcType([$Int32], [$String], false)}, {prop: "quotedString", name: "quotedString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "hexByte", name: "hexByte", pkg: "fmt", typ: $funcType([], [$Uint8, $Bool], false)}, {prop: "hexString", name: "hexString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "scanOne", name: "scanOne", pkg: "fmt", typ: $funcType([$Int32, $emptyInterface], [], false)}, {prop: "doScan", name: "doScan", pkg: "fmt", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "advance", name: "advance", pkg: "fmt", typ: $funcType([$String], [$Int], false)}, {prop: "doScanf", name: "doScanf", pkg: "fmt", typ: $funcType([$String, sliceType], [$Int, $error], false)}]; ptrType$26.methods = [{prop: "readByte", name: "readByte", pkg: "fmt", typ: $funcType([], [$Uint8, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]; fmtFlags.init("fmt", [{prop: "widPresent", name: "widPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "precPresent", name: "precPresent", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "minus", name: "minus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plus", name: "plus", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharp", name: "sharp", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "space", name: "space", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "zero", name: "zero", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "plusV", name: "plusV", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sharpV", name: "sharpV", embedded: false, exported: false, typ: $Bool, tag: ""}]); fmt.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "fmtFlags", name: "fmtFlags", embedded: true, exported: false, typ: fmtFlags, tag: ""}, {prop: "wid", name: "wid", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "prec", name: "prec", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "intbuf", name: "intbuf", embedded: false, exported: false, typ: arrayType, tag: ""}]); State.init([{prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}]); Formatter.init([{prop: "Format", name: "Format", pkg: "", typ: $funcType([State, $Int32], [], false)}]); Stringer.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); GoStringer.init([{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]); buffer.init($Uint8); pp.init("fmt", [{prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "arg", name: "arg", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: reflect.Value, tag: ""}, {prop: "fmt", name: "fmt", embedded: false, exported: false, typ: fmt, tag: ""}, {prop: "reordered", name: "reordered", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "goodArgNum", name: "goodArgNum", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "panicking", name: "panicking", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "erroring", name: "erroring", embedded: false, exported: false, typ: $Bool, tag: ""}]); ScanState.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType$2, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}]); Scanner.init([{prop: "Scan", name: "Scan", pkg: "", typ: $funcType([ScanState, $Int32], [$error], false)}]); scanError.init("fmt", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); ss.init("fmt", [{prop: "rs", name: "rs", embedded: false, exported: false, typ: io.RuneScanner, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: buffer, tag: ""}, {prop: "count", name: "count", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "atEOF", name: "atEOF", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "ssave", name: "ssave", embedded: true, exported: false, typ: ssave, tag: ""}]); ssave.init("fmt", [{prop: "validSave", name: "validSave", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsEnd", name: "nlIsEnd", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "nlIsSpace", name: "nlIsSpace", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "argLimit", name: "argLimit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "limit", name: "limit", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "maxWid", name: "maxWid", embedded: false, exported: false, typ: $Int, tag: ""}]); readRune.init("fmt", [{prop: "reader", name: "reader", embedded: false, exported: false, typ: io.Reader, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "pending", name: "pending", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "pendBuf", name: "pendBuf", embedded: false, exported: false, typ: arrayType$3, tag: ""}, {prop: "peekRune", name: "peekRune", embedded: false, exported: false, typ: $Int32, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ppFree = new sync.Pool.ptr(0, 0, sliceType.nil, (function() { return new pp.ptr(buffer.nil, $ifaceNil, new reflect.Value.ptr(ptrType.nil, 0, 0), new fmt.ptr(ptrType$1.nil, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false), 0, 0, arrayType.zero()), false, false, false, false); })); space = new sliceType$1([$toNativeArray($kindUint16, [9, 13]), $toNativeArray($kindUint16, [32, 32]), $toNativeArray($kindUint16, [133, 133]), $toNativeArray($kindUint16, [160, 160]), $toNativeArray($kindUint16, [5760, 5760]), $toNativeArray($kindUint16, [8192, 8202]), $toNativeArray($kindUint16, [8232, 8233]), $toNativeArray($kindUint16, [8239, 8239]), $toNativeArray($kindUint16, [8287, 8287]), $toNativeArray($kindUint16, [12288, 12288])]); ssFree = new sync.Pool.ptr(0, 0, sliceType.nil, (function() { return new ss.ptr($ifaceNil, buffer.nil, 0, false, new ssave.ptr(false, false, false, 0, 0, 0)); })); complexError = errors.New("syntax error scanning complex number"); boolError = errors.New("syntax error scanning boolean"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["context"] = (function() { var $pkg = {}, $init, errors, fmt, reflect, sync, time, Context, emptyCtx, CancelFunc, canceler, cancelCtx, timerCtx, valueCtx, ptrType, structType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, sliceType, ptrType$5, chanType, chanType$1, mapType, background, todo, closedchan, WithCancel, newCancelCtx, propagateCancel, parentCancelCtx, removeChild, init; errors = $packages["errors"]; fmt = $packages["fmt"]; reflect = $packages["reflect"]; sync = $packages["sync"]; time = $packages["time"]; Context = $pkg.Context = $newType(8, $kindInterface, "context.Context", true, "context", true, null); emptyCtx = $pkg.emptyCtx = $newType(4, $kindInt, "context.emptyCtx", true, "context", false, null); CancelFunc = $pkg.CancelFunc = $newType(4, $kindFunc, "context.CancelFunc", true, "context", true, null); canceler = $pkg.canceler = $newType(8, $kindInterface, "context.canceler", true, "context", false, null); cancelCtx = $pkg.cancelCtx = $newType(0, $kindStruct, "context.cancelCtx", true, "context", false, function(Context_, mu_, done_, children_, err_) { this.$val = this; if (arguments.length === 0) { this.Context = $ifaceNil; this.mu = new sync.Mutex.ptr(0, 0); this.done = $chanNil; this.children = false; this.err = $ifaceNil; return; } this.Context = Context_; this.mu = mu_; this.done = done_; this.children = children_; this.err = err_; }); timerCtx = $pkg.timerCtx = $newType(0, $kindStruct, "context.timerCtx", true, "context", false, function(cancelCtx_, timer_, deadline_) { this.$val = this; if (arguments.length === 0) { this.cancelCtx = new cancelCtx.ptr($ifaceNil, new sync.Mutex.ptr(0, 0), $chanNil, false, $ifaceNil); this.timer = ptrType$5.nil; this.deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); return; } this.cancelCtx = cancelCtx_; this.timer = timer_; this.deadline = deadline_; }); valueCtx = $pkg.valueCtx = $newType(0, $kindStruct, "context.valueCtx", true, "context", false, function(Context_, key_, val_) { this.$val = this; if (arguments.length === 0) { this.Context = $ifaceNil; this.key = $ifaceNil; this.val = $ifaceNil; return; } this.Context = Context_; this.key = key_; this.val = val_; }); ptrType = $ptrType(emptyCtx); structType = $structType("", []); ptrType$1 = $ptrType(time.Location); ptrType$2 = $ptrType(cancelCtx); ptrType$3 = $ptrType(timerCtx); ptrType$4 = $ptrType(valueCtx); sliceType = $sliceType($emptyInterface); ptrType$5 = $ptrType(time.Timer); chanType = $chanType(structType, false, true); chanType$1 = $chanType(structType, false, false); mapType = $mapType(canceler, structType); $ptrType(emptyCtx).prototype.Deadline = function() { var deadline, ok; deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); ok = false; return [deadline, ok]; }; $ptrType(emptyCtx).prototype.Done = function() { return $chanNil; }; $ptrType(emptyCtx).prototype.Err = function() { return $ifaceNil; }; $ptrType(emptyCtx).prototype.Value = function(key) { var key; return $ifaceNil; }; $ptrType(emptyCtx).prototype.String = function() { var _1, e; e = this; _1 = e; if (_1 === (background)) { return "context.Background"; } else if (_1 === (todo)) { return "context.TODO"; } return "unknown empty Context"; }; WithCancel = function(parent) { var _tmp, _tmp$1, c, cancel, ctx, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; c = $f.c; cancel = $f.cancel; ctx = $f.ctx; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; ctx = $ifaceNil; cancel = $throwNilPointerError; c[0] = $clone(newCancelCtx(parent), cancelCtx); $r = propagateCancel(parent, c[0]); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp = c[0]; _tmp$1 = (function(c) { return function $b() { var $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = c[0].cancel(true, $pkg.Canceled); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$s = $s; $f.$r = $r; return $f; }; })(c); ctx = _tmp; cancel = _tmp$1; $s = -1; return [ctx, cancel]; /* */ } return; } if ($f === undefined) { $f = { $blk: WithCancel }; } $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.c = c; $f.cancel = cancel; $f.ctx = ctx; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.WithCancel = WithCancel; newCancelCtx = function(parent) { var parent; return new cancelCtx.ptr(parent, new sync.Mutex.ptr(0, 0), $chanNil, false, $ifaceNil); }; propagateCancel = function(parent, child) { var _key, _r, _tuple, child, ok, p, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r = $f._r; _tuple = $f._tuple; child = $f.child; ok = $f.ok; p = $f.p; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: child = [child]; parent = [parent]; _r = parent[0].Done(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === $chanNil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r === $chanNil) { */ case 1: $s = -1; return; /* } */ case 2: _tuple = parentCancelCtx(parent[0]); p = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ok) { */ case 4: $r = p.mu.Lock(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(p.err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(p.err, $ifaceNil))) { */ case 8: $r = child[0].cancel(false, p.err); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else { */ case 9: if (p.children === false) { p.children = {}; } _key = child[0]; (p.children || $throwRuntimeError("assignment to entry in nil map"))[canceler.keyFor(_key)] = { k: _key, v: new structType.ptr() }; /* } */ case 10: $r = p.mu.Unlock(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else { */ case 5: $go((function(child, parent) { return function $b() { var _arg, _r$1, _r$2, _r$3, _r$4, _selection, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _selection = $f._selection; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$1 = parent[0].Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = child[0].Done(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = $select([[_r$1], [_r$2]]); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _selection = _r$3; /* */ if (_selection[0] === 0) { $s = 4; continue; } /* */ if (_selection[0] === 1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_selection[0] === 0) { */ case 4: _r$4 = parent[0].Err(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = _r$4; $r = child[0].cancel(false, _arg); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else if (_selection[0] === 1) { */ case 5: /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg = _arg; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._selection = _selection; $f.$s = $s; $f.$r = $r; return $f; }; })(child, parent), []); /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: propagateCancel }; } $f._key = _key; $f._r = _r; $f._tuple = _tuple; $f.child = child; $f.ok = ok; $f.p = p; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; parentCancelCtx = function(parent) { var _ref, c, c$1, c$2, c$3, parent; while (true) { _ref = parent; if ($assertType(_ref, ptrType$2, true)[1]) { c = _ref.$val; return [c, true]; } else if ($assertType(_ref, ptrType$3, true)[1]) { c$1 = _ref.$val; return [c$1.cancelCtx, true]; } else if ($assertType(_ref, ptrType$4, true)[1]) { c$2 = _ref.$val; parent = c$2.Context; } else { c$3 = _ref; return [ptrType$2.nil, false]; } } }; removeChild = function(parent, child) { var _tuple, child, ok, p, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; child = $f.child; ok = $f.ok; p = $f.p; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = parentCancelCtx(parent); p = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return; } $r = p.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(p.children === false)) { delete p.children[canceler.keyFor(child)]; } $r = p.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: removeChild }; } $f._tuple = _tuple; $f.child = child; $f.ok = ok; $f.p = p; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; init = function() { $close(closedchan); }; cancelCtx.ptr.prototype.Done = function() { var c, d, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; d = $f.d; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (c.done === $chanNil) { c.done = new $Chan(structType, 0); } d = c.done; $r = c.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return d; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Done }; } $f.c = c; $f.d = d; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.Done = function() { return this.$val.Done(); }; cancelCtx.ptr.prototype.Err = function() { var c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err = c.err; $r = c.mu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.Err }; } $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.Err = function() { return this.$val.Err(); }; cancelCtx.ptr.prototype.String = function() { var _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = fmt.Sprintf("%v.WithCancel", new sliceType([c.Context])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.String }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.String = function() { return this.$val.String(); }; cancelCtx.ptr.prototype.cancel = function(removeFromParent, err) { var _entry, _i, _keys, _ref, c, child, err, removeFromParent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _ref = $f._ref; c = $f.c; child = $f.child; err = $f.err; removeFromParent = $f.removeFromParent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ($interfaceIsEqual(err, $ifaceNil)) { $panic(new $String("context: internal error: missing cancel error")); } $r = c.mu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (!($interfaceIsEqual(c.err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(c.err, $ifaceNil))) { */ case 2: $r = c.mu.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 3: c.err = err; if (c.done === $chanNil) { c.done = closedchan; } else { $close(c.done); } _ref = c.children; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 5: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 6; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 5; continue; } child = _entry.k; $r = child.cancel(false, err); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 5; continue; case 6: c.children = false; $r = c.mu.Unlock(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (removeFromParent) { $s = 9; continue; } /* */ $s = 10; continue; /* if (removeFromParent) { */ case 9: $r = removeChild(c.Context, c); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: cancelCtx.ptr.prototype.cancel }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._ref = _ref; $f.c = c; $f.child = child; $f.err = err; $f.removeFromParent = removeFromParent; $f.$s = $s; $f.$r = $r; return $f; }; cancelCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; timerCtx.ptr.prototype.Deadline = function() { var _tmp, _tmp$1, c, deadline, ok; deadline = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType$1.nil); ok = false; c = this; _tmp = $clone(c.deadline, time.Time); _tmp$1 = true; time.Time.copy(deadline, _tmp); ok = _tmp$1; return [deadline, ok]; }; timerCtx.prototype.Deadline = function() { return this.$val.Deadline(); }; timerCtx.ptr.prototype.String = function() { var _r, c, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = fmt.Sprintf("%v.WithDeadline(%s [%s])", new sliceType([c.cancelCtx.Context, (x$1 = c.deadline, new x$1.constructor.elem(x$1)), time.Until($clone(c.deadline, time.Time))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: timerCtx.ptr.prototype.String }; } $f._r = _r; $f.c = c; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; timerCtx.prototype.String = function() { return this.$val.String(); }; timerCtx.ptr.prototype.cancel = function(removeFromParent, err) { var c, err, removeFromParent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; err = $f.err; removeFromParent = $f.removeFromParent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.cancelCtx.cancel(false, err); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (removeFromParent) { $s = 2; continue; } /* */ $s = 3; continue; /* if (removeFromParent) { */ case 2: $r = removeChild(c.cancelCtx.Context, c); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $r = c.cancelCtx.mu.Lock(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!(c.timer === ptrType$5.nil)) { c.timer.Stop(); c.timer = ptrType$5.nil; } $r = c.cancelCtx.mu.Unlock(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: timerCtx.ptr.prototype.cancel }; } $f.c = c; $f.err = err; $f.removeFromParent = removeFromParent; $f.$s = $s; $f.$r = $r; return $f; }; timerCtx.prototype.cancel = function(removeFromParent, err) { return this.$val.cancel(removeFromParent, err); }; valueCtx.ptr.prototype.String = function() { var _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = fmt.Sprintf("%v.WithValue(%#v, %#v)", new sliceType([c.Context, c.key, c.val])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: valueCtx.ptr.prototype.String }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; valueCtx.prototype.String = function() { return this.$val.String(); }; valueCtx.ptr.prototype.Value = function(key) { var _r, c, key, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; key = $f.key; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if ($interfaceIsEqual(c.key, key)) { $s = -1; return c.val; } _r = c.Context.Value(key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: valueCtx.ptr.prototype.Value }; } $f._r = _r; $f.c = c; $f.key = key; $f.$s = $s; $f.$r = $r; return $f; }; valueCtx.prototype.Value = function(key) { return this.$val.Value(key); }; ptrType.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$2.methods = [{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; ptrType$3.methods = [{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]; ptrType$4.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]; Context.init([{prop: "Deadline", name: "Deadline", pkg: "", typ: $funcType([], [time.Time, $Bool], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "Err", name: "Err", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Value", name: "Value", pkg: "", typ: $funcType([$emptyInterface], [$emptyInterface], false)}]); CancelFunc.init([], [], false); canceler.init([{prop: "Done", name: "Done", pkg: "", typ: $funcType([], [chanType], false)}, {prop: "cancel", name: "cancel", pkg: "context", typ: $funcType([$Bool, $error], [], false)}]); cancelCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "mu", name: "mu", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "done", name: "done", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "children", name: "children", embedded: false, exported: false, typ: mapType, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); timerCtx.init("context", [{prop: "cancelCtx", name: "cancelCtx", embedded: true, exported: false, typ: cancelCtx, tag: ""}, {prop: "timer", name: "timer", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "deadline", name: "deadline", embedded: false, exported: false, typ: time.Time, tag: ""}]); valueCtx.init("context", [{prop: "Context", name: "Context", embedded: true, exported: true, typ: Context, tag: ""}, {prop: "key", name: "key", embedded: false, exported: false, typ: $emptyInterface, tag: ""}, {prop: "val", name: "val", embedded: false, exported: false, typ: $emptyInterface, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.Canceled = errors.New("context canceled"); background = $newDataPointer(0, ptrType); todo = $newDataPointer(0, ptrType); closedchan = new $Chan(structType, 0); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/J-J-J/goluajit/ast"] = (function() { var $pkg = {}, $init, fmt, PositionHolder, Node, Expr, ExprBase, ConstExprBase, TrueExpr, FalseExpr, NilExpr, NumberExpr, StringExpr, Comma3Expr, IdentExpr, AttrGetExpr, TableExpr, FuncCallExpr, LogicalOpExpr, RelationalOpExpr, StringConcatOpExpr, ArithmeticOpExpr, UnaryMinusOpExpr, UnaryNotOpExpr, UnaryLenOpExpr, FunctionExpr, Field, ParList, FuncName, Stmt, StmtBase, AssignStmt, LocalAssignStmt, FuncCallStmt, DoBlockStmt, WhileStmt, RepeatStmt, IfStmt, NumberForStmt, GenericForStmt, FuncDefStmt, ReturnStmt, BreakStmt, Position, Token, sliceType, ptrType, ptrType$1, ptrType$2, ptrType$3, sliceType$1, sliceType$2, ptrType$4, sliceType$3, sliceType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8; fmt = $packages["fmt"]; PositionHolder = $pkg.PositionHolder = $newType(8, $kindInterface, "ast.PositionHolder", true, "github.com/J-J-J/goluajit/ast", true, null); Node = $pkg.Node = $newType(0, $kindStruct, "ast.Node", true, "github.com/J-J-J/goluajit/ast", true, function(line_, lastline_) { this.$val = this; if (arguments.length === 0) { this.line = 0; this.lastline = 0; return; } this.line = line_; this.lastline = lastline_; }); Expr = $pkg.Expr = $newType(8, $kindInterface, "ast.Expr", true, "github.com/J-J-J/goluajit/ast", true, null); ExprBase = $pkg.ExprBase = $newType(0, $kindStruct, "ast.ExprBase", true, "github.com/J-J-J/goluajit/ast", true, function(Node_) { this.$val = this; if (arguments.length === 0) { this.Node = new Node.ptr(0, 0); return; } this.Node = Node_; }); ConstExprBase = $pkg.ConstExprBase = $newType(0, $kindStruct, "ast.ConstExprBase", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); return; } this.ExprBase = ExprBase_; }); TrueExpr = $pkg.TrueExpr = $newType(0, $kindStruct, "ast.TrueExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ConstExprBase_) { this.$val = this; if (arguments.length === 0) { this.ConstExprBase = new ConstExprBase.ptr(new ExprBase.ptr(new Node.ptr(0, 0))); return; } this.ConstExprBase = ConstExprBase_; }); FalseExpr = $pkg.FalseExpr = $newType(0, $kindStruct, "ast.FalseExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ConstExprBase_) { this.$val = this; if (arguments.length === 0) { this.ConstExprBase = new ConstExprBase.ptr(new ExprBase.ptr(new Node.ptr(0, 0))); return; } this.ConstExprBase = ConstExprBase_; }); NilExpr = $pkg.NilExpr = $newType(0, $kindStruct, "ast.NilExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ConstExprBase_) { this.$val = this; if (arguments.length === 0) { this.ConstExprBase = new ConstExprBase.ptr(new ExprBase.ptr(new Node.ptr(0, 0))); return; } this.ConstExprBase = ConstExprBase_; }); NumberExpr = $pkg.NumberExpr = $newType(0, $kindStruct, "ast.NumberExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ConstExprBase_, Value_) { this.$val = this; if (arguments.length === 0) { this.ConstExprBase = new ConstExprBase.ptr(new ExprBase.ptr(new Node.ptr(0, 0))); this.Value = ""; return; } this.ConstExprBase = ConstExprBase_; this.Value = Value_; }); StringExpr = $pkg.StringExpr = $newType(0, $kindStruct, "ast.StringExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ConstExprBase_, Value_) { this.$val = this; if (arguments.length === 0) { this.ConstExprBase = new ConstExprBase.ptr(new ExprBase.ptr(new Node.ptr(0, 0))); this.Value = ""; return; } this.ConstExprBase = ConstExprBase_; this.Value = Value_; }); Comma3Expr = $pkg.Comma3Expr = $newType(0, $kindStruct, "ast.Comma3Expr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); return; } this.ExprBase = ExprBase_; }); IdentExpr = $pkg.IdentExpr = $newType(0, $kindStruct, "ast.IdentExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Value_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Value = ""; return; } this.ExprBase = ExprBase_; this.Value = Value_; }); AttrGetExpr = $pkg.AttrGetExpr = $newType(0, $kindStruct, "ast.AttrGetExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Object_, Key_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Object = $ifaceNil; this.Key = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Object = Object_; this.Key = Key_; }); TableExpr = $pkg.TableExpr = $newType(0, $kindStruct, "ast.TableExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Fields_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Fields = sliceType$1.nil; return; } this.ExprBase = ExprBase_; this.Fields = Fields_; }); FuncCallExpr = $pkg.FuncCallExpr = $newType(0, $kindStruct, "ast.FuncCallExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Func_, Receiver_, Method_, Args_, AdjustRet_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Func = $ifaceNil; this.Receiver = $ifaceNil; this.Method = ""; this.Args = sliceType$2.nil; this.AdjustRet = false; return; } this.ExprBase = ExprBase_; this.Func = Func_; this.Receiver = Receiver_; this.Method = Method_; this.Args = Args_; this.AdjustRet = AdjustRet_; }); LogicalOpExpr = $pkg.LogicalOpExpr = $newType(0, $kindStruct, "ast.LogicalOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Operator_, Lhs_, Rhs_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Operator = ""; this.Lhs = $ifaceNil; this.Rhs = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Operator = Operator_; this.Lhs = Lhs_; this.Rhs = Rhs_; }); RelationalOpExpr = $pkg.RelationalOpExpr = $newType(0, $kindStruct, "ast.RelationalOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Operator_, Lhs_, Rhs_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Operator = ""; this.Lhs = $ifaceNil; this.Rhs = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Operator = Operator_; this.Lhs = Lhs_; this.Rhs = Rhs_; }); StringConcatOpExpr = $pkg.StringConcatOpExpr = $newType(0, $kindStruct, "ast.StringConcatOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Lhs_, Rhs_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Lhs = $ifaceNil; this.Rhs = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Lhs = Lhs_; this.Rhs = Rhs_; }); ArithmeticOpExpr = $pkg.ArithmeticOpExpr = $newType(0, $kindStruct, "ast.ArithmeticOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Operator_, Lhs_, Rhs_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Operator = ""; this.Lhs = $ifaceNil; this.Rhs = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Operator = Operator_; this.Lhs = Lhs_; this.Rhs = Rhs_; }); UnaryMinusOpExpr = $pkg.UnaryMinusOpExpr = $newType(0, $kindStruct, "ast.UnaryMinusOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Expr_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Expr = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Expr = Expr_; }); UnaryNotOpExpr = $pkg.UnaryNotOpExpr = $newType(0, $kindStruct, "ast.UnaryNotOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Expr_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Expr = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Expr = Expr_; }); UnaryLenOpExpr = $pkg.UnaryLenOpExpr = $newType(0, $kindStruct, "ast.UnaryLenOpExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, Expr_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.Expr = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Expr = Expr_; }); FunctionExpr = $pkg.FunctionExpr = $newType(0, $kindStruct, "ast.FunctionExpr", true, "github.com/J-J-J/goluajit/ast", true, function(ExprBase_, ParList_, Stmts_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ExprBase.ptr(new Node.ptr(0, 0)); this.ParList = ptrType$4.nil; this.Stmts = sliceType$3.nil; return; } this.ExprBase = ExprBase_; this.ParList = ParList_; this.Stmts = Stmts_; }); Field = $pkg.Field = $newType(0, $kindStruct, "ast.Field", true, "github.com/J-J-J/goluajit/ast", true, function(Key_, Value_) { this.$val = this; if (arguments.length === 0) { this.Key = $ifaceNil; this.Value = $ifaceNil; return; } this.Key = Key_; this.Value = Value_; }); ParList = $pkg.ParList = $newType(0, $kindStruct, "ast.ParList", true, "github.com/J-J-J/goluajit/ast", true, function(HasVargs_, Names_) { this.$val = this; if (arguments.length === 0) { this.HasVargs = false; this.Names = sliceType$4.nil; return; } this.HasVargs = HasVargs_; this.Names = Names_; }); FuncName = $pkg.FuncName = $newType(0, $kindStruct, "ast.FuncName", true, "github.com/J-J-J/goluajit/ast", true, function(Func_, Receiver_, Method_) { this.$val = this; if (arguments.length === 0) { this.Func = $ifaceNil; this.Receiver = $ifaceNil; this.Method = ""; return; } this.Func = Func_; this.Receiver = Receiver_; this.Method = Method_; }); Stmt = $pkg.Stmt = $newType(8, $kindInterface, "ast.Stmt", true, "github.com/J-J-J/goluajit/ast", true, null); StmtBase = $pkg.StmtBase = $newType(0, $kindStruct, "ast.StmtBase", true, "github.com/J-J-J/goluajit/ast", true, function(Node_) { this.$val = this; if (arguments.length === 0) { this.Node = new Node.ptr(0, 0); return; } this.Node = Node_; }); AssignStmt = $pkg.AssignStmt = $newType(0, $kindStruct, "ast.AssignStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Lhs_, Rhs_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Lhs = sliceType$2.nil; this.Rhs = sliceType$2.nil; return; } this.StmtBase = StmtBase_; this.Lhs = Lhs_; this.Rhs = Rhs_; }); LocalAssignStmt = $pkg.LocalAssignStmt = $newType(0, $kindStruct, "ast.LocalAssignStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Names_, Exprs_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Names = sliceType$4.nil; this.Exprs = sliceType$2.nil; return; } this.StmtBase = StmtBase_; this.Names = Names_; this.Exprs = Exprs_; }); FuncCallStmt = $pkg.FuncCallStmt = $newType(0, $kindStruct, "ast.FuncCallStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Expr_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Expr = $ifaceNil; return; } this.StmtBase = StmtBase_; this.Expr = Expr_; }); DoBlockStmt = $pkg.DoBlockStmt = $newType(0, $kindStruct, "ast.DoBlockStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Stmts_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Stmts = sliceType$3.nil; return; } this.StmtBase = StmtBase_; this.Stmts = Stmts_; }); WhileStmt = $pkg.WhileStmt = $newType(0, $kindStruct, "ast.WhileStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Condition_, Stmts_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Condition = $ifaceNil; this.Stmts = sliceType$3.nil; return; } this.StmtBase = StmtBase_; this.Condition = Condition_; this.Stmts = Stmts_; }); RepeatStmt = $pkg.RepeatStmt = $newType(0, $kindStruct, "ast.RepeatStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Condition_, Stmts_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Condition = $ifaceNil; this.Stmts = sliceType$3.nil; return; } this.StmtBase = StmtBase_; this.Condition = Condition_; this.Stmts = Stmts_; }); IfStmt = $pkg.IfStmt = $newType(0, $kindStruct, "ast.IfStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Condition_, Then_, Else_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Condition = $ifaceNil; this.Then = sliceType$3.nil; this.Else = sliceType$3.nil; return; } this.StmtBase = StmtBase_; this.Condition = Condition_; this.Then = Then_; this.Else = Else_; }); NumberForStmt = $pkg.NumberForStmt = $newType(0, $kindStruct, "ast.NumberForStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Name_, Init_, Limit_, Step_, Stmts_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Name = ""; this.Init = $ifaceNil; this.Limit = $ifaceNil; this.Step = $ifaceNil; this.Stmts = sliceType$3.nil; return; } this.StmtBase = StmtBase_; this.Name = Name_; this.Init = Init_; this.Limit = Limit_; this.Step = Step_; this.Stmts = Stmts_; }); GenericForStmt = $pkg.GenericForStmt = $newType(0, $kindStruct, "ast.GenericForStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Names_, Exprs_, Stmts_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Names = sliceType$4.nil; this.Exprs = sliceType$2.nil; this.Stmts = sliceType$3.nil; return; } this.StmtBase = StmtBase_; this.Names = Names_; this.Exprs = Exprs_; this.Stmts = Stmts_; }); FuncDefStmt = $pkg.FuncDefStmt = $newType(0, $kindStruct, "ast.FuncDefStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Name_, Func_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Name = ptrType$6.nil; this.Func = ptrType$7.nil; return; } this.StmtBase = StmtBase_; this.Name = Name_; this.Func = Func_; }); ReturnStmt = $pkg.ReturnStmt = $newType(0, $kindStruct, "ast.ReturnStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_, Exprs_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); this.Exprs = sliceType$2.nil; return; } this.StmtBase = StmtBase_; this.Exprs = Exprs_; }); BreakStmt = $pkg.BreakStmt = $newType(0, $kindStruct, "ast.BreakStmt", true, "github.com/J-J-J/goluajit/ast", true, function(StmtBase_) { this.$val = this; if (arguments.length === 0) { this.StmtBase = new StmtBase.ptr(new Node.ptr(0, 0)); return; } this.StmtBase = StmtBase_; }); Position = $pkg.Position = $newType(0, $kindStruct, "ast.Position", true, "github.com/J-J-J/goluajit/ast", true, function(Source_, Line_, Column_) { this.$val = this; if (arguments.length === 0) { this.Source = ""; this.Line = 0; this.Column = 0; return; } this.Source = Source_; this.Line = Line_; this.Column = Column_; }); Token = $pkg.Token = $newType(0, $kindStruct, "ast.Token", true, "github.com/J-J-J/goluajit/ast", true, function(Type_, Name_, Str_, Pos_) { this.$val = this; if (arguments.length === 0) { this.Type = 0; this.Name = ""; this.Str = ""; this.Pos = new Position.ptr("", 0, 0); return; } this.Type = Type_; this.Name = Name_; this.Str = Str_; this.Pos = Pos_; }); sliceType = $sliceType($emptyInterface); ptrType = $ptrType(Node); ptrType$1 = $ptrType(ExprBase); ptrType$2 = $ptrType(ConstExprBase); ptrType$3 = $ptrType(Field); sliceType$1 = $sliceType(ptrType$3); sliceType$2 = $sliceType(Expr); ptrType$4 = $ptrType(ParList); sliceType$3 = $sliceType(Stmt); sliceType$4 = $sliceType($String); ptrType$5 = $ptrType(StmtBase); ptrType$6 = $ptrType(FuncName); ptrType$7 = $ptrType(FunctionExpr); ptrType$8 = $ptrType(Token); Node.ptr.prototype.Line = function() { var n; n = this; return n.line; }; Node.prototype.Line = function() { return this.$val.Line(); }; Node.ptr.prototype.SetLine = function(line) { var line, n; n = this; n.line = line; }; Node.prototype.SetLine = function(line) { return this.$val.SetLine(line); }; Node.ptr.prototype.LastLine = function() { var n; n = this; return n.lastline; }; Node.prototype.LastLine = function() { return this.$val.LastLine(); }; Node.ptr.prototype.SetLastLine = function(line) { var line, n; n = this; n.lastline = line; }; Node.prototype.SetLastLine = function(line) { return this.$val.SetLastLine(line); }; Token.ptr.prototype.String = function() { var _r, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = this; _r = fmt.Sprintf("", new sliceType([new $String(t.Name), new $String(t.Str)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Token.ptr.prototype.String }; } $f._r = _r; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; Token.prototype.String = function() { return this.$val.String(); }; ptrType.methods = [{prop: "Line", name: "Line", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetLine", name: "SetLine", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "LastLine", name: "LastLine", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetLastLine", name: "SetLastLine", pkg: "", typ: $funcType([$Int], [], false)}]; ptrType$1.methods = [{prop: "exprMarker", name: "exprMarker", pkg: "github.com/J-J-J/goluajit/ast", typ: $funcType([], [], false)}]; ptrType$2.methods = [{prop: "constExprMarker", name: "constExprMarker", pkg: "github.com/J-J-J/goluajit/ast", typ: $funcType([], [], false)}]; ptrType$5.methods = [{prop: "stmtMarker", name: "stmtMarker", pkg: "github.com/J-J-J/goluajit/ast", typ: $funcType([], [], false)}]; ptrType$8.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; PositionHolder.init([{prop: "LastLine", name: "LastLine", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Line", name: "Line", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetLastLine", name: "SetLastLine", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLine", name: "SetLine", pkg: "", typ: $funcType([$Int], [], false)}]); Node.init("github.com/J-J-J/goluajit/ast", [{prop: "line", name: "line", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "lastline", name: "lastline", embedded: false, exported: false, typ: $Int, tag: ""}]); Expr.init([{prop: "LastLine", name: "LastLine", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Line", name: "Line", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetLastLine", name: "SetLastLine", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLine", name: "SetLine", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "exprMarker", name: "exprMarker", pkg: "github.com/J-J-J/goluajit/ast", typ: $funcType([], [], false)}]); ExprBase.init("", [{prop: "Node", name: "Node", embedded: true, exported: true, typ: Node, tag: ""}]); ConstExprBase.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}]); TrueExpr.init("", [{prop: "ConstExprBase", name: "ConstExprBase", embedded: true, exported: true, typ: ConstExprBase, tag: ""}]); FalseExpr.init("", [{prop: "ConstExprBase", name: "ConstExprBase", embedded: true, exported: true, typ: ConstExprBase, tag: ""}]); NilExpr.init("", [{prop: "ConstExprBase", name: "ConstExprBase", embedded: true, exported: true, typ: ConstExprBase, tag: ""}]); NumberExpr.init("", [{prop: "ConstExprBase", name: "ConstExprBase", embedded: true, exported: true, typ: ConstExprBase, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}]); StringExpr.init("", [{prop: "ConstExprBase", name: "ConstExprBase", embedded: true, exported: true, typ: ConstExprBase, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}]); Comma3Expr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}]); IdentExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: $String, tag: ""}]); AttrGetExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Object", name: "Object", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Key", name: "Key", embedded: false, exported: true, typ: Expr, tag: ""}]); TableExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Fields", name: "Fields", embedded: false, exported: true, typ: sliceType$1, tag: ""}]); FuncCallExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Receiver", name: "Receiver", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Args", name: "Args", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "AdjustRet", name: "AdjustRet", embedded: false, exported: true, typ: $Bool, tag: ""}]); LogicalOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Operator", name: "Operator", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Lhs", name: "Lhs", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Rhs", name: "Rhs", embedded: false, exported: true, typ: Expr, tag: ""}]); RelationalOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Operator", name: "Operator", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Lhs", name: "Lhs", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Rhs", name: "Rhs", embedded: false, exported: true, typ: Expr, tag: ""}]); StringConcatOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Lhs", name: "Lhs", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Rhs", name: "Rhs", embedded: false, exported: true, typ: Expr, tag: ""}]); ArithmeticOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Operator", name: "Operator", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Lhs", name: "Lhs", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Rhs", name: "Rhs", embedded: false, exported: true, typ: Expr, tag: ""}]); UnaryMinusOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Expr", name: "Expr", embedded: false, exported: true, typ: Expr, tag: ""}]); UnaryNotOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Expr", name: "Expr", embedded: false, exported: true, typ: Expr, tag: ""}]); UnaryLenOpExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "Expr", name: "Expr", embedded: false, exported: true, typ: Expr, tag: ""}]); FunctionExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ExprBase, tag: ""}, {prop: "ParList", name: "ParList", embedded: false, exported: true, typ: ptrType$4, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); Field.init("", [{prop: "Key", name: "Key", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: Expr, tag: ""}]); ParList.init("", [{prop: "HasVargs", name: "HasVargs", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Names", name: "Names", embedded: false, exported: true, typ: sliceType$4, tag: ""}]); FuncName.init("", [{prop: "Func", name: "Func", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Receiver", name: "Receiver", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Method", name: "Method", embedded: false, exported: true, typ: $String, tag: ""}]); Stmt.init([{prop: "LastLine", name: "LastLine", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Line", name: "Line", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetLastLine", name: "SetLastLine", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLine", name: "SetLine", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "stmtMarker", name: "stmtMarker", pkg: "github.com/J-J-J/goluajit/ast", typ: $funcType([], [], false)}]); StmtBase.init("", [{prop: "Node", name: "Node", embedded: true, exported: true, typ: Node, tag: ""}]); AssignStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Lhs", name: "Lhs", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Rhs", name: "Rhs", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); LocalAssignStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Names", name: "Names", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "Exprs", name: "Exprs", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); FuncCallStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Expr", name: "Expr", embedded: false, exported: true, typ: Expr, tag: ""}]); DoBlockStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); WhileStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Condition", name: "Condition", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); RepeatStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Condition", name: "Condition", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); IfStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Condition", name: "Condition", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Then", name: "Then", embedded: false, exported: true, typ: sliceType$3, tag: ""}, {prop: "Else", name: "Else", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); NumberForStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Init", name: "Init", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Limit", name: "Limit", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Step", name: "Step", embedded: false, exported: true, typ: Expr, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); GenericForStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Names", name: "Names", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "Exprs", name: "Exprs", embedded: false, exported: true, typ: sliceType$2, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); FuncDefStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: ptrType$6, tag: ""}, {prop: "Func", name: "Func", embedded: false, exported: true, typ: ptrType$7, tag: ""}]); ReturnStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}, {prop: "Exprs", name: "Exprs", embedded: false, exported: true, typ: sliceType$2, tag: ""}]); BreakStmt.init("", [{prop: "StmtBase", name: "StmtBase", embedded: true, exported: true, typ: StmtBase, tag: ""}]); Position.init("", [{prop: "Source", name: "Source", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Line", name: "Line", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Column", name: "Column", embedded: false, exported: true, typ: $Int, tag: ""}]); Token.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Str", name: "Str", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Pos", name: "Pos", embedded: false, exported: true, typ: Position, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = fmt.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["strings"] = (function() { var $pkg = {}, $init, errors, js, bytealg, io, unicode, utf8, Reader, asciiSet, sliceType, sliceType$1, ptrType$5, arrayType$3, ptrType$6, IndexByte, Index, LastIndex, Count, NewReader, explode, Contains, IndexRune, genSplit, Split, Join, HasPrefix, Map, Repeat, ToUpper, ToLower, TrimLeftFunc, TrimRightFunc, TrimFunc, indexFunc, lastIndexFunc, makeASCIISet, makeCutsetFunc, Trim, TrimLeft, TrimSpace, TrimPrefix, Replace; errors = $packages["errors"]; js = $packages["github.com/gopherjs/gopherjs/js"]; bytealg = $packages["internal/bytealg"]; io = $packages["io"]; unicode = $packages["unicode"]; utf8 = $packages["unicode/utf8"]; Reader = $pkg.Reader = $newType(0, $kindStruct, "strings.Reader", true, "strings", true, function(s_, i_, prevRune_) { this.$val = this; if (arguments.length === 0) { this.s = ""; this.i = new $Int64(0, 0); this.prevRune = 0; return; } this.s = s_; this.i = i_; this.prevRune = prevRune_; }); asciiSet = $pkg.asciiSet = $newType(32, $kindArray, "strings.asciiSet", true, "strings", false, null); sliceType = $sliceType($Uint8); sliceType$1 = $sliceType($String); ptrType$5 = $ptrType(asciiSet); arrayType$3 = $arrayType($Uint32, 8); ptrType$6 = $ptrType(Reader); IndexByte = function(s, c) { var c, s; return $parseInt(s.indexOf($global.String.fromCharCode(c))) >> 0; }; $pkg.IndexByte = IndexByte; Index = function(s, sep) { var s, sep; return $parseInt(s.indexOf(sep)) >> 0; }; $pkg.Index = Index; LastIndex = function(s, sep) { var s, sep; return $parseInt(s.lastIndexOf(sep)) >> 0; }; $pkg.LastIndex = LastIndex; Count = function(s, sep) { var n, pos, s, sep; n = 0; if ((sep.length === 0)) { return utf8.RuneCountInString(s) + 1 >> 0; } else if (sep.length > s.length) { return 0; } else if ((sep.length === s.length)) { if (sep === s) { return 1; } return 0; } while (true) { pos = Index(s, sep); if (pos === -1) { break; } n = n + (1) >> 0; s = $substring(s, (pos + sep.length >> 0)); } return n; }; $pkg.Count = Count; Reader.ptr.prototype.Len = function() { var r, x, x$1, x$2, x$3, x$4; r = this; if ((x = r.i, x$1 = (new $Int64(0, r.s.length)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { return 0; } return (((x$2 = (x$3 = (new $Int64(0, r.s.length)), x$4 = r.i, new $Int64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)), x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0)); }; Reader.prototype.Len = function() { return this.$val.Len(); }; Reader.ptr.prototype.Size = function() { var r; r = this; return (new $Int64(0, r.s.length)); }; Reader.prototype.Size = function() { return this.$val.Size(); }; Reader.ptr.prototype.Read = function(b) { var _tmp, _tmp$1, b, err, n, r, x, x$1, x$2, x$3; n = 0; err = $ifaceNil; r = this; if ((x = r.i, x$1 = (new $Int64(0, r.s.length)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { _tmp = 0; _tmp$1 = io.EOF; n = _tmp; err = _tmp$1; return [n, err]; } r.prevRune = -1; n = $copyString(b, $substring(r.s, $flatten64(r.i))); r.i = (x$2 = r.i, x$3 = (new $Int64(0, n)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); return [n, err]; }; Reader.prototype.Read = function(b) { return this.$val.Read(b); }; Reader.ptr.prototype.ReadAt = function(b, off) { var _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, off, r, x; n = 0; err = $ifaceNil; r = this; if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { _tmp = 0; _tmp$1 = errors.New("strings.Reader.ReadAt: negative offset"); n = _tmp; err = _tmp$1; return [n, err]; } if ((x = (new $Int64(0, r.s.length)), (off.$high > x.$high || (off.$high === x.$high && off.$low >= x.$low)))) { _tmp$2 = 0; _tmp$3 = io.EOF; n = _tmp$2; err = _tmp$3; return [n, err]; } n = $copyString(b, $substring(r.s, $flatten64(off))); if (n < b.$length) { err = io.EOF; } return [n, err]; }; Reader.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; Reader.ptr.prototype.ReadByte = function() { var b, r, x, x$1, x$2, x$3; r = this; r.prevRune = -1; if ((x = r.i, x$1 = (new $Int64(0, r.s.length)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { return [0, io.EOF]; } b = r.s.charCodeAt($flatten64(r.i)); r.i = (x$2 = r.i, x$3 = new $Int64(0, 1), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); return [b, $ifaceNil]; }; Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; Reader.ptr.prototype.UnreadByte = function() { var r, x, x$1, x$2; r = this; r.prevRune = -1; if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { return errors.New("strings.Reader.UnreadByte: at beginning of string"); } r.i = (x$1 = r.i, x$2 = new $Int64(0, 1), new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); return $ifaceNil; }; Reader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; Reader.ptr.prototype.ReadRune = function() { var _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, ch, err, r, size, x, x$1, x$2, x$3, x$4, x$5, x$6; ch = 0; size = 0; err = $ifaceNil; r = this; if ((x = r.i, x$1 = (new $Int64(0, r.s.length)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { r.prevRune = -1; _tmp = 0; _tmp$1 = 0; _tmp$2 = io.EOF; ch = _tmp; size = _tmp$1; err = _tmp$2; return [ch, size, err]; } r.prevRune = (((x$2 = r.i, x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0)); c = r.s.charCodeAt($flatten64(r.i)); if (c < 128) { r.i = (x$3 = r.i, x$4 = new $Int64(0, 1), new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); _tmp$3 = ((c >> 0)); _tmp$4 = 1; _tmp$5 = $ifaceNil; ch = _tmp$3; size = _tmp$4; err = _tmp$5; return [ch, size, err]; } _tuple = utf8.DecodeRuneInString($substring(r.s, $flatten64(r.i))); ch = _tuple[0]; size = _tuple[1]; r.i = (x$5 = r.i, x$6 = (new $Int64(0, size)), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); return [ch, size, err]; }; Reader.prototype.ReadRune = function() { return this.$val.ReadRune(); }; Reader.ptr.prototype.UnreadRune = function() { var r; r = this; if (r.prevRune < 0) { return errors.New("strings.Reader.UnreadRune: previous operation was not ReadRune"); } r.i = (new $Int64(0, r.prevRune)); r.prevRune = -1; return $ifaceNil; }; Reader.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; Reader.ptr.prototype.Seek = function(offset, whence) { var _1, abs, offset, r, whence, x, x$1; r = this; r.prevRune = -1; abs = new $Int64(0, 0); _1 = whence; if (_1 === (0)) { abs = offset; } else if (_1 === (1)) { abs = (x = r.i, new $Int64(x.$high + offset.$high, x.$low + offset.$low)); } else if (_1 === (2)) { abs = (x$1 = (new $Int64(0, r.s.length)), new $Int64(x$1.$high + offset.$high, x$1.$low + offset.$low)); } else { return [new $Int64(0, 0), errors.New("strings.Reader.Seek: invalid whence")]; } if ((abs.$high < 0 || (abs.$high === 0 && abs.$low < 0))) { return [new $Int64(0, 0), errors.New("strings.Reader.Seek: negative position")]; } r.i = abs; return [abs, $ifaceNil]; }; Reader.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; Reader.ptr.prototype.WriteTo = function(w) { var _r, _tmp, _tmp$1, _tuple, err, m, n, r, s, w, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; m = $f.m; n = $f.n; r = $f.r; s = $f.s; w = $f.w; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); err = $ifaceNil; r = this; r.prevRune = -1; if ((x = r.i, x$1 = (new $Int64(0, r.s.length)), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { _tmp = new $Int64(0, 0); _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; $s = -1; return [n, err]; } s = $substring(r.s, $flatten64(r.i)); _r = io.WriteString(w, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; m = _tuple[0]; err = _tuple[1]; if (m > s.length) { $panic(new $String("strings.Reader.WriteTo: invalid WriteString count")); } r.i = (x$2 = r.i, x$3 = (new $Int64(0, m)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); n = (new $Int64(0, m)); if (!((m === s.length)) && $interfaceIsEqual(err, $ifaceNil)) { err = io.ErrShortWrite; } $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.m = m; $f.n = n; $f.r = r; $f.s = s; $f.w = w; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; Reader.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; Reader.ptr.prototype.Reset = function(s) { var r, s; r = this; Reader.copy(r, new Reader.ptr(s, new $Int64(0, 0), -1)); }; Reader.prototype.Reset = function(s) { return this.$val.Reset(s); }; NewReader = function(s) { var s; return new Reader.ptr(s, new $Int64(0, 0), -1); }; $pkg.NewReader = NewReader; explode = function(s, n) { var _tuple, a, ch, i, l, n, s, size, x; l = utf8.RuneCountInString(s); if (n < 0 || n > l) { n = l; } a = $makeSlice(sliceType$1, n); i = 0; while (true) { if (!(i < (n - 1 >> 0))) { break; } _tuple = utf8.DecodeRuneInString(s); ch = _tuple[0]; size = _tuple[1]; ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, size)); s = $substring(s, size); if (ch === 65533) { ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = "\xEF\xBF\xBD"); } i = i + (1) >> 0; } if (n > 0) { (x = n - 1 >> 0, ((x < 0 || x >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + x] = s)); } return a; }; Contains = function(s, substr) { var s, substr; return Index(s, substr) >= 0; }; $pkg.Contains = Contains; IndexRune = function(s, r) { var _i, _ref, _rune, i, r, r$1, s; if (0 <= r && r < 128) { return IndexByte(s, ((r << 24 >>> 24))); } else if ((r === 65533)) { _ref = s; _i = 0; while (true) { if (!(_i < _ref.length)) { break; } _rune = $decodeRune(_ref, _i); i = _i; r$1 = _rune[0]; if (r$1 === 65533) { return i; } _i += _rune[1]; } return -1; } else if (!utf8.ValidRune(r)) { return -1; } else { return Index(s, ($encodeRune(r))); } }; $pkg.IndexRune = IndexRune; genSplit = function(s, sep, sepSave, n) { var a, i, m, n, s, sep, sepSave; if (n === 0) { return sliceType$1.nil; } if (sep === "") { return explode(s, n); } if (n < 0) { n = Count(s, sep) + 1 >> 0; } a = $makeSlice(sliceType$1, n); n = n - (1) >> 0; i = 0; while (true) { if (!(i < n)) { break; } m = Index(s, sep); if (m < 0) { break; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = $substring(s, 0, (m + sepSave >> 0))); s = $substring(s, (m + sep.length >> 0)); i = i + (1) >> 0; } ((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i] = s); return $subslice(a, 0, (i + 1 >> 0)); }; Split = function(s, sep) { var s, sep; return genSplit(s, sep, 0, -1); }; $pkg.Split = Split; Join = function(a, sep) { var _1, _i, _ref, a, b, bp, i, n, s, sep; _1 = a.$length; if (_1 === (0)) { return ""; } else if (_1 === (1)) { return (0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0]); } else if (_1 === (2)) { return (0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0]) + sep + (1 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 1]); } else if (_1 === (3)) { return (0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0]) + sep + (1 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 1]) + sep + (2 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 2]); } n = $imul(sep.length, ((a.$length - 1 >> 0))); i = 0; while (true) { if (!(i < a.$length)) { break; } n = n + (((i < 0 || i >= a.$length) ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + i]).length) >> 0; i = i + (1) >> 0; } b = $makeSlice(sliceType, n); bp = $copyString(b, (0 >= a.$length ? ($throwRuntimeError("index out of range"), undefined) : a.$array[a.$offset + 0])); _ref = $subslice(a, 1); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } s = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); bp = bp + ($copyString($subslice(b, bp), sep)) >> 0; bp = bp + ($copyString($subslice(b, bp), s)) >> 0; _i++; } return ($bytesToString(b)); }; $pkg.Join = Join; HasPrefix = function(s, prefix) { var prefix, s; return s.length >= prefix.length && $substring(s, 0, prefix.length) === prefix; }; $pkg.HasPrefix = HasPrefix; Map = function(mapping, s) { var _i, _i$1, _r, _r$1, _ref, _ref$1, _rune, _rune$1, _tuple, b, c, c$1, i, mapping, nb, nbytes, r, r$1, s, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _rune = $f._rune; _rune$1 = $f._rune$1; _tuple = $f._tuple; b = $f.b; c = $f.c; c$1 = $f.c$1; i = $f.i; mapping = $f.mapping; nb = $f.nb; nbytes = $f.nbytes; r = $f.r; r$1 = $f.r$1; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = sliceType.nil; nbytes = 0; _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); i = _i; c = _rune[0]; _r = mapping(c); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } r = _r; if (r === c) { _i += _rune[1]; /* continue; */ $s = 1; continue; } b = $makeSlice(sliceType, (s.length + 4 >> 0)); nbytes = $copyString(b, $substring(s, 0, i)); if (r >= 0) { if (r < 128) { ((nbytes < 0 || nbytes >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + nbytes] = ((r << 24 >>> 24))); nbytes = nbytes + (1) >> 0; } else { nbytes = nbytes + (utf8.EncodeRune($subslice(b, nbytes), r)) >> 0; } } if (c === 65533) { _tuple = utf8.DecodeRuneInString($substring(s, i)); w = _tuple[1]; i = i + (w) >> 0; } else { i = i + (utf8.RuneLen(c)) >> 0; } s = $substring(s, i); /* break; */ $s = 2; continue; /* } */ $s = 1; continue; case 2: if (b === sliceType.nil) { $s = -1; return s; } _ref$1 = s; _i$1 = 0; /* while (true) { */ case 4: /* if (!(_i$1 < _ref$1.length)) { break; } */ if(!(_i$1 < _ref$1.length)) { $s = 5; continue; } _rune$1 = $decodeRune(_ref$1, _i$1); c$1 = _rune$1[0]; _r$1 = mapping(c$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } r$1 = _r$1; if ((0 <= r$1 && r$1 < 128) && nbytes < b.$length) { ((nbytes < 0 || nbytes >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + nbytes] = ((r$1 << 24 >>> 24))); nbytes = nbytes + (1) >> 0; _i$1 += _rune$1[1]; /* continue; */ $s = 4; continue; } if (r$1 >= 0) { if ((nbytes + 4 >> 0) >= b.$length) { nb = $makeSlice(sliceType, ($imul(2, b.$length))); $copySlice(nb, $subslice(b, 0, nbytes)); b = nb; } nbytes = nbytes + (utf8.EncodeRune($subslice(b, nbytes), r$1)) >> 0; } _i$1 += _rune$1[1]; /* } */ $s = 4; continue; case 5: $s = -1; return ($bytesToString($subslice(b, 0, nbytes))); /* */ } return; } if ($f === undefined) { $f = { $blk: Map }; } $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._rune = _rune; $f._rune$1 = _rune$1; $f._tuple = _tuple; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.i = i; $f.mapping = mapping; $f.nb = nb; $f.nbytes = nbytes; $f.r = r; $f.r$1 = r$1; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Map = Map; Repeat = function(s, count) { var _q, b, bp, count, s; if (count < 0) { $panic(new $String("strings: negative Repeat count")); } else if (count > 0 && !(((_q = ($imul(s.length, count)) / count, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) === s.length))) { $panic(new $String("strings: Repeat count causes overflow")); } b = $makeSlice(sliceType, ($imul(s.length, count))); bp = $copyString(b, s); while (true) { if (!(bp < b.$length)) { break; } $copySlice($subslice(b, bp), $subslice(b, 0, bp)); bp = $imul(bp, (2)); } return ($bytesToString(b)); }; $pkg.Repeat = Repeat; ToUpper = function(s) { var _r, _tmp, _tmp$1, b, c, c$1, hasLower, i, i$1, isASCII, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; b = $f.b; c = $f.c; c$1 = $f.c$1; hasLower = $f.hasLower; i = $f.i; i$1 = $f.i$1; isASCII = $f.isASCII; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tmp = true; _tmp$1 = false; isASCII = _tmp; hasLower = _tmp$1; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (c >= 128) { isASCII = false; break; } hasLower = hasLower || (c >= 97 && c <= 122); i = i + (1) >> 0; } if (isASCII) { if (!hasLower) { $s = -1; return s; } b = $makeSlice(sliceType, s.length); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } c$1 = s.charCodeAt(i$1); if (c$1 >= 97 && c$1 <= 122) { c$1 = c$1 - (32) << 24 >>> 24; } ((i$1 < 0 || i$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i$1] = c$1); i$1 = i$1 + (1) >> 0; } $s = -1; return ($bytesToString(b)); } _r = Map(unicode.ToUpper, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ToUpper }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.hasLower = hasLower; $f.i = i; $f.i$1 = i$1; $f.isASCII = isASCII; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ToUpper = ToUpper; ToLower = function(s) { var _r, _tmp, _tmp$1, b, c, c$1, hasUpper, i, i$1, isASCII, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; b = $f.b; c = $f.c; c$1 = $f.c$1; hasUpper = $f.hasUpper; i = $f.i; i$1 = $f.i$1; isASCII = $f.isASCII; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tmp = true; _tmp$1 = false; isASCII = _tmp; hasUpper = _tmp$1; i = 0; while (true) { if (!(i < s.length)) { break; } c = s.charCodeAt(i); if (c >= 128) { isASCII = false; break; } hasUpper = hasUpper || (c >= 65 && c <= 90); i = i + (1) >> 0; } if (isASCII) { if (!hasUpper) { $s = -1; return s; } b = $makeSlice(sliceType, s.length); i$1 = 0; while (true) { if (!(i$1 < s.length)) { break; } c$1 = s.charCodeAt(i$1); if (c$1 >= 65 && c$1 <= 90) { c$1 = c$1 + (32) << 24 >>> 24; } ((i$1 < 0 || i$1 >= b.$length) ? ($throwRuntimeError("index out of range"), undefined) : b.$array[b.$offset + i$1] = c$1); i$1 = i$1 + (1) >> 0; } $s = -1; return ($bytesToString(b)); } _r = Map(unicode.ToLower, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ToLower }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.b = b; $f.c = c; $f.c$1 = c$1; $f.hasUpper = hasUpper; $f.i = i; $f.i$1 = i$1; $f.isASCII = isASCII; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ToLower = ToLower; TrimLeftFunc = function(s, f) { var _r, f, i, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; i = $f.i; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = indexFunc(s, f, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; if (i === -1) { $s = -1; return ""; } $s = -1; return $substring(s, i); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimLeftFunc }; } $f._r = _r; $f.f = f; $f.i = i; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimLeftFunc = TrimLeftFunc; TrimRightFunc = function(s, f) { var _r, _tuple, f, i, s, wid, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; i = $f.i; s = $f.s; wid = $f.wid; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lastIndexFunc(s, f, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } i = _r; if (i >= 0 && s.charCodeAt(i) >= 128) { _tuple = utf8.DecodeRuneInString($substring(s, i)); wid = _tuple[1]; i = i + (wid) >> 0; } else { i = i + (1) >> 0; } $s = -1; return $substring(s, 0, i); /* */ } return; } if ($f === undefined) { $f = { $blk: TrimRightFunc }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.i = i; $f.s = s; $f.wid = wid; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimRightFunc = TrimRightFunc; TrimFunc = function(s, f) { var _r, _r$1, f, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; f = $f.f; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = TrimLeftFunc(s, f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = TrimRightFunc(_r, f); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimFunc }; } $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimFunc = TrimFunc; indexFunc = function(s, f, truth) { var _i, _r, _ref, _rune, f, i, r, s, truth, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; _rune = $f._rune; f = $f.f; i = $f.i; r = $f.r; s = $f.s; truth = $f.truth; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = s; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); i = _i; r = _rune[0]; _r = f(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === truth) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r === truth) { */ case 3: $s = -1; return i; /* } */ case 4: _i += _rune[1]; /* } */ $s = 1; continue; case 2: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: indexFunc }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f._rune = _rune; $f.f = f; $f.i = i; $f.r = r; $f.s = s; $f.truth = truth; $f.$s = $s; $f.$r = $r; return $f; }; lastIndexFunc = function(s, f, truth) { var _r, _tuple, f, i, r, s, size, truth, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; i = $f.i; r = $f.r; s = $f.s; size = $f.size; truth = $f.truth; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = s.length; /* while (true) { */ case 1: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 2; continue; } _tuple = utf8.DecodeLastRuneInString($substring(s, 0, i)); r = _tuple[0]; size = _tuple[1]; i = i - (size) >> 0; _r = f(r); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === truth) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r === truth) { */ case 3: $s = -1; return i; /* } */ case 4: /* } */ $s = 1; continue; case 2: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: lastIndexFunc }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.i = i; $f.r = r; $f.s = s; $f.size = size; $f.truth = truth; $f.$s = $s; $f.$r = $r; return $f; }; makeASCIISet = function(chars) { var _index, _tmp, _tmp$1, _tmp$2, _tmp$3, as, c, chars, i, ok, y; as = arrayType$3.zero(); ok = false; i = 0; while (true) { if (!(i < chars.length)) { break; } c = chars.charCodeAt(i); if (c >= 128) { _tmp = $clone(as, asciiSet); _tmp$1 = false; asciiSet.copy(as, _tmp); ok = _tmp$1; return [as, ok]; } _index = c >>> 5 << 24 >>> 24; ((_index < 0 || _index >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[_index] = ((((_index < 0 || _index >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[_index]) | (((y = ((((c & 31) >>> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0)); i = i + (1) >> 0; } _tmp$2 = $clone(as, asciiSet); _tmp$3 = true; asciiSet.copy(as, _tmp$2); ok = _tmp$3; return [as, ok]; }; asciiSet.prototype.contains = function(c) { var as, c, x, y; as = this.$val; return !((((((x = c >>> 5 << 24 >>> 24, (as.nilCheck, ((x < 0 || x >= as.length) ? ($throwRuntimeError("index out of range"), undefined) : as[x]))) & (((y = ((((c & 31) >>> 0) >>> 0)), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0)) === 0)); }; $ptrType(asciiSet).prototype.contains = function(c) { return (new asciiSet(this.$get())).contains(c); }; makeCutsetFunc = function(cutset) { var _tuple, as, cutset, isASCII; if ((cutset.length === 1) && cutset.charCodeAt(0) < 128) { return (function(r) { var r; return r === ((cutset.charCodeAt(0) >> 0)); }); } _tuple = makeASCIISet(cutset); as = $clone(_tuple[0], asciiSet); isASCII = _tuple[1]; if (isASCII) { return (function(r) { var r; return r < 128 && new ptrType$5(as).contains(((r << 24 >>> 24))); }); } return (function(r) { var r; return IndexRune(cutset, r) >= 0; }); }; Trim = function(s, cutset) { var _r, cutset, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; cutset = $f.cutset; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (s === "" || cutset === "") { $s = -1; return s; } _r = TrimFunc(s, makeCutsetFunc(cutset)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Trim }; } $f._r = _r; $f.cutset = cutset; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Trim = Trim; TrimLeft = function(s, cutset) { var _r, cutset, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; cutset = $f.cutset; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (s === "" || cutset === "") { $s = -1; return s; } _r = TrimLeftFunc(s, makeCutsetFunc(cutset)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimLeft }; } $f._r = _r; $f.cutset = cutset; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimLeft = TrimLeft; TrimSpace = function(s) { var _r, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = TrimFunc(s, unicode.IsSpace); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: TrimSpace }; } $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TrimSpace = TrimSpace; TrimPrefix = function(s, prefix) { var prefix, s; if (HasPrefix(s, prefix)) { return $substring(s, prefix.length); } return s; }; $pkg.TrimPrefix = TrimPrefix; Replace = function(s, old, new$1, n) { var _tuple, i, j, m, n, new$1, old, s, start, t, w, wid; if (old === new$1 || (n === 0)) { return s; } m = Count(s, old); if (m === 0) { return s; } else if (n < 0 || m < n) { n = m; } t = $makeSlice(sliceType, (s.length + ($imul(n, ((new$1.length - old.length >> 0)))) >> 0)); w = 0; start = 0; i = 0; while (true) { if (!(i < n)) { break; } j = start; if (old.length === 0) { if (i > 0) { _tuple = utf8.DecodeRuneInString($substring(s, start)); wid = _tuple[1]; j = j + (wid) >> 0; } } else { j = j + (Index($substring(s, start), old)) >> 0; } w = w + ($copyString($subslice(t, w), $substring(s, start, j))) >> 0; w = w + ($copyString($subslice(t, w), new$1)) >> 0; start = j + old.length >> 0; i = i + (1) >> 0; } w = w + ($copyString($subslice(t, w), $substring(s, start))) >> 0; return ($bytesToString($subslice(t, 0, w))); }; $pkg.Replace = Replace; ptrType$6.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType, $Int64], [$Int, $error], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([$String], [], false)}]; ptrType$5.methods = [{prop: "contains", name: "contains", pkg: "strings", typ: $funcType([$Uint8], [$Bool], false)}]; Reader.init("strings", [{prop: "s", name: "s", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "i", name: "i", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "prevRune", name: "prevRune", embedded: false, exported: false, typ: $Int, tag: ""}]); asciiSet.init($Uint32, 8); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytealg.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = unicode.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/J-J-J/goluajit/parse"] = (function() { var $pkg = {}, $init, bufio, bytes, fmt, ast, io, reflect, strconv, strings, Error, Scanner, Lexer, yySymType, yyXError, yyLexerEx, sliceType, structType, sliceType$1, sliceType$2, ptrType, sliceType$3, arrayType, sliceType$4, sliceType$5, ptrType$1, ptrType$2, sliceType$6, ptrType$3, sliceType$7, ptrType$4, sliceType$8, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, ptrType$11, reservedWords, yyXLAT, yySymNames, yyTokenLiteralStrings, yyReductions, yyXErrors, yyParseTab, yyDebug, writeChar, isDecimal, isIdent, isDigit, NewScanner, Parse, yySymName, yylex1, yyParse, TokenName; bufio = $packages["bufio"]; bytes = $packages["bytes"]; fmt = $packages["fmt"]; ast = $packages["github.com/J-J-J/goluajit/ast"]; io = $packages["io"]; reflect = $packages["reflect"]; strconv = $packages["strconv"]; strings = $packages["strings"]; Error = $pkg.Error = $newType(0, $kindStruct, "parse.Error", true, "github.com/J-J-J/goluajit/parse", true, function(Pos_, Message_, Token_) { this.$val = this; if (arguments.length === 0) { this.Pos = new ast.Position.ptr("", 0, 0); this.Message = ""; this.Token = ""; return; } this.Pos = Pos_; this.Message = Message_; this.Token = Token_; }); Scanner = $pkg.Scanner = $newType(0, $kindStruct, "parse.Scanner", true, "github.com/J-J-J/goluajit/parse", true, function(Pos_, reader_) { this.$val = this; if (arguments.length === 0) { this.Pos = new ast.Position.ptr("", 0, 0); this.reader = ptrType.nil; return; } this.Pos = Pos_; this.reader = reader_; }); Lexer = $pkg.Lexer = $newType(0, $kindStruct, "parse.Lexer", true, "github.com/J-J-J/goluajit/parse", true, function(scanner_, Stmts_, PNewLine_, Token_, PrevTokenType_) { this.$val = this; if (arguments.length === 0) { this.scanner = ptrType$10.nil; this.Stmts = sliceType$4.nil; this.PNewLine = false; this.Token = new ast.Token.ptr(0, "", "", new ast.Position.ptr("", 0, 0)); this.PrevTokenType = 0; return; } this.scanner = scanner_; this.Stmts = Stmts_; this.PNewLine = PNewLine_; this.Token = Token_; this.PrevTokenType = PrevTokenType_; }); yySymType = $pkg.yySymType = $newType(0, $kindStruct, "parse.yySymType", true, "github.com/J-J-J/goluajit/parse", false, function(yys_, token_, stmts_, stmt_, funcname_, funcexpr_, exprlist_, expr_, fieldlist_, field_, fieldsep_, namelist_, parlist_) { this.$val = this; if (arguments.length === 0) { this.yys = 0; this.token = new ast.Token.ptr(0, "", "", new ast.Position.ptr("", 0, 0)); this.stmts = sliceType$4.nil; this.stmt = $ifaceNil; this.funcname = ptrType$1.nil; this.funcexpr = ptrType$2.nil; this.exprlist = sliceType$6.nil; this.expr = $ifaceNil; this.fieldlist = sliceType$7.nil; this.field = ptrType$3.nil; this.fieldsep = ""; this.namelist = sliceType.nil; this.parlist = ptrType$4.nil; return; } this.yys = yys_; this.token = token_; this.stmts = stmts_; this.stmt = stmt_; this.funcname = funcname_; this.funcexpr = funcexpr_; this.exprlist = exprlist_; this.expr = expr_; this.fieldlist = fieldlist_; this.field = field_; this.fieldsep = fieldsep_; this.namelist = namelist_; this.parlist = parlist_; }); yyXError = $pkg.yyXError = $newType(0, $kindStruct, "parse.yyXError", true, "github.com/J-J-J/goluajit/parse", false, function(state_, xsym_) { this.$val = this; if (arguments.length === 0) { this.state = 0; this.xsym = 0; return; } this.state = state_; this.xsym = xsym_; }); yyLexerEx = $pkg.yyLexerEx = $newType(8, $kindInterface, "parse.yyLexerEx", true, "github.com/J-J-J/goluajit/parse", false, null); sliceType = $sliceType($String); structType = $structType("github.com/J-J-J/goluajit/parse", [{prop: "xsym", name: "xsym", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "components", name: "components", embedded: false, exported: false, typ: $Int, tag: ""}]); sliceType$1 = $sliceType($Uint16); sliceType$2 = $sliceType($emptyInterface); ptrType = $ptrType(bufio.Reader); sliceType$3 = $sliceType($Uint8); arrayType = $arrayType($Uint8, 64); sliceType$4 = $sliceType(ast.Stmt); sliceType$5 = $sliceType($Int); ptrType$1 = $ptrType(ast.FuncName); ptrType$2 = $ptrType(ast.FunctionExpr); sliceType$6 = $sliceType(ast.Expr); ptrType$3 = $ptrType(ast.Field); sliceType$7 = $sliceType(ptrType$3); ptrType$4 = $ptrType(ast.ParList); sliceType$8 = $sliceType(yySymType); ptrType$5 = $ptrType(Lexer); ptrType$6 = $ptrType(ast.FuncCallExpr); ptrType$7 = $ptrType(ast.IfStmt); ptrType$8 = $ptrType(Error); ptrType$9 = $ptrType(bytes.Buffer); ptrType$10 = $ptrType(Scanner); ptrType$11 = $ptrType(yySymType); Error.ptr.prototype.Error = function() { var _r, _r$1, e, pos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; e = $f.e; pos = $f.pos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; pos = $clone(e.Pos, ast.Position); /* */ if (pos.Line === -1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (pos.Line === -1) { */ case 1: _r = fmt.Sprintf("%v at EOF: %s\n", new sliceType$2([new $String(pos.Source), new $String(e.Message)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: _r$1 = fmt.Sprintf("%v line:%d(column:%d) near '%v': %s\n", new sliceType$2([new $String(pos.Source), new $Int(pos.Line), new $Int(pos.Column), new $String(e.Token), new $String(e.Message)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Error }; } $f._r = _r; $f._r$1 = _r$1; $f.e = e; $f.pos = pos; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Error = function() { return this.$val.Error(); }; writeChar = function(buf, c) { var buf, c; buf.WriteByte(((c << 24 >>> 24))); }; isDecimal = function(ch) { var ch; return 48 <= ch && ch <= 57; }; isIdent = function(ch, pos) { var ch, pos; return (ch === 95) || 65 <= ch && ch <= 90 || 97 <= ch && ch <= 122 || isDecimal(ch) && pos > 0; }; isDigit = function(ch) { var ch; return 48 <= ch && ch <= 57 || 97 <= ch && ch <= 102 || 65 <= ch && ch <= 70; }; NewScanner = function(reader, source) { var reader, source; return new Scanner.ptr(new ast.Position.ptr(source, 1, 0), bufio.NewReaderSize(reader, 4096)); }; $pkg.NewScanner = NewScanner; Scanner.ptr.prototype.Error = function(tok, msg) { var msg, sc, tok; sc = this; return new Error.ptr($clone(sc.Pos, ast.Position), msg, tok); }; Scanner.prototype.Error = function(tok, msg) { return this.$val.Error(tok, msg); }; Scanner.ptr.prototype.TokenError = function(tok, msg) { var msg, sc, tok; sc = this; return new Error.ptr($clone(tok.Pos, ast.Position), msg, tok.Str); }; Scanner.prototype.TokenError = function(tok, msg) { return this.$val.TokenError(tok, msg); }; Scanner.ptr.prototype.readNext = function() { var _r, _tuple, ch, err, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ch = $f.ch; err = $f.err; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r = sc.reader.ReadByte(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; ch = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, io.EOF)) { $s = -1; return -1; } $s = -1; return ((ch >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.readNext }; } $f._r = _r; $f._tuple = _tuple; $f.ch = ch; $f.err = err; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.readNext = function() { return this.$val.readNext(); }; Scanner.ptr.prototype.Newline = function(ch) { var _r, _r$1, ch, next, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; ch = $f.ch; next = $f.next; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; if (ch < 0) { $s = -1; return; } sc.Pos.Line = sc.Pos.Line + (1) >> 0; sc.Pos.Column = 0; _r = sc.Peek(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } next = _r; /* */ if ((ch === 10) && (next === 13) || (ch === 13) && (next === 10)) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((ch === 10) && (next === 13) || (ch === 13) && (next === 10)) { */ case 2: _r$1 = sc.reader.ReadByte(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.Newline }; } $f._r = _r; $f._r$1 = _r$1; $f.ch = ch; $f.next = next; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.Newline = function(ch) { return this.$val.Newline(ch); }; Scanner.ptr.prototype.Next = function() { var _1, _r, ch, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; ch = $f.ch; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r = sc.readNext(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; _1 = ch; /* */ if ((_1 === (10)) || (_1 === (13))) { $s = 3; continue; } /* */ if (_1 === (-1)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_1 === (10)) || (_1 === (13))) { */ case 3: $r = sc.Newline(ch); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ch = 10; $s = 6; continue; /* } else if (_1 === (-1)) { */ case 4: sc.Pos.Line = -1; sc.Pos.Column = 0; $s = 6; continue; /* } else { */ case 5: sc.Pos.Column = sc.Pos.Column + (1) >> 0; /* } */ case 6: case 2: $s = -1; return ch; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.Next }; } $f._1 = _1; $f._r = _r; $f.ch = ch; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.Next = function() { return this.$val.Next(); }; Scanner.ptr.prototype.Peek = function() { var _r, ch, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ch = $f.ch; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r = sc.readNext(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; if (!((ch === -1))) { sc.reader.UnreadByte(); } $s = -1; return ch; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.Peek }; } $f._r = _r; $f.ch = ch; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.Peek = function() { return this.$val.Peek(); }; Scanner.ptr.prototype.skipWhiteSpace = function(whitespace) { var _r, _r$1, ch, sc, whitespace, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; ch = $f.ch; sc = $f.sc; whitespace = $f.whitespace; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r = sc.Next(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; /* while (true) { */ case 2: /* if (!(!((x = (x$1 = $shiftLeft64(new $Int64(0, 1), ((ch >>> 0))), new $Int64(whitespace.$high & x$1.$high, (whitespace.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))))) { break; } */ if(!(!((x = (x$1 = $shiftLeft64(new $Int64(0, 1), ((ch >>> 0))), new $Int64(whitespace.$high & x$1.$high, (whitespace.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))))) { $s = 3; continue; } _r$1 = sc.Next(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ch = _r$1; /* } */ $s = 2; continue; case 3: $s = -1; return ch; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.skipWhiteSpace }; } $f._r = _r; $f._r$1 = _r$1; $f.ch = ch; $f.sc = sc; $f.whitespace = whitespace; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.skipWhiteSpace = function(whitespace) { return this.$val.skipWhiteSpace(whitespace); }; Scanner.ptr.prototype.skipComments = function(ch) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, buf, ch, err, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _v = $f._v; buf = $f.buf; ch = $f.ch; err = $f.err; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = [buf]; sc = this; _r = sc.Peek(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === 91) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r === 91) { */ case 1: _r$1 = sc.Next(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ch = _r$1; _r$2 = sc.Peek(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } if (_r$2 === 91) { _v = true; $s = 7; continue s; } _r$3 = sc.Peek(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = _r$3 === 61; case 7: /* */ if (_v) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_v) { */ case 5: buf[0] = new bytes.Buffer.ptr(sliceType$3.nil, 0, arrayType.zero(), 0); _r$4 = sc.Next(); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = sc.scanMultilineString(_r$4, buf[0]); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err = _r$5; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return sc.Error(buf[0].String(), "invalid multiline comment"); } $s = -1; return $ifaceNil; /* } */ case 6: /* } */ case 2: /* while (true) { */ case 12: if ((ch === 10) || (ch === 13) || ch < 0) { /* break; */ $s = 13; continue; } _r$6 = sc.Next(); /* */ $s = 14; case 14: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } ch = _r$6; /* } */ $s = 12; continue; case 13: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.skipComments }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._v = _v; $f.buf = buf; $f.ch = ch; $f.err = err; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.skipComments = function(ch) { return this.$val.skipComments(ch); }; Scanner.ptr.prototype.scanIdent = function(ch, buf) { var _arg, _arg$1, _r, _r$1, _r$2, buf, ch, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; buf = $f.buf; ch = $f.ch; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; writeChar(buf, ch); /* while (true) { */ case 1: _r = sc.Peek(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = isIdent(_r, 1); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* if (!(_r$1)) { break; } */ if(!(_r$1)) { $s = 2; continue; } _arg = buf; _r$2 = sc.Next(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; $r = writeChar(_arg, _arg$1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.scanIdent }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.buf = buf; $f.ch = ch; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.scanIdent = function(ch, buf) { return this.$val.scanIdent(ch, buf); }; Scanner.ptr.prototype.scanDecimal = function(ch, buf) { var _arg, _arg$1, _r, _r$1, _r$2, buf, ch, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; buf = $f.buf; ch = $f.ch; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; writeChar(buf, ch); /* while (true) { */ case 1: _r = sc.Peek(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = isDecimal(_r); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* if (!(_r$1)) { break; } */ if(!(_r$1)) { $s = 2; continue; } _arg = buf; _r$2 = sc.Next(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; $r = writeChar(_arg, _arg$1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.scanDecimal }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.buf = buf; $f.ch = ch; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.scanDecimal = function(ch, buf) { return this.$val.scanDecimal(ch, buf); }; Scanner.ptr.prototype.scanNumber = function(ch, buf) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _v, _v$1, buf, ch, hasvalue, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _v = $f._v; _v$1 = $f._v$1; buf = $f.buf; ch = $f.ch; hasvalue = $f.hasvalue; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; /* */ if (ch === 48) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ch === 48) { */ case 1: _r = sc.Peek(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } if (_r === 120) { _v = true; $s = 6; continue s; } _r$1 = sc.Peek(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v = _r$1 === 88; case 6: /* */ if (_v) { $s = 3; continue; } _r$2 = sc.Peek(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } if (!(!((_r$2 === 46)))) { _v$1 = false; $s = 9; continue s; } _r$3 = sc.Peek(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = isDecimal(_r$3); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v$1 = _r$4; case 9: /* */ if (_v$1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_v) { */ case 3: writeChar(buf, ch); _arg = buf; _r$5 = sc.Next(); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = _r$5; $r = writeChar(_arg, _arg$1); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } hasvalue = false; /* while (true) { */ case 15: _r$6 = sc.Peek(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = isDigit(_r$6); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* if (!(_r$7)) { break; } */ if(!(_r$7)) { $s = 16; continue; } _arg$2 = buf; _r$8 = sc.Next(); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$3 = _r$8; $r = writeChar(_arg$2, _arg$3); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } hasvalue = true; /* } */ $s = 15; continue; case 16: if (!hasvalue) { $s = -1; return sc.Error(buf.String(), "illegal hexadecimal number"); } $s = -1; return $ifaceNil; /* } else if (_v$1) { */ case 4: _r$9 = sc.Next(); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } ch = _r$9; /* } */ case 5: /* } */ case 2: _r$10 = sc.scanDecimal(ch, buf); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; _r$11 = sc.Peek(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (_r$11 === 46) { $s = 23; continue; } /* */ $s = 24; continue; /* if (_r$11 === 46) { */ case 23: _r$12 = sc.Next(); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$13 = sc.scanDecimal(_r$12, buf); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; /* } */ case 24: _r$14 = sc.Peek(); /* */ $s = 28; case 28: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } ch = _r$14; /* */ if ((ch === 101) || (ch === 69)) { $s = 29; continue; } /* */ $s = 30; continue; /* if ((ch === 101) || (ch === 69)) { */ case 29: _arg$4 = buf; _r$15 = sc.Next(); /* */ $s = 31; case 31: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$5 = _r$15; $r = writeChar(_arg$4, _arg$5); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$16 = sc.Peek(); /* */ $s = 33; case 33: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } ch = _r$16; /* */ if ((ch === 45) || (ch === 43)) { $s = 34; continue; } /* */ $s = 35; continue; /* if ((ch === 45) || (ch === 43)) { */ case 34: _arg$6 = buf; _r$17 = sc.Next(); /* */ $s = 36; case 36: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _arg$7 = _r$17; $r = writeChar(_arg$6, _arg$7); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 35: _r$18 = sc.Next(); /* */ $s = 38; case 38: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$19 = sc.scanDecimal(_r$18, buf); /* */ $s = 39; case 39: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _r$19; /* } */ case 30: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.scanNumber }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._v = _v; $f._v$1 = _v$1; $f.buf = buf; $f.ch = ch; $f.hasvalue = hasvalue; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.scanNumber = function(ch, buf) { return this.$val.scanNumber(ch, buf); }; Scanner.ptr.prototype.scanString = function(quote, buf) { var _r, _r$1, _r$2, buf, ch, err, quote, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; buf = $f.buf; ch = $f.ch; err = $f.err; quote = $f.quote; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r = sc.Next(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; /* while (true) { */ case 2: /* if (!(!((ch === quote)))) { break; } */ if(!(!((ch === quote)))) { $s = 3; continue; } if ((ch === 10) || (ch === 13) || ch < 0) { $s = -1; return sc.Error(buf.String(), "unterminated string"); } /* */ if (ch === 92) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ch === 92) { */ case 4: _r$1 = sc.scanEscape(ch, buf); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } $s = 6; continue; /* } else { */ case 5: writeChar(buf, ch); /* } */ case 6: _r$2 = sc.Next(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ch = _r$2; /* } */ $s = 2; continue; case 3: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.scanString }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.buf = buf; $f.ch = ch; $f.err = err; $f.quote = quote; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.scanString = function(quote, buf) { return this.$val.scanString(quote, buf); }; Scanner.ptr.prototype.scanEscape = function(ch, buf) { var _1, _r, _r$1, _r$2, _r$3, _tuple, _v, buf, bytes$1, ch, i, sc, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _v = $f._v; buf = $f.buf; bytes$1 = $f.bytes$1; ch = $f.ch; i = $f.i; sc = $f.sc; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _r = sc.Next(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; _1 = ch; /* */ if (_1 === (97)) { $s = 3; continue; } /* */ if (_1 === (98)) { $s = 4; continue; } /* */ if (_1 === (102)) { $s = 5; continue; } /* */ if (_1 === (110)) { $s = 6; continue; } /* */ if (_1 === (114)) { $s = 7; continue; } /* */ if (_1 === (116)) { $s = 8; continue; } /* */ if (_1 === (118)) { $s = 9; continue; } /* */ if (_1 === (92)) { $s = 10; continue; } /* */ if (_1 === (34)) { $s = 11; continue; } /* */ if (_1 === (39)) { $s = 12; continue; } /* */ if (_1 === (10)) { $s = 13; continue; } /* */ if (_1 === (13)) { $s = 14; continue; } /* */ if (48 <= ch && ch <= 57) { $s = 15; continue; } /* */ $s = 16; continue; /* if (_1 === (97)) { */ case 3: buf.WriteByte(7); $s = 17; continue; /* } else if (_1 === (98)) { */ case 4: buf.WriteByte(8); $s = 17; continue; /* } else if (_1 === (102)) { */ case 5: buf.WriteByte(12); $s = 17; continue; /* } else if (_1 === (110)) { */ case 6: buf.WriteByte(10); $s = 17; continue; /* } else if (_1 === (114)) { */ case 7: buf.WriteByte(13); $s = 17; continue; /* } else if (_1 === (116)) { */ case 8: buf.WriteByte(9); $s = 17; continue; /* } else if (_1 === (118)) { */ case 9: buf.WriteByte(11); $s = 17; continue; /* } else if (_1 === (92)) { */ case 10: buf.WriteByte(92); $s = 17; continue; /* } else if (_1 === (34)) { */ case 11: buf.WriteByte(34); $s = 17; continue; /* } else if (_1 === (39)) { */ case 12: buf.WriteByte(39); $s = 17; continue; /* } else if (_1 === (10)) { */ case 13: buf.WriteByte(10); $s = 17; continue; /* } else if (_1 === (13)) { */ case 14: buf.WriteByte(10); $r = sc.Newline(13); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 17; continue; /* } else if (48 <= ch && ch <= 57) { */ case 15: bytes$1 = new sliceType$3([((ch << 24 >>> 24))]); i = 0; /* while (true) { */ case 19: if (!(i < 2)) { _v = false; $s = 21; continue s; } _r$1 = sc.Peek(); /* */ $s = 22; case 22: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = isDecimal(_r$1); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2; case 21: /* if (!(_v)) { break; } */ if(!(_v)) { $s = 20; continue; } _r$3 = sc.Next(); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } bytes$1 = $append(bytes$1, ((_r$3 << 24 >>> 24))); i = i + (1) >> 0; /* } */ $s = 19; continue; case 20: _tuple = strconv.ParseInt(($bytesToString(bytes$1)), 10, 32); val = _tuple[0]; writeChar(buf, (((val.$low + ((val.$high >> 31) * 4294967296)) >> 0))); $s = 17; continue; /* } else { */ case 16: writeChar(buf, ch); /* } */ case 17: case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.scanEscape }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._v = _v; $f.buf = buf; $f.bytes$1 = bytes$1; $f.ch = ch; $f.i = i; $f.sc = sc; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.scanEscape = function(ch, buf) { return this.$val.scanEscape(ch, buf); }; Scanner.ptr.prototype.countSep = function(ch) { var _r, ch, count, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ch = $f.ch; count = $f.count; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; count = 0; /* while (true) { */ case 1: /* if (!(ch === 61)) { break; } */ if(!(ch === 61)) { $s = 2; continue; } _r = sc.Next(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; count = count + 1 >> 0; /* } */ $s = 1; continue; case 2: $s = -1; return [count, ch]; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.countSep }; } $f._r = _r; $f.ch = ch; $f.count = count; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.countSep = function(ch) { return this.$val.countSep(ch); }; Scanner.ptr.prototype.scanMultilineString = function(ch, buf) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tmp, _tmp$1, _tuple, _tuple$1, buf, ch, count1, count2, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; ch = $f.ch; count1 = $f.count1; count2 = $f.count2; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = this; _tmp = 0; _tmp$1 = 0; count1 = _tmp; count2 = _tmp$1; _r = sc.countSep(ch); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; count1 = _tuple[0]; ch = _tuple[1]; if (!((ch === 91))) { $s = -1; return sc.Error(($encodeRune(ch)), "invalid multiline string"); } _r$1 = sc.Next(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ch = _r$1; /* */ if ((ch === 10) || (ch === 13)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((ch === 10) || (ch === 13)) { */ case 3: _r$2 = sc.Next(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } ch = _r$2; /* } */ case 4: /* while (true) { */ case 6: /* */ if (ch < 0) { $s = 8; continue; } /* */ if (ch === 93) { $s = 9; continue; } /* */ $s = 10; continue; /* if (ch < 0) { */ case 8: $s = -1; return sc.Error(buf.String(), "unterminated multiline string"); /* } else if (ch === 93) { */ case 9: _r$3 = sc.Next(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = sc.countSep(_r$3); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; count2 = _tuple$1[0]; ch = _tuple$1[1]; /* */ if ((count1 === count2) && (ch === 93)) { $s = 13; continue; } /* */ $s = 14; continue; /* if ((count1 === count2) && (ch === 93)) { */ case 13: /* goto finally */ $s = 15; continue; /* } */ case 14: buf.WriteByte(93); buf.WriteString(strings.Repeat("=", count2)); /* continue; */ $s = 6; continue; /* } */ case 10: writeChar(buf, ch); _r$5 = sc.Next(); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } ch = _r$5; /* } */ $s = 6; continue; case 7: /* finally: */ case 15: $s = -1; return $ifaceNil; $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.scanMultilineString }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.ch = ch; $f.count1 = count1; $f.count2 = count2; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.scanMultilineString = function(ch, buf) { return this.$val.scanMultilineString(ch, buf); }; Scanner.ptr.prototype.Scan = function(lexer) { var _1, _arg, _arg$1, _arg$2, _arg$3, _buf, _entry, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, buf, c, ch, ch2, err, lexer, newline, ok, sc, tok, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _buf = $f._buf; _entry = $f._entry; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; buf = $f.buf; c = $f.c; ch = $f.ch; ch2 = $f.ch2; err = $f.err; lexer = $f.lexer; newline = $f.newline; ok = $f.ok; sc = $f.sc; tok = $f.tok; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _buf = [_buf]; sc = this; /* redo: */ case 1: tok = new ast.Token.ptr(0, "", "", $clone(sc.Pos, ast.Position)); newline = false; _buf[0] = new bytes.Buffer.ptr(sliceType$3.nil, 0, arrayType.zero(), 0); buf = _buf[0]; err = $ifaceNil; _r = sc.skipWhiteSpace(new $Int64(1, 512)); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ch = _r; /* */ if ((ch === 10) || (ch === 13)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((ch === 10) || (ch === 13)) { */ case 3: newline = true; _r$1 = sc.skipWhiteSpace(new $Int64(1, 9728)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ch = _r$1; /* } */ case 4: if ((ch === 40) && (lexer.PrevTokenType === 41)) { lexer.PNewLine = newline; } /* */ if (isIdent(ch, 0)) { $s = 7; continue; } /* */ if (isDecimal(ch)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (isIdent(ch, 0)) { */ case 7: tok.Type = 57373; _r$2 = sc.scanIdent(ch, buf); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; tok.Str = buf.String(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 12: /* goto finally */ $s = 14; continue; /* } */ case 13: _tuple = (_entry = reservedWords[$String.keyFor(tok.Str)], _entry !== undefined ? [_entry.v, true] : [0, false]); typ = _tuple[0]; ok = _tuple[1]; if (ok) { tok.Type = typ; } $s = 10; continue; /* } else if (isDecimal(ch)) { */ case 8: tok.Type = 57374; _r$3 = sc.scanNumber(ch, buf); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; tok.Str = buf.String(); $s = 10; continue; /* } else { */ case 9: _1 = ch; /* */ if (_1 === (-1)) { $s = 17; continue; } /* */ if (_1 === (45)) { $s = 18; continue; } /* */ if ((_1 === (34)) || (_1 === (39))) { $s = 19; continue; } /* */ if (_1 === (91)) { $s = 20; continue; } /* */ if (_1 === (61)) { $s = 21; continue; } /* */ if (_1 === (126)) { $s = 22; continue; } /* */ if (_1 === (60)) { $s = 23; continue; } /* */ if (_1 === (62)) { $s = 24; continue; } /* */ if (_1 === (46)) { $s = 25; continue; } /* */ if ((_1 === (43)) || (_1 === (42)) || (_1 === (47)) || (_1 === (37)) || (_1 === (94)) || (_1 === (35)) || (_1 === (40)) || (_1 === (41)) || (_1 === (123)) || (_1 === (125)) || (_1 === (93)) || (_1 === (59)) || (_1 === (58)) || (_1 === (44))) { $s = 26; continue; } /* */ $s = 27; continue; /* if (_1 === (-1)) { */ case 17: tok.Type = -1; $s = 28; continue; /* } else if (_1 === (45)) { */ case 18: _r$4 = sc.Peek(); /* */ $s = 32; case 32: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 === 45) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_r$4 === 45) { */ case 29: _r$5 = sc.Next(); /* */ $s = 33; case 33: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$6 = sc.skipComments(_r$5); /* */ $s = 34; case 34: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } err = _r$6; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 35: /* goto finally */ $s = 14; continue; /* } */ case 36: /* goto redo */ $s = 1; continue; $s = 31; continue; /* } else { */ case 30: tok.Type = ch; tok.Str = ($encodeRune(ch)); /* } */ case 31: $s = 28; continue; /* } else if ((_1 === (34)) || (_1 === (39))) { */ case 19: tok.Type = 57375; _r$7 = sc.scanString(ch, buf); /* */ $s = 37; case 37: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } err = _r$7; tok.Str = buf.String(); $s = 28; continue; /* } else if (_1 === (91)) { */ case 20: _r$8 = sc.Peek(); /* */ $s = 38; case 38: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } c = _r$8; /* */ if ((c === 91) || (c === 61)) { $s = 39; continue; } /* */ $s = 40; continue; /* if ((c === 91) || (c === 61)) { */ case 39: tok.Type = 57375; _r$9 = sc.Next(); /* */ $s = 42; case 42: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = sc.scanMultilineString(_r$9, buf); /* */ $s = 43; case 43: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } err = _r$10; tok.Str = buf.String(); $s = 41; continue; /* } else { */ case 40: tok.Type = ch; tok.Str = ($encodeRune(ch)); /* } */ case 41: $s = 28; continue; /* } else if (_1 === (61)) { */ case 21: _r$11 = sc.Peek(); /* */ $s = 47; case 47: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } /* */ if (_r$11 === 61) { $s = 44; continue; } /* */ $s = 45; continue; /* if (_r$11 === 61) { */ case 44: tok.Type = 57367; tok.Str = "=="; _r$12 = sc.Next(); /* */ $s = 48; case 48: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; $s = 46; continue; /* } else { */ case 45: tok.Type = ch; tok.Str = ($encodeRune(ch)); /* } */ case 46: $s = 28; continue; /* } else if (_1 === (126)) { */ case 22: _r$13 = sc.Peek(); /* */ $s = 52; case 52: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } /* */ if (_r$13 === 61) { $s = 49; continue; } /* */ $s = 50; continue; /* if (_r$13 === 61) { */ case 49: tok.Type = 57368; tok.Str = "~="; _r$14 = sc.Next(); /* */ $s = 53; case 53: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; $s = 51; continue; /* } else { */ case 50: err = sc.Error("~", "Invalid '~' token"); /* } */ case 51: $s = 28; continue; /* } else if (_1 === (60)) { */ case 23: _r$15 = sc.Peek(); /* */ $s = 57; case 57: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } /* */ if (_r$15 === 61) { $s = 54; continue; } /* */ $s = 55; continue; /* if (_r$15 === 61) { */ case 54: tok.Type = 57369; tok.Str = "<="; _r$16 = sc.Next(); /* */ $s = 58; case 58: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; $s = 56; continue; /* } else { */ case 55: tok.Type = ch; tok.Str = ($encodeRune(ch)); /* } */ case 56: $s = 28; continue; /* } else if (_1 === (62)) { */ case 24: _r$17 = sc.Peek(); /* */ $s = 62; case 62: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } /* */ if (_r$17 === 61) { $s = 59; continue; } /* */ $s = 60; continue; /* if (_r$17 === 61) { */ case 59: tok.Type = 57370; tok.Str = ">="; _r$18 = sc.Next(); /* */ $s = 63; case 63: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } _r$18; $s = 61; continue; /* } else { */ case 60: tok.Type = ch; tok.Str = ($encodeRune(ch)); /* } */ case 61: $s = 28; continue; /* } else if (_1 === (46)) { */ case 25: _r$19 = sc.Peek(); /* */ $s = 64; case 64: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } ch2 = _r$19; /* */ if (isDecimal(ch2)) { $s = 66; continue; } /* */ if ((ch2 === 46)) { $s = 67; continue; } /* */ $s = 68; continue; /* if (isDecimal(ch2)) { */ case 66: tok.Type = 57374; _r$20 = sc.scanNumber(ch, buf); /* */ $s = 70; case 70: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } err = _r$20; tok.Str = buf.String(); $s = 69; continue; /* } else if ((ch2 === 46)) { */ case 67: writeChar(buf, ch); _arg = buf; _r$21 = sc.Next(); /* */ $s = 71; case 71: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _arg$1 = _r$21; $r = writeChar(_arg, _arg$1); /* */ $s = 72; case 72: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$22 = sc.Peek(); /* */ $s = 76; case 76: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } /* */ if (_r$22 === 46) { $s = 73; continue; } /* */ $s = 74; continue; /* if (_r$22 === 46) { */ case 73: _arg$2 = buf; _r$23 = sc.Next(); /* */ $s = 77; case 77: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _arg$3 = _r$23; $r = writeChar(_arg$2, _arg$3); /* */ $s = 78; case 78: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } tok.Type = 57372; $s = 75; continue; /* } else { */ case 74: tok.Type = 57371; /* } */ case 75: $s = 69; continue; /* } else { */ case 68: tok.Type = 46; /* } */ case 69: case 65: tok.Str = buf.String(); $s = 28; continue; /* } else if ((_1 === (43)) || (_1 === (42)) || (_1 === (47)) || (_1 === (37)) || (_1 === (94)) || (_1 === (35)) || (_1 === (40)) || (_1 === (41)) || (_1 === (123)) || (_1 === (125)) || (_1 === (93)) || (_1 === (59)) || (_1 === (58)) || (_1 === (44))) { */ case 26: tok.Type = ch; tok.Str = ($encodeRune(ch)); $s = 28; continue; /* } else { */ case 27: writeChar(buf, ch); err = sc.Error(buf.String(), "Invalid token"); /* goto finally */ $s = 14; continue; /* } */ case 28: case 16: /* } */ case 10: case 6: /* finally: */ case 14: tok.Name = TokenName((tok.Type)); $s = -1; return [tok, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Scanner.ptr.prototype.Scan }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._buf = _buf; $f._entry = _entry; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $f.buf = buf; $f.c = c; $f.ch = ch; $f.ch2 = ch2; $f.err = err; $f.lexer = lexer; $f.newline = newline; $f.ok = ok; $f.sc = sc; $f.tok = tok; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; Scanner.prototype.Scan = function(lexer) { return this.$val.Scan(lexer); }; Lexer.ptr.prototype.Lex = function(lval) { var _r, _tuple, err, lval, lx, tok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; lval = $f.lval; lx = $f.lx; tok = $f.tok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lx = this; lx.PrevTokenType = lx.Token.Type; _r = lx.scanner.Scan(lx); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; tok = $clone(_tuple[0], ast.Token); err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } if (tok.Type < 0) { $s = -1; return 0; } ast.Token.copy(lval.token, tok); ast.Token.copy(lx.Token, tok); $s = -1; return (tok.Type); /* */ } return; } if ($f === undefined) { $f = { $blk: Lexer.ptr.prototype.Lex }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.lval = lval; $f.lx = lx; $f.tok = tok; $f.$s = $s; $f.$r = $r; return $f; }; Lexer.prototype.Lex = function(lval) { return this.$val.Lex(lval); }; Lexer.ptr.prototype.Error = function(message) { var lx, message; lx = this; $panic(lx.scanner.Error(lx.Token.Str, message)); }; Lexer.prototype.Error = function(message) { return this.$val.Error(message); }; Lexer.ptr.prototype.TokenError = function(tok, message) { var lx, message, tok; lx = this; $panic(lx.scanner.TokenError($clone(tok, ast.Token), message)); }; Lexer.prototype.TokenError = function(tok, message) { return this.$val.TokenError(tok, message); }; Parse = function(reader, name) { var _r, chunk, err, lexer, name, reader, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; chunk = $f.chunk; err = $f.err; lexer = $f.lexer; name = $f.name; reader = $f.reader; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = [err]; chunk = sliceType$4.nil; err[0] = $ifaceNil; lexer = new Lexer.ptr(NewScanner(reader, name), sliceType$4.nil, false, new ast.Token.ptr(0, "", "", new ast.Position.ptr("", 0, 0)), 57358); chunk = sliceType$4.nil; $deferred.push([(function(err) { return function() { var _tuple, e; e = $recover(); if (!($interfaceIsEqual(e, $ifaceNil))) { _tuple = $assertType(e, $error, true); err[0] = _tuple[0]; } }; })(err), []]); _r = yyParse(lexer); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; chunk = lexer.Stmts; $s = -1; return [chunk, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [chunk, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Parse }; } $f._r = _r; $f.chunk = chunk; $f.err = err; $f.lexer = lexer; $f.name = name; $f.reader = reader; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Parse = Parse; yySymName = function(c) { var _entry, _r, _r$1, _tuple, c, ok, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; c = $f.c; ok = $f.ok; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = ""; _tuple = (_entry = yyXLAT[$Int.keyFor(c)], _entry !== undefined ? [_entry.v, true] : [0, false]); x = _tuple[0]; ok = _tuple[1]; if (ok) { s = ((x < 0 || x >= yySymNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : yySymNames.$array[yySymNames.$offset + x]); $s = -1; return s; } /* */ if (c < 127) { $s = 1; continue; } /* */ $s = 2; continue; /* if (c < 127) { */ case 1: _r = fmt.Sprintf("%q", new sliceType$2([new $Int(c)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } s = _r; $s = -1; return s; /* } */ case 2: _r$1 = fmt.Sprintf("%d", new sliceType$2([new $Int(c)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } s = _r$1; $s = -1; return s; /* */ } return; } if ($f === undefined) { $f = { $blk: yySymName }; } $f._entry = _entry; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.c = c; $f.ok = ok; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; yylex1 = function(yylex, lval) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, lval, n, yylex, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; lval = $f.lval; n = $f.n; yylex = $f.yylex; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; _r = yylex.Lex(lval); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; if (n <= 0) { n = 57344; } /* */ if (yyDebug >= 3) { $s = 2; continue; } /* */ $s = 3; continue; /* if (yyDebug >= 3) { */ case 2: _r$1 = yySymName(n); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); _arg$1 = new $Int(n); _arg$2 = new $Int(n); _arg$3 = lval; _r$2 = fmt.Printf("\nlex %s(%#x %d), lval: %+v\n", new sliceType$2([_arg, _arg$1, _arg$2, _arg$3])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 3: n = n; $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: yylex1 }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.lval = lval; $f.n = n; $f.yylex = yylex; $f.$s = $s; $f.$r = $r; return $f; }; yyParse = function(yylex) { var Errflag, Nerrs, _1, _2, _arg, _arg$1, _arg$2, _entry, _entry$1, _entry$2, _entry$3, _entry$4, _entry$5, _entry$6, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, _v, a, cur, cur$1, elseif, elseif$1, exState, fn, key, key$1, l, l$1, l$2, ls, msg, n, nyys, nyys$1, ok, ok$1, ok$2, ok$3, ok$4, ok$5, r, row, row$1, v, x, x$1, x$10, x$100, x$101, x$102, x$103, x$104, x$105, x$106, x$107, x$108, x$109, x$11, x$110, x$111, x$112, x$113, x$114, x$115, x$116, x$117, x$118, x$119, x$12, x$120, x$121, x$122, x$123, x$124, x$125, x$126, x$127, x$128, x$129, x$13, x$130, x$131, x$132, x$133, x$134, x$135, x$136, x$137, x$138, x$139, x$14, x$140, x$141, x$142, x$143, x$144, x$145, x$146, x$147, x$148, x$149, x$15, x$150, x$151, x$152, x$153, x$154, x$155, x$156, x$157, x$158, x$159, x$16, x$160, x$161, x$162, x$163, x$164, x$165, x$166, x$167, x$168, x$169, x$17, x$170, x$171, x$172, x$173, x$174, x$175, x$176, x$177, x$178, x$179, x$18, x$180, x$181, x$182, x$183, x$184, x$185, x$186, x$187, x$188, x$189, x$19, x$190, x$191, x$192, x$193, x$194, x$195, x$196, x$197, x$198, x$199, x$2, x$20, x$200, x$201, x$202, x$203, x$204, x$205, x$206, x$207, x$208, x$209, x$21, x$210, x$211, x$212, x$213, x$214, x$215, x$216, x$217, x$218, x$219, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$3, x$30, x$31, x$32, x$33, x$34, x$35, x$36, x$37, x$38, x$39, x$4, x$40, x$41, x$42, x$43, x$44, x$45, x$46, x$47, x$48, x$49, x$5, x$50, x$51, x$52, x$53, x$54, x$55, x$56, x$57, x$58, x$59, x$6, x$60, x$61, x$62, x$63, x$64, x$65, x$66, x$67, x$68, x$69, x$7, x$70, x$71, x$72, x$73, x$74, x$75, x$76, x$77, x$78, x$79, x$8, x$80, x$81, x$82, x$83, x$84, x$85, x$86, x$87, x$88, x$89, x$9, x$90, x$91, x$92, x$93, x$94, x$95, x$96, x$97, x$98, x$99, x0, yyEx, yyS, yyVAL, yychar, yyerrok, yylex, yylval, yyn, yyp, yypt, yyshift, yystate, yyxchar, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; Errflag = $f.Errflag; Nerrs = $f.Nerrs; _1 = $f._1; _2 = $f._2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _entry$4 = $f._entry$4; _entry$5 = $f._entry$5; _entry$6 = $f._entry$6; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$24 = $f._r$24; _r$25 = $f._r$25; _r$26 = $f._r$26; _r$27 = $f._r$27; _r$28 = $f._r$28; _r$29 = $f._r$29; _r$3 = $f._r$3; _r$30 = $f._r$30; _r$31 = $f._r$31; _r$32 = $f._r$32; _r$33 = $f._r$33; _r$34 = $f._r$34; _r$35 = $f._r$35; _r$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _r$41 = $f._r$41; _r$42 = $f._r$42; _r$43 = $f._r$43; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; _v = $f._v; a = $f.a; cur = $f.cur; cur$1 = $f.cur$1; elseif = $f.elseif; elseif$1 = $f.elseif$1; exState = $f.exState; fn = $f.fn; key = $f.key; key$1 = $f.key$1; l = $f.l; l$1 = $f.l$1; l$2 = $f.l$2; ls = $f.ls; msg = $f.msg; n = $f.n; nyys = $f.nyys; nyys$1 = $f.nyys$1; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; ok$3 = $f.ok$3; ok$4 = $f.ok$4; ok$5 = $f.ok$5; r = $f.r; row = $f.row; row$1 = $f.row$1; v = $f.v; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$100 = $f.x$100; x$101 = $f.x$101; x$102 = $f.x$102; x$103 = $f.x$103; x$104 = $f.x$104; x$105 = $f.x$105; x$106 = $f.x$106; x$107 = $f.x$107; x$108 = $f.x$108; x$109 = $f.x$109; x$11 = $f.x$11; x$110 = $f.x$110; x$111 = $f.x$111; x$112 = $f.x$112; x$113 = $f.x$113; x$114 = $f.x$114; x$115 = $f.x$115; x$116 = $f.x$116; x$117 = $f.x$117; x$118 = $f.x$118; x$119 = $f.x$119; x$12 = $f.x$12; x$120 = $f.x$120; x$121 = $f.x$121; x$122 = $f.x$122; x$123 = $f.x$123; x$124 = $f.x$124; x$125 = $f.x$125; x$126 = $f.x$126; x$127 = $f.x$127; x$128 = $f.x$128; x$129 = $f.x$129; x$13 = $f.x$13; x$130 = $f.x$130; x$131 = $f.x$131; x$132 = $f.x$132; x$133 = $f.x$133; x$134 = $f.x$134; x$135 = $f.x$135; x$136 = $f.x$136; x$137 = $f.x$137; x$138 = $f.x$138; x$139 = $f.x$139; x$14 = $f.x$14; x$140 = $f.x$140; x$141 = $f.x$141; x$142 = $f.x$142; x$143 = $f.x$143; x$144 = $f.x$144; x$145 = $f.x$145; x$146 = $f.x$146; x$147 = $f.x$147; x$148 = $f.x$148; x$149 = $f.x$149; x$15 = $f.x$15; x$150 = $f.x$150; x$151 = $f.x$151; x$152 = $f.x$152; x$153 = $f.x$153; x$154 = $f.x$154; x$155 = $f.x$155; x$156 = $f.x$156; x$157 = $f.x$157; x$158 = $f.x$158; x$159 = $f.x$159; x$16 = $f.x$16; x$160 = $f.x$160; x$161 = $f.x$161; x$162 = $f.x$162; x$163 = $f.x$163; x$164 = $f.x$164; x$165 = $f.x$165; x$166 = $f.x$166; x$167 = $f.x$167; x$168 = $f.x$168; x$169 = $f.x$169; x$17 = $f.x$17; x$170 = $f.x$170; x$171 = $f.x$171; x$172 = $f.x$172; x$173 = $f.x$173; x$174 = $f.x$174; x$175 = $f.x$175; x$176 = $f.x$176; x$177 = $f.x$177; x$178 = $f.x$178; x$179 = $f.x$179; x$18 = $f.x$18; x$180 = $f.x$180; x$181 = $f.x$181; x$182 = $f.x$182; x$183 = $f.x$183; x$184 = $f.x$184; x$185 = $f.x$185; x$186 = $f.x$186; x$187 = $f.x$187; x$188 = $f.x$188; x$189 = $f.x$189; x$19 = $f.x$19; x$190 = $f.x$190; x$191 = $f.x$191; x$192 = $f.x$192; x$193 = $f.x$193; x$194 = $f.x$194; x$195 = $f.x$195; x$196 = $f.x$196; x$197 = $f.x$197; x$198 = $f.x$198; x$199 = $f.x$199; x$2 = $f.x$2; x$20 = $f.x$20; x$200 = $f.x$200; x$201 = $f.x$201; x$202 = $f.x$202; x$203 = $f.x$203; x$204 = $f.x$204; x$205 = $f.x$205; x$206 = $f.x$206; x$207 = $f.x$207; x$208 = $f.x$208; x$209 = $f.x$209; x$21 = $f.x$21; x$210 = $f.x$210; x$211 = $f.x$211; x$212 = $f.x$212; x$213 = $f.x$213; x$214 = $f.x$214; x$215 = $f.x$215; x$216 = $f.x$216; x$217 = $f.x$217; x$218 = $f.x$218; x$219 = $f.x$219; x$22 = $f.x$22; x$23 = $f.x$23; x$24 = $f.x$24; x$25 = $f.x$25; x$26 = $f.x$26; x$27 = $f.x$27; x$28 = $f.x$28; x$29 = $f.x$29; x$3 = $f.x$3; x$30 = $f.x$30; x$31 = $f.x$31; x$32 = $f.x$32; x$33 = $f.x$33; x$34 = $f.x$34; x$35 = $f.x$35; x$36 = $f.x$36; x$37 = $f.x$37; x$38 = $f.x$38; x$39 = $f.x$39; x$4 = $f.x$4; x$40 = $f.x$40; x$41 = $f.x$41; x$42 = $f.x$42; x$43 = $f.x$43; x$44 = $f.x$44; x$45 = $f.x$45; x$46 = $f.x$46; x$47 = $f.x$47; x$48 = $f.x$48; x$49 = $f.x$49; x$5 = $f.x$5; x$50 = $f.x$50; x$51 = $f.x$51; x$52 = $f.x$52; x$53 = $f.x$53; x$54 = $f.x$54; x$55 = $f.x$55; x$56 = $f.x$56; x$57 = $f.x$57; x$58 = $f.x$58; x$59 = $f.x$59; x$6 = $f.x$6; x$60 = $f.x$60; x$61 = $f.x$61; x$62 = $f.x$62; x$63 = $f.x$63; x$64 = $f.x$64; x$65 = $f.x$65; x$66 = $f.x$66; x$67 = $f.x$67; x$68 = $f.x$68; x$69 = $f.x$69; x$7 = $f.x$7; x$70 = $f.x$70; x$71 = $f.x$71; x$72 = $f.x$72; x$73 = $f.x$73; x$74 = $f.x$74; x$75 = $f.x$75; x$76 = $f.x$76; x$77 = $f.x$77; x$78 = $f.x$78; x$79 = $f.x$79; x$8 = $f.x$8; x$80 = $f.x$80; x$81 = $f.x$81; x$82 = $f.x$82; x$83 = $f.x$83; x$84 = $f.x$84; x$85 = $f.x$85; x$86 = $f.x$86; x$87 = $f.x$87; x$88 = $f.x$88; x$89 = $f.x$89; x$9 = $f.x$9; x$90 = $f.x$90; x$91 = $f.x$91; x$92 = $f.x$92; x$93 = $f.x$93; x$94 = $f.x$94; x$95 = $f.x$95; x$96 = $f.x$96; x$97 = $f.x$97; x$98 = $f.x$98; x$99 = $f.x$99; x0 = $f.x0; yyEx = $f.yyEx; yyS = $f.yyS; yyVAL = $f.yyVAL; yychar = $f.yychar; yyerrok = $f.yyerrok; yylex = $f.yylex; yylval = $f.yylval; yyn = $f.yyn; yyp = $f.yyp; yypt = $f.yypt; yyshift = $f.yyshift; yystate = $f.yystate; yyxchar = $f.yyxchar; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: Errflag = [Errflag]; yyVAL = [yyVAL]; yylval = [yylval]; _tuple = $assertType(yylex, yyLexerEx, true); yyEx = _tuple[0]; yyn = 0; yylval[0] = new yySymType.ptr(0, new ast.Token.ptr(0, "", "", new ast.Position.ptr("", 0, 0)), sliceType$4.nil, $ifaceNil, ptrType$1.nil, ptrType$2.nil, sliceType$6.nil, $ifaceNil, sliceType$7.nil, ptrType$3.nil, "", sliceType.nil, ptrType$4.nil); yyVAL[0] = new yySymType.ptr(0, new ast.Token.ptr(0, "", "", new ast.Position.ptr("", 0, 0)), sliceType$4.nil, $ifaceNil, ptrType$1.nil, ptrType$2.nil, sliceType$6.nil, $ifaceNil, sliceType$7.nil, ptrType$3.nil, "", sliceType.nil, ptrType$4.nil); yyS = $makeSlice(sliceType$8, 200); Nerrs = 0; Errflag[0] = 0; yyerrok = (function(Errflag, yyVAL, yylval) { return function $b() { var _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (yyDebug >= 2) { $s = 1; continue; } /* */ $s = 2; continue; /* if (yyDebug >= 2) { */ case 1: _r = fmt.Printf("yyerrok()\n", new sliceType$2([])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; /* } */ case 2: Errflag[0] = 0; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; })(Errflag, yyVAL, yylval); $unused(yyerrok); yystate = 0; yychar = -1; yyxchar = 0; yyshift = 0; yyp = -1; /* goto yystack */ $s = 1; continue; /* ret0: */ case 2: $s = -1; return 0; /* ret1: */ case 3: $s = -1; return 1; /* yystack: */ case 1: yyp = yyp + (1) >> 0; if (yyp >= yyS.$length) { nyys = $makeSlice(sliceType$8, ($imul(yyS.$length, 2))); $copySlice(nyys, yyS); yyS = nyys; } yySymType.copy(((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]), yyVAL[0]); ((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys = yystate; /* yynewstate: */ case 4: /* */ if (yychar < 0) { $s = 5; continue; } /* */ $s = 6; continue; /* if (yychar < 0) { */ case 5: yylval[0].yys = yystate; _r = yylex1(yylex, yylval[0]); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } yychar = _r; ok = false; _tuple$1 = (_entry = yyXLAT[$Int.keyFor(yychar)], _entry !== undefined ? [_entry.v, true] : [0, false]); yyxchar = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { yyxchar = yySymNames.$length; } /* } */ case 6: /* */ if (yyDebug >= 4) { $s = 8; continue; } /* */ $s = 9; continue; /* if (yyDebug >= 4) { */ case 8: a = sliceType$5.nil; _ref = $subslice(yyS, 0, (yyp + 1 >> 0)); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } v = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), yySymType); a = $append(a, v.yys); _i++; } _r$1 = fmt.Printf("state stack %v\n", new sliceType$2([a])); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 9: row = ((yystate < 0 || yystate >= yyParseTab.length) ? ($throwRuntimeError("index out of range"), undefined) : yyParseTab[yystate]); yyn = 0; if (yyxchar < row.$length) { yyn = ((((yyxchar < 0 || yyxchar >= row.$length) ? ($throwRuntimeError("index out of range"), undefined) : row.$array[row.$offset + yyxchar]) >> 0)); if (!((yyn === 0))) { yyn = yyn + (-95) >> 0; } } /* */ if (yyn > 0) { $s = 12; continue; } /* */ if (yyn < 0) { $s = 13; continue; } /* */ if ((yystate === 1)) { $s = 14; continue; } /* */ $s = 15; continue; /* if (yyn > 0) { */ case 12: yychar = -1; yySymType.copy(yyVAL[0], yylval[0]); yystate = yyn; yyshift = yyn; /* */ if (yyDebug >= 2) { $s = 16; continue; } /* */ $s = 17; continue; /* if (yyDebug >= 2) { */ case 16: _r$2 = fmt.Printf("shift, and goto state %d\n", new sliceType$2([new $Int(yystate)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 17: if (Errflag[0] > 0) { Errflag[0] = Errflag[0] - (1) >> 0; } /* goto yystack */ $s = 1; continue; $s = 15; continue; /* } else if (yyn < 0) { */ case 13: $s = 15; continue; /* } else if ((yystate === 1)) { */ case 14: /* */ if (yyDebug >= 2) { $s = 19; continue; } /* */ $s = 20; continue; /* if (yyDebug >= 2) { */ case 19: _r$3 = fmt.Println(new sliceType$2([new $String("accept")])); /* */ $s = 21; case 21: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 20: /* goto ret0 */ $s = 2; continue; /* } */ case 15: case 11: /* */ if (yyn === 0) { $s = 22; continue; } /* */ $s = 23; continue; /* if (yyn === 0) { */ case 22: _1 = Errflag[0]; /* */ if (_1 === (0)) { $s = 25; continue; } /* */ if ((_1 === (1)) || (_1 === (2))) { $s = 26; continue; } /* */ if (_1 === (3)) { $s = 27; continue; } /* */ $s = 28; continue; /* if (_1 === (0)) { */ case 25: /* */ if (yyDebug >= 1) { $s = 29; continue; } /* */ $s = 30; continue; /* if (yyDebug >= 1) { */ case 29: _r$4 = yySymName(yychar); /* */ $s = 31; case 31: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = new $String(_r$4); _arg$1 = new $Int(yystate); _r$5 = fmt.Printf("no action for %s in state %d\n", new sliceType$2([_arg, _arg$1])); /* */ $s = 32; case 32: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; /* } */ case 30: _tuple$2 = (_entry$1 = yyXErrors[yyXError.keyFor(new yyXError.ptr(yystate, yyxchar))], _entry$1 !== undefined ? [_entry$1.v, true] : ["", false]); msg = _tuple$2[0]; ok$1 = _tuple$2[1]; if (!ok$1) { _tuple$3 = (_entry$2 = yyXErrors[yyXError.keyFor(new yyXError.ptr(yystate, -1))], _entry$2 !== undefined ? [_entry$2.v, true] : ["", false]); msg = _tuple$3[0]; ok$1 = _tuple$3[1]; } if (!ok$1 && !((yyshift === 0))) { _tuple$4 = (_entry$3 = yyXErrors[yyXError.keyFor(new yyXError.ptr(yyshift, yyxchar))], _entry$3 !== undefined ? [_entry$3.v, true] : ["", false]); msg = _tuple$4[0]; ok$1 = _tuple$4[1]; } if (!ok$1) { _tuple$5 = (_entry$4 = yyXErrors[yyXError.keyFor(new yyXError.ptr(yyshift, -1))], _entry$4 !== undefined ? [_entry$4.v, true] : ["", false]); msg = _tuple$5[0]; ok$1 = _tuple$5[1]; } /* */ if (yychar > 0) { $s = 33; continue; } /* */ $s = 34; continue; /* if (yychar > 0) { */ case 33: ls = (_entry$5 = yyTokenLiteralStrings[$Int.keyFor(yychar)], _entry$5 !== undefined ? _entry$5.v : ""); /* */ if (ls === "") { $s = 35; continue; } /* */ $s = 36; continue; /* if (ls === "") { */ case 35: _r$6 = yySymName(yychar); /* */ $s = 37; case 37: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } ls = _r$6; /* } */ case 36: /* */ if (!(ls === "")) { $s = 38; continue; } /* */ $s = 39; continue; /* if (!(ls === "")) { */ case 38: /* */ if (msg === "") { $s = 41; continue; } /* */ $s = 42; continue; /* if (msg === "") { */ case 41: _r$7 = fmt.Sprintf("unexpected %s", new sliceType$2([new $String(ls)])); /* */ $s = 44; case 44: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } msg = _r$7; $s = 43; continue; /* } else { */ case 42: _r$8 = fmt.Sprintf("unexpected %s, %s", new sliceType$2([new $String(ls), new $String(msg)])); /* */ $s = 45; case 45: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } msg = _r$8; /* } */ case 43: case 40: /* } */ case 39: /* } */ case 34: if (msg === "") { msg = "syntax error"; } $r = yylex.Error(msg); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } Nerrs = Nerrs + (1) >> 0; Errflag[0] = 3; /* while (true) { */ case 47: /* if (!(yyp >= 0)) { break; } */ if(!(yyp >= 0)) { $s = 48; continue; } row$1 = (x = ((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys, ((x < 0 || x >= yyParseTab.length) ? ($throwRuntimeError("index out of range"), undefined) : yyParseTab[x])); /* */ if (77 < row$1.$length) { $s = 49; continue; } /* */ $s = 50; continue; /* if (77 < row$1.$length) { */ case 49: yyn = (((77 >= row$1.$length ? ($throwRuntimeError("index out of range"), undefined) : row$1.$array[row$1.$offset + 77]) >> 0)) + -95 >> 0; /* */ if (yyn > 0) { $s = 51; continue; } /* */ $s = 52; continue; /* if (yyn > 0) { */ case 51: /* */ if (yyDebug >= 2) { $s = 53; continue; } /* */ $s = 54; continue; /* if (yyDebug >= 2) { */ case 53: _r$9 = fmt.Printf("error recovery found error shift in state %d\n", new sliceType$2([new $Int(((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys)])); /* */ $s = 55; case 55: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; /* } */ case 54: yystate = yyn; /* goto yystack */ $s = 1; continue; /* } */ case 52: /* } */ case 50: /* */ if (yyDebug >= 2) { $s = 56; continue; } /* */ $s = 57; continue; /* if (yyDebug >= 2) { */ case 56: _r$10 = fmt.Printf("error recovery pops state %d\n", new sliceType$2([new $Int(((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys)])); /* */ $s = 58; case 58: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$10; /* } */ case 57: yyp = yyp - (1) >> 0; /* } */ $s = 47; continue; case 48: /* */ if (yyDebug >= 2) { $s = 59; continue; } /* */ $s = 60; continue; /* if (yyDebug >= 2) { */ case 59: _r$11 = fmt.Printf("error recovery failed\n", new sliceType$2([])); /* */ $s = 61; case 61: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _r$11; /* } */ case 60: /* goto ret1 */ $s = 3; continue; $s = 28; continue; /* } else if ((_1 === (1)) || (_1 === (2))) { */ case 26: Errflag[0] = 3; /* while (true) { */ case 62: /* if (!(yyp >= 0)) { break; } */ if(!(yyp >= 0)) { $s = 63; continue; } row$1 = (x$1 = ((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys, ((x$1 < 0 || x$1 >= yyParseTab.length) ? ($throwRuntimeError("index out of range"), undefined) : yyParseTab[x$1])); /* */ if (77 < row$1.$length) { $s = 64; continue; } /* */ $s = 65; continue; /* if (77 < row$1.$length) { */ case 64: yyn = (((77 >= row$1.$length ? ($throwRuntimeError("index out of range"), undefined) : row$1.$array[row$1.$offset + 77]) >> 0)) + -95 >> 0; /* */ if (yyn > 0) { $s = 66; continue; } /* */ $s = 67; continue; /* if (yyn > 0) { */ case 66: /* */ if (yyDebug >= 2) { $s = 68; continue; } /* */ $s = 69; continue; /* if (yyDebug >= 2) { */ case 68: _r$12 = fmt.Printf("error recovery found error shift in state %d\n", new sliceType$2([new $Int(((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys)])); /* */ $s = 70; case 70: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _r$12; /* } */ case 69: yystate = yyn; /* goto yystack */ $s = 1; continue; /* } */ case 67: /* } */ case 65: /* */ if (yyDebug >= 2) { $s = 71; continue; } /* */ $s = 72; continue; /* if (yyDebug >= 2) { */ case 71: _r$13 = fmt.Printf("error recovery pops state %d\n", new sliceType$2([new $Int(((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys)])); /* */ $s = 73; case 73: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _r$13; /* } */ case 72: yyp = yyp - (1) >> 0; /* } */ $s = 62; continue; case 63: /* */ if (yyDebug >= 2) { $s = 74; continue; } /* */ $s = 75; continue; /* if (yyDebug >= 2) { */ case 74: _r$14 = fmt.Printf("error recovery failed\n", new sliceType$2([])); /* */ $s = 76; case 76: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _r$14; /* } */ case 75: /* goto ret1 */ $s = 3; continue; $s = 28; continue; /* } else if (_1 === (3)) { */ case 27: /* */ if (yyDebug >= 2) { $s = 77; continue; } /* */ $s = 78; continue; /* if (yyDebug >= 2) { */ case 77: _r$15 = yySymName(yychar); /* */ $s = 79; case 79: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$2 = new $String(_r$15); _r$16 = fmt.Printf("error recovery discards %s\n", new sliceType$2([_arg$2])); /* */ $s = 80; case 80: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _r$16; /* } */ case 78: /* */ if (yychar === 57344) { $s = 81; continue; } /* */ $s = 82; continue; /* if (yychar === 57344) { */ case 81: /* goto ret1 */ $s = 3; continue; /* } */ case 82: yychar = -1; /* goto yynewstate */ $s = 4; continue; /* } */ case 28: case 24: /* } */ case 23: r = -yyn; x0 = $clone((_entry$6 = yyReductions[$Int.keyFor(r)], _entry$6 !== undefined ? _entry$6.v : new structType.ptr(0, 0)), structType); _tmp = x0.xsym; _tmp$1 = x0.components; x$2 = _tmp; n = _tmp$1; yypt = yyp; $unused(yypt); yyp = yyp - (n) >> 0; if ((yyp + 1 >> 0) >= yyS.$length) { nyys$1 = $makeSlice(sliceType$8, ($imul(yyS.$length, 2))); $copySlice(nyys$1, yyS); yyS = nyys$1; } yySymType.copy(yyVAL[0], (x$3 = yyp + 1 >> 0, ((x$3 < 0 || x$3 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$3]))); exState = yystate; yystate = (((x$4 = (x$5 = ((yyp < 0 || yyp >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + yyp]).yys, ((x$5 < 0 || x$5 >= yyParseTab.length) ? ($throwRuntimeError("index out of range"), undefined) : yyParseTab[x$5])), ((x$2 < 0 || x$2 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$2])) >> 0)) + -95 >> 0; /* */ if (yyDebug >= 2) { $s = 83; continue; } /* */ $s = 84; continue; /* if (yyDebug >= 2) { */ case 83: _r$17 = fmt.Printf("reduce using rule %v (%s), and goto state %d\n", new sliceType$2([new $Int(r), new $String(((x$2 < 0 || x$2 >= yySymNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : yySymNames.$array[yySymNames.$offset + x$2])), new $Int(yystate)])); /* */ $s = 85; case 85: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } _r$17; /* } */ case 84: _2 = r; /* */ if (_2 === (1)) { $s = 87; continue; } /* */ if (_2 === (2)) { $s = 88; continue; } /* */ if (_2 === (3)) { $s = 89; continue; } /* */ if (_2 === (4)) { $s = 90; continue; } /* */ if (_2 === (5)) { $s = 91; continue; } /* */ if (_2 === (6)) { $s = 92; continue; } /* */ if (_2 === (7)) { $s = 93; continue; } /* */ if (_2 === (8)) { $s = 94; continue; } /* */ if (_2 === (9)) { $s = 95; continue; } /* */ if (_2 === (10)) { $s = 96; continue; } /* */ if (_2 === (11)) { $s = 97; continue; } /* */ if (_2 === (12)) { $s = 98; continue; } /* */ if (_2 === (13)) { $s = 99; continue; } /* */ if (_2 === (14)) { $s = 100; continue; } /* */ if (_2 === (15)) { $s = 101; continue; } /* */ if (_2 === (16)) { $s = 102; continue; } /* */ if (_2 === (17)) { $s = 103; continue; } /* */ if (_2 === (18)) { $s = 104; continue; } /* */ if (_2 === (19)) { $s = 105; continue; } /* */ if (_2 === (20)) { $s = 106; continue; } /* */ if (_2 === (21)) { $s = 107; continue; } /* */ if (_2 === (22)) { $s = 108; continue; } /* */ if (_2 === (23)) { $s = 109; continue; } /* */ if (_2 === (24)) { $s = 110; continue; } /* */ if (_2 === (25)) { $s = 111; continue; } /* */ if (_2 === (26)) { $s = 112; continue; } /* */ if (_2 === (27)) { $s = 113; continue; } /* */ if (_2 === (28)) { $s = 114; continue; } /* */ if (_2 === (29)) { $s = 115; continue; } /* */ if (_2 === (30)) { $s = 116; continue; } /* */ if (_2 === (31)) { $s = 117; continue; } /* */ if (_2 === (32)) { $s = 118; continue; } /* */ if (_2 === (33)) { $s = 119; continue; } /* */ if (_2 === (34)) { $s = 120; continue; } /* */ if (_2 === (35)) { $s = 121; continue; } /* */ if (_2 === (36)) { $s = 122; continue; } /* */ if (_2 === (37)) { $s = 123; continue; } /* */ if (_2 === (38)) { $s = 124; continue; } /* */ if (_2 === (39)) { $s = 125; continue; } /* */ if (_2 === (40)) { $s = 126; continue; } /* */ if (_2 === (41)) { $s = 127; continue; } /* */ if (_2 === (42)) { $s = 128; continue; } /* */ if (_2 === (43)) { $s = 129; continue; } /* */ if (_2 === (44)) { $s = 130; continue; } /* */ if (_2 === (45)) { $s = 131; continue; } /* */ if (_2 === (46)) { $s = 132; continue; } /* */ if (_2 === (47)) { $s = 133; continue; } /* */ if (_2 === (48)) { $s = 134; continue; } /* */ if (_2 === (49)) { $s = 135; continue; } /* */ if (_2 === (50)) { $s = 136; continue; } /* */ if (_2 === (51)) { $s = 137; continue; } /* */ if (_2 === (52)) { $s = 138; continue; } /* */ if (_2 === (53)) { $s = 139; continue; } /* */ if (_2 === (54)) { $s = 140; continue; } /* */ if (_2 === (55)) { $s = 141; continue; } /* */ if (_2 === (56)) { $s = 142; continue; } /* */ if (_2 === (57)) { $s = 143; continue; } /* */ if (_2 === (58)) { $s = 144; continue; } /* */ if (_2 === (59)) { $s = 145; continue; } /* */ if (_2 === (60)) { $s = 146; continue; } /* */ if (_2 === (61)) { $s = 147; continue; } /* */ if (_2 === (62)) { $s = 148; continue; } /* */ if (_2 === (63)) { $s = 149; continue; } /* */ if (_2 === (64)) { $s = 150; continue; } /* */ if (_2 === (65)) { $s = 151; continue; } /* */ if (_2 === (66)) { $s = 152; continue; } /* */ if (_2 === (67)) { $s = 153; continue; } /* */ if (_2 === (68)) { $s = 154; continue; } /* */ if (_2 === (69)) { $s = 155; continue; } /* */ if (_2 === (70)) { $s = 156; continue; } /* */ if (_2 === (71)) { $s = 157; continue; } /* */ if (_2 === (72)) { $s = 158; continue; } /* */ if (_2 === (73)) { $s = 159; continue; } /* */ if (_2 === (74)) { $s = 160; continue; } /* */ if (_2 === (75)) { $s = 161; continue; } /* */ if (_2 === (76)) { $s = 162; continue; } /* */ if (_2 === (77)) { $s = 163; continue; } /* */ if (_2 === (78)) { $s = 164; continue; } /* */ if (_2 === (79)) { $s = 165; continue; } /* */ if (_2 === (80)) { $s = 166; continue; } /* */ if (_2 === (81)) { $s = 167; continue; } /* */ if (_2 === (82)) { $s = 168; continue; } /* */ if (_2 === (83)) { $s = 169; continue; } /* */ if (_2 === (84)) { $s = 170; continue; } /* */ if (_2 === (85)) { $s = 171; continue; } /* */ if (_2 === (86)) { $s = 172; continue; } /* */ if (_2 === (87)) { $s = 173; continue; } /* */ if (_2 === (88)) { $s = 174; continue; } /* */ if (_2 === (89)) { $s = 175; continue; } /* */ if (_2 === (90)) { $s = 176; continue; } /* */ if (_2 === (91)) { $s = 177; continue; } /* */ if (_2 === (92)) { $s = 178; continue; } /* */ if (_2 === (93)) { $s = 179; continue; } /* */ if (_2 === (94)) { $s = 180; continue; } /* */ $s = 181; continue; /* if (_2 === (1)) { */ case 87: yyVAL[0].stmts = (x$6 = yypt - 0 >> 0, ((x$6 < 0 || x$6 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$6])).stmts; _tuple$6 = $assertType(yylex, ptrType$5, true); l = _tuple$6[0]; ok$2 = _tuple$6[1]; if (ok$2) { l.Stmts = yyVAL[0].stmts; } $s = 181; continue; /* } else if (_2 === (2)) { */ case 88: yyVAL[0].stmts = $append((x$8 = yypt - 1 >> 0, ((x$8 < 0 || x$8 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$8])).stmts, (x$7 = yypt - 0 >> 0, ((x$7 < 0 || x$7 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$7])).stmt); _tuple$7 = $assertType(yylex, ptrType$5, true); l$1 = _tuple$7[0]; ok$3 = _tuple$7[1]; if (ok$3) { l$1.Stmts = yyVAL[0].stmts; } $s = 181; continue; /* } else if (_2 === (3)) { */ case 89: yyVAL[0].stmts = $append((x$10 = yypt - 2 >> 0, ((x$10 < 0 || x$10 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$10])).stmts, (x$9 = yypt - 1 >> 0, ((x$9 < 0 || x$9 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$9])).stmt); _tuple$8 = $assertType(yylex, ptrType$5, true); l$2 = _tuple$8[0]; ok$4 = _tuple$8[1]; if (ok$4) { l$2.Stmts = yyVAL[0].stmts; } $s = 181; continue; /* } else if (_2 === (4)) { */ case 90: yyVAL[0].stmts = new sliceType$4([]); $s = 181; continue; /* } else if (_2 === (5)) { */ case 91: yyVAL[0].stmts = $append((x$12 = yypt - 1 >> 0, ((x$12 < 0 || x$12 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$12])).stmts, (x$11 = yypt - 0 >> 0, ((x$11 < 0 || x$11 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$11])).stmt); $s = 181; continue; /* } else if (_2 === (6)) { */ case 92: yyVAL[0].stmts = (x$13 = yypt - 1 >> 0, ((x$13 < 0 || x$13 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$13])).stmts; $s = 181; continue; /* } else if (_2 === (7)) { */ case 93: yyVAL[0].stmts = (x$14 = yypt - 0 >> 0, ((x$14 < 0 || x$14 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$14])).stmts; $s = 181; continue; /* } else if (_2 === (8)) { */ case 94: yyVAL[0].stmt = new ast.AssignStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$15 = yypt - 2 >> 0, ((x$15 < 0 || x$15 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$15])).exprlist, (x$16 = yypt - 0 >> 0, ((x$16 < 0 || x$16 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$16])).exprlist); _r$18 = (x$17 = (x$18 = yypt - 2 >> 0, ((x$18 < 0 || x$18 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$18])).exprlist, (0 >= x$17.$length ? ($throwRuntimeError("index out of range"), undefined) : x$17.$array[x$17.$offset + 0])).Line(); /* */ $s = 182; case 182: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLine(_r$18); /* */ $s = 183; case 183: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (9)) { */ case 95: _tuple$9 = $assertType((x$19 = yypt - 0 >> 0, ((x$19 < 0 || x$19 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$19])).expr, ptrType$6, true); ok$5 = _tuple$9[1]; /* */ if (!ok$5) { $s = 184; continue; } /* */ $s = 185; continue; /* if (!ok$5) { */ case 184: $assertType(yylex, ptrType$5).Error("parse error"); $s = 186; continue; /* } else { */ case 185: yyVAL[0].stmt = new ast.FuncCallStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$20 = yypt - 0 >> 0, ((x$20 < 0 || x$20 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$20])).expr); _r$19 = (x$21 = yypt - 0 >> 0, ((x$21 < 0 || x$21 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$21])).expr.Line(); /* */ $s = 187; case 187: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLine(_r$19); /* */ $s = 188; case 188: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 186: $s = 181; continue; /* } else if (_2 === (10)) { */ case 96: yyVAL[0].stmt = new ast.DoBlockStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$22 = yypt - 1 >> 0, ((x$22 < 0 || x$22 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$22])).stmts); $r = yyVAL[0].stmt.SetLine((x$23 = yypt - 2 >> 0, ((x$23 < 0 || x$23 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$23])).token.Pos.Line); /* */ $s = 189; case 189: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$24 = yypt - 0 >> 0, ((x$24 < 0 || x$24 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$24])).token.Pos.Line); /* */ $s = 190; case 190: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (11)) { */ case 97: yyVAL[0].stmt = new ast.WhileStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$25 = yypt - 3 >> 0, ((x$25 < 0 || x$25 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$25])).expr, (x$26 = yypt - 1 >> 0, ((x$26 < 0 || x$26 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$26])).stmts); $r = yyVAL[0].stmt.SetLine((x$27 = yypt - 4 >> 0, ((x$27 < 0 || x$27 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$27])).token.Pos.Line); /* */ $s = 191; case 191: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$28 = yypt - 0 >> 0, ((x$28 < 0 || x$28 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$28])).token.Pos.Line); /* */ $s = 192; case 192: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (12)) { */ case 98: yyVAL[0].stmt = new ast.RepeatStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$29 = yypt - 0 >> 0, ((x$29 < 0 || x$29 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$29])).expr, (x$30 = yypt - 2 >> 0, ((x$30 < 0 || x$30 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$30])).stmts); $r = yyVAL[0].stmt.SetLine((x$31 = yypt - 3 >> 0, ((x$31 < 0 || x$31 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$31])).token.Pos.Line); /* */ $s = 193; case 193: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$20 = (x$32 = yypt - 0 >> 0, ((x$32 < 0 || x$32 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$32])).expr.Line(); /* */ $s = 194; case 194: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine(_r$20); /* */ $s = 195; case 195: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (13)) { */ case 99: yyVAL[0].stmt = new ast.IfStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$33 = yypt - 4 >> 0, ((x$33 < 0 || x$33 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$33])).expr, (x$34 = yypt - 2 >> 0, ((x$34 < 0 || x$34 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$34])).stmts, sliceType$4.nil); cur = yyVAL[0].stmt; _ref$1 = (x$35 = yypt - 1 >> 0, ((x$35 < 0 || x$35 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$35])).stmts; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } elseif = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $assertType(cur, ptrType$7).Else = new sliceType$4([elseif]); cur = elseif; _i$1++; } $r = yyVAL[0].stmt.SetLine((x$36 = yypt - 5 >> 0, ((x$36 < 0 || x$36 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$36])).token.Pos.Line); /* */ $s = 196; case 196: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$37 = yypt - 0 >> 0, ((x$37 < 0 || x$37 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$37])).token.Pos.Line); /* */ $s = 197; case 197: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (14)) { */ case 100: yyVAL[0].stmt = new ast.IfStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$38 = yypt - 6 >> 0, ((x$38 < 0 || x$38 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$38])).expr, (x$39 = yypt - 4 >> 0, ((x$39 < 0 || x$39 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$39])).stmts, sliceType$4.nil); cur$1 = yyVAL[0].stmt; _ref$2 = (x$40 = yypt - 3 >> 0, ((x$40 < 0 || x$40 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$40])).stmts; _i$2 = 0; while (true) { if (!(_i$2 < _ref$2.$length)) { break; } elseif$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); $assertType(cur$1, ptrType$7).Else = new sliceType$4([elseif$1]); cur$1 = elseif$1; _i$2++; } $assertType(cur$1, ptrType$7).Else = (x$41 = yypt - 1 >> 0, ((x$41 < 0 || x$41 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$41])).stmts; $r = yyVAL[0].stmt.SetLine((x$42 = yypt - 7 >> 0, ((x$42 < 0 || x$42 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$42])).token.Pos.Line); /* */ $s = 198; case 198: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$43 = yypt - 0 >> 0, ((x$43 < 0 || x$43 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$43])).token.Pos.Line); /* */ $s = 199; case 199: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (15)) { */ case 101: yyVAL[0].stmt = new ast.NumberForStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$44 = yypt - 7 >> 0, ((x$44 < 0 || x$44 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$44])).token.Str, (x$45 = yypt - 5 >> 0, ((x$45 < 0 || x$45 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$45])).expr, (x$46 = yypt - 3 >> 0, ((x$46 < 0 || x$46 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$46])).expr, $ifaceNil, (x$47 = yypt - 1 >> 0, ((x$47 < 0 || x$47 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$47])).stmts); $r = yyVAL[0].stmt.SetLine((x$48 = yypt - 8 >> 0, ((x$48 < 0 || x$48 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$48])).token.Pos.Line); /* */ $s = 200; case 200: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$49 = yypt - 0 >> 0, ((x$49 < 0 || x$49 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$49])).token.Pos.Line); /* */ $s = 201; case 201: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (16)) { */ case 102: yyVAL[0].stmt = new ast.NumberForStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$50 = yypt - 9 >> 0, ((x$50 < 0 || x$50 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$50])).token.Str, (x$51 = yypt - 7 >> 0, ((x$51 < 0 || x$51 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$51])).expr, (x$52 = yypt - 5 >> 0, ((x$52 < 0 || x$52 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$52])).expr, (x$53 = yypt - 3 >> 0, ((x$53 < 0 || x$53 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$53])).expr, (x$54 = yypt - 1 >> 0, ((x$54 < 0 || x$54 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$54])).stmts); $r = yyVAL[0].stmt.SetLine((x$55 = yypt - 10 >> 0, ((x$55 < 0 || x$55 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$55])).token.Pos.Line); /* */ $s = 202; case 202: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$56 = yypt - 0 >> 0, ((x$56 < 0 || x$56 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$56])).token.Pos.Line); /* */ $s = 203; case 203: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (17)) { */ case 103: yyVAL[0].stmt = new ast.GenericForStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$57 = yypt - 5 >> 0, ((x$57 < 0 || x$57 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$57])).namelist, (x$58 = yypt - 3 >> 0, ((x$58 < 0 || x$58 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$58])).exprlist, (x$59 = yypt - 1 >> 0, ((x$59 < 0 || x$59 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$59])).stmts); $r = yyVAL[0].stmt.SetLine((x$60 = yypt - 6 >> 0, ((x$60 < 0 || x$60 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$60])).token.Pos.Line); /* */ $s = 204; case 204: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$61 = yypt - 0 >> 0, ((x$61 < 0 || x$61 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$61])).token.Pos.Line); /* */ $s = 205; case 205: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (18)) { */ case 104: yyVAL[0].stmt = new ast.FuncDefStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$62 = yypt - 1 >> 0, ((x$62 < 0 || x$62 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$62])).funcname, (x$63 = yypt - 0 >> 0, ((x$63 < 0 || x$63 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$63])).funcexpr); $r = yyVAL[0].stmt.SetLine((x$64 = yypt - 2 >> 0, ((x$64 < 0 || x$64 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$64])).token.Pos.Line); /* */ $s = 206; case 206: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$65 = yypt - 0 >> 0, ((x$65 < 0 || x$65 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$65])).funcexpr.ExprBase.Node.LastLine()); /* */ $s = 207; case 207: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (19)) { */ case 105: yyVAL[0].stmt = new ast.LocalAssignStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), new sliceType([(x$66 = yypt - 1 >> 0, ((x$66 < 0 || x$66 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$66])).token.Str]), new sliceType$6([(x$67 = yypt - 0 >> 0, ((x$67 < 0 || x$67 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$67])).funcexpr])); $r = yyVAL[0].stmt.SetLine((x$68 = yypt - 3 >> 0, ((x$68 < 0 || x$68 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$68])).token.Pos.Line); /* */ $s = 208; case 208: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].stmt.SetLastLine((x$69 = yypt - 0 >> 0, ((x$69 < 0 || x$69 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$69])).funcexpr.ExprBase.Node.LastLine()); /* */ $s = 209; case 209: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (20)) { */ case 106: yyVAL[0].stmt = new ast.LocalAssignStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$70 = yypt - 2 >> 0, ((x$70 < 0 || x$70 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$70])).namelist, (x$71 = yypt - 0 >> 0, ((x$71 < 0 || x$71 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$71])).exprlist); $r = yyVAL[0].stmt.SetLine((x$72 = yypt - 3 >> 0, ((x$72 < 0 || x$72 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$72])).token.Pos.Line); /* */ $s = 210; case 210: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (21)) { */ case 107: yyVAL[0].stmt = new ast.LocalAssignStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$73 = yypt - 0 >> 0, ((x$73 < 0 || x$73 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$73])).namelist, new sliceType$6([])); $r = yyVAL[0].stmt.SetLine((x$74 = yypt - 1 >> 0, ((x$74 < 0 || x$74 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$74])).token.Pos.Line); /* */ $s = 211; case 211: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (22)) { */ case 108: yyVAL[0].stmts = new sliceType$4([]); $s = 181; continue; /* } else if (_2 === (23)) { */ case 109: yyVAL[0].stmts = $append((x$77 = yypt - 4 >> 0, ((x$77 < 0 || x$77 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$77])).stmts, new ast.IfStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$75 = yypt - 2 >> 0, ((x$75 < 0 || x$75 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$75])).expr, (x$76 = yypt - 0 >> 0, ((x$76 < 0 || x$76 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$76])).stmts, sliceType$4.nil)); $r = (x$78 = yyVAL[0].stmts, x$79 = yyVAL[0].stmts.$length - 1 >> 0, ((x$79 < 0 || x$79 >= x$78.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$78.$array[x$78.$offset + x$79])).SetLine((x$80 = yypt - 3 >> 0, ((x$80 < 0 || x$80 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$80])).token.Pos.Line); /* */ $s = 212; case 212: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (24)) { */ case 110: yyVAL[0].stmt = new ast.ReturnStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), sliceType$6.nil); $r = yyVAL[0].stmt.SetLine((x$81 = yypt - 0 >> 0, ((x$81 < 0 || x$81 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$81])).token.Pos.Line); /* */ $s = 213; case 213: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (25)) { */ case 111: yyVAL[0].stmt = new ast.ReturnStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), (x$82 = yypt - 0 >> 0, ((x$82 < 0 || x$82 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$82])).exprlist); $r = yyVAL[0].stmt.SetLine((x$83 = yypt - 1 >> 0, ((x$83 < 0 || x$83 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$83])).token.Pos.Line); /* */ $s = 214; case 214: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (26)) { */ case 112: yyVAL[0].stmt = new ast.BreakStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0))); $r = yyVAL[0].stmt.SetLine((x$84 = yypt - 0 >> 0, ((x$84 < 0 || x$84 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$84])).token.Pos.Line); /* */ $s = 215; case 215: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (27)) { */ case 113: yyVAL[0].funcname = (x$85 = yypt - 0 >> 0, ((x$85 < 0 || x$85 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$85])).funcname; $s = 181; continue; /* } else if (_2 === (28)) { */ case 114: yyVAL[0].funcname = new ast.FuncName.ptr($ifaceNil, (x$86 = yypt - 2 >> 0, ((x$86 < 0 || x$86 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$86])).funcname.Func, (x$87 = yypt - 0 >> 0, ((x$87 < 0 || x$87 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$87])).token.Str); $s = 181; continue; /* } else if (_2 === (29)) { */ case 115: yyVAL[0].funcname = new ast.FuncName.ptr(new ast.IdentExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$88 = yypt - 0 >> 0, ((x$88 < 0 || x$88 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$88])).token.Str), $ifaceNil, ""); $r = yyVAL[0].funcname.Func.SetLine((x$89 = yypt - 0 >> 0, ((x$89 < 0 || x$89 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$89])).token.Pos.Line); /* */ $s = 216; case 216: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (30)) { */ case 116: key = new ast.StringExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))), (x$90 = yypt - 0 >> 0, ((x$90 < 0 || x$90 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$90])).token.Str); key.ConstExprBase.ExprBase.Node.SetLine((x$91 = yypt - 0 >> 0, ((x$91 < 0 || x$91 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$91])).token.Pos.Line); fn = new ast.AttrGetExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$92 = yypt - 2 >> 0, ((x$92 < 0 || x$92 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$92])).funcname.Func, key); fn.ExprBase.Node.SetLine((x$93 = yypt - 0 >> 0, ((x$93 < 0 || x$93 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$93])).token.Pos.Line); yyVAL[0].funcname = new ast.FuncName.ptr(fn, $ifaceNil, ""); $s = 181; continue; /* } else if (_2 === (31)) { */ case 117: yyVAL[0].exprlist = new sliceType$6([(x$94 = yypt - 0 >> 0, ((x$94 < 0 || x$94 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$94])).expr]); $s = 181; continue; /* } else if (_2 === (32)) { */ case 118: yyVAL[0].exprlist = $append((x$96 = yypt - 2 >> 0, ((x$96 < 0 || x$96 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$96])).exprlist, (x$95 = yypt - 0 >> 0, ((x$95 < 0 || x$95 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$95])).expr); $s = 181; continue; /* } else if (_2 === (33)) { */ case 119: yyVAL[0].expr = new ast.IdentExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$97 = yypt - 0 >> 0, ((x$97 < 0 || x$97 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$97])).token.Str); $r = yyVAL[0].expr.SetLine((x$98 = yypt - 0 >> 0, ((x$98 < 0 || x$98 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$98])).token.Pos.Line); /* */ $s = 217; case 217: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (34)) { */ case 120: yyVAL[0].expr = new ast.AttrGetExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$99 = yypt - 3 >> 0, ((x$99 < 0 || x$99 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$99])).expr, (x$100 = yypt - 1 >> 0, ((x$100 < 0 || x$100 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$100])).expr); _r$21 = (x$101 = yypt - 3 >> 0, ((x$101 < 0 || x$101 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$101])).expr.Line(); /* */ $s = 218; case 218: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$21); /* */ $s = 219; case 219: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (35)) { */ case 121: key$1 = new ast.StringExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))), (x$102 = yypt - 0 >> 0, ((x$102 < 0 || x$102 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$102])).token.Str); key$1.ConstExprBase.ExprBase.Node.SetLine((x$103 = yypt - 0 >> 0, ((x$103 < 0 || x$103 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$103])).token.Pos.Line); yyVAL[0].expr = new ast.AttrGetExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$104 = yypt - 2 >> 0, ((x$104 < 0 || x$104 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$104])).expr, key$1); _r$22 = (x$105 = yypt - 2 >> 0, ((x$105 < 0 || x$105 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$105])).expr.Line(); /* */ $s = 220; case 220: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$22); /* */ $s = 221; case 221: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (36)) { */ case 122: yyVAL[0].namelist = new sliceType([(x$106 = yypt - 0 >> 0, ((x$106 < 0 || x$106 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$106])).token.Str]); $s = 181; continue; /* } else if (_2 === (37)) { */ case 123: yyVAL[0].namelist = $append((x$108 = yypt - 2 >> 0, ((x$108 < 0 || x$108 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$108])).namelist, (x$107 = yypt - 0 >> 0, ((x$107 < 0 || x$107 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$107])).token.Str); $s = 181; continue; /* } else if (_2 === (38)) { */ case 124: yyVAL[0].exprlist = new sliceType$6([(x$109 = yypt - 0 >> 0, ((x$109 < 0 || x$109 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$109])).expr]); $s = 181; continue; /* } else if (_2 === (39)) { */ case 125: yyVAL[0].exprlist = $append((x$111 = yypt - 2 >> 0, ((x$111 < 0 || x$111 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$111])).exprlist, (x$110 = yypt - 0 >> 0, ((x$110 < 0 || x$110 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$110])).expr); $s = 181; continue; /* } else if (_2 === (40)) { */ case 126: yyVAL[0].expr = new ast.NilExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)))); $r = yyVAL[0].expr.SetLine((x$112 = yypt - 0 >> 0, ((x$112 < 0 || x$112 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$112])).token.Pos.Line); /* */ $s = 222; case 222: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (41)) { */ case 127: yyVAL[0].expr = new ast.FalseExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)))); $r = yyVAL[0].expr.SetLine((x$113 = yypt - 0 >> 0, ((x$113 < 0 || x$113 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$113])).token.Pos.Line); /* */ $s = 223; case 223: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (42)) { */ case 128: yyVAL[0].expr = new ast.TrueExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)))); $r = yyVAL[0].expr.SetLine((x$114 = yypt - 0 >> 0, ((x$114 < 0 || x$114 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$114])).token.Pos.Line); /* */ $s = 224; case 224: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (43)) { */ case 129: yyVAL[0].expr = new ast.NumberExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))), (x$115 = yypt - 0 >> 0, ((x$115 < 0 || x$115 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$115])).token.Str); $r = yyVAL[0].expr.SetLine((x$116 = yypt - 0 >> 0, ((x$116 < 0 || x$116 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$116])).token.Pos.Line); /* */ $s = 225; case 225: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (44)) { */ case 130: yyVAL[0].expr = new ast.Comma3Expr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))); $r = yyVAL[0].expr.SetLine((x$117 = yypt - 0 >> 0, ((x$117 < 0 || x$117 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$117])).token.Pos.Line); /* */ $s = 226; case 226: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (45)) { */ case 131: yyVAL[0].expr = (x$118 = yypt - 0 >> 0, ((x$118 < 0 || x$118 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$118])).expr; $s = 181; continue; /* } else if (_2 === (46)) { */ case 132: yyVAL[0].expr = (x$119 = yypt - 0 >> 0, ((x$119 < 0 || x$119 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$119])).expr; $s = 181; continue; /* } else if (_2 === (47)) { */ case 133: yyVAL[0].expr = (x$120 = yypt - 0 >> 0, ((x$120 < 0 || x$120 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$120])).expr; $s = 181; continue; /* } else if (_2 === (48)) { */ case 134: yyVAL[0].expr = (x$121 = yypt - 0 >> 0, ((x$121 < 0 || x$121 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$121])).expr; $s = 181; continue; /* } else if (_2 === (49)) { */ case 135: yyVAL[0].expr = new ast.LogicalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "or", (x$122 = yypt - 2 >> 0, ((x$122 < 0 || x$122 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$122])).expr, (x$123 = yypt - 0 >> 0, ((x$123 < 0 || x$123 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$123])).expr); _r$23 = (x$124 = yypt - 2 >> 0, ((x$124 < 0 || x$124 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$124])).expr.Line(); /* */ $s = 227; case 227: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$23); /* */ $s = 228; case 228: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (50)) { */ case 136: yyVAL[0].expr = new ast.LogicalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "and", (x$125 = yypt - 2 >> 0, ((x$125 < 0 || x$125 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$125])).expr, (x$126 = yypt - 0 >> 0, ((x$126 < 0 || x$126 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$126])).expr); _r$24 = (x$127 = yypt - 2 >> 0, ((x$127 < 0 || x$127 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$127])).expr.Line(); /* */ $s = 229; case 229: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$24); /* */ $s = 230; case 230: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (51)) { */ case 137: yyVAL[0].expr = new ast.RelationalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), ">", (x$128 = yypt - 2 >> 0, ((x$128 < 0 || x$128 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$128])).expr, (x$129 = yypt - 0 >> 0, ((x$129 < 0 || x$129 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$129])).expr); _r$25 = (x$130 = yypt - 2 >> 0, ((x$130 < 0 || x$130 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$130])).expr.Line(); /* */ $s = 231; case 231: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$25); /* */ $s = 232; case 232: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (52)) { */ case 138: yyVAL[0].expr = new ast.RelationalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "<", (x$131 = yypt - 2 >> 0, ((x$131 < 0 || x$131 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$131])).expr, (x$132 = yypt - 0 >> 0, ((x$132 < 0 || x$132 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$132])).expr); _r$26 = (x$133 = yypt - 2 >> 0, ((x$133 < 0 || x$133 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$133])).expr.Line(); /* */ $s = 233; case 233: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$26); /* */ $s = 234; case 234: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (53)) { */ case 139: yyVAL[0].expr = new ast.RelationalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), ">=", (x$134 = yypt - 2 >> 0, ((x$134 < 0 || x$134 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$134])).expr, (x$135 = yypt - 0 >> 0, ((x$135 < 0 || x$135 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$135])).expr); _r$27 = (x$136 = yypt - 2 >> 0, ((x$136 < 0 || x$136 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$136])).expr.Line(); /* */ $s = 235; case 235: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$27); /* */ $s = 236; case 236: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (54)) { */ case 140: yyVAL[0].expr = new ast.RelationalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "<=", (x$137 = yypt - 2 >> 0, ((x$137 < 0 || x$137 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$137])).expr, (x$138 = yypt - 0 >> 0, ((x$138 < 0 || x$138 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$138])).expr); _r$28 = (x$139 = yypt - 2 >> 0, ((x$139 < 0 || x$139 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$139])).expr.Line(); /* */ $s = 237; case 237: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$28); /* */ $s = 238; case 238: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (55)) { */ case 141: yyVAL[0].expr = new ast.RelationalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "==", (x$140 = yypt - 2 >> 0, ((x$140 < 0 || x$140 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$140])).expr, (x$141 = yypt - 0 >> 0, ((x$141 < 0 || x$141 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$141])).expr); _r$29 = (x$142 = yypt - 2 >> 0, ((x$142 < 0 || x$142 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$142])).expr.Line(); /* */ $s = 239; case 239: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$29); /* */ $s = 240; case 240: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (56)) { */ case 142: yyVAL[0].expr = new ast.RelationalOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "~=", (x$143 = yypt - 2 >> 0, ((x$143 < 0 || x$143 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$143])).expr, (x$144 = yypt - 0 >> 0, ((x$144 < 0 || x$144 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$144])).expr); _r$30 = (x$145 = yypt - 2 >> 0, ((x$145 < 0 || x$145 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$145])).expr.Line(); /* */ $s = 241; case 241: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$30); /* */ $s = 242; case 242: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (57)) { */ case 143: yyVAL[0].expr = new ast.StringConcatOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$146 = yypt - 2 >> 0, ((x$146 < 0 || x$146 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$146])).expr, (x$147 = yypt - 0 >> 0, ((x$147 < 0 || x$147 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$147])).expr); _r$31 = (x$148 = yypt - 2 >> 0, ((x$148 < 0 || x$148 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$148])).expr.Line(); /* */ $s = 243; case 243: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$31); /* */ $s = 244; case 244: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (58)) { */ case 144: yyVAL[0].expr = new ast.ArithmeticOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "+", (x$149 = yypt - 2 >> 0, ((x$149 < 0 || x$149 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$149])).expr, (x$150 = yypt - 0 >> 0, ((x$150 < 0 || x$150 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$150])).expr); _r$32 = (x$151 = yypt - 2 >> 0, ((x$151 < 0 || x$151 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$151])).expr.Line(); /* */ $s = 245; case 245: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$32); /* */ $s = 246; case 246: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (59)) { */ case 145: yyVAL[0].expr = new ast.ArithmeticOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "-", (x$152 = yypt - 2 >> 0, ((x$152 < 0 || x$152 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$152])).expr, (x$153 = yypt - 0 >> 0, ((x$153 < 0 || x$153 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$153])).expr); _r$33 = (x$154 = yypt - 2 >> 0, ((x$154 < 0 || x$154 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$154])).expr.Line(); /* */ $s = 247; case 247: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$33); /* */ $s = 248; case 248: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (60)) { */ case 146: yyVAL[0].expr = new ast.ArithmeticOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "*", (x$155 = yypt - 2 >> 0, ((x$155 < 0 || x$155 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$155])).expr, (x$156 = yypt - 0 >> 0, ((x$156 < 0 || x$156 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$156])).expr); _r$34 = (x$157 = yypt - 2 >> 0, ((x$157 < 0 || x$157 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$157])).expr.Line(); /* */ $s = 249; case 249: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$34); /* */ $s = 250; case 250: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (61)) { */ case 147: yyVAL[0].expr = new ast.ArithmeticOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "/", (x$158 = yypt - 2 >> 0, ((x$158 < 0 || x$158 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$158])).expr, (x$159 = yypt - 0 >> 0, ((x$159 < 0 || x$159 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$159])).expr); _r$35 = (x$160 = yypt - 2 >> 0, ((x$160 < 0 || x$160 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$160])).expr.Line(); /* */ $s = 251; case 251: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$35); /* */ $s = 252; case 252: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (62)) { */ case 148: yyVAL[0].expr = new ast.ArithmeticOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "%", (x$161 = yypt - 2 >> 0, ((x$161 < 0 || x$161 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$161])).expr, (x$162 = yypt - 0 >> 0, ((x$162 < 0 || x$162 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$162])).expr); _r$36 = (x$163 = yypt - 2 >> 0, ((x$163 < 0 || x$163 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$163])).expr.Line(); /* */ $s = 253; case 253: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$36); /* */ $s = 254; case 254: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (63)) { */ case 149: yyVAL[0].expr = new ast.ArithmeticOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), "^", (x$164 = yypt - 2 >> 0, ((x$164 < 0 || x$164 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$164])).expr, (x$165 = yypt - 0 >> 0, ((x$165 < 0 || x$165 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$165])).expr); _r$37 = (x$166 = yypt - 2 >> 0, ((x$166 < 0 || x$166 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$166])).expr.Line(); /* */ $s = 255; case 255: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$37); /* */ $s = 256; case 256: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (64)) { */ case 150: yyVAL[0].expr = new ast.UnaryMinusOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$167 = yypt - 0 >> 0, ((x$167 < 0 || x$167 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$167])).expr); _r$38 = (x$168 = yypt - 0 >> 0, ((x$168 < 0 || x$168 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$168])).expr.Line(); /* */ $s = 257; case 257: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$38); /* */ $s = 258; case 258: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (65)) { */ case 151: yyVAL[0].expr = new ast.UnaryNotOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$169 = yypt - 0 >> 0, ((x$169 < 0 || x$169 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$169])).expr); _r$39 = (x$170 = yypt - 0 >> 0, ((x$170 < 0 || x$170 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$170])).expr.Line(); /* */ $s = 259; case 259: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$39); /* */ $s = 260; case 260: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (66)) { */ case 152: yyVAL[0].expr = new ast.UnaryLenOpExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$171 = yypt - 0 >> 0, ((x$171 < 0 || x$171 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$171])).expr); _r$40 = (x$172 = yypt - 0 >> 0, ((x$172 < 0 || x$172 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$172])).expr.Line(); /* */ $s = 261; case 261: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$40); /* */ $s = 262; case 262: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (67)) { */ case 153: yyVAL[0].expr = new ast.StringExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))), (x$173 = yypt - 0 >> 0, ((x$173 < 0 || x$173 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$173])).token.Str); $r = yyVAL[0].expr.SetLine((x$174 = yypt - 0 >> 0, ((x$174 < 0 || x$174 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$174])).token.Pos.Line); /* */ $s = 263; case 263: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (68)) { */ case 154: yyVAL[0].expr = (x$175 = yypt - 0 >> 0, ((x$175 < 0 || x$175 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$175])).expr; $s = 181; continue; /* } else if (_2 === (69)) { */ case 155: yyVAL[0].expr = (x$176 = yypt - 0 >> 0, ((x$176 < 0 || x$176 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$176])).expr; $s = 181; continue; /* } else if (_2 === (70)) { */ case 156: yyVAL[0].expr = (x$177 = yypt - 0 >> 0, ((x$177 < 0 || x$177 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$177])).expr; $s = 181; continue; /* } else if (_2 === (71)) { */ case 157: yyVAL[0].expr = (x$178 = yypt - 1 >> 0, ((x$178 < 0 || x$178 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$178])).expr; $r = yyVAL[0].expr.SetLine((x$179 = yypt - 2 >> 0, ((x$179 < 0 || x$179 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$179])).token.Pos.Line); /* */ $s = 264; case 264: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (72)) { */ case 158: $assertType((x$180 = yypt - 1 >> 0, ((x$180 < 0 || x$180 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$180])).expr, ptrType$6).AdjustRet = true; yyVAL[0].expr = (x$181 = yypt - 1 >> 0, ((x$181 < 0 || x$181 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$181])).expr; $s = 181; continue; /* } else if (_2 === (73)) { */ case 159: yyVAL[0].expr = new ast.FuncCallExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$182 = yypt - 1 >> 0, ((x$182 < 0 || x$182 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$182])).expr, $ifaceNil, "", (x$183 = yypt - 0 >> 0, ((x$183 < 0 || x$183 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$183])).exprlist, false); _r$41 = (x$184 = yypt - 1 >> 0, ((x$184 < 0 || x$184 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$184])).expr.Line(); /* */ $s = 265; case 265: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$41); /* */ $s = 266; case 266: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (74)) { */ case 160: yyVAL[0].expr = new ast.FuncCallExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), $ifaceNil, (x$186 = yypt - 3 >> 0, ((x$186 < 0 || x$186 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$186])).expr, (x$185 = yypt - 1 >> 0, ((x$185 < 0 || x$185 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$185])).token.Str, (x$187 = yypt - 0 >> 0, ((x$187 < 0 || x$187 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$187])).exprlist, false); _r$42 = (x$188 = yypt - 3 >> 0, ((x$188 < 0 || x$188 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$188])).expr.Line(); /* */ $s = 267; case 267: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLine(_r$42); /* */ $s = 268; case 268: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (75)) { */ case 161: if ($assertType(yylex, ptrType$5).PNewLine) { $assertType(yylex, ptrType$5).TokenError($clone((x$189 = yypt - 1 >> 0, ((x$189 < 0 || x$189 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$189])).token, ast.Token), "ambiguous syntax (function call x new statement)"); } yyVAL[0].exprlist = new sliceType$6([]); $s = 181; continue; /* } else if (_2 === (76)) { */ case 162: if ($assertType(yylex, ptrType$5).PNewLine) { $assertType(yylex, ptrType$5).TokenError($clone((x$190 = yypt - 2 >> 0, ((x$190 < 0 || x$190 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$190])).token, ast.Token), "ambiguous syntax (function call x new statement)"); } yyVAL[0].exprlist = (x$191 = yypt - 1 >> 0, ((x$191 < 0 || x$191 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$191])).exprlist; $s = 181; continue; /* } else if (_2 === (77)) { */ case 163: yyVAL[0].exprlist = new sliceType$6([(x$192 = yypt - 0 >> 0, ((x$192 < 0 || x$192 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$192])).expr]); $s = 181; continue; /* } else if (_2 === (78)) { */ case 164: yyVAL[0].exprlist = new sliceType$6([(x$193 = yypt - 0 >> 0, ((x$193 < 0 || x$193 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$193])).expr]); $s = 181; continue; /* } else if (_2 === (79)) { */ case 165: yyVAL[0].expr = new ast.FunctionExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$194 = yypt - 0 >> 0, ((x$194 < 0 || x$194 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$194])).funcexpr.ParList, (x$195 = yypt - 0 >> 0, ((x$195 < 0 || x$195 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$195])).funcexpr.Stmts); $r = yyVAL[0].expr.SetLine((x$196 = yypt - 1 >> 0, ((x$196 < 0 || x$196 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$196])).token.Pos.Line); /* */ $s = 269; case 269: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = yyVAL[0].expr.SetLastLine((x$197 = yypt - 0 >> 0, ((x$197 < 0 || x$197 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$197])).funcexpr.ExprBase.Node.LastLine()); /* */ $s = 270; case 270: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (80)) { */ case 166: yyVAL[0].funcexpr = new ast.FunctionExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$198 = yypt - 3 >> 0, ((x$198 < 0 || x$198 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$198])).parlist, (x$199 = yypt - 1 >> 0, ((x$199 < 0 || x$199 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$199])).stmts); yyVAL[0].funcexpr.ExprBase.Node.SetLine((x$200 = yypt - 4 >> 0, ((x$200 < 0 || x$200 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$200])).token.Pos.Line); yyVAL[0].funcexpr.ExprBase.Node.SetLastLine((x$201 = yypt - 0 >> 0, ((x$201 < 0 || x$201 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$201])).token.Pos.Line); $s = 181; continue; /* } else if (_2 === (81)) { */ case 167: yyVAL[0].funcexpr = new ast.FunctionExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new ast.ParList.ptr(false, new sliceType([])), (x$202 = yypt - 1 >> 0, ((x$202 < 0 || x$202 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$202])).stmts); yyVAL[0].funcexpr.ExprBase.Node.SetLine((x$203 = yypt - 3 >> 0, ((x$203 < 0 || x$203 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$203])).token.Pos.Line); yyVAL[0].funcexpr.ExprBase.Node.SetLastLine((x$204 = yypt - 0 >> 0, ((x$204 < 0 || x$204 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$204])).token.Pos.Line); $s = 181; continue; /* } else if (_2 === (82)) { */ case 168: yyVAL[0].parlist = new ast.ParList.ptr(true, new sliceType([])); $s = 181; continue; /* } else if (_2 === (83)) { */ case 169: yyVAL[0].parlist = new ast.ParList.ptr(false, new sliceType([])); yyVAL[0].parlist.Names = $appendSlice(yyVAL[0].parlist.Names, (x$205 = yypt - 0 >> 0, ((x$205 < 0 || x$205 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$205])).namelist); $s = 181; continue; /* } else if (_2 === (84)) { */ case 170: yyVAL[0].parlist = new ast.ParList.ptr(true, new sliceType([])); yyVAL[0].parlist.Names = $appendSlice(yyVAL[0].parlist.Names, (x$206 = yypt - 2 >> 0, ((x$206 < 0 || x$206 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$206])).namelist); $s = 181; continue; /* } else if (_2 === (85)) { */ case 171: yyVAL[0].expr = new ast.TableExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new sliceType$7([])); $r = yyVAL[0].expr.SetLine((x$207 = yypt - 1 >> 0, ((x$207 < 0 || x$207 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$207])).token.Pos.Line); /* */ $s = 271; case 271: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (86)) { */ case 172: yyVAL[0].expr = new ast.TableExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), (x$208 = yypt - 1 >> 0, ((x$208 < 0 || x$208 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$208])).fieldlist); $r = yyVAL[0].expr.SetLine((x$209 = yypt - 2 >> 0, ((x$209 < 0 || x$209 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$209])).token.Pos.Line); /* */ $s = 272; case 272: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (87)) { */ case 173: yyVAL[0].fieldlist = new sliceType$7([(x$210 = yypt - 0 >> 0, ((x$210 < 0 || x$210 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$210])).field]); $s = 181; continue; /* } else if (_2 === (88)) { */ case 174: yyVAL[0].fieldlist = $append((x$212 = yypt - 2 >> 0, ((x$212 < 0 || x$212 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$212])).fieldlist, (x$211 = yypt - 0 >> 0, ((x$211 < 0 || x$211 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$211])).field); $s = 181; continue; /* } else if (_2 === (89)) { */ case 175: yyVAL[0].fieldlist = (x$213 = yypt - 1 >> 0, ((x$213 < 0 || x$213 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$213])).fieldlist; $s = 181; continue; /* } else if (_2 === (90)) { */ case 176: yyVAL[0].field = new ast.Field.ptr(new ast.StringExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))), (x$214 = yypt - 2 >> 0, ((x$214 < 0 || x$214 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$214])).token.Str), (x$215 = yypt - 0 >> 0, ((x$215 < 0 || x$215 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$215])).expr); $r = yyVAL[0].field.Key.SetLine((x$216 = yypt - 2 >> 0, ((x$216 < 0 || x$216 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$216])).token.Pos.Line); /* */ $s = 273; case 273: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 181; continue; /* } else if (_2 === (91)) { */ case 177: yyVAL[0].field = new ast.Field.ptr((x$217 = yypt - 3 >> 0, ((x$217 < 0 || x$217 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$217])).expr, (x$218 = yypt - 0 >> 0, ((x$218 < 0 || x$218 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$218])).expr); $s = 181; continue; /* } else if (_2 === (92)) { */ case 178: yyVAL[0].field = new ast.Field.ptr($ifaceNil, (x$219 = yypt - 0 >> 0, ((x$219 < 0 || x$219 >= yyS.$length) ? ($throwRuntimeError("index out of range"), undefined) : yyS.$array[yyS.$offset + x$219])).expr); $s = 181; continue; /* } else if (_2 === (93)) { */ case 179: yyVAL[0].fieldsep = ","; $s = 181; continue; /* } else if (_2 === (94)) { */ case 180: yyVAL[0].fieldsep = ";"; /* } */ case 181: case 86: if (!(!($interfaceIsEqual(yyEx, $ifaceNil)))) { _v = false; $s = 276; continue s; } _r$43 = yyEx.Reduced(r, exState, yyVAL[0]); /* */ $s = 277; case 277: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; } _v = _r$43; case 276: /* */ if (_v) { $s = 274; continue; } /* */ $s = 275; continue; /* if (_v) { */ case 274: $s = -1; return -1; /* } */ case 275: /* goto yystack */ $s = 1; continue; $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: yyParse }; } $f.Errflag = Errflag; $f.Nerrs = Nerrs; $f._1 = _1; $f._2 = _2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._entry$4 = _entry$4; $f._entry$5 = _entry$5; $f._entry$6 = _entry$6; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$24 = _r$24; $f._r$25 = _r$25; $f._r$26 = _r$26; $f._r$27 = _r$27; $f._r$28 = _r$28; $f._r$29 = _r$29; $f._r$3 = _r$3; $f._r$30 = _r$30; $f._r$31 = _r$31; $f._r$32 = _r$32; $f._r$33 = _r$33; $f._r$34 = _r$34; $f._r$35 = _r$35; $f._r$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $f._r$41 = _r$41; $f._r$42 = _r$42; $f._r$43 = _r$43; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f._v = _v; $f.a = a; $f.cur = cur; $f.cur$1 = cur$1; $f.elseif = elseif; $f.elseif$1 = elseif$1; $f.exState = exState; $f.fn = fn; $f.key = key; $f.key$1 = key$1; $f.l = l; $f.l$1 = l$1; $f.l$2 = l$2; $f.ls = ls; $f.msg = msg; $f.n = n; $f.nyys = nyys; $f.nyys$1 = nyys$1; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.ok$3 = ok$3; $f.ok$4 = ok$4; $f.ok$5 = ok$5; $f.r = r; $f.row = row; $f.row$1 = row$1; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$100 = x$100; $f.x$101 = x$101; $f.x$102 = x$102; $f.x$103 = x$103; $f.x$104 = x$104; $f.x$105 = x$105; $f.x$106 = x$106; $f.x$107 = x$107; $f.x$108 = x$108; $f.x$109 = x$109; $f.x$11 = x$11; $f.x$110 = x$110; $f.x$111 = x$111; $f.x$112 = x$112; $f.x$113 = x$113; $f.x$114 = x$114; $f.x$115 = x$115; $f.x$116 = x$116; $f.x$117 = x$117; $f.x$118 = x$118; $f.x$119 = x$119; $f.x$12 = x$12; $f.x$120 = x$120; $f.x$121 = x$121; $f.x$122 = x$122; $f.x$123 = x$123; $f.x$124 = x$124; $f.x$125 = x$125; $f.x$126 = x$126; $f.x$127 = x$127; $f.x$128 = x$128; $f.x$129 = x$129; $f.x$13 = x$13; $f.x$130 = x$130; $f.x$131 = x$131; $f.x$132 = x$132; $f.x$133 = x$133; $f.x$134 = x$134; $f.x$135 = x$135; $f.x$136 = x$136; $f.x$137 = x$137; $f.x$138 = x$138; $f.x$139 = x$139; $f.x$14 = x$14; $f.x$140 = x$140; $f.x$141 = x$141; $f.x$142 = x$142; $f.x$143 = x$143; $f.x$144 = x$144; $f.x$145 = x$145; $f.x$146 = x$146; $f.x$147 = x$147; $f.x$148 = x$148; $f.x$149 = x$149; $f.x$15 = x$15; $f.x$150 = x$150; $f.x$151 = x$151; $f.x$152 = x$152; $f.x$153 = x$153; $f.x$154 = x$154; $f.x$155 = x$155; $f.x$156 = x$156; $f.x$157 = x$157; $f.x$158 = x$158; $f.x$159 = x$159; $f.x$16 = x$16; $f.x$160 = x$160; $f.x$161 = x$161; $f.x$162 = x$162; $f.x$163 = x$163; $f.x$164 = x$164; $f.x$165 = x$165; $f.x$166 = x$166; $f.x$167 = x$167; $f.x$168 = x$168; $f.x$169 = x$169; $f.x$17 = x$17; $f.x$170 = x$170; $f.x$171 = x$171; $f.x$172 = x$172; $f.x$173 = x$173; $f.x$174 = x$174; $f.x$175 = x$175; $f.x$176 = x$176; $f.x$177 = x$177; $f.x$178 = x$178; $f.x$179 = x$179; $f.x$18 = x$18; $f.x$180 = x$180; $f.x$181 = x$181; $f.x$182 = x$182; $f.x$183 = x$183; $f.x$184 = x$184; $f.x$185 = x$185; $f.x$186 = x$186; $f.x$187 = x$187; $f.x$188 = x$188; $f.x$189 = x$189; $f.x$19 = x$19; $f.x$190 = x$190; $f.x$191 = x$191; $f.x$192 = x$192; $f.x$193 = x$193; $f.x$194 = x$194; $f.x$195 = x$195; $f.x$196 = x$196; $f.x$197 = x$197; $f.x$198 = x$198; $f.x$199 = x$199; $f.x$2 = x$2; $f.x$20 = x$20; $f.x$200 = x$200; $f.x$201 = x$201; $f.x$202 = x$202; $f.x$203 = x$203; $f.x$204 = x$204; $f.x$205 = x$205; $f.x$206 = x$206; $f.x$207 = x$207; $f.x$208 = x$208; $f.x$209 = x$209; $f.x$21 = x$21; $f.x$210 = x$210; $f.x$211 = x$211; $f.x$212 = x$212; $f.x$213 = x$213; $f.x$214 = x$214; $f.x$215 = x$215; $f.x$216 = x$216; $f.x$217 = x$217; $f.x$218 = x$218; $f.x$219 = x$219; $f.x$22 = x$22; $f.x$23 = x$23; $f.x$24 = x$24; $f.x$25 = x$25; $f.x$26 = x$26; $f.x$27 = x$27; $f.x$28 = x$28; $f.x$29 = x$29; $f.x$3 = x$3; $f.x$30 = x$30; $f.x$31 = x$31; $f.x$32 = x$32; $f.x$33 = x$33; $f.x$34 = x$34; $f.x$35 = x$35; $f.x$36 = x$36; $f.x$37 = x$37; $f.x$38 = x$38; $f.x$39 = x$39; $f.x$4 = x$4; $f.x$40 = x$40; $f.x$41 = x$41; $f.x$42 = x$42; $f.x$43 = x$43; $f.x$44 = x$44; $f.x$45 = x$45; $f.x$46 = x$46; $f.x$47 = x$47; $f.x$48 = x$48; $f.x$49 = x$49; $f.x$5 = x$5; $f.x$50 = x$50; $f.x$51 = x$51; $f.x$52 = x$52; $f.x$53 = x$53; $f.x$54 = x$54; $f.x$55 = x$55; $f.x$56 = x$56; $f.x$57 = x$57; $f.x$58 = x$58; $f.x$59 = x$59; $f.x$6 = x$6; $f.x$60 = x$60; $f.x$61 = x$61; $f.x$62 = x$62; $f.x$63 = x$63; $f.x$64 = x$64; $f.x$65 = x$65; $f.x$66 = x$66; $f.x$67 = x$67; $f.x$68 = x$68; $f.x$69 = x$69; $f.x$7 = x$7; $f.x$70 = x$70; $f.x$71 = x$71; $f.x$72 = x$72; $f.x$73 = x$73; $f.x$74 = x$74; $f.x$75 = x$75; $f.x$76 = x$76; $f.x$77 = x$77; $f.x$78 = x$78; $f.x$79 = x$79; $f.x$8 = x$8; $f.x$80 = x$80; $f.x$81 = x$81; $f.x$82 = x$82; $f.x$83 = x$83; $f.x$84 = x$84; $f.x$85 = x$85; $f.x$86 = x$86; $f.x$87 = x$87; $f.x$88 = x$88; $f.x$89 = x$89; $f.x$9 = x$9; $f.x$90 = x$90; $f.x$91 = x$91; $f.x$92 = x$92; $f.x$93 = x$93; $f.x$94 = x$94; $f.x$95 = x$95; $f.x$96 = x$96; $f.x$97 = x$97; $f.x$98 = x$98; $f.x$99 = x$99; $f.x0 = x0; $f.yyEx = yyEx; $f.yyS = yyS; $f.yyVAL = yyVAL; $f.yychar = yychar; $f.yyerrok = yyerrok; $f.yylex = yylex; $f.yylval = yylval; $f.yyn = yyn; $f.yyp = yyp; $f.yypt = yypt; $f.yyshift = yyshift; $f.yystate = yystate; $f.yyxchar = yyxchar; $f.$s = $s; $f.$r = $r; return $f; }; TokenName = function(c) { var c, x, x$1; if (c >= 57346 && (c - 57346 >> 0) < yySymNames.$length) { if (!((x = c - 57346 >> 0, ((x < 0 || x >= yySymNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : yySymNames.$array[yySymNames.$offset + x])) === "")) { return (x$1 = c - 57346 >> 0, ((x$1 < 0 || x$1 >= yySymNames.$length) ? ($throwRuntimeError("index out of range"), undefined) : yySymNames.$array[yySymNames.$offset + x$1])); } } return ($bytesToString(new sliceType$3([((c << 24 >>> 24))]))); }; $pkg.TokenName = TokenName; ptrType$8.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([$String, $String], [ptrType$8], false)}, {prop: "TokenError", name: "TokenError", pkg: "", typ: $funcType([ast.Token, $String], [ptrType$8], false)}, {prop: "readNext", name: "readNext", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([], [$Int], false)}, {prop: "Newline", name: "Newline", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Peek", name: "Peek", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "skipWhiteSpace", name: "skipWhiteSpace", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int64], [$Int], false)}, {prop: "skipComments", name: "skipComments", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int], [$error], false)}, {prop: "scanIdent", name: "scanIdent", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int, ptrType$9], [$error], false)}, {prop: "scanDecimal", name: "scanDecimal", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int, ptrType$9], [$error], false)}, {prop: "scanNumber", name: "scanNumber", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int, ptrType$9], [$error], false)}, {prop: "scanString", name: "scanString", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int, ptrType$9], [$error], false)}, {prop: "scanEscape", name: "scanEscape", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int, ptrType$9], [$error], false)}, {prop: "countSep", name: "countSep", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int], [$Int, $Int], false)}, {prop: "scanMultilineString", name: "scanMultilineString", pkg: "github.com/J-J-J/goluajit/parse", typ: $funcType([$Int, ptrType$9], [$error], false)}, {prop: "Scan", name: "Scan", pkg: "", typ: $funcType([ptrType$5], [ast.Token, $error], false)}]; ptrType$5.methods = [{prop: "Lex", name: "Lex", pkg: "", typ: $funcType([ptrType$11], [$Int], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([$String], [], false)}, {prop: "TokenError", name: "TokenError", pkg: "", typ: $funcType([ast.Token, $String], [], false)}]; Error.init("", [{prop: "Pos", name: "Pos", embedded: false, exported: true, typ: ast.Position, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Token", name: "Token", embedded: false, exported: true, typ: $String, tag: ""}]); Scanner.init("github.com/J-J-J/goluajit/parse", [{prop: "Pos", name: "Pos", embedded: false, exported: true, typ: ast.Position, tag: ""}, {prop: "reader", name: "reader", embedded: false, exported: false, typ: ptrType, tag: ""}]); Lexer.init("github.com/J-J-J/goluajit/parse", [{prop: "scanner", name: "scanner", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "Stmts", name: "Stmts", embedded: false, exported: true, typ: sliceType$4, tag: ""}, {prop: "PNewLine", name: "PNewLine", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Token", name: "Token", embedded: false, exported: true, typ: ast.Token, tag: ""}, {prop: "PrevTokenType", name: "PrevTokenType", embedded: false, exported: true, typ: $Int, tag: ""}]); yySymType.init("github.com/J-J-J/goluajit/parse", [{prop: "yys", name: "yys", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "token", name: "token", embedded: false, exported: false, typ: ast.Token, tag: ""}, {prop: "stmts", name: "stmts", embedded: false, exported: false, typ: sliceType$4, tag: ""}, {prop: "stmt", name: "stmt", embedded: false, exported: false, typ: ast.Stmt, tag: ""}, {prop: "funcname", name: "funcname", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "funcexpr", name: "funcexpr", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "exprlist", name: "exprlist", embedded: false, exported: false, typ: sliceType$6, tag: ""}, {prop: "expr", name: "expr", embedded: false, exported: false, typ: ast.Expr, tag: ""}, {prop: "fieldlist", name: "fieldlist", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "field", name: "field", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "fieldsep", name: "fieldsep", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "namelist", name: "namelist", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "parlist", name: "parlist", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); yyXError.init("github.com/J-J-J/goluajit/parse", [{prop: "state", name: "state", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "xsym", name: "xsym", embedded: false, exported: false, typ: $Int, tag: ""}]); yyLexerEx.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Lex", name: "Lex", pkg: "", typ: $funcType([ptrType$11], [$Int], false)}, {prop: "Reduced", name: "Reduced", pkg: "", typ: $funcType([$Int, $Int, ptrType$11], [$Bool], false)}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = bytes.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ast.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reservedWords = $makeMap($String.keyFor, [{ k: "and", v: 57346 }, { k: "break", v: 57347 }, { k: "do", v: 57348 }, { k: "else", v: 57349 }, { k: "elseif", v: 57350 }, { k: "end", v: 57351 }, { k: "false", v: 57352 }, { k: "for", v: 57353 }, { k: "function", v: 57354 }, { k: "if", v: 57355 }, { k: "in", v: 57356 }, { k: "local", v: 57357 }, { k: "nil", v: 57358 }, { k: "not", v: 57359 }, { k: "or", v: 57360 }, { k: "return", v: 57361 }, { k: "repeat", v: 57362 }, { k: "then", v: 57363 }, { k: "true", v: 57364 }, { k: "until", v: 57365 }, { k: "while", v: 57366 }]); yyXLAT = $makeMap($Int.keyFor, [{ k: 40, v: 0 }, { k: 57373, v: 1 }, { k: 57354, v: 2 }, { k: 45, v: 3 }, { k: 57351, v: 4 }, { k: 59, v: 5 }, { k: 57348, v: 6 }, { k: 57347, v: 7 }, { k: 57353, v: 8 }, { k: 57355, v: 9 }, { k: 57357, v: 10 }, { k: 57362, v: 11 }, { k: 57361, v: 12 }, { k: 57366, v: 13 }, { k: 57349, v: 14 }, { k: 57350, v: 15 }, { k: 57365, v: 16 }, { k: 57344, v: 17 }, { k: 44, v: 18 }, { k: 123, v: 19 }, { k: 57375, v: 20 }, { k: 37, v: 21 }, { k: 42, v: 22 }, { k: 43, v: 23 }, { k: 47, v: 24 }, { k: 60, v: 25 }, { k: 62, v: 26 }, { k: 94, v: 27 }, { k: 57371, v: 28 }, { k: 57346, v: 29 }, { k: 57367, v: 30 }, { k: 57370, v: 31 }, { k: 57369, v: 32 }, { k: 57368, v: 33 }, { k: 57360, v: 34 }, { k: 41, v: 35 }, { k: 125, v: 36 }, { k: 93, v: 37 }, { k: 57363, v: 38 }, { k: 57399, v: 39 }, { k: 57372, v: 40 }, { k: 57400, v: 41 }, { k: 35, v: 42 }, { k: 57378, v: 43 }, { k: 57393, v: 44 }, { k: 57397, v: 45 }, { k: 57352, v: 46 }, { k: 57358, v: 47 }, { k: 57359, v: 48 }, { k: 57374, v: 49 }, { k: 57364, v: 50 }, { k: 57401, v: 51 }, { k: 57384, v: 52 }, { k: 57392, v: 53 }, { k: 91, v: 54 }, { k: 46, v: 55 }, { k: 58, v: 56 }, { k: 61, v: 57 }, { k: 57381, v: 58 }, { k: 57382, v: 59 }, { k: 57380, v: 60 }, { k: 57385, v: 61 }, { k: 57379, v: 62 }, { k: 57389, v: 63 }, { k: 57395, v: 64 }, { k: 57356, v: 65 }, { k: 57386, v: 66 }, { k: 57383, v: 67 }, { k: 57387, v: 68 }, { k: 57388, v: 69 }, { k: 57390, v: 70 }, { k: 57391, v: 71 }, { k: 57394, v: 72 }, { k: 57396, v: 73 }, { k: 57398, v: 74 }, { k: 57402, v: 75 }, { k: 57377, v: 76 }, { k: 57345, v: 77 }, { k: 57376, v: 78 }]); yySymNames = new sliceType(["'('", "TIdent", "TFunction", "'-'", "TEnd", "';'", "TDo", "TBreak", "TFor", "TIf", "TLocal", "TRepeat", "TReturn", "TWhile", "TElse", "TElseIf", "TUntil", "$end", "','", "'{'", "TString", "'%'", "'*'", "'+'", "'/'", "'<'", "'>'", "'^'", "T2Comma", "TAnd", "TEqeq", "TGte", "TLte", "TNeq", "TOr", "')'", "'}'", "']'", "TThen", "string", "T3Comma", "tableconstructor", "'#'", "afunctioncall", "functioncall", "prefixexp", "TFalse", "TNil", "TNot", "TNumber", "TTrue", "var", "expr", "function", "'['", "'.'", "':'", "'='", "chunk", "chunk1", "block", "exprlist", "args", "funcbody", "namelist", "TIn", "field", "elseifs", "fieldlist", "fieldsep", "funcname", "funcname1", "laststat", "parlist", "stat", "varlist", "$default", "error", "UNARY"]); yyTokenLiteralStrings = $makeMap($Int.keyFor, []); yyReductions = $makeMap($Int.keyFor, [{ k: 0, v: new structType.ptr(0, 1) }, { k: 1, v: new structType.ptr(58, 1) }, { k: 2, v: new structType.ptr(58, 2) }, { k: 3, v: new structType.ptr(58, 3) }, { k: 4, v: new structType.ptr(59, 0) }, { k: 5, v: new structType.ptr(59, 2) }, { k: 6, v: new structType.ptr(59, 2) }, { k: 7, v: new structType.ptr(60, 1) }, { k: 8, v: new structType.ptr(74, 3) }, { k: 9, v: new structType.ptr(74, 1) }, { k: 10, v: new structType.ptr(74, 3) }, { k: 11, v: new structType.ptr(74, 5) }, { k: 12, v: new structType.ptr(74, 4) }, { k: 13, v: new structType.ptr(74, 6) }, { k: 14, v: new structType.ptr(74, 8) }, { k: 15, v: new structType.ptr(74, 9) }, { k: 16, v: new structType.ptr(74, 11) }, { k: 17, v: new structType.ptr(74, 7) }, { k: 18, v: new structType.ptr(74, 3) }, { k: 19, v: new structType.ptr(74, 4) }, { k: 20, v: new structType.ptr(74, 4) }, { k: 21, v: new structType.ptr(74, 2) }, { k: 22, v: new structType.ptr(67, 0) }, { k: 23, v: new structType.ptr(67, 5) }, { k: 24, v: new structType.ptr(72, 1) }, { k: 25, v: new structType.ptr(72, 2) }, { k: 26, v: new structType.ptr(72, 1) }, { k: 27, v: new structType.ptr(70, 1) }, { k: 28, v: new structType.ptr(70, 3) }, { k: 29, v: new structType.ptr(71, 1) }, { k: 30, v: new structType.ptr(71, 3) }, { k: 31, v: new structType.ptr(75, 1) }, { k: 32, v: new structType.ptr(75, 3) }, { k: 33, v: new structType.ptr(51, 1) }, { k: 34, v: new structType.ptr(51, 4) }, { k: 35, v: new structType.ptr(51, 3) }, { k: 36, v: new structType.ptr(64, 1) }, { k: 37, v: new structType.ptr(64, 3) }, { k: 38, v: new structType.ptr(61, 1) }, { k: 39, v: new structType.ptr(61, 3) }, { k: 40, v: new structType.ptr(52, 1) }, { k: 41, v: new structType.ptr(52, 1) }, { k: 42, v: new structType.ptr(52, 1) }, { k: 43, v: new structType.ptr(52, 1) }, { k: 44, v: new structType.ptr(52, 1) }, { k: 45, v: new structType.ptr(52, 1) }, { k: 46, v: new structType.ptr(52, 1) }, { k: 47, v: new structType.ptr(52, 1) }, { k: 48, v: new structType.ptr(52, 1) }, { k: 49, v: new structType.ptr(52, 3) }, { k: 50, v: new structType.ptr(52, 3) }, { k: 51, v: new structType.ptr(52, 3) }, { k: 52, v: new structType.ptr(52, 3) }, { k: 53, v: new structType.ptr(52, 3) }, { k: 54, v: new structType.ptr(52, 3) }, { k: 55, v: new structType.ptr(52, 3) }, { k: 56, v: new structType.ptr(52, 3) }, { k: 57, v: new structType.ptr(52, 3) }, { k: 58, v: new structType.ptr(52, 3) }, { k: 59, v: new structType.ptr(52, 3) }, { k: 60, v: new structType.ptr(52, 3) }, { k: 61, v: new structType.ptr(52, 3) }, { k: 62, v: new structType.ptr(52, 3) }, { k: 63, v: new structType.ptr(52, 3) }, { k: 64, v: new structType.ptr(52, 2) }, { k: 65, v: new structType.ptr(52, 2) }, { k: 66, v: new structType.ptr(52, 2) }, { k: 67, v: new structType.ptr(39, 1) }, { k: 68, v: new structType.ptr(45, 1) }, { k: 69, v: new structType.ptr(45, 1) }, { k: 70, v: new structType.ptr(45, 1) }, { k: 71, v: new structType.ptr(45, 3) }, { k: 72, v: new structType.ptr(43, 3) }, { k: 73, v: new structType.ptr(44, 2) }, { k: 74, v: new structType.ptr(44, 4) }, { k: 75, v: new structType.ptr(62, 2) }, { k: 76, v: new structType.ptr(62, 3) }, { k: 77, v: new structType.ptr(62, 1) }, { k: 78, v: new structType.ptr(62, 1) }, { k: 79, v: new structType.ptr(53, 2) }, { k: 80, v: new structType.ptr(63, 5) }, { k: 81, v: new structType.ptr(63, 4) }, { k: 82, v: new structType.ptr(73, 1) }, { k: 83, v: new structType.ptr(73, 1) }, { k: 84, v: new structType.ptr(73, 3) }, { k: 85, v: new structType.ptr(41, 2) }, { k: 86, v: new structType.ptr(41, 3) }, { k: 87, v: new structType.ptr(68, 1) }, { k: 88, v: new structType.ptr(68, 3) }, { k: 89, v: new structType.ptr(68, 2) }, { k: 90, v: new structType.ptr(66, 3) }, { k: 91, v: new structType.ptr(66, 5) }, { k: 92, v: new structType.ptr(66, 1) }, { k: 93, v: new structType.ptr(69, 1) }, { k: 94, v: new structType.ptr(69, 1) }]); yyXErrors = $makeMap(yyXError.keyFor, []); yyParseTab = $toNativeArray($kindSlice, [new sliceType$1([91, 91, 91, 0, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95]), new sliceType$1([116, 113, 108, 0, 94, 100, 103, 111, 107, 106, 109, 105, 110, 104, 94, 94, 94, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 115, 102, 0, 0, 0, 0, 0, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 99, 101]), new sliceType$1([0, 0, 0, 0, 93, 282, 0, 0, 0, 0, 0, 0, 0, 0, 93, 93, 93, 93]), new sliceType$1([90, 90, 90, 0, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90]), new sliceType$1([89, 89, 89, 0, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277]), new sliceType$1([207, 86, 86, 0, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 204, 206, 0, 0, 0, 0, 0, 205]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 275]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 271, 123]), new sliceType$1([91, 91, 91, 0, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 268]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 256, 123]), new sliceType$1([0, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238]), new sliceType$1([0, 231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 229, 230]), new sliceType$1([0, 184, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223]), new sliceType$1([116, 113, 133, 127, 71, 71, 0, 0, 0, 0, 0, 0, 0, 0, 71, 71, 71, 71, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 210, 123, 0, 0, 0, 0, 0, 0, 0, 221]), new sliceType$1([0, 0, 0, 0, 69, 69, 0, 0, 0, 0, 0, 0, 0, 0, 69, 69, 69, 69]), new sliceType$1([27, 27, 27, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 64, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 64]), new sliceType$1([62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 62, 62]), new sliceType$1([26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26]), new sliceType$1([25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 132, 117, 119, 118, 128, 121, 120, 131, 126, 123]), new sliceType$1([207, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 134, 130, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 209, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 204, 206, 0, 0, 0, 0, 0, 205]), new sliceType$1([55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0, 0, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55]), new sliceType$1([54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 0, 0, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54]), new sliceType$1([53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 0, 0, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53]), new sliceType$1([52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 0, 0, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52]), new sliceType$1([51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, 0, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51]), new sliceType$1([50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]), new sliceType$1([48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48]), new sliceType$1([47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47]), new sliceType$1([0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 202]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 201, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 200, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 199, 123]), new sliceType$1([28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 28, 28]), new sliceType$1([27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27]), new sliceType$1([25, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25]), new sliceType$1([183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182]), new sliceType$1([116, 135, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 136, 123, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 0, 138]), new sliceType$1([62, 0, 0, 62, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 62, 180]), new sliceType$1([0, 0, 0, 152, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 3]), new sliceType$1([10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10]), new sliceType$1([0, 0, 0, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 176]), new sliceType$1([0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 141, 123]), new sliceType$1([0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 0, 157]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 174, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 173, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 172, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 171, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 170, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 169, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 168, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 167, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 166, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 165, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 164, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 163, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 162, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 161, 123]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 160, 123]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 158]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 159, 123]), new sliceType$1([0, 0, 0, 152, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 4]), new sliceType$1([32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 32, 32, 32, 32, 32, 32, 156, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32]), new sliceType$1([33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0, 0, 33, 33, 33, 33, 33, 33, 156, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33]), new sliceType$1([34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 0, 0, 34, 34, 34, 34, 34, 34, 156, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34]), new sliceType$1([35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 0, 0, 35, 35, 35, 35, 35, 35, 156, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35]), new sliceType$1([36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 0, 0, 155, 153, 36, 154, 36, 36, 156, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36]), new sliceType$1([37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 0, 0, 155, 153, 37, 154, 37, 37, 156, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37]), new sliceType$1([38, 38, 38, 152, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0, 0, 155, 153, 151, 154, 38, 38, 156, 150, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38]), new sliceType$1([39, 39, 39, 152, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 0, 0, 155, 153, 151, 154, 39, 39, 156, 150, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39]), new sliceType$1([40, 40, 40, 152, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 0, 0, 155, 153, 151, 154, 40, 40, 156, 150, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40]), new sliceType$1([41, 41, 41, 152, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 0, 0, 155, 153, 151, 154, 41, 41, 156, 150, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41]), new sliceType$1([42, 42, 42, 152, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 155, 153, 151, 154, 42, 42, 156, 150, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42]), new sliceType$1([43, 43, 43, 152, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 0, 0, 155, 153, 151, 154, 43, 43, 156, 150, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43]), new sliceType$1([44, 44, 44, 152, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 0, 0, 155, 153, 151, 154, 44, 44, 156, 150, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44]), new sliceType$1([45, 45, 45, 152, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 45, 148, 146, 147, 149, 45, 45, 45, 45, 45]), new sliceType$1([46, 46, 46, 152, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 46, 46, 46, 46, 46]), new sliceType$1([9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9]), new sliceType$1([116, 135, 133, 127, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 136, 123, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 179]), new sliceType$1([2, 2, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 2]), new sliceType$1([1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1]), new sliceType$1([0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 181, 123]), new sliceType$1([0, 0, 0, 152, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 5]), new sliceType$1([16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]), new sliceType$1([0, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, 0, 0, 0, 0, 186]), new sliceType$1([59, 59, 59, 0, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 190]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13]), new sliceType$1([0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 88, 88]), new sliceType$1([0, 0, 0, 0, 191]), new sliceType$1([14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 193]), new sliceType$1([0, 0, 0, 0, 194]), new sliceType$1([15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15]), new sliceType$1([0, 196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197]), new sliceType$1([58, 58, 58, 0, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 58]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11]), new sliceType$1([23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23]), new sliceType$1([29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 0, 0, 29, 29, 29, 29, 29, 29, 156, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29]), new sliceType$1([30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 0, 0, 30, 30, 30, 30, 30, 30, 156, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]), new sliceType$1([31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 31, 31, 31, 31, 31, 31, 156, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31]), new sliceType$1([24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24, 24]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 219, 123]), new sliceType$1([0, 218]), new sliceType$1([22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 22, 22]), new sliceType$1([0, 216]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 210, 123, 0, 0, 0, 0, 0, 0, 0, 211]), new sliceType$1([18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 18]), new sliceType$1([17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17]), new sliceType$1([57, 57, 57, 152, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 57]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214]), new sliceType$1([20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 215, 123]), new sliceType$1([19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19]), new sliceType$1([56, 56, 56, 152, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 56]), new sliceType$1([207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217]), new sliceType$1([21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21]), new sliceType$1([60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 60, 60, 60]), new sliceType$1([0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 0, 220]), new sliceType$1([61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 61, 61, 61]), new sliceType$1([0, 0, 0, 0, 70, 70, 0, 0, 0, 0, 0, 0, 0, 0, 70, 70, 70, 70, 213]), new sliceType$1([0, 227]), new sliceType$1([74, 74, 74, 0, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 210, 123, 0, 0, 0, 0, 0, 0, 0, 226]), new sliceType$1([0, 196]), new sliceType$1([75, 75, 75, 0, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 213]), new sliceType$1([183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228]), new sliceType$1([76, 76, 76, 0, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76]), new sliceType$1([183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236]), new sliceType$1([68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 232]), new sliceType$1([66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 66]), new sliceType$1([0, 235]), new sliceType$1([0, 234]), new sliceType$1([65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 65]), new sliceType$1([67]), new sliceType$1([77, 77, 77, 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 0, 0, 0, 0, 0, 0, 0, 59]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 210, 123, 0, 0, 0, 0, 0, 0, 0, 240]), new sliceType$1([0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 242]), new sliceType$1([0, 0, 0, 0, 243]), new sliceType$1([78, 78, 78, 0, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 245, 123]), new sliceType$1([0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 247, 123]), new sliceType$1([0, 0, 0, 152, 0, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 254]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 250, 123]), new sliceType$1([0, 0, 0, 152, 0, 0, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 252]), new sliceType$1([0, 0, 0, 0, 253]), new sliceType$1([79, 79, 79, 0, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79]), new sliceType$1([0, 0, 0, 0, 255]), new sliceType$1([80, 80, 80, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80]), new sliceType$1([0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 0, 0, 257]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 258]), new sliceType$1([0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259]), new sliceType$1([0, 0, 0, 0, 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261, 262]), new sliceType$1([82, 82, 82, 0, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 266]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 263, 123]), new sliceType$1([0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142, 0, 0, 0, 264]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 265]), new sliceType$1([0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 72]), new sliceType$1([0, 0, 0, 0, 267]), new sliceType$1([81, 81, 81, 0, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81]), new sliceType$1([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 269]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 270, 123]), new sliceType$1([83, 83, 83, 152, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142]), new sliceType$1([0, 0, 0, 152, 0, 0, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 153, 151, 154, 145, 144, 156, 150, 143, 148, 146, 147, 149, 142]), new sliceType$1([91, 91, 91, 0, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 97, 273]), new sliceType$1([0, 0, 0, 0, 274]), new sliceType$1([84, 84, 84, 0, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84]), new sliceType$1([0, 0, 0, 0, 276]), new sliceType$1([85, 85, 85, 0, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85]), new sliceType$1([116, 113, 133, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 122, 125, 129, 114, 115, 117, 119, 118, 128, 121, 120, 131, 210, 123, 0, 0, 0, 0, 0, 0, 0, 281]), new sliceType$1([116, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 115, 280, 0, 0, 0, 0, 0, 279]), new sliceType$1([27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 27, 27, 63]), new sliceType$1([207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 204, 206, 0, 0, 0, 0, 0, 205]), new sliceType$1([87, 87, 87, 0, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 213]), new sliceType$1([0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 92, 92, 92])]); yyDebug = 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/J-J-J/goluajit/pm"] = (function() { var $pkg = {}, $init, fmt, Error, MatchData, scannerState, scanner, opCode, inst, class$1, dotClass, charClass, singleClass, setClass, rangeClass, pattern, singlePattern, seqPattern, repeatPattern, posCapPattern, capPattern, numberPattern, bracePattern, iptr, sliceType, sliceType$1, sliceType$2, ptrType, sliceType$3, sliceType$4, ptrType$1, ptrType$2, ptrType$3, sliceType$5, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, sliceType$6, ptrType$9, sliceType$7, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, newError, newMatchState, newScanner, parseClass, parseClassSet, parsePattern, compilePattern, recursiveVM, Find; fmt = $packages["fmt"]; Error = $pkg.Error = $newType(0, $kindStruct, "pm.Error", true, "github.com/J-J-J/goluajit/pm", true, function(Pos_, Message_) { this.$val = this; if (arguments.length === 0) { this.Pos = 0; this.Message = ""; return; } this.Pos = Pos_; this.Message = Message_; }); MatchData = $pkg.MatchData = $newType(0, $kindStruct, "pm.MatchData", true, "github.com/J-J-J/goluajit/pm", true, function(captures_) { this.$val = this; if (arguments.length === 0) { this.captures = sliceType$1.nil; return; } this.captures = captures_; }); scannerState = $pkg.scannerState = $newType(0, $kindStruct, "pm.scannerState", true, "github.com/J-J-J/goluajit/pm", false, function(Pos_, started_) { this.$val = this; if (arguments.length === 0) { this.Pos = 0; this.started = false; return; } this.Pos = Pos_; this.started = started_; }); scanner = $pkg.scanner = $newType(0, $kindStruct, "pm.scanner", true, "github.com/J-J-J/goluajit/pm", false, function(src_, State_, saved_) { this.$val = this; if (arguments.length === 0) { this.src = sliceType$2.nil; this.State = new scannerState.ptr(0, false); this.saved = new scannerState.ptr(0, false); return; } this.src = src_; this.State = State_; this.saved = saved_; }); opCode = $pkg.opCode = $newType(4, $kindInt, "pm.opCode", true, "github.com/J-J-J/goluajit/pm", false, null); inst = $pkg.inst = $newType(0, $kindStruct, "pm.inst", true, "github.com/J-J-J/goluajit/pm", false, function(OpCode_, Class_, Operand1_, Operand2_) { this.$val = this; if (arguments.length === 0) { this.OpCode = 0; this.Class = $ifaceNil; this.Operand1 = 0; this.Operand2 = 0; return; } this.OpCode = OpCode_; this.Class = Class_; this.Operand1 = Operand1_; this.Operand2 = Operand2_; }); class$1 = $pkg.class = $newType(8, $kindInterface, "pm.class", true, "github.com/J-J-J/goluajit/pm", false, null); dotClass = $pkg.dotClass = $newType(0, $kindStruct, "pm.dotClass", true, "github.com/J-J-J/goluajit/pm", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); charClass = $pkg.charClass = $newType(0, $kindStruct, "pm.charClass", true, "github.com/J-J-J/goluajit/pm", false, function(Ch_) { this.$val = this; if (arguments.length === 0) { this.Ch = 0; return; } this.Ch = Ch_; }); singleClass = $pkg.singleClass = $newType(0, $kindStruct, "pm.singleClass", true, "github.com/J-J-J/goluajit/pm", false, function(Class_) { this.$val = this; if (arguments.length === 0) { this.Class = 0; return; } this.Class = Class_; }); setClass = $pkg.setClass = $newType(0, $kindStruct, "pm.setClass", true, "github.com/J-J-J/goluajit/pm", false, function(IsNot_, Classes_) { this.$val = this; if (arguments.length === 0) { this.IsNot = false; this.Classes = sliceType$3.nil; return; } this.IsNot = IsNot_; this.Classes = Classes_; }); rangeClass = $pkg.rangeClass = $newType(0, $kindStruct, "pm.rangeClass", true, "github.com/J-J-J/goluajit/pm", false, function(Begin_, End_) { this.$val = this; if (arguments.length === 0) { this.Begin = $ifaceNil; this.End = $ifaceNil; return; } this.Begin = Begin_; this.End = End_; }); pattern = $pkg.pattern = $newType(8, $kindInterface, "pm.pattern", true, "github.com/J-J-J/goluajit/pm", false, null); singlePattern = $pkg.singlePattern = $newType(0, $kindStruct, "pm.singlePattern", true, "github.com/J-J-J/goluajit/pm", false, function(Class_) { this.$val = this; if (arguments.length === 0) { this.Class = $ifaceNil; return; } this.Class = Class_; }); seqPattern = $pkg.seqPattern = $newType(0, $kindStruct, "pm.seqPattern", true, "github.com/J-J-J/goluajit/pm", false, function(MustHead_, MustTail_, Patterns_) { this.$val = this; if (arguments.length === 0) { this.MustHead = false; this.MustTail = false; this.Patterns = sliceType$4.nil; return; } this.MustHead = MustHead_; this.MustTail = MustTail_; this.Patterns = Patterns_; }); repeatPattern = $pkg.repeatPattern = $newType(0, $kindStruct, "pm.repeatPattern", true, "github.com/J-J-J/goluajit/pm", false, function(Type_, Class_) { this.$val = this; if (arguments.length === 0) { this.Type = 0; this.Class = $ifaceNil; return; } this.Type = Type_; this.Class = Class_; }); posCapPattern = $pkg.posCapPattern = $newType(0, $kindStruct, "pm.posCapPattern", true, "github.com/J-J-J/goluajit/pm", false, function() { this.$val = this; if (arguments.length === 0) { return; } }); capPattern = $pkg.capPattern = $newType(0, $kindStruct, "pm.capPattern", true, "github.com/J-J-J/goluajit/pm", false, function(Pattern_) { this.$val = this; if (arguments.length === 0) { this.Pattern = $ifaceNil; return; } this.Pattern = Pattern_; }); numberPattern = $pkg.numberPattern = $newType(0, $kindStruct, "pm.numberPattern", true, "github.com/J-J-J/goluajit/pm", false, function(N_) { this.$val = this; if (arguments.length === 0) { this.N = 0; return; } this.N = N_; }); bracePattern = $pkg.bracePattern = $newType(0, $kindStruct, "pm.bracePattern", true, "github.com/J-J-J/goluajit/pm", false, function(Begin_, End_) { this.$val = this; if (arguments.length === 0) { this.Begin = 0; this.End = 0; return; } this.Begin = Begin_; this.End = End_; }); iptr = $pkg.iptr = $newType(0, $kindStruct, "pm.iptr", true, "github.com/J-J-J/goluajit/pm", false, function(insts_, capture_) { this.$val = this; if (arguments.length === 0) { this.insts = sliceType$5.nil; this.capture = 0; return; } this.insts = insts_; this.capture = capture_; }); sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Uint32); sliceType$2 = $sliceType($Uint8); ptrType = $ptrType(charClass); sliceType$3 = $sliceType(class$1); sliceType$4 = $sliceType(pattern); ptrType$1 = $ptrType(singlePattern); ptrType$2 = $ptrType(seqPattern); ptrType$3 = $ptrType(iptr); sliceType$5 = $sliceType(inst); ptrType$4 = $ptrType(repeatPattern); ptrType$5 = $ptrType(posCapPattern); ptrType$6 = $ptrType(capPattern); ptrType$7 = $ptrType(bracePattern); ptrType$8 = $ptrType(numberPattern); sliceType$6 = $sliceType(ptrType$3); ptrType$9 = $ptrType(MatchData); sliceType$7 = $sliceType(ptrType$9); ptrType$10 = $ptrType(Error); ptrType$11 = $ptrType(scanner); ptrType$12 = $ptrType(dotClass); ptrType$13 = $ptrType(singleClass); ptrType$14 = $ptrType(setClass); ptrType$15 = $ptrType(rangeClass); newError = function(pos, message, args) { var _r, args, message, pos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; args = $f.args; message = $f.message; pos = $f.pos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (args.$length === 0) { $s = -1; return new Error.ptr(pos, message); } _r = fmt.Sprintf(message, args); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return new Error.ptr(pos, _r); /* */ } return; } if ($f === undefined) { $f = { $blk: newError }; } $f._r = _r; $f.args = args; $f.message = message; $f.pos = pos; $f.$s = $s; $f.$r = $r; return $f; }; Error.ptr.prototype.Error = function() { var _1, _r, _r$1, _r$2, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _1 = e.Pos; /* */ if (_1 === (-1)) { $s = 2; continue; } /* */ if (_1 === (-2)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (-1)) { */ case 2: _r = fmt.Sprintf("%s at EOS", new sliceType([new $String(e.Message)])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else if (_1 === (-2)) { */ case 3: _r$1 = fmt.Sprintf("%s", new sliceType([new $String(e.Message)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } else { */ case 4: _r$2 = fmt.Sprintf("%s at %d", new sliceType([new $String(e.Message), new $Int(e.Pos)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* } */ case 5: case 1: $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Error }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Error = function() { return this.$val.Error(); }; newMatchState = function() { return new MatchData.ptr(new sliceType$1([])); }; MatchData.ptr.prototype.addPosCapture = function(s, pos) { var pos, s, st, x, x$1, x$2; st = this; while (true) { if (!((s + 1 >> 0) >= st.captures.$length)) { break; } st.captures = $append(st.captures, 0); } (x = st.captures, ((s < 0 || s >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + s] = ((((((pos >>> 0)) << 1 >>> 0)) | 1) >>> 0))); (x$1 = st.captures, x$2 = s + 1 >> 0, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2] = ((((((pos >>> 0)) << 1 >>> 0)) | 1) >>> 0))); }; MatchData.prototype.addPosCapture = function(s, pos) { return this.$val.addPosCapture(s, pos); }; MatchData.ptr.prototype.setCapture = function(s, pos) { var pos, s, st, v, x, x$1; st = this; while (true) { if (!(s >= st.captures.$length)) { break; } st.captures = $append(st.captures, 0); } v = (x = st.captures, ((s < 0 || s >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + s])); (x$1 = st.captures, ((s < 0 || s >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + s] = ((((pos >>> 0)) << 1 >>> 0)))); return v; }; MatchData.prototype.setCapture = function(s, pos) { return this.$val.setCapture(s, pos); }; MatchData.ptr.prototype.restoreCapture = function(s, pos) { var pos, s, st, x; st = this; (x = st.captures, ((s < 0 || s >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + s] = pos)); }; MatchData.prototype.restoreCapture = function(s, pos) { return this.$val.restoreCapture(s, pos); }; MatchData.ptr.prototype.CaptureLength = function() { var st; st = this; return st.captures.$length; }; MatchData.prototype.CaptureLength = function() { return this.$val.CaptureLength(); }; MatchData.ptr.prototype.IsPosCapture = function(idx) { var idx, st, x; st = this; return ((((x = st.captures, ((idx < 0 || idx >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + idx])) & 1) >>> 0)) === 1; }; MatchData.prototype.IsPosCapture = function(idx) { return this.$val.IsPosCapture(idx); }; MatchData.ptr.prototype.Capture = function(idx) { var idx, st, x; st = this; return ((((x = st.captures, ((idx < 0 || idx >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + idx])) >>> 1 >>> 0) >> 0)); }; MatchData.prototype.Capture = function(idx) { return this.$val.Capture(idx); }; newScanner = function(src) { var src; return new scanner.ptr(src, new scannerState.ptr(0, false), new scannerState.ptr(0, false)); }; scanner.ptr.prototype.Length = function() { var sc; sc = this; return sc.src.$length; }; scanner.prototype.Length = function() { return this.$val.Length(); }; scanner.ptr.prototype.Next = function() { var sc, x, x$1; sc = this; if (!sc.State.started) { sc.State.started = true; if (sc.src.$length === 0) { sc.State.Pos = -1; } } else { sc.State.Pos = sc.NextPos(); } if (sc.State.Pos === -1) { return -1; } return (((x = sc.src, x$1 = sc.State.Pos, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >> 0)); }; scanner.prototype.Next = function() { return this.$val.Next(); }; scanner.ptr.prototype.CurrentPos = function() { var sc; sc = this; return sc.State.Pos; }; scanner.prototype.CurrentPos = function() { return this.$val.CurrentPos(); }; scanner.ptr.prototype.NextPos = function() { var sc; sc = this; if ((sc.State.Pos === -1) || sc.State.Pos >= (sc.src.$length - 1 >> 0)) { return -1; } if (!sc.State.started) { return 0; } return sc.State.Pos + 1 >> 0; }; scanner.prototype.NextPos = function() { return this.$val.NextPos(); }; scanner.ptr.prototype.Peek = function() { var ch, cureof, sc; sc = this; cureof = sc.State.Pos === -1; ch = sc.Next(); if (!cureof) { if (sc.State.Pos === -1) { sc.State.Pos = sc.src.$length - 1 >> 0; } else { sc.State.Pos = sc.State.Pos - (1) >> 0; if (sc.State.Pos < 0) { sc.State.Pos = 0; sc.State.started = false; } } } return ch; }; scanner.prototype.Peek = function() { return this.$val.Peek(); }; scanner.ptr.prototype.Save = function() { var sc; sc = this; scannerState.copy(sc.saved, sc.State); }; scanner.prototype.Save = function() { return this.$val.Save(); }; scanner.ptr.prototype.Restore = function() { var sc; sc = this; scannerState.copy(sc.State, sc.saved); }; scanner.prototype.Restore = function() { return this.$val.Restore(); }; dotClass.ptr.prototype.Matches = function(ch) { var ch, pn; pn = this; return true; }; dotClass.prototype.Matches = function(ch) { return this.$val.Matches(ch); }; charClass.ptr.prototype.Matches = function(ch) { var ch, pn; pn = this; return pn.Ch === ch; }; charClass.prototype.Matches = function(ch) { return this.$val.Matches(ch); }; singleClass.ptr.prototype.Matches = function(ch) { var _1, _2, ch, pn, ret; pn = this; ret = false; _1 = pn.Class; if ((_1 === (97)) || (_1 === (65))) { ret = 65 <= ch && ch <= 90 || 97 <= ch && ch <= 122; } else if ((_1 === (99)) || (_1 === (67))) { ret = (0 <= ch && ch <= 31) || (ch === 127); } else if ((_1 === (100)) || (_1 === (68))) { ret = 48 <= ch && ch <= 57; } else if ((_1 === (108)) || (_1 === (76))) { ret = 97 <= ch && ch <= 122; } else if ((_1 === (112)) || (_1 === (80))) { ret = (33 <= ch && ch <= 47) || (48 <= ch && ch <= 64) || (91 <= ch && ch <= 96) || (123 <= ch && ch <= 126); } else if ((_1 === (115)) || (_1 === (83))) { _2 = ch; if ((_2 === (32)) || (_2 === (12)) || (_2 === (10)) || (_2 === (13)) || (_2 === (9)) || (_2 === (11))) { ret = true; } } else if ((_1 === (117)) || (_1 === (85))) { ret = 65 <= ch && ch <= 90; } else if ((_1 === (119)) || (_1 === (87))) { ret = 48 <= ch && ch <= 57 || 65 <= ch && ch <= 90 || 97 <= ch && ch <= 122; } else if ((_1 === (120)) || (_1 === (88))) { ret = 48 <= ch && ch <= 57 || 97 <= ch && ch <= 102 || 65 <= ch && ch <= 70; } else if ((_1 === (122)) || (_1 === (90))) { ret = ch === 0; } else { return ch === pn.Class; } if (65 <= pn.Class && pn.Class <= 90) { return !ret; } return ret; }; singleClass.prototype.Matches = function(ch) { return this.$val.Matches(ch); }; setClass.ptr.prototype.Matches = function(ch) { var _i, _r, _ref, ch, class$2, pn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; ch = $f.ch; class$2 = $f.class$2; pn = $f.pn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pn = this; _ref = pn.Classes; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } class$2 = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = class$2.Matches(ch); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r) { */ case 3: $s = -1; return !pn.IsNot; /* } */ case 4: _i++; /* } */ $s = 1; continue; case 2: $s = -1; return pn.IsNot; /* */ } return; } if ($f === undefined) { $f = { $blk: setClass.ptr.prototype.Matches }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.ch = ch; $f.class$2 = class$2; $f.pn = pn; $f.$s = $s; $f.$r = $r; return $f; }; setClass.prototype.Matches = function(ch) { return this.$val.Matches(ch); }; rangeClass.ptr.prototype.Matches = function(ch) { var _ref, _tuple, begin, ch, end, ok, pn; pn = this; _ref = pn.Begin; if ($assertType(_ref, ptrType, true)[1]) { begin = _ref.$val; _tuple = $assertType(pn.End, ptrType, true); end = _tuple[0]; ok = _tuple[1]; if (!ok) { return false; } return begin.Ch <= ch && ch <= end.Ch; } return false; }; rangeClass.prototype.Matches = function(ch) { return this.$val.Matches(ch); }; parseClass = function(sc, allowset) { var _1, _r, _r$1, allowset, ch, sc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; allowset = $f.allowset; ch = $f.ch; sc = $f.sc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ch = sc.Next(); _1 = ch; /* */ if (_1 === (37)) { $s = 2; continue; } /* */ if (_1 === (46)) { $s = 3; continue; } /* */ if (_1 === (91)) { $s = 4; continue; } /* */ if (_1 === (-1)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === (37)) { */ case 2: $s = -1; return new singleClass.ptr(sc.Next()); /* } else if (_1 === (46)) { */ case 3: if (allowset) { $s = -1; return new dotClass.ptr(); } $s = -1; return new charClass.ptr(ch); /* } else if (_1 === (91)) { */ case 4: /* */ if (allowset) { $s = 8; continue; } /* */ $s = 9; continue; /* if (allowset) { */ case 8: _r = parseClassSet(sc); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 9: $s = -1; return new charClass.ptr(ch); /* } else if (_1 === (-1)) { */ case 5: _r$1 = newError(sc.CurrentPos(), "unexpected EOS", new sliceType([])); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $panic(_r$1); $s = 7; continue; /* } else { */ case 6: $s = -1; return new charClass.ptr(ch); /* } */ case 7: case 1: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: parseClass }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.allowset = allowset; $f.ch = ch; $f.sc = sc; $f.$s = $s; $f.$r = $r; return $f; }; parseClassSet = function(sc) { var _1, _r, _r$1, _r$2, _r$3, begin, ch, end, isrange, sc, set, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; begin = $f.begin; ch = $f.ch; end = $f.end; isrange = $f.isrange; sc = $f.sc; set = $f.set; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: set = new setClass.ptr(false, new sliceType$3([])); if (sc.Peek() === 94) { set.IsNot = true; sc.Next(); } isrange = false; /* while (true) { */ case 1: ch = sc.Peek(); _1 = ch; /* */ if (_1 === (-1)) { $s = 4; continue; } /* */ if (_1 === (93)) { $s = 5; continue; } /* */ if (_1 === (45)) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_1 === (-1)) { */ case 4: _r = newError(sc.CurrentPos(), "unexpected EOS", new sliceType([])); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $panic(_r); $s = 8; continue; /* } else if (_1 === (93)) { */ case 5: /* */ if (set.Classes.$length > 0) { $s = 10; continue; } /* */ $s = 11; continue; /* if (set.Classes.$length > 0) { */ case 10: sc.Next(); /* goto exit */ $s = 12; continue; /* } */ case 11: /* */ if (set.Classes.$length > 0) { $s = 13; continue; } /* */ $s = 14; continue; /* if (set.Classes.$length > 0) { */ case 13: sc.Next(); isrange = true; /* continue; */ $s = 1; continue; /* } */ case 14: _r$1 = parseClass(sc, false); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } set.Classes = $append(set.Classes, _r$1); $s = 8; continue; /* } else if (_1 === (45)) { */ case 6: /* */ if (set.Classes.$length > 0) { $s = 16; continue; } /* */ $s = 17; continue; /* if (set.Classes.$length > 0) { */ case 16: sc.Next(); isrange = true; /* continue; */ $s = 1; continue; /* } */ case 17: _r$2 = parseClass(sc, false); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } set.Classes = $append(set.Classes, _r$2); $s = 8; continue; /* } else { */ case 7: _r$3 = parseClass(sc, false); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } set.Classes = $append(set.Classes, _r$3); /* } */ case 8: case 3: if (isrange) { begin = (x = set.Classes, x$1 = set.Classes.$length - 2 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); end = (x$2 = set.Classes, x$3 = set.Classes.$length - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])); set.Classes = $subslice(set.Classes, 0, (set.Classes.$length - 2 >> 0)); set.Classes = $append(set.Classes, new rangeClass.ptr(begin, end)); isrange = false; } /* } */ $s = 1; continue; case 2: /* exit: */ case 12: if (isrange) { set.Classes = $append(set.Classes, new charClass.ptr(45)); } $s = -1; return set; /* */ } return; } if ($f === undefined) { $f = { $blk: parseClassSet }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.begin = begin; $f.ch = ch; $f.end = end; $f.isrange = isrange; $f.sc = sc; $f.set = set; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; parsePattern = function(sc, toplevel) { var _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, ch, ok, pat, ret, sc, spat, toplevel, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; ch = $f.ch; ok = $f.ok; pat = $f.pat; ret = $f.ret; sc = $f.sc; spat = $f.spat; toplevel = $f.toplevel; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pat = new seqPattern.ptr(false, false, sliceType$4.nil); if (toplevel) { if (sc.Peek() === 94) { sc.Next(); pat.MustHead = true; } } /* while (true) { */ case 1: ch = sc.Peek(); _1 = ch; /* */ if (_1 === (37)) { $s = 4; continue; } /* */ if ((_1 === (46)) || (_1 === (91)) || (_1 === (93))) { $s = 5; continue; } /* */ if (_1 === (41)) { $s = 6; continue; } /* */ if (_1 === (40)) { $s = 7; continue; } /* */ if ((_1 === (42)) || (_1 === (43)) || (_1 === (45)) || (_1 === (63))) { $s = 8; continue; } /* */ if (_1 === (36)) { $s = 9; continue; } /* */ if (_1 === (-1)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (37)) { */ case 4: sc.Save(); sc.Next(); _2 = sc.Peek(); /* */ if (_2 === (48)) { $s = 14; continue; } /* */ if ((_2 === (49)) || (_2 === (50)) || (_2 === (51)) || (_2 === (52)) || (_2 === (53)) || (_2 === (54)) || (_2 === (55)) || (_2 === (56)) || (_2 === (57))) { $s = 15; continue; } /* */ if (_2 === (98)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_2 === (48)) { */ case 14: _r = newError(sc.CurrentPos(), "invalid capture index", new sliceType([])); /* */ $s = 19; case 19: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $panic(_r); $s = 18; continue; /* } else if ((_2 === (49)) || (_2 === (50)) || (_2 === (51)) || (_2 === (52)) || (_2 === (53)) || (_2 === (54)) || (_2 === (55)) || (_2 === (56)) || (_2 === (57))) { */ case 15: pat.Patterns = $append(pat.Patterns, new numberPattern.ptr(sc.Next() - 48 >> 0)); $s = 18; continue; /* } else if (_2 === (98)) { */ case 16: sc.Next(); pat.Patterns = $append(pat.Patterns, new bracePattern.ptr(sc.Next(), sc.Next())); $s = 18; continue; /* } else { */ case 17: sc.Restore(); _r$1 = parseClass(sc, true); /* */ $s = 20; case 20: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } pat.Patterns = $append(pat.Patterns, new singlePattern.ptr(_r$1)); /* } */ case 18: case 13: $s = 12; continue; /* } else if ((_1 === (46)) || (_1 === (91)) || (_1 === (93))) { */ case 5: _r$2 = parseClass(sc, true); /* */ $s = 21; case 21: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } pat.Patterns = $append(pat.Patterns, new singlePattern.ptr(_r$2)); $s = 12; continue; /* } else if (_1 === (41)) { */ case 6: /* */ if (toplevel) { $s = 22; continue; } /* */ $s = 23; continue; /* if (toplevel) { */ case 22: _r$3 = newError(sc.CurrentPos(), "invalid ')'", new sliceType([])); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $panic(_r$3); /* } */ case 23: $s = -1; return pat; /* } else if (_1 === (40)) { */ case 7: sc.Next(); /* */ if (sc.Peek() === 41) { $s = 25; continue; } /* */ $s = 26; continue; /* if (sc.Peek() === 41) { */ case 25: sc.Next(); pat.Patterns = $append(pat.Patterns, new posCapPattern.ptr()); $s = 27; continue; /* } else { */ case 26: _r$4 = parsePattern(sc, false); /* */ $s = 28; case 28: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } ret = new capPattern.ptr(_r$4); /* */ if (!((sc.Peek() === 41))) { $s = 29; continue; } /* */ $s = 30; continue; /* if (!((sc.Peek() === 41))) { */ case 29: _r$5 = newError(sc.CurrentPos(), "unfinished capture", new sliceType([])); /* */ $s = 31; case 31: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $panic(_r$5); /* } */ case 30: sc.Next(); pat.Patterns = $append(pat.Patterns, ret); /* } */ case 27: $s = 12; continue; /* } else if ((_1 === (42)) || (_1 === (43)) || (_1 === (45)) || (_1 === (63))) { */ case 8: sc.Next(); if (pat.Patterns.$length > 0) { _tuple = $assertType((x = pat.Patterns, x$1 = pat.Patterns.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])), ptrType$1, true); spat = _tuple[0]; ok = _tuple[1]; if (ok) { pat.Patterns = $subslice(pat.Patterns, 0, (pat.Patterns.$length - 1 >> 0)); pat.Patterns = $append(pat.Patterns, new repeatPattern.ptr(ch, spat.Class)); /* continue; */ $s = 1; continue; } } pat.Patterns = $append(pat.Patterns, new singlePattern.ptr(new charClass.ptr(ch))); $s = 12; continue; /* } else if (_1 === (36)) { */ case 9: if (toplevel && ((sc.NextPos() === (sc.Length() - 1 >> 0)) || (sc.NextPos() === -1))) { pat.MustTail = true; } else { pat.Patterns = $append(pat.Patterns, new singlePattern.ptr(new charClass.ptr(ch))); } sc.Next(); $s = 12; continue; /* } else if (_1 === (-1)) { */ case 10: sc.Next(); /* goto exit */ $s = 32; continue; $s = 12; continue; /* } else { */ case 11: sc.Next(); pat.Patterns = $append(pat.Patterns, new singlePattern.ptr(new charClass.ptr(ch))); /* } */ case 12: case 3: /* } */ $s = 1; continue; case 2: /* exit: */ case 32: $s = -1; return pat; $s = -1; return ptrType$2.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: parsePattern }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.ch = ch; $f.ok = ok; $f.pat = pat; $f.ret = ret; $f.sc = sc; $f.spat = spat; $f.toplevel = toplevel; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; compilePattern = function(p, ps) { var _1, _i, _ref, _ref$1, _tmp, _tmp$1, c0, c1, cp, idx, p, pat, pat$1, pat$2, pat$3, pat$4, pat$5, pat$6, ps, ptr, toplevel; ptr = ptrType$3.nil; toplevel = false; if (ps.$length === 0) { toplevel = true; ptr = new iptr.ptr(new sliceType$5([new inst.ptr(5, $ifaceNil, 0, -1)]), 2); } else { ptr = (0 >= ps.$length ? ($throwRuntimeError("index out of range"), undefined) : ps.$array[ps.$offset + 0]); } _ref = p; if ($assertType(_ref, ptrType$1, true)[1]) { pat = _ref.$val; ptr.insts = $append(ptr.insts, new inst.ptr(0, pat.Class, -1, -1)); } else if ($assertType(_ref, ptrType$2, true)[1]) { pat$1 = _ref.$val; _ref$1 = pat$1.Patterns; _i = 0; while (true) { if (!(_i < _ref$1.$length)) { break; } cp = ((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]); compilePattern(cp, new sliceType$6([ptr])); _i++; } } else if ($assertType(_ref, ptrType$4, true)[1]) { pat$2 = _ref.$val; idx = ptr.insts.$length; _1 = pat$2.Type; if (_1 === (42)) { ptr.insts = $append(ptr.insts, new inst.ptr(4, $ifaceNil, idx + 1 >> 0, idx + 3 >> 0), new inst.ptr(0, pat$2.Class, -1, -1), new inst.ptr(3, $ifaceNil, idx, -1)); } else if (_1 === (43)) { ptr.insts = $append(ptr.insts, new inst.ptr(0, pat$2.Class, -1, -1), new inst.ptr(4, $ifaceNil, idx, idx + 2 >> 0)); } else if (_1 === (45)) { ptr.insts = $append(ptr.insts, new inst.ptr(4, $ifaceNil, idx + 3 >> 0, idx + 1 >> 0), new inst.ptr(0, pat$2.Class, -1, -1), new inst.ptr(3, $ifaceNil, idx, -1)); } else if (_1 === (63)) { ptr.insts = $append(ptr.insts, new inst.ptr(4, $ifaceNil, idx + 1 >> 0, idx + 2 >> 0), new inst.ptr(0, pat$2.Class, -1, -1)); } } else if ($assertType(_ref, ptrType$5, true)[1]) { pat$3 = _ref.$val; ptr.insts = $append(ptr.insts, new inst.ptr(6, $ifaceNil, ptr.capture, -1)); ptr.capture = ptr.capture + (2) >> 0; } else if ($assertType(_ref, ptrType$6, true)[1]) { pat$4 = _ref.$val; _tmp = ptr.capture; _tmp$1 = ptr.capture + 1 >> 0; c0 = _tmp; c1 = _tmp$1; ptr.capture = ptr.capture + (2) >> 0; ptr.insts = $append(ptr.insts, new inst.ptr(5, $ifaceNil, c0, -1)); compilePattern(pat$4.Pattern, new sliceType$6([ptr])); ptr.insts = $append(ptr.insts, new inst.ptr(5, $ifaceNil, c1, -1)); } else if ($assertType(_ref, ptrType$7, true)[1]) { pat$5 = _ref.$val; ptr.insts = $append(ptr.insts, new inst.ptr(7, $ifaceNil, pat$5.Begin, pat$5.End)); } else if ($assertType(_ref, ptrType$8, true)[1]) { pat$6 = _ref.$val; ptr.insts = $append(ptr.insts, new inst.ptr(8, $ifaceNil, pat$6.N, -1)); } if (toplevel) { if ($assertType(p, ptrType$2).MustTail) { ptr.insts = $append(ptr.insts, new inst.ptr(5, $ifaceNil, 1, -1), new inst.ptr(2, $ifaceNil, -1, -1)); } ptr.insts = $append(ptr.insts, new inst.ptr(5, $ifaceNil, 1, -1), new inst.ptr(1, $ifaceNil, -1, -1)); } return ptr.insts; }; recursiveVM = function(src, insts, pc, sp, ms) { var _1, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, _v, capture, count, i, idx, inst$1, insts, m, ms, nsp, nsp$1, ok, ok$1, pc, s, sp, src, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; capture = $f.capture; count = $f.count; i = $f.i; idx = $f.idx; inst$1 = $f.inst$1; insts = $f.insts; m = $f.m; ms = $f.ms; nsp = $f.nsp; nsp$1 = $f.nsp$1; ok = $f.ok; ok$1 = $f.ok$1; pc = $f.pc; s = $f.s; sp = $f.sp; src = $f.src; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: m = ptrType$9.nil; if (ms.$length === 0) { m = newMatchState(); } else { m = (0 >= ms.$length ? ($throwRuntimeError("index out of range"), undefined) : ms.$array[ms.$offset + 0]); } /* redo: */ case 1: inst$1 = $clone(((pc < 0 || pc >= insts.$length) ? ($throwRuntimeError("index out of range"), undefined) : insts.$array[insts.$offset + pc]), inst); _1 = inst$1.OpCode; /* */ if (_1 === (0)) { $s = 3; continue; } /* */ if (_1 === (1)) { $s = 4; continue; } /* */ if (_1 === (2)) { $s = 5; continue; } /* */ if (_1 === (3)) { $s = 6; continue; } /* */ if (_1 === (4)) { $s = 7; continue; } /* */ if (_1 === (5)) { $s = 8; continue; } /* */ if (_1 === (6)) { $s = 9; continue; } /* */ if (_1 === (7)) { $s = 10; continue; } /* */ if (_1 === (8)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_1 === (0)) { */ case 3: if (sp >= src.$length) { _v = true; $s = 15; continue s; } _r = inst$1.Class.Matches(((((sp < 0 || sp >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + sp]) >> 0))); /* */ $s = 16; case 16: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = !_r; case 15: /* */ if (_v) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_v) { */ case 13: $s = -1; return [false, sp, m]; /* } */ case 14: pc = pc + (1) >> 0; sp = sp + (1) >> 0; /* goto redo */ $s = 1; continue; $s = 12; continue; /* } else if (_1 === (1)) { */ case 4: $s = -1; return [true, sp, m]; /* } else if (_1 === (2)) { */ case 5: $s = -1; return [sp >= src.$length, sp, m]; /* } else if (_1 === (3)) { */ case 6: pc = inst$1.Operand1; /* goto redo */ $s = 1; continue; $s = 12; continue; /* } else if (_1 === (4)) { */ case 7: _r$1 = recursiveVM(src, insts, inst$1.Operand1, sp, new sliceType$7([m])); /* */ $s = 17; case 17: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; ok = _tuple[0]; nsp = _tuple[1]; if (ok) { $s = -1; return [true, nsp, m]; } pc = inst$1.Operand2; /* goto redo */ $s = 1; continue; $s = 12; continue; /* } else if (_1 === (5)) { */ case 8: s = m.setCapture(inst$1.Operand1, sp); _r$2 = recursiveVM(src, insts, pc + 1 >> 0, sp, new sliceType$7([m])); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; ok$1 = _tuple$1[0]; nsp$1 = _tuple$1[1]; if (ok$1) { $s = -1; return [true, nsp$1, m]; } m.restoreCapture(inst$1.Operand1, s); $s = -1; return [false, sp, m]; /* } else if (_1 === (6)) { */ case 9: m.addPosCapture(inst$1.Operand1, sp + 1 >> 0); pc = pc + (1) >> 0; /* goto redo */ $s = 1; continue; $s = 12; continue; /* } else if (_1 === (7)) { */ case 10: if (sp >= src.$length || !((((((sp < 0 || sp >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + sp]) >> 0)) === inst$1.Operand1))) { $s = -1; return [false, sp, m]; } count = 1; sp = sp + 1 >> 0; /* while (true) { */ case 19: /* if (!(sp < src.$length)) { break; } */ if(!(sp < src.$length)) { $s = 20; continue; } if (((((sp < 0 || sp >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + sp]) >> 0)) === inst$1.Operand2) { count = count - (1) >> 0; } /* */ if (count === 0) { $s = 21; continue; } /* */ $s = 22; continue; /* if (count === 0) { */ case 21: pc = pc + (1) >> 0; sp = sp + (1) >> 0; /* goto redo */ $s = 1; continue; /* } */ case 22: if (((((sp < 0 || sp >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + sp]) >> 0)) === inst$1.Operand1) { count = count + (1) >> 0; } sp = sp + (1) >> 0; /* } */ $s = 19; continue; case 20: $s = -1; return [false, sp, m]; /* } else if (_1 === (8)) { */ case 11: idx = $imul(inst$1.Operand1, 2); /* */ if (idx >= (m.CaptureLength() - 1 >> 0)) { $s = 23; continue; } /* */ $s = 24; continue; /* if (idx >= (m.CaptureLength() - 1 >> 0)) { */ case 23: _r$3 = newError(-2, "invalid capture index", new sliceType([])); /* */ $s = 25; case 25: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $panic(_r$3); /* } */ case 24: capture = $subslice(src, m.Capture(idx), m.Capture(idx + 1 >> 0)); i = 0; while (true) { if (!(i < capture.$length)) { break; } if ((i + sp >> 0) >= src.$length || !((((i < 0 || i >= capture.$length) ? ($throwRuntimeError("index out of range"), undefined) : capture.$array[capture.$offset + i]) === (x = i + sp >> 0, ((x < 0 || x >= src.$length) ? ($throwRuntimeError("index out of range"), undefined) : src.$array[src.$offset + x]))))) { $s = -1; return [false, sp, m]; } i = i + (1) >> 0; } pc = pc + (1) >> 0; sp = sp + (capture.$length) >> 0; /* goto redo */ $s = 1; continue; /* } */ case 12: case 2: $panic(new $String("should not reach here")); $s = -1; return [false, 0, ptrType$9.nil]; /* */ } return; } if ($f === undefined) { $f = { $blk: recursiveVM }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.capture = capture; $f.count = count; $f.i = i; $f.idx = idx; $f.inst$1 = inst$1; $f.insts = insts; $f.m = m; $f.ms = ms; $f.nsp = nsp; $f.nsp$1 = nsp$1; $f.ok = ok; $f.ok$1 = ok$1; $f.pc = pc; $f.s = s; $f.sp = sp; $f.src = src; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Find = function(p, src, offset, limit) { var _r, _r$1, _tuple, err, insts, limit, matches, ms, nsp, offset, ok, p, pat, sp, src, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; insts = $f.insts; limit = $f.limit; matches = $f.matches; ms = $f.ms; nsp = $f.nsp; offset = $f.offset; ok = $f.ok; p = $f.p; pat = $f.pat; sp = $f.sp; src = $f.src; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = [err]; matches = sliceType$7.nil; err[0] = $ifaceNil; $deferred.push([(function(err) { return function() { var _tuple, ok, perr, v; v = $recover(); if (!($interfaceIsEqual(v, $ifaceNil))) { _tuple = $assertType(v, ptrType$10, true); perr = _tuple[0]; ok = _tuple[1]; if (ok) { err[0] = perr; } else { $panic(v); } } }; })(err), []]); _r = parsePattern(newScanner((new sliceType$2($stringToBytes(p)))), true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } pat = _r; insts = compilePattern(pat, new sliceType$6([])); matches = new sliceType$7([]); sp = offset; /* while (true) { */ case 2: /* if (!(sp <= src.$length)) { break; } */ if(!(sp <= src.$length)) { $s = 3; continue; } _r$1 = recursiveVM(src, insts, 0, sp, new sliceType$7([])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; ok = _tuple[0]; nsp = _tuple[1]; ms = _tuple[2]; sp = sp + (1) >> 0; if (ok) { if (sp < nsp) { sp = nsp; } matches = $append(matches, ms); } if ((matches.$length === limit) || pat.MustHead) { /* break; */ $s = 3; continue; } /* } */ $s = 2; continue; case 3: $s = -1; return [matches, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [matches, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Find }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.insts = insts; $f.limit = limit; $f.matches = matches; $f.ms = ms; $f.nsp = nsp; $f.offset = offset; $f.ok = ok; $f.p = p; $f.pat = pat; $f.sp = sp; $f.src = src; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Find = Find; ptrType$10.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$9.methods = [{prop: "addPosCapture", name: "addPosCapture", pkg: "github.com/J-J-J/goluajit/pm", typ: $funcType([$Int, $Int], [], false)}, {prop: "setCapture", name: "setCapture", pkg: "github.com/J-J-J/goluajit/pm", typ: $funcType([$Int, $Int], [$Uint32], false)}, {prop: "restoreCapture", name: "restoreCapture", pkg: "github.com/J-J-J/goluajit/pm", typ: $funcType([$Int, $Uint32], [], false)}, {prop: "CaptureLength", name: "CaptureLength", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "IsPosCapture", name: "IsPosCapture", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Capture", name: "Capture", pkg: "", typ: $funcType([$Int], [$Int], false)}]; ptrType$11.methods = [{prop: "Length", name: "Length", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "CurrentPos", name: "CurrentPos", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NextPos", name: "NextPos", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Peek", name: "Peek", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Save", name: "Save", pkg: "", typ: $funcType([], [], false)}, {prop: "Restore", name: "Restore", pkg: "", typ: $funcType([], [], false)}]; ptrType$12.methods = [{prop: "Matches", name: "Matches", pkg: "", typ: $funcType([$Int], [$Bool], false)}]; ptrType.methods = [{prop: "Matches", name: "Matches", pkg: "", typ: $funcType([$Int], [$Bool], false)}]; ptrType$13.methods = [{prop: "Matches", name: "Matches", pkg: "", typ: $funcType([$Int], [$Bool], false)}]; ptrType$14.methods = [{prop: "Matches", name: "Matches", pkg: "", typ: $funcType([$Int], [$Bool], false)}]; ptrType$15.methods = [{prop: "Matches", name: "Matches", pkg: "", typ: $funcType([$Int], [$Bool], false)}]; Error.init("", [{prop: "Pos", name: "Pos", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}]); MatchData.init("github.com/J-J-J/goluajit/pm", [{prop: "captures", name: "captures", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); scannerState.init("github.com/J-J-J/goluajit/pm", [{prop: "Pos", name: "Pos", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "started", name: "started", embedded: false, exported: false, typ: $Bool, tag: ""}]); scanner.init("github.com/J-J-J/goluajit/pm", [{prop: "src", name: "src", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "State", name: "State", embedded: false, exported: true, typ: scannerState, tag: ""}, {prop: "saved", name: "saved", embedded: false, exported: false, typ: scannerState, tag: ""}]); inst.init("", [{prop: "OpCode", name: "OpCode", embedded: false, exported: true, typ: opCode, tag: ""}, {prop: "Class", name: "Class", embedded: false, exported: true, typ: class$1, tag: ""}, {prop: "Operand1", name: "Operand1", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Operand2", name: "Operand2", embedded: false, exported: true, typ: $Int, tag: ""}]); class$1.init([{prop: "Matches", name: "Matches", pkg: "", typ: $funcType([$Int], [$Bool], false)}]); dotClass.init("", []); charClass.init("", [{prop: "Ch", name: "Ch", embedded: false, exported: true, typ: $Int, tag: ""}]); singleClass.init("", [{prop: "Class", name: "Class", embedded: false, exported: true, typ: $Int, tag: ""}]); setClass.init("", [{prop: "IsNot", name: "IsNot", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Classes", name: "Classes", embedded: false, exported: true, typ: sliceType$3, tag: ""}]); rangeClass.init("", [{prop: "Begin", name: "Begin", embedded: false, exported: true, typ: class$1, tag: ""}, {prop: "End", name: "End", embedded: false, exported: true, typ: class$1, tag: ""}]); pattern.init([]); singlePattern.init("", [{prop: "Class", name: "Class", embedded: false, exported: true, typ: class$1, tag: ""}]); seqPattern.init("", [{prop: "MustHead", name: "MustHead", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "MustTail", name: "MustTail", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Patterns", name: "Patterns", embedded: false, exported: true, typ: sliceType$4, tag: ""}]); repeatPattern.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Class", name: "Class", embedded: false, exported: true, typ: class$1, tag: ""}]); posCapPattern.init("", []); capPattern.init("", [{prop: "Pattern", name: "Pattern", embedded: false, exported: true, typ: pattern, tag: ""}]); numberPattern.init("", [{prop: "N", name: "N", embedded: false, exported: true, typ: $Int, tag: ""}]); bracePattern.init("", [{prop: "Begin", name: "Begin", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "End", name: "End", embedded: false, exported: true, typ: $Int, tag: ""}]); iptr.init("github.com/J-J-J/goluajit/pm", [{prop: "insts", name: "insts", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "capture", name: "capture", embedded: false, exported: false, typ: $Int, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = fmt.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["sort"] = (function() { var $pkg = {}, $init, reflect, insertionSort, siftDown, heapSort, medianOfThree, doPivot, quickSort, Sort, maxDepth; reflect = $packages["reflect"]; insertionSort = function(data, a, b) { var _r, _v, a, b, data, i, j, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _v = $f._v; a = $f.a; b = $f.b; data = $f.data; i = $f.i; j = $f.j; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: i = a + 1 >> 0; /* while (true) { */ case 1: /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 2; continue; } j = i; /* while (true) { */ case 3: if (!(j > a)) { _v = false; $s = 5; continue s; } _r = data.Less(j, j - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 5: /* if (!(_v)) { break; } */ if(!(_v)) { $s = 4; continue; } $r = data.Swap(j, j - 1 >> 0); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } j = j - (1) >> 0; /* } */ $s = 3; continue; case 4: i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: insertionSort }; } $f._r = _r; $f._v = _v; $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.j = j; $f.$s = $s; $f.$r = $r; return $f; }; siftDown = function(data, lo, hi, first) { var _r, _r$1, _v, child, data, first, hi, lo, root, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; child = $f.child; data = $f.data; first = $f.first; hi = $f.hi; lo = $f.lo; root = $f.root; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: root = lo; /* while (true) { */ case 1: child = ($imul(2, root)) + 1 >> 0; if (child >= hi) { /* break; */ $s = 2; continue; } if (!((child + 1 >> 0) < hi)) { _v = false; $s = 5; continue s; } _r = data.Less(first + child >> 0, (first + child >> 0) + 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 5: /* */ if (_v) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_v) { */ case 3: child = child + (1) >> 0; /* } */ case 4: _r$1 = data.Less(first + root >> 0, first + child >> 0); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!_r$1) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!_r$1) { */ case 7: $s = -1; return; /* } */ case 8: $r = data.Swap(first + root >> 0, first + child >> 0); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } root = child; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: siftDown }; } $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.child = child; $f.data = data; $f.first = first; $f.hi = hi; $f.lo = lo; $f.root = root; $f.$s = $s; $f.$r = $r; return $f; }; heapSort = function(data, a, b) { var _q, a, b, data, first, hi, i, i$1, lo, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; a = $f.a; b = $f.b; data = $f.data; first = $f.first; hi = $f.hi; i = $f.i; i$1 = $f.i$1; lo = $f.lo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: first = a; lo = 0; hi = b - a >> 0; i = (_q = ((hi - 1 >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); /* while (true) { */ case 1: /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 2; continue; } $r = siftDown(data, i, hi, first); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i - (1) >> 0; /* } */ $s = 1; continue; case 2: i$1 = hi - 1 >> 0; /* while (true) { */ case 4: /* if (!(i$1 >= 0)) { break; } */ if(!(i$1 >= 0)) { $s = 5; continue; } $r = data.Swap(first, first + i$1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = siftDown(data, lo, i$1, first); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i$1 = i$1 - (1) >> 0; /* } */ $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: heapSort }; } $f._q = _q; $f.a = a; $f.b = b; $f.data = data; $f.first = first; $f.hi = hi; $f.i = i; $f.i$1 = i$1; $f.lo = lo; $f.$s = $s; $f.$r = $r; return $f; }; medianOfThree = function(data, m1, m0, m2) { var _r, _r$1, _r$2, data, m0, m1, m2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; data = $f.data; m0 = $f.m0; m1 = $f.m1; m2 = $f.m2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = data.Less(m1, m0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r) { */ case 1: $r = data.Swap(m1, m0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r$1 = data.Less(m2, m1); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_r$1) { */ case 5: $r = data.Swap(m2, m1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = data.Less(m1, m0); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_r$2) { */ case 9: $r = data.Swap(m1, m0); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: medianOfThree }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.data = data; $f.m0 = m0; $f.m1 = m1; $f.m2 = m2; $f.$s = $s; $f.$r = $r; return $f; }; doPivot = function(data, lo, hi) { var _q, _q$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, _tmp$2, _tmp$3, _v, _v$1, _v$2, _v$3, _v$4, a, b, c, data, dups, hi, lo, m, midhi, midlo, pivot, protect, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _q = $f._q; _q$1 = $f._q$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; a = $f.a; b = $f.b; c = $f.c; data = $f.data; dups = $f.dups; hi = $f.hi; lo = $f.lo; m = $f.m; midhi = $f.midhi; midlo = $f.midlo; pivot = $f.pivot; protect = $f.protect; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: midlo = 0; midhi = 0; m = ((((((lo + hi >> 0) >>> 0)) >>> 1 >>> 0) >> 0)); /* */ if ((hi - lo >> 0) > 40) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((hi - lo >> 0) > 40) { */ case 1: s = (_q = ((hi - lo >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); $r = medianOfThree(data, lo, lo + s >> 0, lo + ($imul(2, s)) >> 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = medianOfThree(data, m, m - s >> 0, m + s >> 0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = medianOfThree(data, hi - 1 >> 0, (hi - 1 >> 0) - s >> 0, (hi - 1 >> 0) - ($imul(2, s)) >> 0); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $r = medianOfThree(data, lo, m, hi - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } pivot = lo; _tmp = lo + 1 >> 0; _tmp$1 = hi - 1 >> 0; a = _tmp; c = _tmp$1; /* while (true) { */ case 7: if (!(a < c)) { _v = false; $s = 9; continue s; } _r = data.Less(a, pivot); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _v = _r; case 9: /* if (!(_v)) { break; } */ if(!(_v)) { $s = 8; continue; } a = a + (1) >> 0; /* } */ $s = 7; continue; case 8: b = a; /* while (true) { */ case 11: /* while (true) { */ case 13: if (!(b < c)) { _v$1 = false; $s = 15; continue s; } _r$1 = data.Less(pivot, b); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _v$1 = !_r$1; case 15: /* if (!(_v$1)) { break; } */ if(!(_v$1)) { $s = 14; continue; } b = b + (1) >> 0; /* } */ $s = 13; continue; case 14: /* while (true) { */ case 17: if (!(b < c)) { _v$2 = false; $s = 19; continue s; } _r$2 = data.Less(pivot, c - 1 >> 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v$2 = _r$2; case 19: /* if (!(_v$2)) { break; } */ if(!(_v$2)) { $s = 18; continue; } c = c - (1) >> 0; /* } */ $s = 17; continue; case 18: if (b >= c) { /* break; */ $s = 12; continue; } $r = data.Swap(b, c - 1 >> 0); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } b = b + (1) >> 0; c = c - (1) >> 0; /* } */ $s = 11; continue; case 12: protect = (hi - c >> 0) < 5; /* */ if (!protect && (hi - c >> 0) < (_q$1 = ((hi - lo >> 0)) / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero"))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!protect && (hi - c >> 0) < (_q$1 = ((hi - lo >> 0)) / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero"))) { */ case 22: dups = 0; _r$3 = data.Less(pivot, hi - 1 >> 0); /* */ $s = 26; case 26: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (!_r$3) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!_r$3) { */ case 24: $r = data.Swap(c, hi - 1 >> 0); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c = c + (1) >> 0; dups = dups + (1) >> 0; /* } */ case 25: _r$4 = data.Less(b - 1 >> 0, pivot); /* */ $s = 30; case 30: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (!_r$4) { $s = 28; continue; } /* */ $s = 29; continue; /* if (!_r$4) { */ case 28: b = b - (1) >> 0; dups = dups + (1) >> 0; /* } */ case 29: _r$5 = data.Less(m, pivot); /* */ $s = 33; case 33: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if (!_r$5) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!_r$5) { */ case 31: $r = data.Swap(m, b - 1 >> 0); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } b = b - (1) >> 0; dups = dups + (1) >> 0; /* } */ case 32: protect = dups > 1; /* } */ case 23: /* */ if (protect) { $s = 35; continue; } /* */ $s = 36; continue; /* if (protect) { */ case 35: /* while (true) { */ case 37: /* while (true) { */ case 39: if (!(a < b)) { _v$3 = false; $s = 41; continue s; } _r$6 = data.Less(b - 1 >> 0, pivot); /* */ $s = 42; case 42: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _v$3 = !_r$6; case 41: /* if (!(_v$3)) { break; } */ if(!(_v$3)) { $s = 40; continue; } b = b - (1) >> 0; /* } */ $s = 39; continue; case 40: /* while (true) { */ case 43: if (!(a < b)) { _v$4 = false; $s = 45; continue s; } _r$7 = data.Less(a, pivot); /* */ $s = 46; case 46: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _v$4 = _r$7; case 45: /* if (!(_v$4)) { break; } */ if(!(_v$4)) { $s = 44; continue; } a = a + (1) >> 0; /* } */ $s = 43; continue; case 44: if (a >= b) { /* break; */ $s = 38; continue; } $r = data.Swap(a, b - 1 >> 0); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } a = a + (1) >> 0; b = b - (1) >> 0; /* } */ $s = 37; continue; case 38: /* } */ case 36: $r = data.Swap(pivot, b - 1 >> 0); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tmp$2 = b - 1 >> 0; _tmp$3 = c; midlo = _tmp$2; midhi = _tmp$3; $s = -1; return [midlo, midhi]; /* */ } return; } if ($f === undefined) { $f = { $blk: doPivot }; } $f._q = _q; $f._q$1 = _q$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f.a = a; $f.b = b; $f.c = c; $f.data = data; $f.dups = dups; $f.hi = hi; $f.lo = lo; $f.m = m; $f.midhi = midhi; $f.midlo = midlo; $f.pivot = pivot; $f.protect = protect; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; quickSort = function(data, a, b, maxDepth$1) { var _r, _r$1, _tuple, a, b, data, i, maxDepth$1, mhi, mlo, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; b = $f.b; data = $f.data; i = $f.i; maxDepth$1 = $f.maxDepth$1; mhi = $f.mhi; mlo = $f.mlo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* while (true) { */ case 1: /* if (!((b - a >> 0) > 12)) { break; } */ if(!((b - a >> 0) > 12)) { $s = 2; continue; } /* */ if (maxDepth$1 === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (maxDepth$1 === 0) { */ case 3: $r = heapSort(data, a, b); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 4: maxDepth$1 = maxDepth$1 - (1) >> 0; _r = doPivot(data, a, b); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; mlo = _tuple[0]; mhi = _tuple[1]; /* */ if ((mlo - a >> 0) < (b - mhi >> 0)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((mlo - a >> 0) < (b - mhi >> 0)) { */ case 7: $r = quickSort(data, a, mlo, maxDepth$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } a = mhi; $s = 9; continue; /* } else { */ case 8: $r = quickSort(data, mhi, b, maxDepth$1); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } b = mlo; /* } */ case 9: /* } */ $s = 1; continue; case 2: /* */ if ((b - a >> 0) > 1) { $s = 12; continue; } /* */ $s = 13; continue; /* if ((b - a >> 0) > 1) { */ case 12: i = a + 6 >> 0; /* while (true) { */ case 14: /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 15; continue; } _r$1 = data.Less(i, i - 6 >> 0); /* */ $s = 18; case 18: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_r$1) { */ case 16: $r = data.Swap(i, i - 6 >> 0); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: i = i + (1) >> 0; /* } */ $s = 14; continue; case 15: $r = insertionSort(data, a, b); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: quickSort }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.maxDepth$1 = maxDepth$1; $f.mhi = mhi; $f.mlo = mlo; $f.$s = $s; $f.$r = $r; return $f; }; Sort = function(data) { var _r, data, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; data = $f.data; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = data.Len(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; $r = quickSort(data, 0, n, maxDepth(n)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Sort }; } $f._r = _r; $f.data = data; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Sort = Sort; maxDepth = function(n) { var depth, i, n; depth = 0; i = n; while (true) { if (!(i > 0)) { break; } depth = depth + (1) >> 0; i = (i >> $min((1), 31)) >> 0; } return $imul(depth, 2); }; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = reflect.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["path/filepath"] = (function() { var $pkg = {}, $init, errors, os, runtime, sort, strings, utf8, lazybuf, sliceType, sliceType$1, ptrType$1, Clean, FromSlash, SplitList, Join, Abs, unixAbs, Base, Dir, VolumeName, IsAbs, volumeNameLen, splitList, abs, join; errors = $packages["errors"]; os = $packages["os"]; runtime = $packages["runtime"]; sort = $packages["sort"]; strings = $packages["strings"]; utf8 = $packages["unicode/utf8"]; lazybuf = $pkg.lazybuf = $newType(0, $kindStruct, "filepath.lazybuf", true, "path/filepath", false, function(path_, buf_, w_, volAndPath_, volLen_) { this.$val = this; if (arguments.length === 0) { this.path = ""; this.buf = sliceType$1.nil; this.w = 0; this.volAndPath = ""; this.volLen = 0; return; } this.path = path_; this.buf = buf_; this.w = w_; this.volAndPath = volAndPath_; this.volLen = volLen_; }); sliceType = $sliceType($String); sliceType$1 = $sliceType($Uint8); ptrType$1 = $ptrType(lazybuf); lazybuf.ptr.prototype.index = function(i) { var b, i, x; b = this; if (!(b.buf === sliceType$1.nil)) { return (x = b.buf, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); } return b.path.charCodeAt(i); }; lazybuf.prototype.index = function(i) { return this.$val.index(i); }; lazybuf.ptr.prototype.append = function(c) { var b, c, x, x$1; b = this; if (b.buf === sliceType$1.nil) { if (b.w < b.path.length && (b.path.charCodeAt(b.w) === c)) { b.w = b.w + (1) >> 0; return; } b.buf = $makeSlice(sliceType$1, b.path.length); $copyString(b.buf, $substring(b.path, 0, b.w)); } (x = b.buf, x$1 = b.w, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = c)); b.w = b.w + (1) >> 0; }; lazybuf.prototype.append = function(c) { return this.$val.append(c); }; lazybuf.ptr.prototype.string = function() { var b; b = this; if (b.buf === sliceType$1.nil) { return $substring(b.volAndPath, 0, (b.volLen + b.w >> 0)); } return $substring(b.volAndPath, 0, b.volLen) + ($bytesToString($subslice(b.buf, 0, b.w))); }; lazybuf.prototype.string = function() { return this.$val.string(); }; Clean = function(path) { var _tmp, _tmp$1, _tmp$2, _tmp$3, dotdot, n, originalPath, out, path, r, rooted, volLen; originalPath = path; volLen = volumeNameLen(path); path = $substring(path, volLen); if (path === "") { if (volLen > 1 && !((originalPath.charCodeAt(1) === 58))) { return FromSlash(originalPath); } return originalPath + "."; } rooted = os.IsPathSeparator(path.charCodeAt(0)); n = path.length; out = new lazybuf.ptr(path, sliceType$1.nil, 0, originalPath, volLen); _tmp = 0; _tmp$1 = 0; r = _tmp; dotdot = _tmp$1; if (rooted) { out.append(47); _tmp$2 = 1; _tmp$3 = 1; r = _tmp$2; dotdot = _tmp$3; } while (true) { if (!(r < n)) { break; } if (os.IsPathSeparator(path.charCodeAt(r))) { r = r + (1) >> 0; } else if ((path.charCodeAt(r) === 46) && (((r + 1 >> 0) === n) || os.IsPathSeparator(path.charCodeAt((r + 1 >> 0))))) { r = r + (1) >> 0; } else if ((path.charCodeAt(r) === 46) && (path.charCodeAt((r + 1 >> 0)) === 46) && (((r + 2 >> 0) === n) || os.IsPathSeparator(path.charCodeAt((r + 2 >> 0))))) { r = r + (2) >> 0; if (out.w > dotdot) { out.w = out.w - (1) >> 0; while (true) { if (!(out.w > dotdot && !os.IsPathSeparator(out.index(out.w)))) { break; } out.w = out.w - (1) >> 0; } } else if (!rooted) { if (out.w > 0) { out.append(47); } out.append(46); out.append(46); dotdot = out.w; } } else { if (rooted && !((out.w === 1)) || !rooted && !((out.w === 0))) { out.append(47); } while (true) { if (!(r < n && !os.IsPathSeparator(path.charCodeAt(r)))) { break; } out.append(path.charCodeAt(r)); r = r + (1) >> 0; } } } if (out.w === 0) { out.append(46); } return FromSlash(out.string()); }; $pkg.Clean = Clean; FromSlash = function(path) { var path; if (true) { return path; } return strings.Replace(path, "/", "/", -1); }; $pkg.FromSlash = FromSlash; SplitList = function(path) { var path; return splitList(path); }; $pkg.SplitList = SplitList; Join = function(elem) { var elem; return join(elem); }; $pkg.Join = Join; Abs = function(path) { var _r, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = abs(path); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Abs }; } $f._r = _r; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Abs = Abs; unixAbs = function(path) { var _r, _tuple, err, path, wd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; path = $f.path; wd = $f.wd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (IsAbs(path)) { $s = -1; return [Clean(path), $ifaceNil]; } _r = os.Getwd(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; wd = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } $s = -1; return [Join(new sliceType([wd, path])), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: unixAbs }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.path = path; $f.wd = wd; $f.$s = $s; $f.$r = $r; return $f; }; Base = function(path) { var i, path; if (path === "") { return "."; } while (true) { if (!(path.length > 0 && os.IsPathSeparator(path.charCodeAt((path.length - 1 >> 0))))) { break; } path = $substring(path, 0, (path.length - 1 >> 0)); } path = $substring(path, VolumeName(path).length); i = path.length - 1 >> 0; while (true) { if (!(i >= 0 && !os.IsPathSeparator(path.charCodeAt(i)))) { break; } i = i - (1) >> 0; } if (i >= 0) { path = $substring(path, (i + 1 >> 0)); } if (path === "") { return "/"; } return path; }; $pkg.Base = Base; Dir = function(path) { var dir, i, path, vol; vol = VolumeName(path); i = path.length - 1 >> 0; while (true) { if (!(i >= vol.length && !os.IsPathSeparator(path.charCodeAt(i)))) { break; } i = i - (1) >> 0; } dir = Clean($substring(path, vol.length, (i + 1 >> 0))); if (dir === "." && vol.length > 2) { return vol; } return vol + dir; }; $pkg.Dir = Dir; VolumeName = function(path) { var path; return $substring(path, 0, volumeNameLen(path)); }; $pkg.VolumeName = VolumeName; IsAbs = function(path) { var path; return strings.HasPrefix(path, "/"); }; $pkg.IsAbs = IsAbs; volumeNameLen = function(path) { var path; return 0; }; splitList = function(path) { var path; if (path === "") { return new sliceType([]); } return strings.Split(path, ":"); }; abs = function(path) { var _r, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = unixAbs(path); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: abs }; } $f._r = _r; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; join = function(elem) { var _i, _ref, e, elem, i; _ref = elem; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; e = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!(e === "")) { return Clean(strings.Join($subslice(elem, i), "/")); } _i++; } return ""; }; ptrType$1.methods = [{prop: "index", name: "index", pkg: "path/filepath", typ: $funcType([$Int], [$Uint8], false)}, {prop: "append", name: "append", pkg: "path/filepath", typ: $funcType([$Uint8], [], false)}, {prop: "string", name: "string", pkg: "path/filepath", typ: $funcType([], [$String], false)}]; lazybuf.init("path/filepath", [{prop: "path", name: "path", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "w", name: "w", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "volAndPath", name: "volAndPath", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "volLen", name: "volLen", embedded: false, exported: false, typ: $Int, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = utf8.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $pkg.ErrBadPattern = errors.New("syntax error in pattern"); $pkg.SkipDir = errors.New("skip this directory"); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["io/ioutil"] = (function() { var $pkg = {}, $init, bytes, io, os, filepath, sort, strconv, strings, sync, time, sliceType, sliceType$1, ptrType, arrayType, ptrType$1, sliceType$3, blackHolePool, rand, randmu, readAll, ReadAll, reseed, nextRandom, TempFile; bytes = $packages["bytes"]; io = $packages["io"]; os = $packages["os"]; filepath = $packages["path/filepath"]; sort = $packages["sort"]; strconv = $packages["strconv"]; strings = $packages["strings"]; sync = $packages["sync"]; time = $packages["time"]; sliceType = $sliceType($emptyInterface); sliceType$1 = $sliceType($Uint8); ptrType = $ptrType(sliceType$1); arrayType = $arrayType($Uint8, 64); ptrType$1 = $ptrType(os.File); sliceType$3 = $sliceType($String); readAll = function(r, capacity) { var _r, _tmp, _tmp$1, _tuple, b, buf, capacity, err, r, x, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; b = $f.b; buf = $f.buf; capacity = $f.capacity; err = $f.err; r = $f.r; x = $f.x; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = [err]; b = sliceType$1.nil; err[0] = $ifaceNil; buf = new bytes.Buffer.ptr(sliceType$1.nil, 0, arrayType.zero(), 0); $deferred.push([(function(err) { return function() { var _tuple, e, ok, panicErr; e = $recover(); if ($interfaceIsEqual(e, $ifaceNil)) { return; } _tuple = $assertType(e, $error, true); panicErr = _tuple[0]; ok = _tuple[1]; if (ok && $interfaceIsEqual(panicErr, bytes.ErrTooLarge)) { err[0] = panicErr; } else { $panic(e); } }; })(err), []]); if ((x = (new $Int64(0, (((capacity.$low + ((capacity.$high >> 31) * 4294967296)) >> 0)))), (x.$high === capacity.$high && x.$low === capacity.$low))) { buf.Grow((((capacity.$low + ((capacity.$high >> 31) * 4294967296)) >> 0))); } _r = buf.ReadFrom(r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err[0] = _tuple[1]; _tmp = buf.Bytes(); _tmp$1 = err[0]; b = _tmp; err[0] = _tmp$1; $s = -1; return [b, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [b, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: readAll }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.b = b; $f.buf = buf; $f.capacity = capacity; $f.err = err; $f.r = r; $f.x = x; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; ReadAll = function(r) { var _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = readAll(r, new $Int64(0, 512)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAll }; } $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.ReadAll = ReadAll; reseed = function() { var x, x$1; return (((x = $clone(time.Now(), time.Time).UnixNano(), x$1 = (new $Int64(0, os.Getpid())), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)).$low >>> 0)); }; nextRandom = function() { var _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = randmu.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r = rand; if (r === 0) { r = reseed(); } r = ($imul(r, 1664525) >>> 0) + 1013904223 >>> 0; rand = r; $r = randmu.Unlock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $substring(strconv.Itoa((((1000000000 + (_r = r % 1000000000, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >>> 0) >> 0))), 1); /* */ } return; } if ($f === undefined) { $f = { $blk: nextRandom }; } $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; TempFile = function(dir, pattern) { var _arg, _arg$1, _r, _r$1, _r$2, _r$3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, dir, err, f, i, name, nconflict, pattern, pos, prefix, suffix, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; dir = $f.dir; err = $f.err; f = $f.f; i = $f.i; name = $f.name; nconflict = $f.nconflict; pattern = $f.pattern; pos = $f.pos; prefix = $f.prefix; suffix = $f.suffix; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = ptrType$1.nil; err = $ifaceNil; /* */ if (dir === "") { $s = 1; continue; } /* */ $s = 2; continue; /* if (dir === "") { */ case 1: _r = os.TempDir(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } dir = _r; /* } */ case 2: _tmp = ""; _tmp$1 = ""; prefix = _tmp; suffix = _tmp$1; pos = strings.LastIndex(pattern, "*"); if (!((pos === -1))) { _tmp$2 = $substring(pattern, 0, pos); _tmp$3 = $substring(pattern, (pos + 1 >> 0)); prefix = _tmp$2; suffix = _tmp$3; } else { prefix = pattern; } nconflict = 0; i = 0; /* while (true) { */ case 4: /* if (!(i < 10000)) { break; } */ if(!(i < 10000)) { $s = 5; continue; } _arg = dir; _r$1 = nextRandom(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = prefix + _r$1 + suffix; _r$2 = filepath.Join(new sliceType$3([_arg, _arg$1])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } name = _r$2; _r$3 = os.OpenFile(name, 194, 384); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; f = _tuple[0]; err = _tuple[1]; /* */ if (os.IsExist(err)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (os.IsExist(err)) { */ case 9: nconflict = nconflict + (1) >> 0; /* */ if (nconflict > 10) { $s = 11; continue; } /* */ $s = 12; continue; /* if (nconflict > 10) { */ case 11: $r = randmu.Lock(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } rand = reseed(); $r = randmu.Unlock(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: i = i + (1) >> 0; /* continue; */ $s = 4; continue; /* } */ case 10: /* break; */ $s = 5; continue; /* } */ $s = 4; continue; case 5: $s = -1; return [f, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: TempFile }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.dir = dir; $f.err = err; $f.f = f; $f.i = i; $f.name = name; $f.nconflict = nconflict; $f.pattern = pattern; $f.pos = pos; $f.prefix = prefix; $f.suffix = suffix; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.TempFile = TempFile; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = filepath.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } rand = 0; randmu = new sync.Mutex.ptr(0, 0); blackHolePool = new sync.Pool.ptr(0, 0, sliceType.nil, (function() { var b, b$24ptr; b = $makeSlice(sliceType$1, 8192); return (b$24ptr || (b$24ptr = new ptrType(function() { return b; }, function($v) { b = $subslice(new sliceType$1($v.$array), $v.$offset, $v.$offset + $v.$length); }))); })); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["math/rand"] = (function() { var $pkg = {}, $init, nosync, math, Source, Source64, Rand, lockedSource, rngSource, arrayType, ptrType, ptrType$1, sliceType, ptrType$2, ptrType$3, funcType, sliceType$1, ptrType$5, ke, we, fe, kn, wn, fn, globalRand, rngCooked, absInt32, NewSource, New, read, Seed, Intn, Float64, seedrand; nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; math = $packages["math"]; Source = $pkg.Source = $newType(8, $kindInterface, "rand.Source", true, "math/rand", true, null); Source64 = $pkg.Source64 = $newType(8, $kindInterface, "rand.Source64", true, "math/rand", true, null); Rand = $pkg.Rand = $newType(0, $kindStruct, "rand.Rand", true, "math/rand", true, function(src_, s64_, readVal_, readPos_) { this.$val = this; if (arguments.length === 0) { this.src = $ifaceNil; this.s64 = $ifaceNil; this.readVal = new $Int64(0, 0); this.readPos = 0; return; } this.src = src_; this.s64 = s64_; this.readVal = readVal_; this.readPos = readPos_; }); lockedSource = $pkg.lockedSource = $newType(0, $kindStruct, "rand.lockedSource", true, "math/rand", false, function(lk_, src_) { this.$val = this; if (arguments.length === 0) { this.lk = new nosync.Mutex.ptr(false); this.src = $ifaceNil; return; } this.lk = lk_; this.src = src_; }); rngSource = $pkg.rngSource = $newType(0, $kindStruct, "rand.rngSource", true, "math/rand", false, function(tap_, feed_, vec_) { this.$val = this; if (arguments.length === 0) { this.tap = 0; this.feed = 0; this.vec = arrayType.zero(); return; } this.tap = tap_; this.feed = feed_; this.vec = vec_; }); arrayType = $arrayType($Int64, 607); ptrType = $ptrType(lockedSource); ptrType$1 = $ptrType($Int8); sliceType = $sliceType($Int); ptrType$2 = $ptrType($Int64); ptrType$3 = $ptrType(Rand); funcType = $funcType([$Int, $Int], [], false); sliceType$1 = $sliceType($Uint8); ptrType$5 = $ptrType(rngSource); Rand.ptr.prototype.ExpFloat64 = function() { var _r, _r$1, _r$2, _r$3, i, j, r, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; j = $f.j; r = $f.r; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* while (true) { */ case 1: _r = r.Uint32(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } j = _r; i = (j & 255) >>> 0; x = (j) * (((i < 0 || i >= we.length) ? ($throwRuntimeError("index out of range"), undefined) : we[i])); if (j < ((i < 0 || i >= ke.length) ? ($throwRuntimeError("index out of range"), undefined) : ke[i])) { $s = -1; return x; } /* */ if (i === 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (i === 0) { */ case 4: _r$1 = r.Float64(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = math.Log(_r$1); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return 7.69711747013105 - _r$2; /* } */ case 5: _r$3 = r.Float64(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if ($fround(((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]) + $fround(($fround(_r$3)) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[x$1])) - ((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]))))) < ($fround(math.Exp(-x)))) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($fround(((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]) + $fround(($fround(_r$3)) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[x$1])) - ((i < 0 || i >= fe.length) ? ($throwRuntimeError("index out of range"), undefined) : fe[i]))))) < ($fround(math.Exp(-x)))) { */ case 8: $s = -1; return x; /* } */ case 9: /* } */ $s = 1; continue; case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.ExpFloat64 }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.j = j; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.ExpFloat64 = function() { return this.$val.ExpFloat64(); }; absInt32 = function(i) { var i; if (i < 0) { return ((-i >>> 0)); } return ((i >>> 0)); }; Rand.ptr.prototype.NormFloat64 = function() { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, i, j, r, x, x$1, y, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; i = $f.i; j = $f.j; r = $f.r; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* while (true) { */ case 1: _r = r.Uint32(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } j = ((_r >> 0)); i = j & 127; x = (j) * (((i < 0 || i >= wn.length) ? ($throwRuntimeError("index out of range"), undefined) : wn[i])); if (absInt32(j) < ((i < 0 || i >= kn.length) ? ($throwRuntimeError("index out of range"), undefined) : kn[i])) { $s = -1; return x; } /* */ if (i === 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (i === 0) { */ case 4: /* while (true) { */ case 6: _r$1 = r.Float64(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = math.Log(_r$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } x = -_r$2 * 0.29047645161474317; _r$3 = r.Float64(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = math.Log(_r$3); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } y = -_r$4; if (y + y >= x * x) { /* break; */ $s = 7; continue; } /* } */ $s = 6; continue; case 7: if (j > 0) { $s = -1; return 3.442619855899 + x; } $s = -1; return -3.442619855899 - x; /* } */ case 5: _r$5 = r.Float64(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } /* */ if ($fround(((i < 0 || i >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[i]) + $fround(($fround(_r$5)) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[x$1])) - ((i < 0 || i >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[i]))))) < ($fround(math.Exp(-0.5 * x * x)))) { $s = 12; continue; } /* */ $s = 13; continue; /* if ($fround(((i < 0 || i >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[i]) + $fround(($fround(_r$5)) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[x$1])) - ((i < 0 || i >= fn.length) ? ($throwRuntimeError("index out of range"), undefined) : fn[i]))))) < ($fround(math.Exp(-0.5 * x * x)))) { */ case 12: $s = -1; return x; /* } */ case 13: /* } */ $s = 1; continue; case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.NormFloat64 }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.i = i; $f.j = j; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.NormFloat64 = function() { return this.$val.NormFloat64(); }; NewSource = function(seed) { var rng, seed; rng = new rngSource.ptr(0, 0, arrayType.zero()); rng.Seed(seed); return rng; }; $pkg.NewSource = NewSource; New = function(src) { var _tuple, s64, src; _tuple = $assertType(src, Source64, true); s64 = _tuple[0]; return new Rand.ptr(src, s64, new $Int64(0, 0), 0); }; $pkg.New = New; Rand.ptr.prototype.Seed = function(seed) { var _tuple, lk, ok, r, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; lk = $f.lk; ok = $f.ok; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _tuple = $assertType(r.src, ptrType, true); lk = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: $r = lk.seedPos(seed, (r.$ptr_readPos || (r.$ptr_readPos = new ptrType$1(function() { return this.$target.readPos; }, function($v) { this.$target.readPos = $v; }, r)))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 2: $r = r.src.Seed(seed); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r.readPos = 0; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Seed }; } $f._tuple = _tuple; $f.lk = lk; $f.ok = ok; $f.r = r; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; Rand.ptr.prototype.Int63 = function() { var _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.src.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63 }; } $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Int63 = function() { return this.$val.Int63(); }; Rand.ptr.prototype.Uint32 = function() { var _r, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return (($shiftRightInt64(_r, 31).$low >>> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Uint32 }; } $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Uint32 = function() { return this.$val.Uint32(); }; Rand.ptr.prototype.Uint64 = function() { var _r, _r$1, _r$2, r, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; r = $f.r; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* */ if (!($interfaceIsEqual(r.s64, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(r.s64, $ifaceNil))) { */ case 1: _r = r.s64.Uint64(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: _r$1 = r.Int63(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = r.Int63(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return (x = $shiftRightUint64(((x$1 = _r$1, new $Uint64(x$1.$high, x$1.$low))), 31), x$2 = $shiftLeft64(((x$3 = _r$2, new $Uint64(x$3.$high, x$3.$low))), 32), new $Uint64(x.$high | x$2.$high, (x.$low | x$2.$low) >>> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Uint64 }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Uint64 = function() { return this.$val.Uint64(); }; Rand.ptr.prototype.Int31 = function() { var _r, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return (((x = $shiftRightInt64(_r, 32), x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31 }; } $f._r = _r; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Int31 = function() { return this.$val.Int31(); }; Rand.ptr.prototype.Int = function() { var _r, r, u, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; r = $f.r; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } u = ((_r.$low >>> 0)); $s = -1; return ((((u << 1 >>> 0) >>> 1 >>> 0) >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int }; } $f._r = _r; $f.r = r; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Int = function() { return this.$val.Int(); }; Rand.ptr.prototype.Int63n = function(n) { var _r, _r$1, _r$2, max, n, r, v, x, x$1, x$2, x$3, x$4, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; max = $f.max; n = $f.n; r = $f.r; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if ((n.$high < 0 || (n.$high === 0 && n.$low <= 0))) { $panic(new $String("invalid argument to Int63n")); } /* */ if ((x = (x$1 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(n.$high & x$1.$high, (n.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((x = (x$1 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(n.$high & x$1.$high, (n.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))) { */ case 1: _r = r.Int63(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return (x$2 = _r, x$3 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); /* } */ case 2: max = ((x$4 = (x$5 = $div64(new $Uint64(2147483648, 0), (new $Uint64(n.$high, n.$low)), true), new $Uint64(2147483647 - x$5.$high, 4294967295 - x$5.$low)), new $Int64(x$4.$high, x$4.$low))); _r$1 = r.Int63(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; /* while (true) { */ case 5: /* if (!((v.$high > max.$high || (v.$high === max.$high && v.$low > max.$low)))) { break; } */ if(!((v.$high > max.$high || (v.$high === max.$high && v.$low > max.$low)))) { $s = 6; continue; } _r$2 = r.Int63(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v = _r$2; /* } */ $s = 5; continue; case 6: $s = -1; return $div64(v, n, true); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63n }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.max = max; $f.n = n; $f.r = r; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Int63n = function(n) { return this.$val.Int63n(n); }; Rand.ptr.prototype.Int31n = function(n) { var _r, _r$1, _r$2, _r$3, _r$4, max, n, r, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; max = $f.max; n = $f.n; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (n <= 0) { $panic(new $String("invalid argument to Int31n")); } /* */ if ((n & ((n - 1 >> 0))) === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((n & ((n - 1 >> 0))) === 0) { */ case 1: _r = r.Int31(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r & ((n - 1 >> 0)); /* } */ case 2: max = (((2147483647 - (_r$1 = 2147483648 % ((n >>> 0)), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >>> 0) >> 0)); _r$2 = r.Int31(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v = _r$2; /* while (true) { */ case 5: /* if (!(v > max)) { break; } */ if(!(v > max)) { $s = 6; continue; } _r$3 = r.Int31(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } v = _r$3; /* } */ $s = 5; continue; case 6: $s = -1; return (_r$4 = v % n, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31n }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.max = max; $f.n = n; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Int31n = function(n) { return this.$val.Int31n(n); }; Rand.ptr.prototype.int31n = function(n) { var _r, _r$1, _r$2, low, n, prod, r, thresh, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; low = $f.low; n = $f.n; prod = $f.prod; r = $f.r; thresh = $f.thresh; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; _r = r.Uint32(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; prod = $mul64((new $Uint64(0, v)), (new $Uint64(0, n))); low = ((prod.$low >>> 0)); /* */ if (low < ((n >>> 0))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (low < ((n >>> 0))) { */ case 2: thresh = (_r$1 = ((-n >>> 0)) % ((n >>> 0)), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")); /* while (true) { */ case 4: /* if (!(low < thresh)) { break; } */ if(!(low < thresh)) { $s = 5; continue; } _r$2 = r.Uint32(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } v = _r$2; prod = $mul64((new $Uint64(0, v)), (new $Uint64(0, n))); low = ((prod.$low >>> 0)); /* } */ $s = 4; continue; case 5: /* } */ case 3: $s = -1; return (($shiftRightUint64(prod, 32).$low >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.int31n }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.low = low; $f.n = n; $f.prod = prod; $f.r = r; $f.thresh = thresh; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.int31n = function(n) { return this.$val.int31n(n); }; Rand.ptr.prototype.Intn = function(n) { var _r, _r$1, n, r, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; n = $f.n; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (n <= 0) { $panic(new $String("invalid argument to Intn")); } /* */ if (n <= 2147483647) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n <= 2147483647) { */ case 1: _r = r.Int31n(((n >> 0))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return ((_r >> 0)); /* } */ case 2: _r$1 = r.Int63n((new $Int64(0, n))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return (((x = _r$1, x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Intn }; } $f._r = _r; $f._r$1 = _r$1; $f.n = n; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Intn = function(n) { return this.$val.Intn(n); }; Rand.ptr.prototype.Float64 = function() { var _r, f, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* again: */ case 1: _r = r.Int63(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } f = ($flatten64(_r)) / 9.223372036854776e+18; /* */ if (f === 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (f === 1) { */ case 3: /* goto again */ $s = 1; continue; /* } */ case 4: $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float64 }; } $f._r = _r; $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Float64 = function() { return this.$val.Float64(); }; Rand.ptr.prototype.Float32 = function() { var _r, f, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; /* again: */ case 1: _r = r.Float64(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } f = ($fround(_r)); /* */ if (f === 1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (f === 1) { */ case 3: /* goto again */ $s = 1; continue; /* } */ case 4: $s = -1; return f; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float32 }; } $f._r = _r; $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Float32 = function() { return this.$val.Float32(); }; Rand.ptr.prototype.Perm = function(n) { var _r, i, j, m, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; j = $f.j; m = $f.m; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; m = $makeSlice(sliceType, n); i = 0; /* while (true) { */ case 1: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } _r = r.Intn(i + 1 >> 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } j = _r; ((i < 0 || i >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + i] = ((j < 0 || j >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + j])); ((j < 0 || j >= m.$length) ? ($throwRuntimeError("index out of range"), undefined) : m.$array[m.$offset + j] = i); i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $s = -1; return m; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Perm }; } $f._r = _r; $f.i = i; $f.j = j; $f.m = m; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Perm = function(n) { return this.$val.Perm(n); }; Rand.ptr.prototype.Shuffle = function(n, swap) { var _r, _r$1, i, j, j$1, n, r, swap, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; i = $f.i; j = $f.j; j$1 = $f.j$1; n = $f.n; r = $f.r; swap = $f.swap; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; if (n < 0) { $panic(new $String("invalid argument to Shuffle")); } i = n - 1 >> 0; /* while (true) { */ case 1: /* if (!(i > 2147483646)) { break; } */ if(!(i > 2147483646)) { $s = 2; continue; } _r = r.Int63n((new $Int64(0, (i + 1 >> 0)))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } j = (((x = _r, x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); $r = swap(i, j); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i - (1) >> 0; /* } */ $s = 1; continue; case 2: /* while (true) { */ case 5: /* if (!(i > 0)) { break; } */ if(!(i > 0)) { $s = 6; continue; } _r$1 = r.int31n((((i + 1 >> 0) >> 0))); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } j$1 = ((_r$1 >> 0)); $r = swap(i, j$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i - (1) >> 0; /* } */ $s = 5; continue; case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Shuffle }; } $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.j = j; $f.j$1 = j$1; $f.n = n; $f.r = r; $f.swap = swap; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Shuffle = function(n, swap) { return this.$val.Shuffle(n, swap); }; Rand.ptr.prototype.Read = function(p) { var _r, _r$1, _tuple, _tuple$1, _tuple$2, err, lk, n, ok, p, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; lk = $f.lk; n = $f.n; ok = $f.ok; p = $f.p; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; _tuple = $assertType(r.src, ptrType, true); lk = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = lk.read(p, (r.$ptr_readVal || (r.$ptr_readVal = new ptrType$2(function() { return this.$target.readVal; }, function($v) { this.$target.readVal = $v; }, r))), (r.$ptr_readPos || (r.$ptr_readPos = new ptrType$1(function() { return this.$target.readPos; }, function($v) { this.$target.readPos = $v; }, r)))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; n = _tuple$1[0]; err = _tuple$1[1]; $s = -1; return [n, err]; /* } */ case 2: _r$1 = read(p, $methodVal(r, "Int63"), (r.$ptr_readVal || (r.$ptr_readVal = new ptrType$2(function() { return this.$target.readVal; }, function($v) { this.$target.readVal = $v; }, r))), (r.$ptr_readPos || (r.$ptr_readPos = new ptrType$1(function() { return this.$target.readPos; }, function($v) { this.$target.readPos = $v; }, r)))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; n = _tuple$2[0]; err = _tuple$2[1]; $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Read }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.lk = lk; $f.n = n; $f.ok = ok; $f.p = p; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; Rand.prototype.Read = function(p) { return this.$val.Read(p); }; read = function(p, int63, readVal, readPos) { var _r, err, int63, n, p, pos, readPos, readVal, val, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; err = $f.err; int63 = $f.int63; n = $f.n; p = $f.p; pos = $f.pos; readPos = $f.readPos; readVal = $f.readVal; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; pos = readPos.$get(); val = readVal.$get(); n = 0; /* while (true) { */ case 1: /* if (!(n < p.$length)) { break; } */ if(!(n < p.$length)) { $s = 2; continue; } /* */ if (pos === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (pos === 0) { */ case 3: _r = int63(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } val = _r; pos = 7; /* } */ case 4: ((n < 0 || n >= p.$length) ? ($throwRuntimeError("index out of range"), undefined) : p.$array[p.$offset + n] = ((val.$low << 24 >>> 24))); val = $shiftRightInt64(val, (8)); pos = pos - (1) << 24 >> 24; n = n + (1) >> 0; /* } */ $s = 1; continue; case 2: readPos.$set(pos); readVal.$set(val); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: read }; } $f._r = _r; $f.err = err; $f.int63 = int63; $f.n = n; $f.p = p; $f.pos = pos; $f.readPos = readPos; $f.readVal = readVal; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; }; Seed = function(seed) { var seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = globalRand.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Seed }; } $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Seed = Seed; Intn = function(n) { var _r, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = globalRand.Intn(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Intn }; } $f._r = _r; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Intn = Intn; Float64 = function() { var _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = globalRand.Float64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Float64 }; } $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Float64 = Float64; lockedSource.ptr.prototype.Int63 = function() { var _r, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Int64(0, 0); r = this; r.lk.Lock(); _r = r.src.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; r.lk.Unlock(); $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Int63 }; } $f._r = _r; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; lockedSource.prototype.Int63 = function() { return this.$val.Int63(); }; lockedSource.ptr.prototype.Uint64 = function() { var _r, n, r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = new $Uint64(0, 0); r = this; r.lk.Lock(); _r = r.src.Uint64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; r.lk.Unlock(); $s = -1; return n; /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Uint64 }; } $f._r = _r; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; }; lockedSource.prototype.Uint64 = function() { return this.$val.Uint64(); }; lockedSource.ptr.prototype.Seed = function(seed) { var r, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; r.lk.Lock(); $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } r.lk.Unlock(); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Seed }; } $f.r = r; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; lockedSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; lockedSource.ptr.prototype.seedPos = function(seed, readPos) { var r, readPos, seed, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; r = $f.r; readPos = $f.readPos; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: r = this; r.lk.Lock(); $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } readPos.$set(0); r.lk.Unlock(); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.seedPos }; } $f.r = r; $f.readPos = readPos; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; }; lockedSource.prototype.seedPos = function(seed, readPos) { return this.$val.seedPos(seed, readPos); }; lockedSource.ptr.prototype.read = function(p, readVal, readPos) { var _r, _tuple, err, n, p, r, readPos, readVal, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; n = $f.n; p = $f.p; r = $f.r; readPos = $f.readPos; readVal = $f.readVal; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: n = 0; err = $ifaceNil; r = this; r.lk.Lock(); _r = read(p, $methodVal(r.src, "Int63"), readVal, readPos); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; r.lk.Unlock(); $s = -1; return [n, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.read }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.n = n; $f.p = p; $f.r = r; $f.readPos = readPos; $f.readVal = readVal; $f.$s = $s; $f.$r = $r; return $f; }; lockedSource.prototype.read = function(p, readVal, readPos) { return this.$val.read(p, readVal, readPos); }; seedrand = function(x) { var _q, _r, hi, lo, x; hi = (_q = x / 44488, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); lo = (_r = x % 44488, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); x = ($imul(48271, lo)) - ($imul(3399, hi)) >> 0; if (x < 0) { x = x + (2147483647) >> 0; } return x; }; rngSource.ptr.prototype.Seed = function(seed) { var i, rng, seed, u, x, x$1, x$2, x$3, x$4, x$5; rng = this; rng.tap = 0; rng.feed = 334; seed = $div64(seed, new $Int64(0, 2147483647), true); if ((seed.$high < 0 || (seed.$high === 0 && seed.$low < 0))) { seed = (x = new $Int64(0, 2147483647), new $Int64(seed.$high + x.$high, seed.$low + x.$low)); } if ((seed.$high === 0 && seed.$low === 0)) { seed = new $Int64(0, 89482311); } x$1 = (((seed.$low + ((seed.$high >> 31) * 4294967296)) >> 0)); i = -20; while (true) { if (!(i < 607)) { break; } x$1 = seedrand(x$1); if (i >= 0) { u = new $Int64(0, 0); u = $shiftLeft64((new $Int64(0, x$1)), 40); x$1 = seedrand(x$1); u = (x$2 = $shiftLeft64((new $Int64(0, x$1)), 20), new $Int64(u.$high ^ x$2.$high, (u.$low ^ x$2.$low) >>> 0)); x$1 = seedrand(x$1); u = (x$3 = (new $Int64(0, x$1)), new $Int64(u.$high ^ x$3.$high, (u.$low ^ x$3.$low) >>> 0)); u = (x$4 = ((i < 0 || i >= rngCooked.length) ? ($throwRuntimeError("index out of range"), undefined) : rngCooked[i]), new $Int64(u.$high ^ x$4.$high, (u.$low ^ x$4.$low) >>> 0)); (x$5 = rng.vec, ((i < 0 || i >= x$5.length) ? ($throwRuntimeError("index out of range"), undefined) : x$5[i] = u)); } i = i + (1) >> 0; } }; rngSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; rngSource.ptr.prototype.Int63 = function() { var rng, x, x$1; rng = this; return ((x = (x$1 = rng.Uint64(), new $Uint64(x$1.$high & 2147483647, (x$1.$low & 4294967295) >>> 0)), new $Int64(x.$high, x.$low))); }; rngSource.prototype.Int63 = function() { return this.$val.Int63(); }; rngSource.ptr.prototype.Uint64 = function() { var rng, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8; rng = this; rng.tap = rng.tap - (1) >> 0; if (rng.tap < 0) { rng.tap = rng.tap + (607) >> 0; } rng.feed = rng.feed - (1) >> 0; if (rng.feed < 0) { rng.feed = rng.feed + (607) >> 0; } x$6 = (x = (x$1 = rng.vec, x$2 = rng.feed, ((x$2 < 0 || x$2 >= x$1.length) ? ($throwRuntimeError("index out of range"), undefined) : x$1[x$2])), x$3 = (x$4 = rng.vec, x$5 = rng.tap, ((x$5 < 0 || x$5 >= x$4.length) ? ($throwRuntimeError("index out of range"), undefined) : x$4[x$5])), new $Int64(x.$high + x$3.$high, x.$low + x$3.$low)); (x$7 = rng.vec, x$8 = rng.feed, ((x$8 < 0 || x$8 >= x$7.length) ? ($throwRuntimeError("index out of range"), undefined) : x$7[x$8] = x$6)); return (new $Uint64(x$6.$high, x$6.$low)); }; rngSource.prototype.Uint64 = function() { return this.$val.Uint64(); }; ptrType$3.methods = [{prop: "ExpFloat64", name: "ExpFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "NormFloat64", name: "NormFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([], [$Uint32], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "Int31", name: "Int31", pkg: "", typ: $funcType([], [$Int32], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Int63n", name: "Int63n", pkg: "", typ: $funcType([$Int64], [$Int64], false)}, {prop: "Int31n", name: "Int31n", pkg: "", typ: $funcType([$Int32], [$Int32], false)}, {prop: "int31n", name: "int31n", pkg: "math/rand", typ: $funcType([$Int32], [$Int32], false)}, {prop: "Intn", name: "Intn", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Float32", name: "Float32", pkg: "", typ: $funcType([], [$Float32], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "Shuffle", name: "Shuffle", pkg: "", typ: $funcType([$Int, funcType], [], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; ptrType.methods = [{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "seedPos", name: "seedPos", pkg: "math/rand", typ: $funcType([$Int64, ptrType$1], [], false)}, {prop: "read", name: "read", pkg: "math/rand", typ: $funcType([sliceType$1, ptrType$2, ptrType$1], [$Int, $error], false)}]; ptrType$5.methods = [{prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}]; Source.init([{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}]); Source64.init([{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}]); Rand.init("math/rand", [{prop: "src", name: "src", embedded: false, exported: false, typ: Source, tag: ""}, {prop: "s64", name: "s64", embedded: false, exported: false, typ: Source64, tag: ""}, {prop: "readVal", name: "readVal", embedded: false, exported: false, typ: $Int64, tag: ""}, {prop: "readPos", name: "readPos", embedded: false, exported: false, typ: $Int8, tag: ""}]); lockedSource.init("math/rand", [{prop: "lk", name: "lk", embedded: false, exported: false, typ: nosync.Mutex, tag: ""}, {prop: "src", name: "src", embedded: false, exported: false, typ: Source64, tag: ""}]); rngSource.init("math/rand", [{prop: "tap", name: "tap", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "feed", name: "feed", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "vec", name: "vec", embedded: false, exported: false, typ: arrayType, tag: ""}]); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = nosync.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ke = $toNativeArray($kindUint32, [3801129273, 0, 2615860924, 3279400049, 3571300752, 3733536696, 3836274812, 3906990442, 3958562475, 3997804264, 4028649213, 4053523342, 4074002619, 4091154507, 4105727352, 4118261130, 4129155133, 4138710916, 4147160435, 4154685009, 4161428406, 4167506077, 4173011791, 4178022498, 4182601930, 4186803325, 4190671498, 4194244443, 4197554582, 4200629752, 4203493986, 4206168142, 4208670408, 4211016720, 4213221098, 4215295924, 4217252177, 4219099625, 4220846988, 4222502074, 4224071896, 4225562770, 4226980400, 4228329951, 4229616109, 4230843138, 4232014925, 4233135020, 4234206673, 4235232866, 4236216336, 4237159604, 4238064994, 4238934652, 4239770563, 4240574564, 4241348362, 4242093539, 4242811568, 4243503822, 4244171579, 4244816032, 4245438297, 4246039419, 4246620374, 4247182079, 4247725394, 4248251127, 4248760037, 4249252839, 4249730206, 4250192773, 4250641138, 4251075867, 4251497493, 4251906522, 4252303431, 4252688672, 4253062674, 4253425844, 4253778565, 4254121205, 4254454110, 4254777611, 4255092022, 4255397640, 4255694750, 4255983622, 4256264513, 4256537670, 4256803325, 4257061702, 4257313014, 4257557464, 4257795244, 4258026541, 4258251531, 4258470383, 4258683258, 4258890309, 4259091685, 4259287526, 4259477966, 4259663135, 4259843154, 4260018142, 4260188212, 4260353470, 4260514019, 4260669958, 4260821380, 4260968374, 4261111028, 4261249421, 4261383632, 4261513736, 4261639802, 4261761900, 4261880092, 4261994441, 4262105003, 4262211835, 4262314988, 4262414513, 4262510454, 4262602857, 4262691764, 4262777212, 4262859239, 4262937878, 4263013162, 4263085118, 4263153776, 4263219158, 4263281289, 4263340187, 4263395872, 4263448358, 4263497660, 4263543789, 4263586755, 4263626565, 4263663224, 4263696735, 4263727099, 4263754314, 4263778377, 4263799282, 4263817020, 4263831582, 4263842955, 4263851124, 4263856071, 4263857776, 4263856218, 4263851370, 4263843206, 4263831695, 4263816804, 4263798497, 4263776735, 4263751476, 4263722676, 4263690284, 4263654251, 4263614520, 4263571032, 4263523724, 4263472530, 4263417377, 4263358192, 4263294892, 4263227394, 4263155608, 4263079437, 4262998781, 4262913534, 4262823581, 4262728804, 4262629075, 4262524261, 4262414220, 4262298801, 4262177846, 4262051187, 4261918645, 4261780032, 4261635148, 4261483780, 4261325704, 4261160681, 4260988457, 4260808763, 4260621313, 4260425802, 4260221905, 4260009277, 4259787550, 4259556329, 4259315195, 4259063697, 4258801357, 4258527656, 4258242044, 4257943926, 4257632664, 4257307571, 4256967906, 4256612870, 4256241598, 4255853155, 4255446525, 4255020608, 4254574202, 4254106002, 4253614578, 4253098370, 4252555662, 4251984571, 4251383021, 4250748722, 4250079132, 4249371435, 4248622490, 4247828790, 4246986404, 4246090910, 4245137315, 4244119963, 4243032411, 4241867296, 4240616155, 4239269214, 4237815118, 4236240596, 4234530035, 4232664930, 4230623176, 4228378137, 4225897409, 4223141146, 4220059768, 4216590757, 4212654085, 4208145538, 4202926710, 4196809522, 4189531420, 4180713890, 4169789475, 4155865042, 4137444620, 4111806704, 4073393724, 4008685917, 3873074895]); we = $toNativeArray($kindFloat32, [2.0249555365836613e-09, 1.4866739783681027e-11, 2.4409616689036184e-11, 3.1968806074589295e-11, 3.844677007314168e-11, 4.42282044321729e-11, 4.951644302919611e-11, 5.443358958023836e-11, 5.905943789574764e-11, 6.34494193296753e-11, 6.764381416113352e-11, 7.167294535648239e-11, 7.556032188826833e-11, 7.932458162551725e-11, 8.298078890689453e-11, 8.654132271912474e-11, 9.001651507523079e-11, 9.341507428706208e-11, 9.674443190998971e-11, 1.0001099254308699e-10, 1.0322031424037093e-10, 1.0637725422757427e-10, 1.0948611461891744e-10, 1.1255067711157807e-10, 1.1557434870246297e-10, 1.1856014781042035e-10, 1.2151082917633005e-10, 1.2442885610752796e-10, 1.2731647680563896e-10, 1.3017574518325858e-10, 1.330085347417409e-10, 1.3581656632677408e-10, 1.386014220061682e-10, 1.413645728254309e-10, 1.4410737880776736e-10, 1.4683107507629245e-10, 1.4953686899854546e-10, 1.522258291641876e-10, 1.5489899640730442e-10, 1.575573282952547e-10, 1.6020171300645814e-10, 1.628330109637588e-10, 1.6545202707884954e-10, 1.68059510752272e-10, 1.7065616975120435e-10, 1.73242697965037e-10, 1.758197337720091e-10, 1.783878739169964e-10, 1.8094774290045024e-10, 1.834998542005195e-10, 1.8604476292871652e-10, 1.8858298256319017e-10, 1.9111498494872592e-10, 1.9364125580789704e-10, 1.9616222535212557e-10, 1.9867835154840918e-10, 2.011900368525943e-10, 2.0369768372052732e-10, 2.062016807302669e-10, 2.0870240258208383e-10, 2.1120022397624894e-10, 2.136955057352452e-10, 2.1618855317040442e-10, 2.1867974098199738e-10, 2.2116936060356807e-10, 2.2365774510202385e-10, 2.2614519978869652e-10, 2.2863201609713002e-10, 2.3111849933865614e-10, 2.3360494094681883e-10, 2.3609159072179864e-10, 2.3857874009713953e-10, 2.4106666662859766e-10, 2.4355562011635357e-10, 2.460458781161634e-10, 2.485376904282077e-10, 2.5103127909709144e-10, 2.5352694943414633e-10, 2.560248957284017e-10, 2.585253955356137e-10, 2.610286709003873e-10, 2.6353494386732734e-10, 2.6604446423661443e-10, 2.6855745405285347e-10, 2.71074163116225e-10, 2.7359478571575835e-10, 2.7611959940720965e-10, 2.786487707240326e-10, 2.8118254946640775e-10, 2.8372118543451563e-10, 2.8626484516180994e-10, 2.8881380620404684e-10, 2.9136826285025563e-10, 2.9392840938946563e-10, 2.96494523377433e-10, 2.990667713476114e-10, 3.016454031001814e-10, 3.042306406797479e-10, 3.068226783753403e-10, 3.09421765987139e-10, 3.12028125559749e-10, 3.1464195138219964e-10, 3.17263521010247e-10, 3.1989300097734485e-10, 3.225306410836737e-10, 3.2517669112941405e-10, 3.2783134540359526e-10, 3.3049485370639786e-10, 3.3316743808242677e-10, 3.3584937608743815e-10, 3.385408342548857e-10, 3.4124211789610115e-10, 3.4395342130011386e-10, 3.4667499426710435e-10, 3.494071143528288e-10, 3.521500313574677e-10, 3.54903967325626e-10, 3.576691720574843e-10, 3.6044595086437425e-10, 3.632345535464765e-10, 3.660352021483959e-10, 3.688482297370399e-10, 3.716738583570134e-10, 3.7451239331964814e-10, 3.773641121807003e-10, 3.802292924959261e-10, 3.831082673322328e-10, 3.8600128648980103e-10, 3.8890865527996255e-10, 3.9183070676962473e-10, 3.9476774627011935e-10, 3.977200790927782e-10, 4.006880383045086e-10, 4.0367195697221803e-10, 4.066721681628138e-10, 4.0968900494320337e-10, 4.127228558914453e-10, 4.15774054074447e-10, 4.188429603146915e-10, 4.2192993543466173e-10, 4.25035395767992e-10, 4.2815970213716525e-10, 4.313032986313914e-10, 4.3446651831757777e-10, 4.376498607960855e-10, 4.408536868893975e-10, 4.4407846844229937e-10, 4.4732464954400086e-10, 4.5059267428371186e-10, 4.538830145062178e-10, 4.5719619756745544e-10, 4.605326675566346e-10, 4.638929240741163e-10, 4.672775499869886e-10, 4.706869893844612e-10, 4.74121908400349e-10, 4.775827511238617e-10, 4.810701836888143e-10, 4.845848167178701e-10, 4.881271498113904e-10, 4.916979601254923e-10, 4.952977472605369e-10, 4.989272883726414e-10, 5.025872495956207e-10, 5.062783525744408e-10, 5.100013189540675e-10, 5.13756870379467e-10, 5.175458395179078e-10, 5.21369003525507e-10, 5.252272505806843e-10, 5.29121357839557e-10, 5.330522134805449e-10, 5.3702081670437e-10, 5.41028055689452e-10, 5.450749851476644e-10, 5.491624932574268e-10, 5.532918012640664e-10, 5.574638528571541e-10, 5.616799247931681e-10, 5.659410717839819e-10, 5.702485705860738e-10, 5.746036979559221e-10, 5.790077306500052e-10, 5.83462111958255e-10, 5.879682296594524e-10, 5.925275825546805e-10, 5.971417249561739e-10, 6.01812211176167e-10, 6.065408175714992e-10, 6.113292094767075e-10, 6.16179329782085e-10, 6.21092954844471e-10, 6.260721940876124e-10, 6.311191569352559e-10, 6.362359528111483e-10, 6.414249686947926e-10, 6.466885360545405e-10, 6.520292639144998e-10, 6.574497612987784e-10, 6.629528592760892e-10, 6.685415554485985e-10, 6.742187919073217e-10, 6.799880103436351e-10, 6.858525969377638e-10, 6.918161599145378e-10, 6.978825850545434e-10, 7.040559801829716e-10, 7.103406751696184e-10, 7.167412219288849e-10, 7.232625609532306e-10, 7.2990985477972e-10, 7.366885990123251e-10, 7.436047333442275e-10, 7.506645305355164e-10, 7.57874762946642e-10, 7.652426470272644e-10, 7.727759543385559e-10, 7.804830115532013e-10, 7.883728114777e-10, 7.964550685635174e-10, 8.047402189070851e-10, 8.132396422944055e-10, 8.219657177122031e-10, 8.309318788590758e-10, 8.401527806789488e-10, 8.496445214056791e-10, 8.594246980742071e-10, 8.695127395874636e-10, 8.799300732498239e-10, 8.90700457834015e-10, 9.01850316648023e-10, 9.134091816243028e-10, 9.254100818978372e-10, 9.37890431984556e-10, 9.508922538259412e-10, 9.64463842123564e-10, 9.78660263939446e-10, 9.935448019859905e-10, 1.0091912860943353e-09, 1.0256859805934937e-09, 1.0431305819125214e-09, 1.0616465484503124e-09, 1.0813799855569073e-09, 1.1025096391392708e-09, 1.1252564435793033e-09, 1.149898620766976e-09, 1.176793218427008e-09, 1.2064089727203964e-09, 1.2393785997488749e-09, 1.2765849488616254e-09, 1.319313880365769e-09, 1.36954347862428e-09, 1.4305497897382224e-09, 1.5083649884672923e-09, 1.6160853766322703e-09, 1.7921247819074893e-09]); fe = $toNativeArray($kindFloat32, [1, 0.9381436705589294, 0.900469958782196, 0.8717043399810791, 0.847785472869873, 0.8269932866096497, 0.8084216713905334, 0.7915276288986206, 0.7759568691253662, 0.7614634037017822, 0.7478685975074768, 0.7350381016731262, 0.7228676676750183, 0.7112747430801392, 0.7001926302909851, 0.6895664930343628, 0.6793505549430847, 0.669506311416626, 0.6600008606910706, 0.6508058309555054, 0.6418967247009277, 0.633251965045929, 0.62485271692276, 0.6166821718215942, 0.608725368976593, 0.6009689569473267, 0.5934008955955505, 0.5860103368759155, 0.5787873864173889, 0.5717230439186096, 0.5648092031478882, 0.5580382943153381, 0.5514034032821655, 0.5448982119560242, 0.5385168790817261, 0.5322538614273071, 0.526104211807251, 0.5200631618499756, 0.5141264200210571, 0.5082897543907166, 0.5025495290756226, 0.4969019889831543, 0.4913438558578491, 0.4858720004558563, 0.48048335313796997, 0.4751752018928528, 0.4699448347091675, 0.4647897481918335, 0.4597076177597046, 0.4546961486339569, 0.4497532546520233, 0.44487687945365906, 0.4400651156902313, 0.4353161156177521, 0.4306281507015228, 0.42599955201148987, 0.42142874002456665, 0.4169141948223114, 0.4124544560909271, 0.40804818272590637, 0.4036940038204193, 0.39939069747924805, 0.3951369822025299, 0.39093172550201416, 0.38677382469177246, 0.38266217708587646, 0.378595769405365, 0.37457355856895447, 0.37059465050697327, 0.366658091545105, 0.362762987613678, 0.358908474445343, 0.35509374737739563, 0.35131800174713135, 0.3475804924964905, 0.34388044476509094, 0.34021714329719543, 0.33658990263938904, 0.3329980671405792, 0.3294409513473511, 0.32591795921325684, 0.32242849469184875, 0.3189719021320343, 0.3155476748943329, 0.31215524673461914, 0.3087940812110901, 0.30546361207962036, 0.30216339230537415, 0.29889291524887085, 0.29565170407295227, 0.2924392819404602, 0.2892552316188812, 0.28609907627105713, 0.2829704284667969, 0.27986884117126465, 0.2767939269542694, 0.2737452983856201, 0.2707225978374481, 0.26772540807724, 0.26475343108177185, 0.2618062496185303, 0.258883535861969, 0.2559850215911865, 0.25311028957366943, 0.25025907158851624, 0.24743106961250305, 0.2446259707212448, 0.24184346199035645, 0.23908329010009766, 0.23634515702724457, 0.2336287796497345, 0.23093391954898834, 0.22826029360294342, 0.22560766339302063, 0.22297576069831848, 0.22036437690258026, 0.21777324378490448, 0.21520215272903442, 0.212650865316391, 0.21011915802955627, 0.20760682225227356, 0.20511364936828613, 0.20263944566249847, 0.20018397271633148, 0.19774706661701202, 0.1953285187482834, 0.19292815029621124, 0.19054576754570007, 0.18818120658397675, 0.18583425879478455, 0.18350479006767273, 0.18119260668754578, 0.17889754474163055, 0.17661945521831512, 0.17435817420482635, 0.1721135377883911, 0.16988539695739746, 0.16767361760139465, 0.16547803580760956, 0.16329853236675262, 0.16113494336605072, 0.1589871346950531, 0.15685498714447021, 0.15473836660385132, 0.15263713896274567, 0.1505511850118637, 0.1484803706407547, 0.14642459154129028, 0.1443837285041809, 0.14235764741897583, 0.1403462439775467, 0.13834942877292633, 0.136367067694664, 0.13439907133579254, 0.1324453204870224, 0.1305057406425476, 0.12858019769191742, 0.12666863203048706, 0.12477091699838638, 0.12288697808980942, 0.1210167184472084, 0.11916005611419678, 0.11731690168380737, 0.11548716574907303, 0.11367076635360718, 0.11186762899160385, 0.11007767915725708, 0.1083008274435997, 0.10653700679540634, 0.10478614270687103, 0.1030481606721878, 0.10132300108671188, 0.0996105819940567, 0.09791085124015808, 0.09622374176979065, 0.09454918652772903, 0.09288713335990906, 0.09123751521110535, 0.08960027992725372, 0.08797537535429001, 0.08636274188756943, 0.0847623273730278, 0.08317409455776215, 0.08159798383712769, 0.08003395050764084, 0.07848194986581802, 0.07694194465875626, 0.07541389018297195, 0.07389774918556213, 0.07239348441362381, 0.070901058614254, 0.06942043453454971, 0.06795158982276917, 0.06649449467658997, 0.06504911929368973, 0.06361543387174606, 0.06219341605901718, 0.06078304722905159, 0.0593843050301075, 0.05799717456102371, 0.05662164092063904, 0.05525768920779228, 0.05390531197190285, 0.05256449431180954, 0.05123523622751236, 0.04991753399372101, 0.04861138388514519, 0.047316793352365494, 0.04603376239538193, 0.044762298464775085, 0.04350241273641586, 0.04225412383675575, 0.04101744294166565, 0.039792392402887344, 0.03857899457216263, 0.03737728297710419, 0.03618728369474411, 0.03500903770327568, 0.03384258225560188, 0.0326879620552063, 0.031545232981443405, 0.030414443463087082, 0.0292956605553627, 0.028188949450850487, 0.027094384655356407, 0.02601204626262188, 0.024942025542259216, 0.023884421214461327, 0.022839335724711418, 0.021806888282299042, 0.020787203684449196, 0.019780423492193222, 0.018786700442433357, 0.017806200310587883, 0.016839107498526573, 0.015885621309280396, 0.014945968054234982, 0.01402039173990488, 0.013109165243804455, 0.012212592177093029, 0.011331013403832912, 0.010464809834957123, 0.009614413604140282, 0.008780314587056637, 0.007963077165186405, 0.007163353264331818, 0.0063819061033427715, 0.005619642324745655, 0.004877655766904354, 0.004157294984906912, 0.003460264764726162, 0.0027887988835573196, 0.0021459676790982485, 0.001536299823783338, 0.0009672692976891994, 0.0004541343660093844]); kn = $toNativeArray($kindUint32, [1991057938, 0, 1611602771, 1826899878, 1918584482, 1969227037, 2001281515, 2023368125, 2039498179, 2051788381, 2061460127, 2069267110, 2075699398, 2081089314, 2085670119, 2089610331, 2093034710, 2096037586, 2098691595, 2101053571, 2103168620, 2105072996, 2106796166, 2108362327, 2109791536, 2111100552, 2112303493, 2113412330, 2114437283, 2115387130, 2116269447, 2117090813, 2117856962, 2118572919, 2119243101, 2119871411, 2120461303, 2121015852, 2121537798, 2122029592, 2122493434, 2122931299, 2123344971, 2123736059, 2124106020, 2124456175, 2124787725, 2125101763, 2125399283, 2125681194, 2125948325, 2126201433, 2126441213, 2126668298, 2126883268, 2127086657, 2127278949, 2127460589, 2127631985, 2127793506, 2127945490, 2128088244, 2128222044, 2128347141, 2128463758, 2128572095, 2128672327, 2128764606, 2128849065, 2128925811, 2128994934, 2129056501, 2129110560, 2129157136, 2129196237, 2129227847, 2129251929, 2129268426, 2129277255, 2129278312, 2129271467, 2129256561, 2129233410, 2129201800, 2129161480, 2129112170, 2129053545, 2128985244, 2128906855, 2128817916, 2128717911, 2128606255, 2128482298, 2128345305, 2128194452, 2128028813, 2127847342, 2127648860, 2127432031, 2127195339, 2126937058, 2126655214, 2126347546, 2126011445, 2125643893, 2125241376, 2124799783, 2124314271, 2123779094, 2123187386, 2122530867, 2121799464, 2120980787, 2120059418, 2119015917, 2117825402, 2116455471, 2114863093, 2112989789, 2110753906, 2108037662, 2104664315, 2100355223, 2094642347, 2086670106, 2074676188, 2054300022, 2010539237]); wn = $toNativeArray($kindFloat32, [1.7290404663583558e-09, 1.2680928529462676e-10, 1.689751810696194e-10, 1.9862687883343e-10, 2.223243117382978e-10, 2.4244936613904144e-10, 2.601613091623989e-10, 2.761198769629658e-10, 2.9073962681813725e-10, 3.042996965518796e-10, 3.169979556627567e-10, 3.289802041894774e-10, 3.4035738116777736e-10, 3.5121602848242617e-10, 3.61625090983253e-10, 3.7164057942185025e-10, 3.813085680537398e-10, 3.906675816178762e-10, 3.997501218933053e-10, 4.0858399996679395e-10, 4.1719308563337165e-10, 4.255982233303257e-10, 4.3381759295968436e-10, 4.4186720948857783e-10, 4.497613115272969e-10, 4.57512583373898e-10, 4.6513240481438345e-10, 4.726310454117311e-10, 4.800177477726209e-10, 4.873009773476156e-10, 4.944885056978876e-10, 5.015873272284921e-10, 5.086040477664255e-10, 5.155446070048697e-10, 5.224146670812502e-10, 5.292193350214802e-10, 5.359634958068682e-10, 5.426517013518151e-10, 5.492881705038144e-10, 5.558769555769061e-10, 5.624218868405251e-10, 5.689264614971989e-10, 5.75394121238304e-10, 5.818281967329142e-10, 5.882316855831959e-10, 5.946076964136182e-10, 6.009590047817426e-10, 6.072883862451306e-10, 6.135985053390414e-10, 6.19892026598734e-10, 6.261713370037114e-10, 6.324390455780815e-10, 6.386973727678935e-10, 6.449488165749528e-10, 6.511955974453087e-10, 6.574400468473129e-10, 6.636843297158634e-10, 6.699307220081607e-10, 6.761814441702541e-10, 6.824387166481927e-10, 6.887046488657234e-10, 6.949815167800466e-10, 7.012714853260604e-10, 7.075767749498141e-10, 7.13899661608508e-10, 7.202424212593428e-10, 7.266072743483676e-10, 7.329966078550854e-10, 7.394128087589991e-10, 7.458582640396116e-10, 7.523354716987285e-10, 7.588469852493063e-10, 7.653954137154528e-10, 7.719834771435785e-10, 7.786139510912449e-10, 7.852897221383159e-10, 7.920137878869582e-10, 7.987892014504894e-10, 8.056192379868321e-10, 8.125072836762115e-10, 8.194568912323064e-10, 8.264716688799467e-10, 8.3355555791087e-10, 8.407127216614185e-10, 8.479473234679347e-10, 8.552640262671218e-10, 8.626675485068347e-10, 8.701631637464402e-10, 8.777562010564566e-10, 8.854524335966119e-10, 8.932581896381464e-10, 9.011799639857543e-10, 9.092249730890956e-10, 9.174008219758889e-10, 9.25715837318819e-10, 9.341788453909317e-10, 9.42799727177146e-10, 9.515889187738935e-10, 9.605578554783278e-10, 9.697193048552322e-10, 9.790869226478094e-10, 9.886760299337993e-10, 9.985036131254788e-10, 1.008588212947359e-09, 1.0189509236369076e-09, 1.0296150598776421e-09, 1.040606933955246e-09, 1.0519566329136865e-09, 1.0636980185552147e-09, 1.0758701707302976e-09, 1.0885182755160372e-09, 1.101694735439196e-09, 1.115461056855338e-09, 1.1298901814171813e-09, 1.1450695946990663e-09, 1.1611052119775422e-09, 1.178127595480305e-09, 1.1962995039027646e-09, 1.2158286599728285e-09, 1.2369856250415978e-09, 1.2601323318151003e-09, 1.2857697129220469e-09, 1.3146201904845611e-09, 1.3477839955200466e-09, 1.3870635751089821e-09, 1.43574030442295e-09, 1.5008658760251592e-09, 1.6030947680434338e-09]); fn = $toNativeArray($kindFloat32, [1, 0.963599681854248, 0.9362826943397522, 0.9130436182022095, 0.8922816514968872, 0.8732430338859558, 0.8555005788803101, 0.8387836217880249, 0.8229072093963623, 0.8077383041381836, 0.7931770086288452, 0.7791460752487183, 0.7655841708183289, 0.7524415850639343, 0.7396772503852844, 0.7272568941116333, 0.7151514887809753, 0.7033361196517944, 0.6917891502380371, 0.6804918646812439, 0.6694276928901672, 0.6585819721221924, 0.6479418277740479, 0.6374954581260681, 0.6272324919700623, 0.6171433925628662, 0.6072195172309875, 0.5974531769752502, 0.5878370404243469, 0.5783646702766418, 0.5690299868583679, 0.5598273873329163, 0.550751805305481, 0.5417983531951904, 0.5329626798629761, 0.5242405533790588, 0.5156282186508179, 0.5071220397949219, 0.49871864914894104, 0.4904148280620575, 0.48220765590667725, 0.47409430146217346, 0.466072142124176, 0.45813870429992676, 0.45029163360595703, 0.44252872467041016, 0.4348478317260742, 0.42724698781967163, 0.41972434520721436, 0.41227802634239197, 0.40490642189979553, 0.39760786294937134, 0.3903807997703552, 0.3832238018512726, 0.3761354684829712, 0.3691144585609436, 0.36215949058532715, 0.3552693724632263, 0.3484429717063904, 0.3416791558265686, 0.33497685194015503, 0.32833510637283325, 0.3217529058456421, 0.3152293860912323, 0.30876362323760986, 0.3023548424243927, 0.2960021495819092, 0.2897048592567444, 0.28346219658851624, 0.2772735059261322, 0.271138072013855, 0.2650552988052368, 0.25902456045150757, 0.25304529070854187, 0.24711695313453674, 0.24123899638652802, 0.23541094362735748, 0.22963231801986694, 0.22390270233154297, 0.21822164952754974, 0.21258877217769623, 0.20700371265411377, 0.20146611332893372, 0.1959756463766098, 0.19053204357624054, 0.18513499200344086, 0.17978426814079285, 0.1744796335697174, 0.16922089457511902, 0.16400785744190216, 0.1588403731584549, 0.15371830761432648, 0.14864157140254974, 0.14361007511615753, 0.13862377405166626, 0.13368265330791473, 0.12878671288490295, 0.12393598258495331, 0.11913054436445236, 0.11437050998210907, 0.10965602099895477, 0.1049872562289238, 0.10036443918943405, 0.09578784555196762, 0.09125780314207077, 0.08677466958761215, 0.08233889937400818, 0.07795098423957825, 0.07361150532960892, 0.06932111829519272, 0.06508058309555054, 0.06089077144861221, 0.05675266310572624, 0.05266740173101425, 0.048636294901371, 0.044660862535238266, 0.040742866694927216, 0.03688438981771469, 0.03308788686990738, 0.029356317594647408, 0.025693291798233986, 0.02210330404341221, 0.018592102453112602, 0.015167297795414925, 0.011839478276669979, 0.0086244847625494, 0.005548994988203049, 0.0026696291752159595]); rngCooked = $toNativeArray($kindInt64, [new $Int64(-973649357, 3952672746), new $Int64(-1065661887, 3130416987), new $Int64(324977939, 3414273807), new $Int64(1241840476, 2806224363), new $Int64(-1477934308, 1997590414), new $Int64(2103305448, 2402795971), new $Int64(1663160183, 1140819369), new $Int64(1120601685, 1788868961), new $Int64(1848035537, 1089001426), new $Int64(1235702047, 873593504), new $Int64(1911387977, 581324885), new $Int64(-1654874170, 1609182556), new $Int64(1069394745, 1241596776), new $Int64(1895445337, 1771189259), new $Int64(-1374618802, 3467012610), new $Int64(-140526423, 2344407434), new $Int64(-1745367887, 782467244), new $Int64(26335124, 3404933915), new $Int64(1063924276, 618867887), new $Int64(-968700782, 520164395), new $Int64(-1591572833, 1341358184), new $Int64(-1515085039, 665794848), new $Int64(1527227641, 3183648150), new $Int64(1781176124, 696329606), new $Int64(1789146075, 4151988961), new $Int64(-2087444114, 998951326), new $Int64(-612324923, 1364957564), new $Int64(63173359, 4090230633), new $Int64(-1498029007, 4009697548), new $Int64(248009524, 2569622517), new $Int64(778703922, 3742421481), new $Int64(-1109106023, 1506914633), new $Int64(1738099768, 1983412561), new $Int64(236311649, 1436266083), new $Int64(-1111517500, 3922894967), new $Int64(-1336974714, 1792680179), new $Int64(563141142, 1188796351), new $Int64(1349617468, 405968250), new $Int64(1044074554, 433754187), new $Int64(870549669, 4073162024), new $Int64(-1094251604, 433121399), new $Int64(2451824, 4162580594), new $Int64(-137262572, 4132415622), new $Int64(-1536231048, 3033822028), new $Int64(2016407895, 824682382), new $Int64(2366218, 3583765414), new $Int64(-624604839, 535386927), new $Int64(1637219058, 2286693689), new $Int64(1453075389, 2968466525), new $Int64(193683513, 1351410206), new $Int64(-283806096, 1412813499), new $Int64(492736522, 4126267639), new $Int64(512765208, 2105529399), new $Int64(2132966268, 2413882233), new $Int64(947457634, 32226200), new $Int64(1149341356, 2032329073), new $Int64(106485445, 1356518208), new $Int64(-2067810156, 3430061722), new $Int64(-1484435135, 3820169661), new $Int64(-1665985194, 2981816134), new $Int64(1017155588, 4184371017), new $Int64(206574701, 2119206761), new $Int64(-852109057, 2472200560), new $Int64(-560457548, 2853524696), new $Int64(1307803389, 1681119904), new $Int64(-174986835, 95608918), new $Int64(392686347, 3690479145), new $Int64(-1205570926, 1397922290), new $Int64(-1159314025, 1516129515), new $Int64(-320178155, 1547420459), new $Int64(1311333971, 1470949486), new $Int64(-1953469798, 1336785672), new $Int64(-45086614, 4131677129), new $Int64(-1392278100, 4246329084), new $Int64(-1142500187, 3788585631), new $Int64(-66478285, 3080389532), new $Int64(-646438364, 2215402037), new $Int64(391002300, 1171593935), new $Int64(1408774047, 1423855166), new $Int64(-519177718, 2276716302), new $Int64(-368453140, 2068027241), new $Int64(1369359303, 3427553297), new $Int64(189241615, 3289637845), new $Int64(1057480830, 3486407650), new $Int64(-1512910664, 3071877822), new $Int64(1159653919, 3363620705), new $Int64(-934256930, 4159821533), new $Int64(-76621938, 1894661), new $Int64(-674493898, 1156868282), new $Int64(348271067, 776219088), new $Int64(-501428838, 2425634259), new $Int64(1716021749, 680510161), new $Int64(-574263456, 1310101429), new $Int64(1095885995, 2964454134), new $Int64(-325695512, 3467098407), new $Int64(1990672920, 2109628894), new $Int64(-2139648704, 1232604732), new $Int64(-1838070714, 3261916179), new $Int64(1699175360, 434597899), new $Int64(235436061, 1624796439), new $Int64(-1626402839, 3589632480), new $Int64(1198416575, 864579159), new $Int64(-1938748161, 1380889830), new $Int64(619206309, 2654509477), new $Int64(1419738251, 1468209306), new $Int64(-1744284772, 100794388), new $Int64(-1191421458, 2991674471), new $Int64(-208666741, 2224662036), new $Int64(-173659161, 977097250), new $Int64(1351320195, 726419512), new $Int64(-183459897, 1747974366), new $Int64(-753095183, 1556430604), new $Int64(-1049492215, 1080776742), new $Int64(-385846958, 280794874), new $Int64(117767733, 919835643), new $Int64(-967009426, 3434019658), new $Int64(-1951414480, 2461941785), new $Int64(133215641, 3615001066), new $Int64(417204809, 3103414427), new $Int64(790056561, 3380809712), new $Int64(-1267681408, 2724693469), new $Int64(547796833, 598827710), new $Int64(-1846559452, 3452273442), new $Int64(-75778224, 649274915), new $Int64(-801301329, 2585724112), new $Int64(-1510934263, 3165579553), new $Int64(1185578221, 2635894283), new $Int64(-52910178, 2053289721), new $Int64(985976581, 3169337108), new $Int64(1170569632, 144717764), new $Int64(1079216270, 1383666384), new $Int64(-124804942, 681540375), new $Int64(1375448925, 537050586), new $Int64(-1964768344, 315246468), new $Int64(226402871, 849323088), new $Int64(-885062465, 45543944), new $Int64(-946445250, 2319052083), new $Int64(-40708194, 3613090841), new $Int64(560472520, 2992171180), new $Int64(-381863169, 2068244785), new $Int64(917538188, 4239862634), new $Int64(-1369555809, 3892253031), new $Int64(720683925, 958186149), new $Int64(-423297785, 1877702262), new $Int64(1357886971, 837674867), new $Int64(1837048883, 1507589294), new $Int64(1905518400, 873336795), new $Int64(-1879761037, 2764496274), new $Int64(-1806480530, 4196182374), new $Int64(-1066765755, 550964545), new $Int64(818747069, 420611474), new $Int64(-1924830376, 204265180), new $Int64(1549974541, 1787046383), new $Int64(1215581865, 3102292318), new $Int64(418321538, 1552199393), new $Int64(1243493047, 980542004), new $Int64(267284263, 3293718720), new $Int64(1179528763, 3771917473), new $Int64(599484404, 2195808264), new $Int64(252818753, 3894702887), new $Int64(-1367475956, 2099949527), new $Int64(1424094358, 338442522), new $Int64(490737398, 637158004), new $Int64(-1727621530, 281976339), new $Int64(574970164, 3619802330), new $Int64(-431930823, 3084554784), new $Int64(-1264611183, 4129772886), new $Int64(-2104399043, 1680378557), new $Int64(-1621962591, 3339087776), new $Int64(1680500332, 4220317857), new $Int64(-1935828963, 2959322499), new $Int64(1675600481, 1488354890), new $Int64(-834863562, 3958162143), new $Int64(-1226511573, 2773705983), new $Int64(1876039582, 225908689), new $Int64(-1183735113, 908216283), new $Int64(-605696219, 3574646075), new $Int64(-1827723091, 1936937569), new $Int64(1519770881, 75492235), new $Int64(816689472, 1935193178), new $Int64(2142521206, 2018250883), new $Int64(455141620, 3943126022), new $Int64(-601399488, 3066544345), new $Int64(1932392669, 2793082663), new $Int64(-1239009361, 3297036421), new $Int64(1640597065, 2206987825), new $Int64(-553246738, 807894872), new $Int64(-1781325307, 766252117), new $Int64(2060649606, 3833114345), new $Int64(845619743, 1255067973), new $Int64(1201145605, 741697208), new $Int64(-1476242608, 2810093753), new $Int64(1109032642, 4229340371), new $Int64(1462188720, 1361684224), new $Int64(-1159399429, 1906263026), new $Int64(475781207, 3904421704), new $Int64(-623537128, 1769075545), new $Int64(1062308525, 2621599764), new $Int64(1279509432, 3431891480), new $Int64(-1742751146, 1871896503), new $Int64(128756421, 1412808876), new $Int64(1605404688, 952876175), new $Int64(-230443691, 1824438899), new $Int64(1662295856, 1005035476), new $Int64(-156574141, 527508597), new $Int64(1288873303, 3066806859), new $Int64(565995893, 3244940914), new $Int64(-889746188, 209092916), new $Int64(-247669406, 1242699167), new $Int64(-713830396, 456723774), new $Int64(1776978905, 1001252870), new $Int64(1468772157, 2026725874), new $Int64(857254202, 2137562569), new $Int64(765939740, 3183366709), new $Int64(1533887628, 2612072960), new $Int64(56977098, 1727148468), new $Int64(-1197583895, 3803658212), new $Int64(1883670356, 479946959), new $Int64(685713571, 1562982345), new $Int64(-1946242443, 1766109365), new $Int64(700596547, 3257093788), new $Int64(-184714929, 2365720207), new $Int64(93384808, 3742754173), new $Int64(-458385235, 2878193673), new $Int64(1096135042, 2174002182), new $Int64(-834260953, 3573511231), new $Int64(-754572527, 1760299077), new $Int64(-1375627191, 2260779833), new $Int64(-866019274, 1452805722), new $Int64(-1229671918, 2940011802), new $Int64(1890251082, 1886183802), new $Int64(893897673, 2514369088), new $Int64(1644345561, 3924317791), new $Int64(-1974867432, 500935732), new $Int64(1403501753, 676580929), new $Int64(-1565912283, 1184984890), new $Int64(-691968413, 1271474274), new $Int64(-1828754738, 3163791473), new $Int64(2051027584, 2842487377), new $Int64(1511537551, 2170968612), new $Int64(573262976, 3535856740), new $Int64(-2053227187, 1488599718), new $Int64(-1180531831, 3408913763), new $Int64(-2086531912, 2501050084), new $Int64(-875130448, 1639124157), new $Int64(-2009482504, 4088176393), new $Int64(1574896563, 3989947576), new $Int64(-165243708, 3414355209), new $Int64(-792329287, 2275136352), new $Int64(-2057774345, 2151835223), new $Int64(-931144933, 1654534827), new $Int64(-679921451, 377892833), new $Int64(-482716010, 660204544), new $Int64(85706799, 390828249), new $Int64(-1422172693, 3402783878), new $Int64(-1468634160, 3717936603), new $Int64(1113532086, 2211058823), new $Int64(1564224320, 2692150867), new $Int64(1952770442, 1928910388), new $Int64(788716862, 3931011137), new $Int64(1083670504, 1112701047), new $Int64(-68150572, 2452299106), new $Int64(-896164822, 2337204777), new $Int64(1774877857, 273889282), new $Int64(1798719843, 1462008793), new $Int64(2138834788, 1554494002), new $Int64(-1194967131, 182675323), new $Int64(-1598554764, 1882802136), new $Int64(589279648, 3700220025), new $Int64(381039426, 3083431543), new $Int64(-851859191, 3622207527), new $Int64(338126939, 432729309), new $Int64(-1667470126, 2391914317), new $Int64(-1849558151, 235747924), new $Int64(2120733629, 3088823825), new $Int64(-745079795, 2314658321), new $Int64(1165929723, 2957634338), new $Int64(501323675, 4117056981), new $Int64(1564699815, 1482500298), new $Int64(-740826490, 840489337), new $Int64(799522364, 3483178565), new $Int64(532129761, 2074004656), new $Int64(724246478, 3643392642), new $Int64(-665153481, 1583624461), new $Int64(-885822954, 287473085), new $Int64(1667835381, 3136843981), new $Int64(1138806821, 1266970974), new $Int64(135185781, 1998688839), new $Int64(392094735, 1492900209), new $Int64(1031326774, 1538112737), new $Int64(-2070568842, 2207265429), new $Int64(-1886797613, 963263315), new $Int64(1671145500, 2295892134), new $Int64(1068469660, 2002560897), new $Int64(-356250305, 1369254035), new $Int64(33436120, 3353312708), new $Int64(57507843, 947771099), new $Int64(-1945755145, 1747061399), new $Int64(1507240140, 2047354631), new $Int64(720000810, 4165367136), new $Int64(479265078, 3388864963), new $Int64(-952181250, 286492130), new $Int64(2045622690, 2795735007), new $Int64(-715730566, 3703961339), new $Int64(-148436487, 1797825479), new $Int64(1429039600, 1116589674), new $Int64(-1665420098, 2593309206), new $Int64(1329049334, 3404995677), new $Int64(-750579440, 3453462936), new $Int64(1014767077, 3016498634), new $Int64(75698599, 1650371545), new $Int64(1592007860, 212344364), new $Int64(1127766888, 3843932156), new $Int64(-748019856, 3573129983), new $Int64(-890581831, 665897820), new $Int64(1071492673, 1675628772), new $Int64(243225682, 2831752928), new $Int64(2120298836, 1486294219), new $Int64(-1954407413, 268782709), new $Int64(-1002123503, 4186179080), new $Int64(624342951, 1613720397), new $Int64(857179861, 2703686015), new $Int64(-911618704, 2205342611), new $Int64(-672703993, 1411666394), new $Int64(-1528454899, 677744900), new $Int64(-1876628533, 4172867247), new $Int64(135494707, 2163418403), new $Int64(849547544, 2841526879), new $Int64(-1117516959, 1082141470), new $Int64(-1770111792, 4046134367), new $Int64(51415528, 2142943655), new $Int64(-249824333, 3124627521), new $Int64(998228909, 219992939), new $Int64(-1078790951, 1756846531), new $Int64(1283749206, 1225118210), new $Int64(-525858006, 1647770243), new $Int64(-2035959705, 444807907), new $Int64(2036369448, 3952076173), new $Int64(53201823, 1461839639), new $Int64(315761893, 3699250910), new $Int64(702974850, 1373688981), new $Int64(734022261, 147523747), new $Int64(-2047330906, 1211276581), new $Int64(1294440951, 2548832680), new $Int64(1144696256, 1995631888), new $Int64(-1992983070, 2011457303), new $Int64(-1351022674, 3057425772), new $Int64(667839456, 81484597), new $Int64(-1681980888, 3646681560), new $Int64(-1372462725, 635548515), new $Int64(602489502, 2508044581), new $Int64(-1794220117, 1014917157), new $Int64(719992433, 3214891315), new $Int64(-1294799037, 959582252), new $Int64(226415134, 3347040449), new $Int64(-362868096, 4102971975), new $Int64(397887437, 4078022210), new $Int64(-536803826, 2851767182), new $Int64(-1398321012, 1540160644), new $Int64(-1549098876, 1057290595), new $Int64(-112592988, 3907769253), new $Int64(579300318, 4248952684), new $Int64(-1054576049, 132554364), new $Int64(-1085862414, 1029351092), new $Int64(697840928, 2583007416), new $Int64(298619124, 1486185789), new $Int64(55905697, 2871589073), new $Int64(2017643612, 723203291), new $Int64(146250550, 2494333952), new $Int64(-1082993397, 2230939180), new $Int64(-1804568072, 3943232912), new $Int64(1768732449, 2181367922), new $Int64(-729261111, 2889274791), new $Int64(1824032949, 2046728161), new $Int64(1653899792, 1376052477), new $Int64(1022327048, 381236993), new $Int64(-1113097690, 3188942166), new $Int64(-74480109, 350070824), new $Int64(144881592, 61758415), new $Int64(-741824226, 3492950336), new $Int64(-2030042720, 3093818430), new $Int64(-453590535, 2962480613), new $Int64(-1912050708, 3154871160), new $Int64(-1636478569, 3228564679), new $Int64(610731502, 888276216), new $Int64(-946702974, 3574998604), new $Int64(-1277068380, 1967526716), new $Int64(-1556147941, 1554691298), new $Int64(-1573024234, 339944798), new $Int64(1223764147, 1154515356), new $Int64(1825645307, 967516237), new $Int64(1546195135, 596588202), new $Int64(-1867600880, 3764362170), new $Int64(-1655392592, 266611402), new $Int64(-393255880, 2047856075), new $Int64(-1000726433, 21444105), new $Int64(-949424754, 3065563181), new $Int64(-232418803, 1140663212), new $Int64(633187674, 2323741028), new $Int64(2126290159, 3103873707), new $Int64(1008658319, 2766828349), new $Int64(-485587503, 1970872996), new $Int64(1628585413, 3766615585), new $Int64(-595148528, 2036813414), new $Int64(-1994877121, 3105536507), new $Int64(13954645, 3396176938), new $Int64(-721402003, 1377154485), new $Int64(-61839181, 3807014186), new $Int64(543009040, 3710110597), new $Int64(-1751425519, 916420443), new $Int64(734556788, 2103831255), new $Int64(-1766161494, 717331943), new $Int64(-1574598896, 3550505941), new $Int64(45939673, 378749927), new $Int64(-1997615719, 611017331), new $Int64(592130075, 758907650), new $Int64(1012992349, 154266815), new $Int64(-1040454942, 1407468696), new $Int64(-1678191250, 970098704), new $Int64(-285057486, 1971660656), new $Int64(998365243, 3332747885), new $Int64(1947089649, 1935189867), new $Int64(1510248801, 203520055), new $Int64(-1305165746, 3916463034), new $Int64(-388598655, 3474113316), new $Int64(1036101639, 316544223), new $Int64(-1773744891, 1650844677), new $Int64(-907191419, 4267565603), new $Int64(-1070275024, 2501167616), new $Int64(-1520651863, 3929401789), new $Int64(-2091360852, 337170252), new $Int64(-960502090, 2061966842), new $Int64(-304190848, 2508461464), new $Int64(-1941471116, 2791377107), new $Int64(1240791848, 1227227588), new $Int64(1813978778, 1709681848), new $Int64(1153692192, 3768820575), new $Int64(-1002297449, 2887126398), new $Int64(-1447111334, 296561685), new $Int64(700300844, 3729960077), new $Int64(-1572311344, 372833036), new $Int64(2078875613, 2409779288), new $Int64(1829161290, 555274064), new $Int64(-1105595719, 4239804901), new $Int64(1839403216, 3723486978), new $Int64(-1649093095, 2145871984), new $Int64(-1582765715, 3565480803), new $Int64(-1568653827, 2197313814), new $Int64(974785092, 3613674566), new $Int64(438638731, 3042093666), new $Int64(-96556264, 3324034321), new $Int64(869420878, 3708873369), new $Int64(946682149, 1698090092), new $Int64(1618900382, 4213940712), new $Int64(-1843479747, 2087477361), new $Int64(-1766167800, 2407950639), new $Int64(-1296225558, 3942568569), new $Int64(-1223900450, 4088074412), new $Int64(723260036, 2964773675), new $Int64(-673921829, 1539178386), new $Int64(1062961552, 2694849566), new $Int64(460977733, 2120273838), new $Int64(-1604570740, 2484608657), new $Int64(880846449, 2956190677), new $Int64(1970902366, 4223313749), new $Int64(662161910, 3502682327), new $Int64(705634754, 4133891139), new $Int64(-1031359300, 1166449596), new $Int64(1038247601, 3362705993), new $Int64(93734798, 3892921029), new $Int64(1876124043, 786869787), new $Int64(1057490746, 1046342263), new $Int64(242763728, 493777327), new $Int64(-853573201, 3304827646), new $Int64(616460742, 125356352), new $Int64(499300063, 74094113), new $Int64(-795586925, 2500816079), new $Int64(-490248444, 514015239), new $Int64(1377565129, 543520454), new $Int64(-2039776725, 3614531153), new $Int64(2056746300, 2356753985), new $Int64(1390062617, 2018141668), new $Int64(131272971, 2087974891), new $Int64(-1502927041, 3166972343), new $Int64(372256200, 1517638666), new $Int64(-935275664, 173466846), new $Int64(-695774461, 4241513471), new $Int64(-1413550842, 2783126920), new $Int64(1972004134, 4167264826), new $Int64(29260506, 3907395640), new $Int64(-910901561, 1539634186), new $Int64(-595957298, 178241987), new $Int64(-113277636, 182168164), new $Int64(-1102530459, 2386154934), new $Int64(1379126408, 4077374341), new $Int64(-2114679722, 1732699140), new $Int64(-421057745, 1041306002), new $Int64(1860414813, 2068001749), new $Int64(1005320202, 3208962910), new $Int64(844054010, 697710380), new $Int64(-1509359403, 2228431183), new $Int64(-810313977, 3554678728), new $Int64(-750989047, 173470263), new $Int64(-85886265, 3848297795), new $Int64(-926936977, 246236185), new $Int64(-1984190461, 2066374846), new $Int64(1771673660, 312890749), new $Int64(703378057, 3573310289), new $Int64(-598851901, 143166754), new $Int64(613554316, 2081511079), new $Int64(1197802104, 486038032), new $Int64(-1906483789, 2982218564), new $Int64(364901986, 1000939191), new $Int64(1902782651, 2750454885), new $Int64(-671844857, 3375313137), new $Int64(-1643868040, 881302957), new $Int64(-1508784745, 2514186393), new $Int64(-1703622845, 360024739), new $Int64(1399671872, 292500025), new $Int64(1381210821, 2276300752), new $Int64(521803381, 4069087683), new $Int64(-1938982667, 1637778212), new $Int64(720490469, 1676670893), new $Int64(1067262482, 3855174429), new $Int64(2114075974, 2067248671), new $Int64(-89426259, 2884561259), new $Int64(-805741095, 2456511185), new $Int64(983726246, 561175414), new $Int64(-1719489563, 432588903), new $Int64(885133709, 4059399550), new $Int64(-93096266, 1075014784), new $Int64(-1733832628, 2728058415), new $Int64(1839142064, 1299703678), new $Int64(1262333188, 2347583393), new $Int64(1285481956, 2468164145), new $Int64(-1158354011, 1140014346), new $Int64(2033889184, 1936972070), new $Int64(-1737578993, 3870530098), new $Int64(-484494257, 1717789158), new $Int64(-232997156, 1153452491), new $Int64(-990424416, 3948827651), new $Int64(-1357145630, 2101413152), new $Int64(1495744672, 3854091229), new $Int64(83644069, 4215565463), new $Int64(-1385277313, 1202710438), new $Int64(-564909037, 2072216740), new $Int64(705690639, 2066751068), new $Int64(-2113583312, 173902580), new $Int64(-741983806, 142459001), new $Int64(172391592, 1889151926), new $Int64(-498943125, 3034199774), new $Int64(1618587731, 516490102), new $Int64(93114264, 3692577783), new $Int64(-2078821353, 2953948865), new $Int64(-320938673, 4041040923), new $Int64(-1942517976, 592046130), new $Int64(-705643640, 384297211), new $Int64(-2051649464, 265863924), new $Int64(2101717619, 1333136237), new $Int64(1499611781, 1406273556), new $Int64(1074670496, 426305476), new $Int64(125704633, 2750898176), new $Int64(488068495, 1633944332), new $Int64(2037723464, 3236349343), new $Int64(-1703423246, 4013676611), new $Int64(1718532237, 2265047407), new $Int64(1433593806, 875071080), new $Int64(-343047503, 1418843655), new $Int64(2009228711, 451657300), new $Int64(1229446621, 1866374663), new $Int64(1653472867, 1551455622), new $Int64(577191481, 3560962459), new $Int64(1669204077, 3347903778), new $Int64(-298327194, 2675874918), new $Int64(-1831355577, 2762991672), new $Int64(530492383, 3689068477), new $Int64(844089962, 4071997905), new $Int64(1508155730, 1381702441), new $Int64(2089931018, 2373284878), new $Int64(-864267462, 2143983064), new $Int64(308739063, 1938207195), new $Int64(1754949306, 1188152253), new $Int64(1272345009, 615870490), new $Int64(742653194, 2662252621), new $Int64(1477718295, 3839976789), new $Int64(-2091334213, 306752547), new $Int64(-1426688067, 2162363077), new $Int64(-57052633, 2767224719), new $Int64(-1471624099, 2628837712), new $Int64(1678405918, 2967771969), new $Int64(1694285728, 499792248), new $Int64(-1744131281, 4285253508), new $Int64(962357072, 2856511070), new $Int64(679471692, 2526409716), new $Int64(-1793706473, 1240875658), new $Int64(-914893422, 2577342868), new $Int64(-1001298215, 4136853496), new $Int64(-1477114974, 2403540137), new $Int64(1372824515, 1371410668), new $Int64(-176562048, 371758825), new $Int64(-441063112, 1528834084), new $Int64(-71688630, 1504757260), new $Int64(-1461820072, 699052551), new $Int64(-505543539, 3347789870), new $Int64(1951619734, 3430604759), new $Int64(2119672219, 1935601723), new $Int64(966789690, 834676166)]); globalRand = New(new lockedSource.ptr(new nosync.Mutex.ptr(false), $assertType(NewSource(new $Int64(0, 1)), Source64))); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["os/exec"] = (function() { var $pkg = {}, $init, bytes, context, errors, io, os, filepath, runtime, strconv, strings, sync, syscall, Error, Cmd, ExitError, closeOnce, prefixSuffixSaver, F, sliceType, ptrType, sliceType$1, ptrType$1, ptrType$2, ptrType$3, sliceType$2, funcType, sliceType$3, sliceType$4, ptrType$4, structType, sliceType$5, arrayType, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, chanType, chanType$1, ptrType$10, skipStdinCopyError, Command, interfaceEqual, lookExtensions, minInt, dedupEnv, dedupEnvCase, init, findExecutable, LookPath; bytes = $packages["bytes"]; context = $packages["context"]; errors = $packages["errors"]; io = $packages["io"]; os = $packages["os"]; filepath = $packages["path/filepath"]; runtime = $packages["runtime"]; strconv = $packages["strconv"]; strings = $packages["strings"]; sync = $packages["sync"]; syscall = $packages["syscall"]; Error = $pkg.Error = $newType(0, $kindStruct, "exec.Error", true, "os/exec", true, function(Name_, Err_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.Err = $ifaceNil; return; } this.Name = Name_; this.Err = Err_; }); Cmd = $pkg.Cmd = $newType(0, $kindStruct, "exec.Cmd", true, "os/exec", true, function(Path_, Args_, Env_, Dir_, Stdin_, Stdout_, Stderr_, ExtraFiles_, SysProcAttr_, Process_, ProcessState_, ctx_, lookPathErr_, finished_, childFiles_, closeAfterStart_, closeAfterWait_, goroutine_, errch_, waitDone_) { this.$val = this; if (arguments.length === 0) { this.Path = ""; this.Args = sliceType.nil; this.Env = sliceType.nil; this.Dir = ""; this.Stdin = $ifaceNil; this.Stdout = $ifaceNil; this.Stderr = $ifaceNil; this.ExtraFiles = sliceType$1.nil; this.SysProcAttr = ptrType$1.nil; this.Process = ptrType$2.nil; this.ProcessState = ptrType$3.nil; this.ctx = $ifaceNil; this.lookPathErr = $ifaceNil; this.finished = false; this.childFiles = sliceType$1.nil; this.closeAfterStart = sliceType$2.nil; this.closeAfterWait = sliceType$2.nil; this.goroutine = sliceType$3.nil; this.errch = $chanNil; this.waitDone = $chanNil; return; } this.Path = Path_; this.Args = Args_; this.Env = Env_; this.Dir = Dir_; this.Stdin = Stdin_; this.Stdout = Stdout_; this.Stderr = Stderr_; this.ExtraFiles = ExtraFiles_; this.SysProcAttr = SysProcAttr_; this.Process = Process_; this.ProcessState = ProcessState_; this.ctx = ctx_; this.lookPathErr = lookPathErr_; this.finished = finished_; this.childFiles = childFiles_; this.closeAfterStart = closeAfterStart_; this.closeAfterWait = closeAfterWait_; this.goroutine = goroutine_; this.errch = errch_; this.waitDone = waitDone_; }); ExitError = $pkg.ExitError = $newType(0, $kindStruct, "exec.ExitError", true, "os/exec", true, function(ProcessState_, Stderr_) { this.$val = this; if (arguments.length === 0) { this.ProcessState = ptrType$3.nil; this.Stderr = sliceType$5.nil; return; } this.ProcessState = ProcessState_; this.Stderr = Stderr_; }); closeOnce = $pkg.closeOnce = $newType(0, $kindStruct, "exec.closeOnce", true, "os/exec", false, function(File_, once_, err_) { this.$val = this; if (arguments.length === 0) { this.File = ptrType.nil; this.once = new sync.Once.ptr(new sync.Mutex.ptr(0, 0), 0); this.err = $ifaceNil; return; } this.File = File_; this.once = once_; this.err = err_; }); prefixSuffixSaver = $pkg.prefixSuffixSaver = $newType(0, $kindStruct, "exec.prefixSuffixSaver", true, "os/exec", false, function(N_, prefix_, suffix_, suffixOff_, skipped_) { this.$val = this; if (arguments.length === 0) { this.N = 0; this.prefix = sliceType$5.nil; this.suffix = sliceType$5.nil; this.suffixOff = 0; this.skipped = new $Int64(0, 0); return; } this.N = N_; this.prefix = prefix_; this.suffix = suffix_; this.suffixOff = suffixOff_; this.skipped = skipped_; }); F = $newType(4, $kindFunc, "exec.F", true, "os/exec", true, null); sliceType = $sliceType($String); ptrType = $ptrType(os.File); sliceType$1 = $sliceType(ptrType); ptrType$1 = $ptrType(syscall.SysProcAttr); ptrType$2 = $ptrType(os.Process); ptrType$3 = $ptrType(os.ProcessState); sliceType$2 = $sliceType(io.Closer); funcType = $funcType([], [$error], false); sliceType$3 = $sliceType(funcType); sliceType$4 = $sliceType(F); ptrType$4 = $ptrType(Cmd); structType = $structType("", []); sliceType$5 = $sliceType($Uint8); arrayType = $arrayType($Uint8, 64); ptrType$5 = $ptrType(ExitError); ptrType$6 = $ptrType(prefixSuffixSaver); ptrType$7 = $ptrType(sliceType$5); ptrType$8 = $ptrType(os.PathError); ptrType$9 = $ptrType(Error); chanType = $chanType($error, false, false); chanType$1 = $chanType(structType, false, false); ptrType$10 = $ptrType(closeOnce); Error.ptr.prototype.Error = function() { var _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return "exec: " + strconv.Quote(e.Name) + ": " + _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Error.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; Error.prototype.Error = function() { return this.$val.Error(); }; Command = function(name, arg) { var _r, _tuple, arg, cmd, err, lp, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; arg = $f.arg; cmd = $f.cmd; err = $f.err; lp = $f.lp; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cmd = new Cmd.ptr(name, $appendSlice(new sliceType([name]), arg), sliceType.nil, "", $ifaceNil, $ifaceNil, $ifaceNil, sliceType$1.nil, ptrType$1.nil, ptrType$2.nil, ptrType$3.nil, $ifaceNil, $ifaceNil, false, sliceType$1.nil, sliceType$2.nil, sliceType$2.nil, sliceType$3.nil, $chanNil, $chanNil); /* */ if (filepath.Base(name) === name) { $s = 1; continue; } /* */ $s = 2; continue; /* if (filepath.Base(name) === name) { */ case 1: _r = LookPath(name); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; lp = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { cmd.lookPathErr = err; } else { cmd.Path = lp; } /* } */ case 2: $s = -1; return cmd; /* */ } return; } if ($f === undefined) { $f = { $blk: Command }; } $f._r = _r; $f._tuple = _tuple; $f.arg = arg; $f.cmd = cmd; $f.err = err; $f.lp = lp; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.Command = Command; interfaceEqual = function(a, b) { var a, b, $deferred; /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); $deferred.push([(function() { $recover(); }), []]); return $interfaceIsEqual(a, b); /* */ } catch(err) { $err = err; return false; } finally { $callDeferred($deferred, $err); } }; Cmd.ptr.prototype.envv = function() { var _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!(c.Env === sliceType.nil)) { $s = -1; return c.Env; } _r = os.Environ(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.envv }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.envv = function() { return this.$val.envv(); }; Cmd.ptr.prototype.argv = function() { var c; c = this; if (c.Args.$length > 0) { return c.Args; } return new sliceType([c.Path]); }; Cmd.prototype.argv = function() { return this.$val.argv(); }; Cmd.ptr.prototype.stdin = function() { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, c, err, f, f$1, ok, pr, pw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; err = $f.err; f = $f.f; f$1 = $f.f$1; ok = $f.ok; pr = $f.pr; pw = $f.pw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; pw = [pw]; f = ptrType.nil; err = $ifaceNil; c[0] = this; /* */ if ($interfaceIsEqual(c[0].Stdin, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(c[0].Stdin, $ifaceNil)) { */ case 1: _r = os.Open("/dev/null"); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [f, err]; } c[0].closeAfterStart = $append(c[0].closeAfterStart, f); $s = -1; return [f, err]; /* } */ case 2: _tuple$1 = $assertType(c[0].Stdin, ptrType, true); f$1 = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { _tmp = f$1; _tmp$1 = $ifaceNil; f = _tmp; err = _tmp$1; $s = -1; return [f, err]; } _r$1 = os.Pipe(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; pr = _tuple$2[0]; pw[0] = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [f, err]; } c[0].closeAfterStart = $append(c[0].closeAfterStart, pr); c[0].closeAfterWait = $append(c[0].closeAfterWait, pw[0]); c[0].goroutine = $append(c[0].goroutine, (function(c, pw) { return function $b() { var _r$2, _r$3, _r$4, _tuple$3, _v, err$1, err1, skip, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple$3 = $f._tuple$3; _v = $f._v; err$1 = $f.err$1; err1 = $f.err1; skip = $f.skip; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$2 = io.Copy(pw[0], c[0].Stdin); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$3 = _r$2; err$1 = _tuple$3[1]; skip = skipStdinCopyError; if (!(!(skip === $throwNilPointerError))) { _v = false; $s = 4; continue s; } _r$3 = skip(err$1); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _v = _r$3; case 4: /* */ if (_v) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_v) { */ case 2: err$1 = $ifaceNil; /* } */ case 3: _r$4 = pw[0].Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err1 = _r$4; if ($interfaceIsEqual(err$1, $ifaceNil)) { err$1 = err1; } $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple$3 = _tuple$3; $f._v = _v; $f.err$1 = err$1; $f.err1 = err1; $f.skip = skip; $f.$s = $s; $f.$r = $r; return $f; }; })(c, pw)); _tmp$2 = pr; _tmp$3 = $ifaceNil; f = _tmp$2; err = _tmp$3; $s = -1; return [f, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.stdin }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.err = err; $f.f = f; $f.f$1 = f$1; $f.ok = ok; $f.pr = pr; $f.pw = pw; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.stdin = function() { return this.$val.stdin(); }; Cmd.ptr.prototype.stdout = function() { var _r, _tuple, c, err, f, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = ptrType.nil; err = $ifaceNil; c = this; _r = c.writerDescriptor(c.Stdout); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = _tuple[0]; err = _tuple[1]; $s = -1; return [f, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.stdout }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.stdout = function() { return this.$val.stdout(); }; Cmd.ptr.prototype.stderr = function() { var _r, _tmp, _tmp$1, _tuple, c, err, f, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; c = $f.c; err = $f.err; f = $f.f; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: f = ptrType.nil; err = $ifaceNil; c = this; if (!($interfaceIsEqual(c.Stderr, $ifaceNil)) && interfaceEqual(c.Stderr, c.Stdout)) { _tmp = (x = c.childFiles, (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1])); _tmp$1 = $ifaceNil; f = _tmp; err = _tmp$1; $s = -1; return [f, err]; } _r = c.writerDescriptor(c.Stderr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = _tuple[0]; err = _tuple[1]; $s = -1; return [f, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.stderr }; } $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.f = f; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.stderr = function() { return this.$val.stderr(); }; Cmd.ptr.prototype.writerDescriptor = function(w) { var _r, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, _tuple$2, c, err, f, f$1, ok, pr, pw, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; err = $f.err; f = $f.f; f$1 = $f.f$1; ok = $f.ok; pr = $f.pr; pw = $f.pw; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: pr = [pr]; w = [w]; f = ptrType.nil; err = $ifaceNil; c = this; /* */ if ($interfaceIsEqual(w[0], $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(w[0], $ifaceNil)) { */ case 1: _r = os.OpenFile("/dev/null", 1, 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; f = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [f, err]; } c.closeAfterStart = $append(c.closeAfterStart, f); $s = -1; return [f, err]; /* } */ case 2: _tuple$1 = $assertType(w[0], ptrType, true); f$1 = _tuple$1[0]; ok = _tuple$1[1]; if (ok) { _tmp = f$1; _tmp$1 = $ifaceNil; f = _tmp; err = _tmp$1; $s = -1; return [f, err]; } _r$1 = os.Pipe(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$2 = _r$1; pr[0] = _tuple$2[0]; pw = _tuple$2[1]; err = _tuple$2[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [f, err]; } c.closeAfterStart = $append(c.closeAfterStart, pw); c.closeAfterWait = $append(c.closeAfterWait, pr[0]); c.goroutine = $append(c.goroutine, (function(pr, w) { return function $b() { var _r$2, _r$3, _tuple$3, err$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple$3 = $f._tuple$3; err$1 = $f.err$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$2 = io.Copy(w[0], pr[0]); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$3 = _r$2; err$1 = _tuple$3[1]; _r$3 = pr[0].Close(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return err$1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple$3 = _tuple$3; $f.err$1 = err$1; $f.$s = $s; $f.$r = $r; return $f; }; })(pr, w)); _tmp$2 = pw; _tmp$3 = $ifaceNil; f = _tmp$2; err = _tmp$3; $s = -1; return [f, err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.writerDescriptor }; } $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.err = err; $f.f = f; $f.f$1 = f$1; $f.ok = ok; $f.pr = pr; $f.pw = pw; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.writerDescriptor = function(w) { return this.$val.writerDescriptor(w); }; Cmd.ptr.prototype.closeDescriptors = function(closers) { var _i, _r, _ref, c, closers, fd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; c = $f.c; closers = $f.closers; fd = $f.fd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _ref = closers; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } fd = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = fd.Close(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _i++; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.closeDescriptors }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.c = c; $f.closers = closers; $f.fd = fd; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.closeDescriptors = function(closers) { return this.$val.closeDescriptors(closers); }; Cmd.ptr.prototype.Run = function() { var _r, _r$1, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.Start(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = c.Wait(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.Run }; } $f._r = _r; $f._r$1 = _r$1; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.Run = function() { return this.$val.Run(); }; lookExtensions = function(path, dir) { var _r, _r$1, _r$2, _r$3, _tuple, dir, dirandpath, err, ext, lp, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; dir = $f.dir; dirandpath = $f.dirandpath; err = $f.err; ext = $f.ext; lp = $f.lp; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (filepath.Base(path) === path) { path = filepath.Join(new sliceType([".", path])); } /* */ if (dir === "") { $s = 1; continue; } /* */ $s = 2; continue; /* if (dir === "") { */ case 1: _r = LookPath(path); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: /* */ if (!(filepath.VolumeName(path) === "")) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!(filepath.VolumeName(path) === "")) { */ case 4: _r$1 = LookPath(path); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 5: /* */ if (path.length > 1 && os.IsPathSeparator(path.charCodeAt(0))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (path.length > 1 && os.IsPathSeparator(path.charCodeAt(0))) { */ case 7: _r$2 = LookPath(path); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* } */ case 8: dirandpath = filepath.Join(new sliceType([dir, path])); _r$3 = LookPath(dirandpath); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; lp = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return ["", err]; } ext = strings.TrimPrefix(lp, dirandpath); $s = -1; return [path + ext, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: lookExtensions }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.dir = dir; $f.dirandpath = dirandpath; $f.err = err; $f.ext = ext; $f.lp = lp; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.ptr.prototype.Start = function() { var _arg, _arg$1, _arg$2, _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _ref$1, _selection, _tuple, _tuple$1, _tuple$2, c, err, err$1, err$2, fd, fn, lp, setupFd, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; _ref$1 = $f._ref$1; _selection = $f._selection; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; fd = $f.fd; fn = $f.fn; lp = $f.lp; setupFd = $f.setupFd; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = [c]; c[0] = this; /* */ if (!($interfaceIsEqual(c[0].lookPathErr, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(c[0].lookPathErr, $ifaceNil))) { */ case 1: $r = c[0].closeDescriptors(c[0].closeAfterStart); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c[0].closeDescriptors(c[0].closeAfterWait); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return c[0].lookPathErr; /* } */ case 2: /* */ if (false) { $s = 5; continue; } /* */ $s = 6; continue; /* if (false) { */ case 5: _r = lookExtensions(c[0].Path, c[0].Dir); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; lp = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: $r = c[0].closeDescriptors(c[0].closeAfterStart); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c[0].closeDescriptors(c[0].closeAfterWait); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err; /* } */ case 9: c[0].Path = lp; /* } */ case 6: if (!(c[0].Process === ptrType$2.nil)) { $s = -1; return errors.New("exec: already started"); } /* */ if (!($interfaceIsEqual(c[0].ctx, $ifaceNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(c[0].ctx, $ifaceNil))) { */ case 12: _r$1 = c[0].ctx.Done(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = $select([[_r$1], []]); /* */ if (_selection[0] === 0) { $s = 15; continue; } /* */ if (_selection[0] === 1) { $s = 16; continue; } /* */ $s = 17; continue; /* if (_selection[0] === 0) { */ case 15: $r = c[0].closeDescriptors(c[0].closeAfterStart); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c[0].closeDescriptors(c[0].closeAfterWait); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = c[0].ctx.Err(); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* } else if (_selection[0] === 1) { */ case 16: /* } */ case 17: /* } */ case 13: _ref = new sliceType$4([$methodExpr(ptrType$4, "stdin"), $methodExpr(ptrType$4, "stdout"), $methodExpr(ptrType$4, "stderr")]); _i = 0; /* while (true) { */ case 21: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 22; continue; } setupFd = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$3 = setupFd(c[0]); /* */ $s = 23; case 23: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; fd = _tuple$1[0]; err$1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 24; continue; } /* */ $s = 25; continue; /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 24: $r = c[0].closeDescriptors(c[0].closeAfterStart); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c[0].closeDescriptors(c[0].closeAfterWait); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err$1; /* } */ case 25: c[0].childFiles = $append(c[0].childFiles, fd); _i++; /* } */ $s = 21; continue; case 22: c[0].childFiles = $appendSlice(c[0].childFiles, c[0].ExtraFiles); err$2 = $ifaceNil; _arg = c[0].Path; _arg$1 = c[0].argv(); _r$4 = c[0].envv(); /* */ $s = 28; case 28: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = dedupEnv(_r$4); /* */ $s = 29; case 29: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$2 = new os.ProcAttr.ptr(c[0].Dir, _r$5, c[0].childFiles, c[0].SysProcAttr); _r$6 = os.StartProcess(_arg, _arg$1, _arg$2); /* */ $s = 30; case 30: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$2 = _r$6; c[0].Process = _tuple$2[0]; err$2 = _tuple$2[1]; /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 31; continue; } /* */ $s = 32; continue; /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 31: $r = c[0].closeDescriptors(c[0].closeAfterStart); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = c[0].closeDescriptors(c[0].closeAfterWait); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err$2; /* } */ case 32: $r = c[0].closeDescriptors(c[0].closeAfterStart); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c[0].errch = new $Chan($error, c[0].goroutine.$length); _ref$1 = c[0].goroutine; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } fn = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); $go((function(c) { return function $b(fn$1) { var _r$7, fn$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$7 = $f._r$7; fn$1 = $f.fn$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$7 = fn$1(); /* */ $s = 1; case 1: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = $send(c[0].errch, _r$7); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$7 = _r$7; $f.fn$1 = fn$1; $f.$s = $s; $f.$r = $r; return $f; }; })(c), [fn]); _i$1++; } if (!($interfaceIsEqual(c[0].ctx, $ifaceNil))) { c[0].waitDone = new $Chan(structType, 0); $go((function(c) { return function $b() { var _r$7, _r$8, _r$9, _selection$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _selection$1 = $f._selection$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r$7 = c[0].ctx.Done(); /* */ $s = 1; case 1: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = $select([[_r$7], [c[0].waitDone]]); /* */ $s = 2; case 2: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _selection$1 = _r$8; /* */ if (_selection$1[0] === 0) { $s = 3; continue; } /* */ if (_selection$1[0] === 1) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_selection$1[0] === 0) { */ case 3: _r$9 = c[0].Process.Kill(); /* */ $s = 6; case 6: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; $s = 5; continue; /* } else if (_selection$1[0] === 1) { */ case 4: /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._selection$1 = _selection$1; $f.$s = $s; $f.$r = $r; return $f; }; })(c), []); } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.Start }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f._ref$1 = _ref$1; $f._selection = _selection; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.fd = fd; $f.fn = fn; $f.lp = lp; $f.setupFd = setupFd; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.Start = function() { return this.$val.Start(); }; ExitError.ptr.prototype.Error = function() { var e; e = this; return e.ProcessState.String(); }; ExitError.prototype.Error = function() { return this.$val.Error(); }; Cmd.ptr.prototype.Wait = function() { var _i, _r, _r$1, _ref, _tuple, c, copyError, err, err$1, state, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; c = $f.c; copyError = $f.copyError; err = $f.err; err$1 = $f.err$1; state = $f.state; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (c.Process === ptrType$2.nil) { $s = -1; return errors.New("exec: not started"); } if (c.finished) { $s = -1; return errors.New("exec: Wait was already called"); } c.finished = true; _r = c.Process.Wait(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; state = _tuple[0]; err = _tuple[1]; if (!(c.waitDone === $chanNil)) { $close(c.waitDone); } c.ProcessState = state; copyError = $ifaceNil; _ref = c.goroutine; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } _r$1 = $recv(c.errch); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err$1 = _r$1[0]; if (!($interfaceIsEqual(err$1, $ifaceNil)) && $interfaceIsEqual(copyError, $ifaceNil)) { copyError = err$1; } _i++; /* } */ $s = 2; continue; case 3: $r = c.closeDescriptors(c.closeAfterWait); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } else if (!state.Success()) { $s = -1; return new ExitError.ptr(state, sliceType$5.nil); } $s = -1; return copyError; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.Wait }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f.c = c; $f.copyError = copyError; $f.err = err; $f.err$1 = err$1; $f.state = state; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.Wait = function() { return this.$val.Wait(); }; Cmd.ptr.prototype.Output = function() { var _r, _tuple, c, captureErr, ee, err, ok, stdout, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; captureErr = $f.captureErr; ee = $f.ee; err = $f.err; ok = $f.ok; stdout = $f.stdout; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: stdout = [stdout]; c = this; if (!($interfaceIsEqual(c.Stdout, $ifaceNil))) { $s = -1; return [sliceType$5.nil, errors.New("exec: Stdout already set")]; } stdout[0] = new bytes.Buffer.ptr(sliceType$5.nil, 0, arrayType.zero(), 0); c.Stdout = stdout[0]; captureErr = $interfaceIsEqual(c.Stderr, $ifaceNil); if (captureErr) { c.Stderr = new prefixSuffixSaver.ptr(32768, sliceType$5.nil, sliceType$5.nil, 0, new $Int64(0, 0)); } _r = c.Run(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if (!($interfaceIsEqual(err, $ifaceNil)) && captureErr) { _tuple = $assertType(err, ptrType$5, true); ee = _tuple[0]; ok = _tuple[1]; if (ok) { ee.Stderr = $assertType(c.Stderr, ptrType$6).Bytes(); } } $s = -1; return [stdout[0].Bytes(), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.Output }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.captureErr = captureErr; $f.ee = ee; $f.err = err; $f.ok = ok; $f.stdout = stdout; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.Output = function() { return this.$val.Output(); }; Cmd.ptr.prototype.CombinedOutput = function() { var _r, b, c, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; b = $f.b; c = $f.c; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; c = this; if (!($interfaceIsEqual(c.Stdout, $ifaceNil))) { $s = -1; return [sliceType$5.nil, errors.New("exec: Stdout already set")]; } if (!($interfaceIsEqual(c.Stderr, $ifaceNil))) { $s = -1; return [sliceType$5.nil, errors.New("exec: Stderr already set")]; } b[0] = new bytes.Buffer.ptr(sliceType$5.nil, 0, arrayType.zero(), 0); c.Stdout = b[0]; c.Stderr = b[0]; _r = c.Run(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; $s = -1; return [b[0].Bytes(), err]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.CombinedOutput }; } $f._r = _r; $f.b = b; $f.c = c; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.CombinedOutput = function() { return this.$val.CombinedOutput(); }; Cmd.ptr.prototype.StdinPipe = function() { var _r, _tuple, c, err, pr, pw, wc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; pr = $f.pr; pw = $f.pw; wc = $f.wc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!($interfaceIsEqual(c.Stdin, $ifaceNil))) { $s = -1; return [$ifaceNil, errors.New("exec: Stdin already set")]; } if (!(c.Process === ptrType$2.nil)) { $s = -1; return [$ifaceNil, errors.New("exec: StdinPipe after process started")]; } _r = os.Pipe(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; pr = _tuple[0]; pw = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } c.Stdin = pr; c.closeAfterStart = $append(c.closeAfterStart, pr); wc = new closeOnce.ptr(pw, new sync.Once.ptr(new sync.Mutex.ptr(0, 0), 0), $ifaceNil); c.closeAfterWait = $append(c.closeAfterWait, wc); $s = -1; return [wc, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.StdinPipe }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.pr = pr; $f.pw = pw; $f.wc = wc; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.StdinPipe = function() { return this.$val.StdinPipe(); }; closeOnce.ptr.prototype.Close = function() { var c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; $r = c.once.Do($methodVal(c, "close")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return c.err; /* */ } return; } if ($f === undefined) { $f = { $blk: closeOnce.ptr.prototype.Close }; } $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; closeOnce.prototype.Close = function() { return this.$val.Close(); }; closeOnce.ptr.prototype.close = function() { var _r, c, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; c = $f.c; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; _r = c.File.Close(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } c.err = _r; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: closeOnce.ptr.prototype.close }; } $f._r = _r; $f.c = c; $f.$s = $s; $f.$r = $r; return $f; }; closeOnce.prototype.close = function() { return this.$val.close(); }; Cmd.ptr.prototype.StdoutPipe = function() { var _r, _tuple, c, err, pr, pw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; pr = $f.pr; pw = $f.pw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!($interfaceIsEqual(c.Stdout, $ifaceNil))) { $s = -1; return [$ifaceNil, errors.New("exec: Stdout already set")]; } if (!(c.Process === ptrType$2.nil)) { $s = -1; return [$ifaceNil, errors.New("exec: StdoutPipe after process started")]; } _r = os.Pipe(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; pr = _tuple[0]; pw = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } c.Stdout = pw; c.closeAfterStart = $append(c.closeAfterStart, pw); c.closeAfterWait = $append(c.closeAfterWait, pr); $s = -1; return [pr, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.StdoutPipe }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.pr = pr; $f.pw = pw; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.StdoutPipe = function() { return this.$val.StdoutPipe(); }; Cmd.ptr.prototype.StderrPipe = function() { var _r, _tuple, c, err, pr, pw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; pr = $f.pr; pw = $f.pw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: c = this; if (!($interfaceIsEqual(c.Stderr, $ifaceNil))) { $s = -1; return [$ifaceNil, errors.New("exec: Stderr already set")]; } if (!(c.Process === ptrType$2.nil)) { $s = -1; return [$ifaceNil, errors.New("exec: StderrPipe after process started")]; } _r = os.Pipe(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; pr = _tuple[0]; pw = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [$ifaceNil, err]; } c.Stderr = pw; c.closeAfterStart = $append(c.closeAfterStart, pw); c.closeAfterWait = $append(c.closeAfterWait, pr); $s = -1; return [pr, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: Cmd.ptr.prototype.StderrPipe }; } $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.pr = pr; $f.pw = pw; $f.$s = $s; $f.$r = $r; return $f; }; Cmd.prototype.StderrPipe = function() { return this.$val.StderrPipe(); }; prefixSuffixSaver.ptr.prototype.Write = function(p) { var _tmp, _tmp$1, err, lenp, n, n$1, overage, p, w, x, x$1, x$2, x$3; n = 0; err = $ifaceNil; w = this; lenp = p.$length; p = w.fill((w.$ptr_prefix || (w.$ptr_prefix = new ptrType$7(function() { return this.$target.prefix; }, function($v) { this.$target.prefix = $v; }, w))), p); overage = p.$length - w.N >> 0; if (overage > 0) { p = $subslice(p, overage); w.skipped = (x = w.skipped, x$1 = (new $Int64(0, overage)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); } p = w.fill((w.$ptr_suffix || (w.$ptr_suffix = new ptrType$7(function() { return this.$target.suffix; }, function($v) { this.$target.suffix = $v; }, w))), p); while (true) { if (!(p.$length > 0)) { break; } n$1 = $copySlice($subslice(w.suffix, w.suffixOff), p); p = $subslice(p, n$1); w.skipped = (x$2 = w.skipped, x$3 = (new $Int64(0, n$1)), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); w.suffixOff = w.suffixOff + (n$1) >> 0; if (w.suffixOff === w.N) { w.suffixOff = 0; } } _tmp = lenp; _tmp$1 = $ifaceNil; n = _tmp; err = _tmp$1; return [n, err]; }; prefixSuffixSaver.prototype.Write = function(p) { return this.$val.Write(p); }; prefixSuffixSaver.ptr.prototype.fill = function(dst, p) { var add, dst, p, pRemain, remain, w; pRemain = sliceType$5.nil; w = this; remain = w.N - dst.$get().$length >> 0; if (remain > 0) { add = minInt(p.$length, remain); dst.$set($appendSlice(dst.$get(), $subslice(p, 0, add))); p = $subslice(p, add); } pRemain = p; return pRemain; }; prefixSuffixSaver.prototype.fill = function(dst, p) { return this.$val.fill(dst, p); }; prefixSuffixSaver.ptr.prototype.Bytes = function() { var buf, w, x; w = this; if (w.suffix === sliceType$5.nil) { return w.prefix; } if ((x = w.skipped, (x.$high === 0 && x.$low === 0))) { return $appendSlice(w.prefix, w.suffix); } buf = new bytes.Buffer.ptr(sliceType$5.nil, 0, arrayType.zero(), 0); buf.Grow((w.prefix.$length + w.suffix.$length >> 0) + 50 >> 0); buf.Write(w.prefix); buf.WriteString("\n... omitting "); buf.WriteString(strconv.FormatInt(w.skipped, 10)); buf.WriteString(" bytes ...\n"); buf.Write($subslice(w.suffix, w.suffixOff)); buf.Write($subslice(w.suffix, 0, w.suffixOff)); return buf.Bytes(); }; prefixSuffixSaver.prototype.Bytes = function() { return this.$val.Bytes(); }; minInt = function(a, b) { var a, b; if (a < b) { return a; } return b; }; dedupEnv = function(env) { var _r, env, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; env = $f.env; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = dedupEnvCase(false, env); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: dedupEnv }; } $f._r = _r; $f.env = env; $f.$s = $s; $f.$r = $r; return $f; }; dedupEnvCase = function(caseInsensitive, env) { var _entry, _i, _key, _r, _ref, _tuple, caseInsensitive, dupIdx, env, eq, isDup, k, kv, out, saw, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _key = $f._key; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; caseInsensitive = $f.caseInsensitive; dupIdx = $f.dupIdx; env = $f.env; eq = $f.eq; isDup = $f.isDup; k = $f.k; kv = $f.kv; out = $f.out; saw = $f.saw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: out = $makeSlice(sliceType, 0, env.$length); saw = $makeMap($String.keyFor, []); _ref = env; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } kv = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); eq = strings.Index(kv, "="); /* */ if (eq < 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (eq < 0) { */ case 3: out = $append(out, kv); _i++; /* continue; */ $s = 1; continue; /* } */ case 4: k = $substring(kv, 0, eq); /* */ if (caseInsensitive) { $s = 5; continue; } /* */ $s = 6; continue; /* if (caseInsensitive) { */ case 5: _r = strings.ToLower(k); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } k = _r; /* } */ case 6: _tuple = (_entry = saw[$String.keyFor(k)], _entry !== undefined ? [_entry.v, true] : [0, false]); dupIdx = _tuple[0]; isDup = _tuple[1]; if (isDup) { ((dupIdx < 0 || dupIdx >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + dupIdx] = kv); _i++; /* continue; */ $s = 1; continue; } _key = k; (saw || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: out.$length }; out = $append(out, kv); _i++; /* } */ $s = 1; continue; case 2: $s = -1; return out; /* */ } return; } if ($f === undefined) { $f = { $blk: dedupEnvCase }; } $f._entry = _entry; $f._i = _i; $f._key = _key; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.caseInsensitive = caseInsensitive; $f.dupIdx = dupIdx; $f.env = env; $f.eq = eq; $f.isDup = isDup; $f.k = k; $f.kv = kv; $f.out = out; $f.saw = saw; $f.$s = $s; $f.$r = $r; return $f; }; init = function() { skipStdinCopyError = (function(err) { var _tuple, err, ok, pe; _tuple = $assertType(err, ptrType$8, true); pe = _tuple[0]; ok = _tuple[1]; return ok && pe.Op === "write" && pe.Path === "|1" && $interfaceIsEqual(pe.Err, new syscall.Errno(32)); }); }; findExecutable = function(file) { var _r, _r$1, _tuple, d, err, file, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; d = $f.d; err = $f.err; file = $f.file; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = os.Stat(file); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; d = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } _r$1 = d.Mode(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } m = _r$1; if (!new os.FileMode(m).IsDir() && !((((m & 73) >>> 0) === 0))) { $s = -1; return $ifaceNil; } $s = -1; return os.ErrPermission; /* */ } return; } if ($f === undefined) { $f = { $blk: findExecutable }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.d = d; $f.err = err; $f.file = file; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; LookPath = function(file) { var _i, _r, _r$1, _r$2, _ref, dir, err, err$1, file, path, path$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; dir = $f.dir; err = $f.err; err$1 = $f.err$1; file = $f.file; path = $f.path; path$1 = $f.path$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (strings.Contains(file, "/")) { $s = 1; continue; } /* */ $s = 2; continue; /* if (strings.Contains(file, "/")) { */ case 1: _r = findExecutable(file); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return [file, $ifaceNil]; } $s = -1; return ["", new Error.ptr(file, err)]; /* } */ case 2: _r$1 = os.Getenv("PATH"); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } path = _r$1; _ref = filepath.SplitList(path); _i = 0; /* while (true) { */ case 5: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } dir = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (dir === "") { dir = "."; } path$1 = filepath.Join(new sliceType([dir, file])); _r$2 = findExecutable(path$1); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err$1 = _r$2; if ($interfaceIsEqual(err$1, $ifaceNil)) { $s = -1; return [path$1, $ifaceNil]; } _i++; /* } */ $s = 5; continue; case 6: $s = -1; return ["", new Error.ptr(file, $pkg.ErrNotFound)]; /* */ } return; } if ($f === undefined) { $f = { $blk: LookPath }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.dir = dir; $f.err = err; $f.err$1 = err$1; $f.file = file; $f.path = path; $f.path$1 = path$1; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.LookPath = LookPath; ptrType$9.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$4.methods = [{prop: "envv", name: "envv", pkg: "os/exec", typ: $funcType([], [sliceType], false)}, {prop: "argv", name: "argv", pkg: "os/exec", typ: $funcType([], [sliceType], false)}, {prop: "stdin", name: "stdin", pkg: "os/exec", typ: $funcType([], [ptrType, $error], false)}, {prop: "stdout", name: "stdout", pkg: "os/exec", typ: $funcType([], [ptrType, $error], false)}, {prop: "stderr", name: "stderr", pkg: "os/exec", typ: $funcType([], [ptrType, $error], false)}, {prop: "writerDescriptor", name: "writerDescriptor", pkg: "os/exec", typ: $funcType([io.Writer], [ptrType, $error], false)}, {prop: "closeDescriptors", name: "closeDescriptors", pkg: "os/exec", typ: $funcType([sliceType$2], [], false)}, {prop: "Run", name: "Run", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Start", name: "Start", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Output", name: "Output", pkg: "", typ: $funcType([], [sliceType$5, $error], false)}, {prop: "CombinedOutput", name: "CombinedOutput", pkg: "", typ: $funcType([], [sliceType$5, $error], false)}, {prop: "StdinPipe", name: "StdinPipe", pkg: "", typ: $funcType([], [io.WriteCloser, $error], false)}, {prop: "StdoutPipe", name: "StdoutPipe", pkg: "", typ: $funcType([], [io.ReadCloser, $error], false)}, {prop: "StderrPipe", name: "StderrPipe", pkg: "", typ: $funcType([], [io.ReadCloser, $error], false)}]; ptrType$5.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$10.methods = [{prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "close", name: "close", pkg: "os/exec", typ: $funcType([], [], false)}]; ptrType$6.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$5], [$Int, $error], false)}, {prop: "fill", name: "fill", pkg: "os/exec", typ: $funcType([ptrType$7, sliceType$5], [sliceType$5], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$5], false)}]; Error.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Err", name: "Err", embedded: false, exported: true, typ: $error, tag: ""}]); Cmd.init("os/exec", [{prop: "Path", name: "Path", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Args", name: "Args", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "Env", name: "Env", embedded: false, exported: true, typ: sliceType, tag: ""}, {prop: "Dir", name: "Dir", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Stdin", name: "Stdin", embedded: false, exported: true, typ: io.Reader, tag: ""}, {prop: "Stdout", name: "Stdout", embedded: false, exported: true, typ: io.Writer, tag: ""}, {prop: "Stderr", name: "Stderr", embedded: false, exported: true, typ: io.Writer, tag: ""}, {prop: "ExtraFiles", name: "ExtraFiles", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "SysProcAttr", name: "SysProcAttr", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Process", name: "Process", embedded: false, exported: true, typ: ptrType$2, tag: ""}, {prop: "ProcessState", name: "ProcessState", embedded: false, exported: true, typ: ptrType$3, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}, {prop: "lookPathErr", name: "lookPathErr", embedded: false, exported: false, typ: $error, tag: ""}, {prop: "finished", name: "finished", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "childFiles", name: "childFiles", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "closeAfterStart", name: "closeAfterStart", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "closeAfterWait", name: "closeAfterWait", embedded: false, exported: false, typ: sliceType$2, tag: ""}, {prop: "goroutine", name: "goroutine", embedded: false, exported: false, typ: sliceType$3, tag: ""}, {prop: "errch", name: "errch", embedded: false, exported: false, typ: chanType, tag: ""}, {prop: "waitDone", name: "waitDone", embedded: false, exported: false, typ: chanType$1, tag: ""}]); ExitError.init("", [{prop: "ProcessState", name: "ProcessState", embedded: true, exported: true, typ: ptrType$3, tag: ""}, {prop: "Stderr", name: "Stderr", embedded: false, exported: true, typ: sliceType$5, tag: ""}]); closeOnce.init("os/exec", [{prop: "File", name: "File", embedded: true, exported: true, typ: ptrType, tag: ""}, {prop: "once", name: "once", embedded: false, exported: false, typ: sync.Once, tag: ""}, {prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]); prefixSuffixSaver.init("os/exec", [{prop: "N", name: "N", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "prefix", name: "prefix", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "suffix", name: "suffix", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "suffixOff", name: "suffixOff", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "skipped", name: "skipped", embedded: false, exported: false, typ: $Int64, tag: ""}]); F.init([ptrType$4], [ptrType, $error], false); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = context.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = filepath.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sync.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } skipStdinCopyError = $throwNilPointerError; $pkg.ErrNotFound = errors.New("executable file not found in $PATH"); init(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/J-J-J/goluajit"] = (function() { var $pkg = {}, $init, bufio, context, errors, fmt, ast, parse, pm, io, ioutil, math, rand, os, exec, filepath, reflect, runtime, sort, strconv, strings, atomic, syscall, time, iface, allocator, expContextType, expcontext, assigncontext, lblabels, constLValueExpr, CompileError, codeStore, varNamePoolValue, varNamePool, codeBlock, funcContext, LNumber, DbgLocalInfo, DbgCall, FunctionProto, Upvalue, lFile, lFileType, luaLib, opArgMode, opType, opProp, APIError, APIErrorType, ResumeState, P, Options, Debug, callFrame, callFrameStack, registry, replaceInfo, strMatchData, lValueArraySorter, flagScanner, LValueType, LValue, LNilType, LBool, LString, LTable, LFunction, LGFunction, Global, LState, LUserData, instFunc, arrayType, ptrType, arrayType$1, ptrType$1, ptrType$2, structType, sliceType, sliceType$1, sliceType$2, sliceType$3, sliceType$4, sliceType$5, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, sliceType$6, sliceType$7, ptrType$10, ptrType$11, sliceType$8, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, ptrType$17, sliceType$9, ptrType$18, ptrType$19, ptrType$20, ptrType$21, sliceType$10, sliceType$11, sliceType$12, ptrType$22, ptrType$23, ptrType$24, ptrType$25, ptrType$26, ptrType$27, ptrType$28, ptrType$29, ptrType$30, ptrType$31, ptrType$32, ptrType$33, ptrType$34, sliceType$13, ptrType$35, ptrType$36, ptrType$37, ptrType$38, ptrType$39, ptrType$40, ptrType$41, ptrType$42, ptrType$43, ptrType$44, ptrType$45, sliceType$14, ptrType$46, ptrType$47, ptrType$48, ptrType$49, ptrType$50, ptrType$51, ptrType$52, sliceType$15, ptrType$53, ptrType$54, sliceType$16, ptrType$55, sliceType$17, sliceType$18, ptrType$56, sliceType$19, ptrType$57, ptrType$58, ptrType$59, ptrType$60, ptrType$61, sliceType$20, ptrType$62, sliceType$21, ptrType$63, sliceType$22, ptrType$64, ptrType$65, ptrType$66, ptrType$67, ptrType$68, arrayType$2, structType$1, arrayType$3, sliceType$23, ptrType$69, ptrType$70, ptrType$71, ptrType$72, mapType, ptrType$73, sliceType$24, ptrType$74, funcType, mapType$1, mapType$2, mapType$3, mapType$4, mapType$5, funcType$1, funcType$2, preloads, baseFuncs, loopdetection, _ecnone0, _ecnonem1, _ecnonem2, ecfuncdef, coFuncs, debugFuncs, ioFuncs, stdFiles, fileMethods, fileSeekOptions, filebufOptions, ioOpenOpions, ioPopenOptions, luaLibs, loLoaders, loFuncs, mathFuncs, opProps, startedAt, osFuncs, strFuncs, tableFuncs, cDateFlagToGo, lValueNames, jumpTable, init, newAllocator, OpenBase, baseAssert, baseCollectGarbage, baseDoFile, baseError, baseGetFEnv, baseGetMetatable, ipairsaux, baseIpairs, loadaux, baseLoad, baseLoadFile, baseLoadString, baseNext, pairsaux, basePairs, basePCall, basePrint, base_PrintRegs, baseRawEqual, baseRawGet, baseRawSet, baseSelect, baseSetFEnv, baseSetMetatable, baseToNumber, baseToString, baseType, baseUnpack, baseXPCall, loModule, loRequire, baseNewProxy, ecupdate, ecnone, shouldmove, sline, eline, savereg, raiseCompileError, isVarArgReturnExpr, lnumberValue, newVarNamePool, newCodeBlock, newFuncContext, compileChunk, compileBlock, compileStmt, compileAssignStmtLeft, compileAssignStmtRight, compileAssignStmt, compileRegAssignment, compileLocalAssignStmt, compileReturnStmt, compileIfStmt, compileBranchCondition, compileWhileStmt, compileRepeatStmt, compileBreakStmt, compileFuncDefStmt, compileNumberForStmt, compileGenericForStmt, compileExpr, compileExprWithPropagation, compileExprWithKMVPropagation, compileExprWithMVPropagation, constFold, compileFunctionExpr, compileTableExpr, compileArithmeticOpExpr, compileStringConcatOpExpr, compileUnaryOpExpr, compileRelationalOpExprAux, compileRelationalOpExpr, compileLogicalOpExpr, compileLogicalOpExprAux, compileFuncCallExpr, loadRk, getIdentRefType, getExprName, patchCode, Compile, init$1, OpenCoroutine, coCreate, coYield, coResume, coRunning, coStatus, wrapaux, coWrap, OpenDebug, debugGetFEnv, debugGetInfo, debugGetLocal, debugGetMetatable, debugGetUpvalue, debugSetFEnv, debugSetLocal, debugSetMetatable, debugSetUpvalue, debugTraceback, UpvalueIndex, newFunctionProto, newLFunctionL, newLFunctionG, checkFile, errorIfFileIsClosed, newFile, newProcess, fileDefOut, fileDefIn, fileIsWritable, fileIsReadable, OpenIo, fileToString, fileWriteAux, fileCloseAux, fileFlushAux, fileReadAux, fileSeek, fileWrite, fileClose, fileFlush, fileLinesIter, fileLines, fileRead, fileSetVBuf, ioInput, ioClose, ioFlush, ioLinesIter, ioLines, ioOpenFile, ioPopen, ioRead, ioType, ioTmpFile, ioOutput, ioWrite, loGetPath, loFindFile, OpenPackage, loLoaderPreload, loLoaderLua, loLoadLib, loSeeAll, OpenMath, mathAbs, mathAcos, mathAsin, mathAtan, mathAtan2, mathCeil, mathCos, mathCosh, mathDeg, mathExp, mathFloor, mathFmod, mathFrexp, mathLdexp, mathLog, mathLog10, mathMax, mathMin, mathMod, mathModf, mathPow, mathRad, mathRandom, mathRandomseed, mathSin, mathSinh, mathSqrt, mathTan, mathTanh, opGetOpCode, opSetOpCode, opGetArgA, opSetArgA, opGetArgB, opSetArgB, opGetArgC, opSetArgC, opGetArgBx, opSetArgBx, opGetArgSbx, opSetArgSbx, opCreateABC, opCreateABx, opCreateASbx, opIsK, opRkAsk, opToString, init$2, getIntField, getBoolField, OpenOs, osClock, osDiffTime, osExecute, osExit, osDate, osGetEnv, osRemove, osRename, osSetLocale, osSetEnv, osTime, osTmpname, newAPIError, newAPIErrorS, newAPIErrorE, newCallFrameStack, newRegistry, newGlobal, panicWithTraceback, panicWithoutTraceback, newLState, NewState, OpenString, strByte, strChar, strDump, strFind, strFormat, strGsub, checkCaptureIndex, capturedString, strGsubDoReplace, strGsubStr, strGsubTable, strGsubFunc, strGmatchIter, strGmatch, strLen, strLower, strMatch, strRep, strReverse, strSub, strUpper, luaIndex2StringIndex, newLTable, OpenTable, tableSort, tableGetN, tableMaxN, tableRemove, tableConcat, tableInsert, intMin, intMax, defaultFormat, newFlagScanner, strftime, isInteger, isArrayKey, parseNumber, popenArgs, readBufioSize, readBufioLine, int2Fb, strCmp, unsafeFastStringToReadOnlyBytes, LVIsFalse, LVAsBool, LVAsString, LVCanConvToString, LVAsNumber, mainLoop, mainLoopWithContext, switchToParentThread, callGFunction, threadRun, init$3, opArith, luaModulo, numberArith, objectArith, stringConcat, lessThan, equals, objectRationalWithError, objectRational; bufio = $packages["bufio"]; context = $packages["context"]; errors = $packages["errors"]; fmt = $packages["fmt"]; ast = $packages["github.com/J-J-J/goluajit/ast"]; parse = $packages["github.com/J-J-J/goluajit/parse"]; pm = $packages["github.com/J-J-J/goluajit/pm"]; io = $packages["io"]; ioutil = $packages["io/ioutil"]; math = $packages["math"]; rand = $packages["math/rand"]; os = $packages["os"]; exec = $packages["os/exec"]; filepath = $packages["path/filepath"]; reflect = $packages["reflect"]; runtime = $packages["runtime"]; sort = $packages["sort"]; strconv = $packages["strconv"]; strings = $packages["strings"]; atomic = $packages["sync/atomic"]; syscall = $packages["syscall"]; time = $packages["time"]; iface = $pkg.iface = $newType(0, $kindStruct, "lua.iface", true, "github.com/J-J-J/goluajit", false, function(itab_, word_) { this.$val = this; if (arguments.length === 0) { this.itab = 0; this.word = 0; return; } this.itab = itab_; this.word = word_; }); allocator = $pkg.allocator = $newType(0, $kindStruct, "lua.allocator", true, "github.com/J-J-J/goluajit", false, function(size_, fptrs_, fheader_, scratchValue_, scratchValueP_) { this.$val = this; if (arguments.length === 0) { this.size = 0; this.fptrs = sliceType$5.nil; this.fheader = ptrType$3.nil; this.scratchValue = $ifaceNil; this.scratchValueP = ptrType$4.nil; return; } this.size = size_; this.fptrs = fptrs_; this.fheader = fheader_; this.scratchValue = scratchValue_; this.scratchValueP = scratchValueP_; }); expContextType = $pkg.expContextType = $newType(4, $kindInt, "lua.expContextType", true, "github.com/J-J-J/goluajit", false, null); expcontext = $pkg.expcontext = $newType(0, $kindStruct, "lua.expcontext", true, "github.com/J-J-J/goluajit", false, function(ctype_, reg_, varargopt_) { this.$val = this; if (arguments.length === 0) { this.ctype = 0; this.reg = 0; this.varargopt = 0; return; } this.ctype = ctype_; this.reg = reg_; this.varargopt = varargopt_; }); assigncontext = $pkg.assigncontext = $newType(0, $kindStruct, "lua.assigncontext", true, "github.com/J-J-J/goluajit", false, function(ec_, keyrk_, valuerk_, keyks_, needmove_) { this.$val = this; if (arguments.length === 0) { this.ec = ptrType$72.nil; this.keyrk = 0; this.valuerk = 0; this.keyks = false; this.needmove = false; return; } this.ec = ec_; this.keyrk = keyrk_; this.valuerk = valuerk_; this.keyks = keyks_; this.needmove = needmove_; }); lblabels = $pkg.lblabels = $newType(0, $kindStruct, "lua.lblabels", true, "github.com/J-J-J/goluajit", false, function(t_, f_, e_, b_) { this.$val = this; if (arguments.length === 0) { this.t = 0; this.f = 0; this.e = 0; this.b = false; return; } this.t = t_; this.f = f_; this.e = e_; this.b = b_; }); constLValueExpr = $pkg.constLValueExpr = $newType(0, $kindStruct, "lua.constLValueExpr", true, "github.com/J-J-J/goluajit", false, function(ExprBase_, Value_) { this.$val = this; if (arguments.length === 0) { this.ExprBase = new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)); this.Value = $ifaceNil; return; } this.ExprBase = ExprBase_; this.Value = Value_; }); CompileError = $pkg.CompileError = $newType(0, $kindStruct, "lua.CompileError", true, "github.com/J-J-J/goluajit", true, function(context_, Line_, Message_) { this.$val = this; if (arguments.length === 0) { this.context = ptrType$12.nil; this.Line = 0; this.Message = ""; return; } this.context = context_; this.Line = Line_; this.Message = Message_; }); codeStore = $pkg.codeStore = $newType(0, $kindStruct, "lua.codeStore", true, "github.com/J-J-J/goluajit", false, function(codes_, lines_, pc_) { this.$val = this; if (arguments.length === 0) { this.codes = sliceType$11.nil; this.lines = sliceType$12.nil; this.pc = 0; return; } this.codes = codes_; this.lines = lines_; this.pc = pc_; }); varNamePoolValue = $pkg.varNamePoolValue = $newType(0, $kindStruct, "lua.varNamePoolValue", true, "github.com/J-J-J/goluajit", false, function(Index_, Name_) { this.$val = this; if (arguments.length === 0) { this.Index = 0; this.Name = ""; return; } this.Index = Index_; this.Name = Name_; }); varNamePool = $pkg.varNamePool = $newType(0, $kindStruct, "lua.varNamePool", true, "github.com/J-J-J/goluajit", false, function(names_, offset_) { this.$val = this; if (arguments.length === 0) { this.names = sliceType$1.nil; this.offset = 0; return; } this.names = names_; this.offset = offset_; }); codeBlock = $pkg.codeBlock = $newType(0, $kindStruct, "lua.codeBlock", true, "github.com/J-J-J/goluajit", false, function(LocalVars_, BreakLabel_, Parent_, RefUpvalue_, LineStart_, LastLine_) { this.$val = this; if (arguments.length === 0) { this.LocalVars = ptrType$20.nil; this.BreakLabel = 0; this.Parent = ptrType$21.nil; this.RefUpvalue = false; this.LineStart = 0; this.LastLine = 0; return; } this.LocalVars = LocalVars_; this.BreakLabel = BreakLabel_; this.Parent = Parent_; this.RefUpvalue = RefUpvalue_; this.LineStart = LineStart_; this.LastLine = LastLine_; }); funcContext = $pkg.funcContext = $newType(0, $kindStruct, "lua.funcContext", true, "github.com/J-J-J/goluajit", false, function(Proto_, Code_, Parent_, Upvalues_, Block_, Blocks_, regTop_, labelId_, labelPc_) { this.$val = this; if (arguments.length === 0) { this.Proto = ptrType$18.nil; this.Code = ptrType$19.nil; this.Parent = ptrType$12.nil; this.Upvalues = ptrType$20.nil; this.Block = ptrType$21.nil; this.Blocks = sliceType$10.nil; this.regTop = 0; this.labelId = 0; this.labelPc = false; return; } this.Proto = Proto_; this.Code = Code_; this.Parent = Parent_; this.Upvalues = Upvalues_; this.Block = Block_; this.Blocks = Blocks_; this.regTop = regTop_; this.labelId = labelId_; this.labelPc = labelPc_; }); LNumber = $pkg.LNumber = $newType(8, $kindFloat64, "lua.LNumber", true, "github.com/J-J-J/goluajit", true, null); DbgLocalInfo = $pkg.DbgLocalInfo = $newType(0, $kindStruct, "lua.DbgLocalInfo", true, "github.com/J-J-J/goluajit", true, function(Name_, StartPc_, EndPc_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.StartPc = 0; this.EndPc = 0; return; } this.Name = Name_; this.StartPc = StartPc_; this.EndPc = EndPc_; }); DbgCall = $pkg.DbgCall = $newType(0, $kindStruct, "lua.DbgCall", true, "github.com/J-J-J/goluajit", true, function(Name_, Pc_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.Pc = 0; return; } this.Name = Name_; this.Pc = Pc_; }); FunctionProto = $pkg.FunctionProto = $newType(0, $kindStruct, "lua.FunctionProto", true, "github.com/J-J-J/goluajit", true, function(SourceName_, LineDefined_, LastLineDefined_, NumUpvalues_, NumParameters_, IsVarArg_, NumUsedRegisters_, Code_, Constants_, FunctionPrototypes_, DbgSourcePositions_, DbgLocals_, DbgCalls_, DbgUpvalues_, stringConstants_) { this.$val = this; if (arguments.length === 0) { this.SourceName = ""; this.LineDefined = 0; this.LastLineDefined = 0; this.NumUpvalues = 0; this.NumParameters = 0; this.IsVarArg = 0; this.NumUsedRegisters = 0; this.Code = sliceType$11.nil; this.Constants = sliceType$7.nil; this.FunctionPrototypes = sliceType$16.nil; this.DbgSourcePositions = sliceType$12.nil; this.DbgLocals = sliceType$17.nil; this.DbgCalls = sliceType$18.nil; this.DbgUpvalues = sliceType$1.nil; this.stringConstants = sliceType$1.nil; return; } this.SourceName = SourceName_; this.LineDefined = LineDefined_; this.LastLineDefined = LastLineDefined_; this.NumUpvalues = NumUpvalues_; this.NumParameters = NumParameters_; this.IsVarArg = IsVarArg_; this.NumUsedRegisters = NumUsedRegisters_; this.Code = Code_; this.Constants = Constants_; this.FunctionPrototypes = FunctionPrototypes_; this.DbgSourcePositions = DbgSourcePositions_; this.DbgLocals = DbgLocals_; this.DbgCalls = DbgCalls_; this.DbgUpvalues = DbgUpvalues_; this.stringConstants = stringConstants_; }); Upvalue = $pkg.Upvalue = $newType(0, $kindStruct, "lua.Upvalue", true, "github.com/J-J-J/goluajit", true, function(next_, reg_, index_, value_, closed_) { this.$val = this; if (arguments.length === 0) { this.next = ptrType$56.nil; this.reg = ptrType$54.nil; this.index = 0; this.value = $ifaceNil; this.closed = false; return; } this.next = next_; this.reg = reg_; this.index = index_; this.value = value_; this.closed = closed_; }); lFile = $pkg.lFile = $newType(0, $kindStruct, "lua.lFile", true, "github.com/J-J-J/goluajit", false, function(fp_, pp_, writer_, reader_, stdout_, closed_) { this.$val = this; if (arguments.length === 0) { this.fp = ptrType$2.nil; this.pp = ptrType$58.nil; this.writer = $ifaceNil; this.reader = ptrType$59.nil; this.stdout = $ifaceNil; this.closed = false; return; } this.fp = fp_; this.pp = pp_; this.writer = writer_; this.reader = reader_; this.stdout = stdout_; this.closed = closed_; }); lFileType = $pkg.lFileType = $newType(4, $kindInt, "lua.lFileType", true, "github.com/J-J-J/goluajit", false, null); luaLib = $pkg.luaLib = $newType(0, $kindStruct, "lua.luaLib", true, "github.com/J-J-J/goluajit", false, function(libName_, libFunc_) { this.$val = this; if (arguments.length === 0) { this.libName = ""; this.libFunc = $throwNilPointerError; return; } this.libName = libName_; this.libFunc = libFunc_; }); opArgMode = $pkg.opArgMode = $newType(4, $kindInt, "lua.opArgMode", true, "github.com/J-J-J/goluajit", false, null); opType = $pkg.opType = $newType(4, $kindInt, "lua.opType", true, "github.com/J-J-J/goluajit", false, null); opProp = $pkg.opProp = $newType(0, $kindStruct, "lua.opProp", true, "github.com/J-J-J/goluajit", false, function(Name_, IsTest_, SetRegA_, ModeArgB_, ModeArgC_, Type_) { this.$val = this; if (arguments.length === 0) { this.Name = ""; this.IsTest = false; this.SetRegA = false; this.ModeArgB = 0; this.ModeArgC = 0; this.Type = 0; return; } this.Name = Name_; this.IsTest = IsTest_; this.SetRegA = SetRegA_; this.ModeArgB = ModeArgB_; this.ModeArgC = ModeArgC_; this.Type = Type_; }); APIError = $pkg.APIError = $newType(0, $kindStruct, "lua.APIError", true, "github.com/J-J-J/goluajit", true, function(Type_, Object_, StackTrace_, Cause_) { this.$val = this; if (arguments.length === 0) { this.Type = 0; this.Object = $ifaceNil; this.StackTrace = ""; this.Cause = $ifaceNil; return; } this.Type = Type_; this.Object = Object_; this.StackTrace = StackTrace_; this.Cause = Cause_; }); APIErrorType = $pkg.APIErrorType = $newType(4, $kindInt, "lua.APIErrorType", true, "github.com/J-J-J/goluajit", true, null); ResumeState = $pkg.ResumeState = $newType(4, $kindInt, "lua.ResumeState", true, "github.com/J-J-J/goluajit", true, null); P = $pkg.P = $newType(0, $kindStruct, "lua.P", true, "github.com/J-J-J/goluajit", true, function(Fn_, NRet_, Protect_, Handler_) { this.$val = this; if (arguments.length === 0) { this.Fn = $ifaceNil; this.NRet = 0; this.Protect = false; this.Handler = ptrType$7.nil; return; } this.Fn = Fn_; this.NRet = NRet_; this.Protect = Protect_; this.Handler = Handler_; }); Options = $pkg.Options = $newType(0, $kindStruct, "lua.Options", true, "github.com/J-J-J/goluajit", true, function(CallStackSize_, RegistrySize_, SkipOpenLibs_, IncludeGoStackTrace_) { this.$val = this; if (arguments.length === 0) { this.CallStackSize = 0; this.RegistrySize = 0; this.SkipOpenLibs = false; this.IncludeGoStackTrace = false; return; } this.CallStackSize = CallStackSize_; this.RegistrySize = RegistrySize_; this.SkipOpenLibs = SkipOpenLibs_; this.IncludeGoStackTrace = IncludeGoStackTrace_; }); Debug = $pkg.Debug = $newType(0, $kindStruct, "lua.Debug", true, "github.com/J-J-J/goluajit", true, function(frame_, Name_, What_, Source_, CurrentLine_, NUpvalues_, LineDefined_, LastLineDefined_) { this.$val = this; if (arguments.length === 0) { this.frame = ptrType$10.nil; this.Name = ""; this.What = ""; this.Source = ""; this.CurrentLine = 0; this.NUpvalues = 0; this.LineDefined = 0; this.LastLineDefined = 0; return; } this.frame = frame_; this.Name = Name_; this.What = What_; this.Source = Source_; this.CurrentLine = CurrentLine_; this.NUpvalues = NUpvalues_; this.LineDefined = LineDefined_; this.LastLineDefined = LastLineDefined_; }); callFrame = $pkg.callFrame = $newType(0, $kindStruct, "lua.callFrame", true, "github.com/J-J-J/goluajit", false, function(Idx_, Fn_, Parent_, Pc_, Base_, LocalBase_, ReturnBase_, NArgs_, NRet_, TailCall_) { this.$val = this; if (arguments.length === 0) { this.Idx = 0; this.Fn = ptrType$7.nil; this.Parent = ptrType$10.nil; this.Pc = 0; this.Base = 0; this.LocalBase = 0; this.ReturnBase = 0; this.NArgs = 0; this.NRet = 0; this.TailCall = 0; return; } this.Idx = Idx_; this.Fn = Fn_; this.Parent = Parent_; this.Pc = Pc_; this.Base = Base_; this.LocalBase = LocalBase_; this.ReturnBase = ReturnBase_; this.NArgs = NArgs_; this.NRet = NRet_; this.TailCall = TailCall_; }); callFrameStack = $pkg.callFrameStack = $newType(0, $kindStruct, "lua.callFrameStack", true, "github.com/J-J-J/goluajit", false, function(array_, sp_) { this.$val = this; if (arguments.length === 0) { this.array = sliceType$22.nil; this.sp = 0; return; } this.array = array_; this.sp = sp_; }); registry = $pkg.registry = $newType(0, $kindStruct, "lua.registry", true, "github.com/J-J-J/goluajit", false, function(array_, top_, alloc_) { this.$val = this; if (arguments.length === 0) { this.array = sliceType$7.nil; this.top = 0; this.alloc = ptrType$66.nil; return; } this.array = array_; this.top = top_; this.alloc = alloc_; }); replaceInfo = $pkg.replaceInfo = $newType(0, $kindStruct, "lua.replaceInfo", true, "github.com/J-J-J/goluajit", false, function(Indicies_, String_) { this.$val = this; if (arguments.length === 0) { this.Indicies = sliceType$12.nil; this.String = ""; return; } this.Indicies = Indicies_; this.String = String_; }); strMatchData = $pkg.strMatchData = $newType(0, $kindStruct, "lua.strMatchData", true, "github.com/J-J-J/goluajit", false, function(str_, pos_, matches_) { this.$val = this; if (arguments.length === 0) { this.str = ""; this.pos = 0; this.matches = sliceType$24.nil; return; } this.str = str_; this.pos = pos_; this.matches = matches_; }); lValueArraySorter = $pkg.lValueArraySorter = $newType(0, $kindStruct, "lua.lValueArraySorter", true, "github.com/J-J-J/goluajit", false, function(L_, Fn_, Values_) { this.$val = this; if (arguments.length === 0) { this.L = ptrType$9.nil; this.Fn = ptrType$7.nil; this.Values = sliceType$7.nil; return; } this.L = L_; this.Fn = Fn_; this.Values = Values_; }); flagScanner = $pkg.flagScanner = $newType(0, $kindStruct, "lua.flagScanner", true, "github.com/J-J-J/goluajit", false, function(flag_, start_, end_, buf_, str_, Length_, Pos_, HasFlag_, ChangeFlag_) { this.$val = this; if (arguments.length === 0) { this.flag = 0; this.start = ""; this.end = ""; this.buf = sliceType$20.nil; this.str = ""; this.Length = 0; this.Pos = 0; this.HasFlag = false; this.ChangeFlag = false; return; } this.flag = flag_; this.start = start_; this.end = end_; this.buf = buf_; this.str = str_; this.Length = Length_; this.Pos = Pos_; this.HasFlag = HasFlag_; this.ChangeFlag = ChangeFlag_; }); LValueType = $pkg.LValueType = $newType(4, $kindInt, "lua.LValueType", true, "github.com/J-J-J/goluajit", true, null); LValue = $pkg.LValue = $newType(8, $kindInterface, "lua.LValue", true, "github.com/J-J-J/goluajit", true, null); LNilType = $pkg.LNilType = $newType(0, $kindStruct, "lua.LNilType", true, "github.com/J-J-J/goluajit", true, function() { this.$val = this; if (arguments.length === 0) { return; } }); LBool = $pkg.LBool = $newType(1, $kindBool, "lua.LBool", true, "github.com/J-J-J/goluajit", true, null); LString = $pkg.LString = $newType(8, $kindString, "lua.LString", true, "github.com/J-J-J/goluajit", true, null); LTable = $pkg.LTable = $newType(0, $kindStruct, "lua.LTable", true, "github.com/J-J-J/goluajit", true, function(Metatable_, array_, dict_, strdict_, keys_, k2i_) { this.$val = this; if (arguments.length === 0) { this.Metatable = $ifaceNil; this.array = sliceType$7.nil; this.dict = false; this.strdict = false; this.keys = sliceType$7.nil; this.k2i = false; return; } this.Metatable = Metatable_; this.array = array_; this.dict = dict_; this.strdict = strdict_; this.keys = keys_; this.k2i = k2i_; }); LFunction = $pkg.LFunction = $newType(0, $kindStruct, "lua.LFunction", true, "github.com/J-J-J/goluajit", true, function(IsG_, Env_, Proto_, GFunction_, Upvalues_) { this.$val = this; if (arguments.length === 0) { this.IsG = false; this.Env = ptrType$1.nil; this.Proto = ptrType$18.nil; this.GFunction = $throwNilPointerError; this.Upvalues = sliceType$19.nil; return; } this.IsG = IsG_; this.Env = Env_; this.Proto = Proto_; this.GFunction = GFunction_; this.Upvalues = Upvalues_; }); LGFunction = $pkg.LGFunction = $newType(4, $kindFunc, "lua.LGFunction", true, "github.com/J-J-J/goluajit", true, null); Global = $pkg.Global = $newType(0, $kindStruct, "lua.Global", true, "github.com/J-J-J/goluajit", true, function(MainThread_, CurrentThread_, Registry_, Global_, builtinMts_, tempFiles_, gccount_) { this.$val = this; if (arguments.length === 0) { this.MainThread = ptrType$9.nil; this.CurrentThread = ptrType$9.nil; this.Registry = ptrType$1.nil; this.Global = ptrType$1.nil; this.builtinMts = false; this.tempFiles = sliceType$21.nil; this.gccount = 0; return; } this.MainThread = MainThread_; this.CurrentThread = CurrentThread_; this.Registry = Registry_; this.Global = Global_; this.builtinMts = builtinMts_; this.tempFiles = tempFiles_; this.gccount = gccount_; }); LState = $pkg.LState = $newType(0, $kindStruct, "lua.LState", true, "github.com/J-J-J/goluajit", true, function(G_, Parent_, Env_, Panic_, Dead_, Options_, stop_, reg_, stack_, alloc_, currentFrame_, wrapped_, uvcache_, hasErrorFunc_, mainLoop_, ctx_) { this.$val = this; if (arguments.length === 0) { this.G = ptrType$64.nil; this.Parent = ptrType$9.nil; this.Env = ptrType$1.nil; this.Panic = $throwNilPointerError; this.Dead = false; this.Options = new Options.ptr(0, 0, false, false); this.stop = 0; this.reg = ptrType$54.nil; this.stack = ptrType$65.nil; this.alloc = ptrType$66.nil; this.currentFrame = ptrType$10.nil; this.wrapped = false; this.uvcache = ptrType$56.nil; this.hasErrorFunc = false; this.mainLoop = $throwNilPointerError; this.ctx = $ifaceNil; return; } this.G = G_; this.Parent = Parent_; this.Env = Env_; this.Panic = Panic_; this.Dead = Dead_; this.Options = Options_; this.stop = stop_; this.reg = reg_; this.stack = stack_; this.alloc = alloc_; this.currentFrame = currentFrame_; this.wrapped = wrapped_; this.uvcache = uvcache_; this.hasErrorFunc = hasErrorFunc_; this.mainLoop = mainLoop_; this.ctx = ctx_; }); LUserData = $pkg.LUserData = $newType(0, $kindStruct, "lua.LUserData", true, "github.com/J-J-J/goluajit", true, function(Value_, Env_, Metatable_) { this.$val = this; if (arguments.length === 0) { this.Value = $ifaceNil; this.Env = ptrType$1.nil; this.Metatable = $ifaceNil; return; } this.Value = Value_; this.Env = Env_; this.Metatable = Metatable_; }); instFunc = $pkg.instFunc = $newType(4, $kindFunc, "lua.instFunc", true, "github.com/J-J-J/goluajit", false, null); arrayType = $arrayType(LValue, 128); ptrType = $ptrType(time.Location); arrayType$1 = $arrayType(instFunc, 42); ptrType$1 = $ptrType(LTable); ptrType$2 = $ptrType(os.File); structType = $structType("github.com/J-J-J/goluajit", [{prop: "name", name: "name", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "file", name: "file", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "writable", name: "writable", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "readable", name: "readable", embedded: false, exported: false, typ: $Bool, tag: ""}]); sliceType = $sliceType(structType); sliceType$1 = $sliceType($String); sliceType$2 = $sliceType(opProp); sliceType$3 = $sliceType(LGFunction); sliceType$4 = $sliceType(luaLib); sliceType$5 = $sliceType($Float64); ptrType$3 = $ptrType(reflect.SliceHeader); ptrType$4 = $ptrType(iface); ptrType$5 = $ptrType(sliceType$5); ptrType$6 = $ptrType(LValue); ptrType$7 = $ptrType(LFunction); ptrType$8 = $ptrType(LUserData); ptrType$9 = $ptrType(LState); sliceType$6 = $sliceType($emptyInterface); sliceType$7 = $sliceType(LValue); ptrType$10 = $ptrType(callFrame); ptrType$11 = $ptrType(APIError); sliceType$8 = $sliceType(LValueType); ptrType$12 = $ptrType(funcContext); ptrType$13 = $ptrType(ast.FuncCallExpr); ptrType$14 = $ptrType(ast.Comma3Expr); ptrType$15 = $ptrType(ast.NumberExpr); ptrType$16 = $ptrType(constLValueExpr); ptrType$17 = $ptrType($Uint32); sliceType$9 = $sliceType(varNamePoolValue); ptrType$18 = $ptrType(FunctionProto); ptrType$19 = $ptrType(codeStore); ptrType$20 = $ptrType(varNamePool); ptrType$21 = $ptrType(codeBlock); sliceType$10 = $sliceType(ptrType$21); sliceType$11 = $sliceType($Uint32); sliceType$12 = $sliceType($Int); ptrType$22 = $ptrType(ast.AssignStmt); ptrType$23 = $ptrType(ast.LocalAssignStmt); ptrType$24 = $ptrType(ast.FuncCallStmt); ptrType$25 = $ptrType(ast.DoBlockStmt); ptrType$26 = $ptrType(ast.WhileStmt); ptrType$27 = $ptrType(ast.RepeatStmt); ptrType$28 = $ptrType(ast.FuncDefStmt); ptrType$29 = $ptrType(ast.ReturnStmt); ptrType$30 = $ptrType(ast.IfStmt); ptrType$31 = $ptrType(ast.BreakStmt); ptrType$32 = $ptrType(ast.NumberForStmt); ptrType$33 = $ptrType(ast.GenericForStmt); ptrType$34 = $ptrType(assigncontext); sliceType$13 = $sliceType(ptrType$34); ptrType$35 = $ptrType(ast.IdentExpr); ptrType$36 = $ptrType(ast.AttrGetExpr); ptrType$37 = $ptrType($Int); ptrType$38 = $ptrType(ast.StringExpr); ptrType$39 = $ptrType(ast.LogicalOpExpr); ptrType$40 = $ptrType(ast.FunctionExpr); ptrType$41 = $ptrType(ast.FalseExpr); ptrType$42 = $ptrType(ast.NilExpr); ptrType$43 = $ptrType(ast.TrueExpr); ptrType$44 = $ptrType(ast.UnaryNotOpExpr); ptrType$45 = $ptrType(ast.RelationalOpExpr); sliceType$14 = $sliceType(ast.Expr); ptrType$46 = $ptrType(ast.TableExpr); ptrType$47 = $ptrType(ast.ArithmeticOpExpr); ptrType$48 = $ptrType(ast.StringConcatOpExpr); ptrType$49 = $ptrType(ast.UnaryMinusOpExpr); ptrType$50 = $ptrType(ast.UnaryLenOpExpr); ptrType$51 = $ptrType(CompileError); ptrType$52 = $ptrType(ast.ParList); sliceType$15 = $sliceType(ast.Stmt); ptrType$53 = $ptrType(Debug); ptrType$54 = $ptrType(registry); sliceType$16 = $sliceType(ptrType$18); ptrType$55 = $ptrType(DbgLocalInfo); sliceType$17 = $sliceType(ptrType$55); sliceType$18 = $sliceType(DbgCall); ptrType$56 = $ptrType(Upvalue); sliceType$19 = $sliceType(ptrType$56); ptrType$57 = $ptrType(lFile); ptrType$58 = $ptrType(exec.Cmd); ptrType$59 = $ptrType(bufio.Reader); ptrType$60 = $ptrType(bufio.Writer); ptrType$61 = $ptrType(exec.ExitError); sliceType$20 = $sliceType($Uint8); ptrType$62 = $ptrType(LNumber); sliceType$21 = $sliceType(ptrType$2); ptrType$63 = $ptrType(syscall.SysProcAttr); sliceType$22 = $sliceType(callFrame); ptrType$64 = $ptrType(Global); ptrType$65 = $ptrType(callFrameStack); ptrType$66 = $ptrType(allocator); ptrType$67 = $ptrType($Int32); ptrType$68 = $ptrType(LNilType); arrayType$2 = $arrayType($Uint64, 256); structType$1 = $structType("", [{prop: "Size", name: "Size", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Mallocs", name: "Mallocs", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Frees", name: "Frees", embedded: false, exported: true, typ: $Uint64, tag: ""}]); arrayType$3 = $arrayType(structType$1, 61); sliceType$23 = $sliceType(replaceInfo); ptrType$69 = $ptrType(strMatchData); ptrType$70 = $ptrType(reflect.StringHeader); ptrType$71 = $ptrType($String); ptrType$72 = $ptrType(expcontext); mapType = $mapType($Int, $Int); ptrType$73 = $ptrType(pm.MatchData); sliceType$24 = $sliceType(ptrType$73); ptrType$74 = $ptrType(flagScanner); funcType = $funcType([LValue, LValue], [], false); mapType$1 = $mapType(LValue, LValue); mapType$2 = $mapType($String, LValue); mapType$3 = $mapType(LValue, $Int); mapType$4 = $mapType($Int, LValue); mapType$5 = $mapType($String, LGFunction); funcType$1 = $funcType([ptrType$9], [], false); funcType$2 = $funcType([ptrType$9, ptrType$10], [], false); init = function() { var i; i = 0; while (true) { if (!(i < 128)) { break; } ((i < 0 || i >= preloads.length) ? ($throwRuntimeError("index out of range"), undefined) : preloads[i] = new LNumber((i))); i = i + (1) >> 0; } }; newAllocator = function(size) { var al, size; al = new allocator.ptr(size, $makeSlice(sliceType$5, 0, size), ptrType$3.nil, $ifaceNil, ptrType$4.nil); al.fheader = ($pointerOfStructConversion(((al.$ptr_fptrs || (al.$ptr_fptrs = new ptrType$5(function() { return this.$target.fptrs; }, function($v) { this.$target.fptrs = $v; }, al)))), ptrType$3)); al.scratchValue = new LNumber(0); al.scratchValueP = ($pointerOfStructConversion(((al.$ptr_scratchValue || (al.$ptr_scratchValue = new ptrType$6(function() { return this.$target.scratchValue; }, function($v) { this.$target.scratchValue = $v; }, al)))), ptrType$4)); return al; }; allocator.ptr.prototype.LNumber2I = function(v) { var al, fptr, v, x; al = this; if (v >= 0 && v < 128 && ((v) === ($flatten64((new $Int64(0, v)))))) { return (x = ((v >> 0)), ((x < 0 || x >= preloads.length) ? ($throwRuntimeError("index out of range"), undefined) : preloads[x])); } if (al.fptrs.$capacity === al.fptrs.$length) { al.fptrs = $makeSlice(sliceType$5, 0, al.size); al.fheader = ($pointerOfStructConversion(((al.$ptr_fptrs || (al.$ptr_fptrs = new ptrType$5(function() { return this.$target.fptrs; }, function($v) { this.$target.fptrs = $v; }, al)))), ptrType$3)); } al.fptrs = $append(al.fptrs, (v)); fptr = (((al.fheader.Data + ($imul((((al.fptrs.$length - 1 >> 0) >>> 0)), 8) >>> 0) >>> 0))); al.scratchValueP.word = (fptr); return al.scratchValue; }; allocator.prototype.LNumber2I = function(v) { return this.$val.LNumber2I(v); }; LState.ptr.prototype.CheckAny = function(n) { var ls, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ls = $f.ls; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; /* */ if (n > ls.GetTop()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (n > ls.GetTop()) { */ case 1: $r = ls.ArgError(n, "value expected"); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return ls.Get(n); /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckAny }; } $f.ls = ls; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckAny = function(n) { return this.$val.CheckAny(n); }; LState.ptr.prototype.CheckInt = function(n) { var _tuple, intv, ls, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; intv = $f.intv; ls = $f.ls; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, LNumber, true); intv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return ((intv >> 0)); } $r = ls.TypeError(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckInt }; } $f._tuple = _tuple; $f.intv = intv; $f.ls = ls; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckInt = function(n) { return this.$val.CheckInt(n); }; LState.ptr.prototype.CheckInt64 = function(n) { var _tuple, intv, ls, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; intv = $f.intv; ls = $f.ls; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, LNumber, true); intv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (new $Int64(0, intv)); } $r = ls.TypeError(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new $Int64(0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckInt64 }; } $f._tuple = _tuple; $f.intv = intv; $f.ls = ls; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckInt64 = function(n) { return this.$val.CheckInt64(n); }; LState.ptr.prototype.CheckNumber = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, LNumber, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckNumber }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckNumber = function(n) { return this.$val.CheckNumber(n); }; LState.ptr.prototype.CheckString = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, LString, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (lv); } $r = ls.TypeError(n, 3); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckString }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckString = function(n) { return this.$val.CheckString(n); }; LState.ptr.prototype.CheckBool = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, LBool, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (lv); } $r = ls.TypeError(n, 1); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckBool }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckBool = function(n) { return this.$val.CheckBool(n); }; LState.ptr.prototype.CheckTable = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, ptrType$1, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 7); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$1.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckTable }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckTable = function(n) { return this.$val.CheckTable(n); }; LState.ptr.prototype.CheckFunction = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, ptrType$7, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 4); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$7.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckFunction }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckFunction = function(n) { return this.$val.CheckFunction(n); }; LState.ptr.prototype.CheckUserData = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, ptrType$8, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 5); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$8.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckUserData }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckUserData = function(n) { return this.$val.CheckUserData(n); }; LState.ptr.prototype.CheckThread = function(n) { var _tuple, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _tuple = $assertType(v, ptrType$9, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 6); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$9.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckThread }; } $f._tuple = _tuple; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckThread = function(n) { return this.$val.CheckThread(n); }; LState.ptr.prototype.CheckType = function(n, typ) { var _r, ls, n, typ, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; n = $f.n; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); _r = v.Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === typ))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === typ))) { */ case 1: $r = ls.TypeError(n, typ); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckType }; } $f._r = _r; $f.ls = ls; $f.n = n; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckType = function(n, typ) { return this.$val.CheckType(n, typ); }; LState.ptr.prototype.CheckTypes = function(n, typs) { var _arg, _arg$1, _i, _i$1, _r, _r$1, _r$2, _ref, _ref$1, buf, ls, n, typ, typ$1, typs, vt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; buf = $f.buf; ls = $f.ls; n = $f.n; typ = $f.typ; typ$1 = $f.typ$1; typs = $f.typs; vt = $f.vt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.Get(n).Type(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } vt = _r; _ref = typs; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } typ = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (vt === typ) { $s = -1; return; } _i++; } buf = new sliceType$1([]); _ref$1 = typs; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } typ$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); buf = $append(buf, new LValueType(typ$1).String()); _i$1++; } _arg = n; _r$1 = ls.Get(n).Type(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = strings.Join(buf, " or ") + " expected, got " + _r$2; $r = ls.ArgError(_arg, _arg$1); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckTypes }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f.buf = buf; $f.ls = ls; $f.n = n; $f.typ = typ; $f.typ$1 = typ$1; $f.typs = typs; $f.vt = vt; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckTypes = function(n, typs) { return this.$val.CheckTypes(n, typs); }; LState.ptr.prototype.CheckOption = function(n, options) { var _arg, _arg$1, _i, _r, _r$1, _ref, i, ls, n, options, str, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; i = $f.i; ls = $f.ls; n = $f.n; options = $f.options; str = $f.str; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.CheckString(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _ref = options; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (v === str) { $s = -1; return i; } _i++; } _arg = n; _r$1 = fmt.Sprintf("invalid option: %s (must be one of %s)", new sliceType$6([new $String(str), new $String(strings.Join(options, ","))])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; $r = ls.ArgError(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CheckOption }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.i = i; $f.ls = ls; $f.n = n; $f.options = options; $f.str = str; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CheckOption = function(n, options) { return this.$val.CheckOption(n, options); }; LState.ptr.prototype.OptInt = function(n, d) { var _tuple, d, intv, ls, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; intv = $f.intv; ls = $f.ls; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, LNumber, true); intv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return ((intv >> 0)); } $r = ls.TypeError(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptInt }; } $f._tuple = _tuple; $f.d = d; $f.intv = intv; $f.ls = ls; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptInt = function(n, d) { return this.$val.OptInt(n, d); }; LState.ptr.prototype.OptInt64 = function(n, d) { var _tuple, d, intv, ls, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; intv = $f.intv; ls = $f.ls; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, LNumber, true); intv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (new $Int64(0, intv)); } $r = ls.TypeError(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return new $Int64(0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptInt64 }; } $f._tuple = _tuple; $f.d = d; $f.intv = intv; $f.ls = ls; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptInt64 = function(n, d) { return this.$val.OptInt64(n, d); }; LState.ptr.prototype.OptNumber = function(n, d) { var _tuple, d, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, LNumber, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 2); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptNumber }; } $f._tuple = _tuple; $f.d = d; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptNumber = function(n, d) { return this.$val.OptNumber(n, d); }; LState.ptr.prototype.OptString = function(n, d) { var _tuple, d, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, LString, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (lv); } $r = ls.TypeError(n, 3); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptString }; } $f._tuple = _tuple; $f.d = d; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptString = function(n, d) { return this.$val.OptString(n, d); }; LState.ptr.prototype.OptBool = function(n, d) { var _tuple, d, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, LBool, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (lv); } $r = ls.TypeError(n, 1); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptBool }; } $f._tuple = _tuple; $f.d = d; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptBool = function(n, d) { return this.$val.OptBool(n, d); }; LState.ptr.prototype.OptTable = function(n, d) { var _tuple, d, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, ptrType$1, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 7); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$1.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptTable }; } $f._tuple = _tuple; $f.d = d; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptTable = function(n, d) { return this.$val.OptTable(n, d); }; LState.ptr.prototype.OptFunction = function(n, d) { var _tuple, d, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, ptrType$7, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 4); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$7.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptFunction }; } $f._tuple = _tuple; $f.d = d; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptFunction = function(n, d) { return this.$val.OptFunction(n, d); }; LState.ptr.prototype.OptUserData = function(n, d) { var _tuple, d, ls, lv, n, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; d = $f.d; ls = $f.ls; lv = $f.lv; n = $f.n; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; v = ls.Get(n); if ($interfaceIsEqual(v, $pkg.LNil)) { $s = -1; return d; } _tuple = $assertType(v, ptrType$8, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return lv; } $r = ls.TypeError(n, 5); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$8.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OptUserData }; } $f._tuple = _tuple; $f.d = d; $f.ls = ls; $f.lv = lv; $f.n = n; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OptUserData = function(n, d) { return this.$val.OptUserData(n, d); }; LState.ptr.prototype.ArgError = function(n, message) { var _arg, _arg$1, _arg$2, _r, ls, message, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; ls = $f.ls; message = $f.message; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _arg = new $Int(n); _r = ls.rawFrameFuncName(ls.currentFrame); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = new $String(_r); _arg$2 = new $String(message); $r = ls.RaiseError("bad argument #%v to %v (%v)", new sliceType$6([_arg, _arg$1, _arg$2])); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ArgError }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f.ls = ls; $f.message = message; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ArgError = function(n, message) { return this.$val.ArgError(n, message); }; LState.ptr.prototype.TypeError = function(n, typ) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, ls, n, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; ls = $f.ls; n = $f.n; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _arg = new $Int(n); _r = ls.rawFrameFuncName(ls.currentFrame); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = new $String(_r); _arg$2 = new $String(new LValueType(typ).String()); _r$1 = ls.Get(n).Type(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$3 = new $String(_r$2); $r = ls.RaiseError("bad argument #%v to %v (%v expected, got %v)", new sliceType$6([_arg, _arg$1, _arg$2, _arg$3])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.TypeError }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ls = ls; $f.n = n; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.TypeError = function(n, typ) { return this.$val.TypeError(n, typ); }; LState.ptr.prototype.Where = function(level) { var _r, level, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; level = $f.level; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.where(level, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Where }; } $f._r = _r; $f.level = level; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Where = function(level) { return this.$val.Where(level); }; LState.ptr.prototype.FindTable = function(obj, n, size) { var _i, _r, _ref, curobj, ls, n, name, names, nextobj, obj, size, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; curobj = $f.curobj; ls = $f.ls; n = $f.n; name = $f.name; names = $f.names; nextobj = $f.nextobj; obj = $f.obj; size = $f.size; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; names = strings.Split(n, "."); curobj = obj; _ref = names; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); if (!((curobj.Type() === 7))) { $s = -1; return $pkg.LNil; } nextobj = ls.RawGet(curobj, new LString((name))); /* */ if ($interfaceIsEqual(nextobj, $pkg.LNil)) { $s = 3; continue; } _r = nextobj.Type(); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (!((_r === 7))) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(nextobj, $pkg.LNil)) { */ case 3: tb = ls.CreateTable(0, size); $r = ls.RawSet(curobj, new LString((name)), tb); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } curobj = tb; $s = 6; continue; /* } else if (!((_r === 7))) { */ case 4: $s = -1; return $pkg.LNil; /* } else { */ case 5: curobj = $assertType(nextobj, ptrType$1); /* } */ case 6: _i++; /* } */ $s = 1; continue; case 2: $s = -1; return curobj; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.FindTable }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.curobj = curobj; $f.ls = ls; $f.n = n; $f.name = name; $f.names = names; $f.nextobj = nextobj; $f.obj = obj; $f.size = size; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.FindTable = function(obj, n, size) { return this.$val.FindTable(obj, n, size); }; LState.ptr.prototype.RegisterModule = function(name, funcs) { var _entry, _i, _keys, _r, _r$1, _r$2, _r$3, _ref, _tuple, fn, fname, funcs, ls, mod, name, newmod, newmodtb, ok, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; fn = $f.fn; fname = $f.fname; funcs = $f.funcs; ls = $f.ls; mod = $f.mod; name = $f.name; newmod = $f.newmod; newmodtb = $f.newmodtb; ok = $f.ok; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.FindTable($assertType(ls.Get(-10000), ptrType$1), "_LOADED", 1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; _r$1 = ls.GetField(tb, name); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mod = _r$1; _r$2 = mod.Type(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (!((_r$2 === 7))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((_r$2 === 7))) { */ case 3: _r$3 = ls.FindTable($assertType(ls.Get(-10002), ptrType$1), name, $keys(funcs).length); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } newmod = _r$3; _tuple = $assertType(newmod, ptrType$1, true); newmodtb = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!ok) { */ case 7: $r = ls.RaiseError("name conflict for module(%v)", new sliceType$6([new $String(name)])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 9; continue; /* } else { */ case 8: _ref = funcs; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } fname = _entry.k; fn = _entry.v; newmodtb.RawSetString(fname, ls.NewFunction(fn)); _i++; } $r = ls.SetField(tb, name, newmodtb); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return newmodtb; /* } */ case 9: /* } */ case 4: $s = -1; return mod; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.RegisterModule }; } $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f.fn = fn; $f.fname = fname; $f.funcs = funcs; $f.ls = ls; $f.mod = mod; $f.name = name; $f.newmod = newmod; $f.newmodtb = newmodtb; $f.ok = ok; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.RegisterModule = function(name, funcs) { return this.$val.RegisterModule(name, funcs); }; LState.ptr.prototype.SetFuncs = function(tb, funcs, upvalues) { var _entry, _i, _keys, _ref, fn, fname, funcs, ls, tb, upvalues; ls = this; _ref = funcs; _i = 0; _keys = $keys(_ref); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; continue; } fname = _entry.k; fn = _entry.v; tb.RawSetString(fname, ls.NewClosure(fn, upvalues)); _i++; } return tb; }; LState.prototype.SetFuncs = function(tb, funcs, upvalues) { return this.$val.SetFuncs(tb, funcs, upvalues); }; LState.ptr.prototype.NewTypeMetatable = function(typ) { var _r, _tuple, ls, mt, mtnew, ok, regtable, tb, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; ls = $f.ls; mt = $f.mt; mtnew = $f.mtnew; ok = $f.ok; regtable = $f.regtable; tb = $f.tb; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; regtable = ls.Get(-10000); _r = ls.GetField(regtable, typ); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mt = _r; _tuple = $assertType(mt, ptrType$1, true); tb = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return tb; } mtnew = ls.NewTable(); $r = ls.SetField(regtable, typ, mtnew); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return mtnew; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.NewTypeMetatable }; } $f._r = _r; $f._tuple = _tuple; $f.ls = ls; $f.mt = mt; $f.mtnew = mtnew; $f.ok = ok; $f.regtable = regtable; $f.tb = tb; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.NewTypeMetatable = function(typ) { return this.$val.NewTypeMetatable(typ); }; LState.ptr.prototype.GetMetaField = function(obj, event) { var _r, event, ls, obj, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; event = $f.event; ls = $f.ls; obj = $f.obj; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.metaOp1(obj, event); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetMetaField }; } $f._r = _r; $f.event = event; $f.ls = ls; $f.obj = obj; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetMetaField = function(obj, event) { return this.$val.GetMetaField(obj, event); }; LState.ptr.prototype.GetTypeMetatable = function(typ) { var _r, ls, typ, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.GetField(ls.Get(-10000), typ); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetTypeMetatable }; } $f._r = _r; $f.ls = ls; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetTypeMetatable = function(typ) { return this.$val.GetTypeMetatable(typ); }; LState.ptr.prototype.CallMeta = function(obj, event) { var _r, _r$1, event, ls, obj, op, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; event = $f.event; ls = $f.ls; obj = $f.obj; op = $f.op; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.metaOp1(obj, event); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } op = _r; _r$1 = op.Type(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1 === 4) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_r$1 === 4) { */ case 2: ls.reg.Push(op); ls.reg.Push(obj); $r = ls.Call(1, 1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ls.reg.Pop(); /* } */ case 3: $s = -1; return $pkg.LNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CallMeta }; } $f._r = _r; $f._r$1 = _r$1; $f.event = event; $f.ls = ls; $f.obj = obj; $f.op = op; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CallMeta = function(obj, event) { return this.$val.CallMeta(obj, event); }; LState.ptr.prototype.LoadFile = function(path) { var _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, c, err, file, ls, path, reader, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; err = $f.err; file = $f.file; ls = $f.ls; path = $f.path; reader = $f.reader; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); ls = this; file = ptrType$2.nil; err = $ifaceNil; /* */ if (path.length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (path.length === 0) { */ case 1: file = os.Stdin; $s = 3; continue; /* } else { */ case 2: _r = os.Open(path); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; file = _tuple[0]; err = _tuple[1]; $deferred.push([$methodVal(file, "Close"), []]); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$1 = newAPIErrorE(1, err); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return [ptrType$7.nil, _r$1]; /* } */ case 6: /* } */ case 3: reader = bufio.NewReader(file); _r$2 = reader.ReadByte(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; c = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, io.EOF))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual(err, io.EOF))) { */ case 9: _r$3 = newAPIErrorE(1, err); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $s = -1; return [ptrType$7.nil, _r$3]; /* } */ case 10: /* */ if (c === 35) { $s = 12; continue; } /* */ $s = 13; continue; /* if (c === 35) { */ case 12: _r$4 = readBufioLine(reader); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; err = _tuple$2[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 15: _r$5 = newAPIErrorE(1, err); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $s = -1; return [ptrType$7.nil, _r$5]; /* } */ case 16: /* } */ case 13: /* */ if (!($interfaceIsEqual(err, io.EOF))) { $s = 18; continue; } /* */ $s = 19; continue; /* if (!($interfaceIsEqual(err, io.EOF))) { */ case 18: err = reader.UnreadByte(); /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 20; continue; } /* */ $s = 21; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 20: _r$6 = newAPIErrorE(1, err); /* */ $s = 22; case 22: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $s = -1; return [ptrType$7.nil, _r$6]; /* } */ case 21: /* } */ case 19: _r$7 = ls.Load(reader, path); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $s = -1; return _r$7; /* */ } return; } } catch(err) { $err = err; $s = -1; return [ptrType$7.nil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: LState.ptr.prototype.LoadFile }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.err = err; $f.file = file; $f.ls = ls; $f.path = path; $f.reader = reader; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; LState.prototype.LoadFile = function(path) { return this.$val.LoadFile(path); }; LState.ptr.prototype.LoadString = function(source) { var _r, ls, source, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; source = $f.source; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.Load(strings.NewReader(source), ""); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.LoadString }; } $f._r = _r; $f.ls = ls; $f.source = source; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.LoadString = function(source) { return this.$val.LoadString(source); }; LState.ptr.prototype.DoFile = function(path) { var _r, _r$1, _tuple, err, fn, ls, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; fn = $f.fn; ls = $f.ls; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.LoadFile(path); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fn = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } ls.Push(fn); _r$1 = ls.PCall(0, -1, ptrType$7.nil); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.DoFile }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.fn = fn; $f.ls = ls; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.DoFile = function(path) { return this.$val.DoFile(path); }; LState.ptr.prototype.DoString = function(source) { var _r, _r$1, _tuple, err, fn, ls, source, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; fn = $f.fn; ls = $f.ls; source = $f.source; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.LoadString(source); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fn = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $s = -1; return err; /* } else { */ case 3: ls.Push(fn); _r$1 = ls.PCall(0, -1, ptrType$7.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 4: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.DoString }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.fn = fn; $f.ls = ls; $f.source = source; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.DoString = function(source) { return this.$val.DoString(source); }; LState.ptr.prototype.ToStringMeta = function(lv) { var _r, _r$1, _r$2, _tuple, fn, ls, lv, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; fn = $f.fn; ls = $f.ls; lv = $f.lv; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.metaOp1(lv, "__tostring"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.assertFunction(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; fn = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: ls.Push(fn); ls.Push(lv); $r = ls.Call(1, 1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ls.reg.Pop(); /* } else { */ case 4: _r$2 = lv.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return new LString((_r$2)); /* } */ case 5: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ToStringMeta }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.fn = fn; $f.ls = ls; $f.lv = lv; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ToStringMeta = function(lv) { return this.$val.ToStringMeta(lv); }; LState.ptr.prototype.PreloadModule = function(name, loader) { var _r, _r$1, _tuple, loader, ls, name, ok, preload, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; loader = $f.loader; ls = $f.ls; name = $f.name; ok = $f.ok; preload = $f.preload; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.GetField(ls.Get(-10001), "package"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = ls.GetField(_r, "preload"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } preload = _r$1; _tuple = $assertType(preload, ptrType$1, true); ok = _tuple[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: $r = ls.RaiseError("package.preload must be a table", new sliceType$6([])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $r = ls.SetField(preload, name, ls.NewFunction(loader)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.PreloadModule }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.loader = loader; $f.ls = ls; $f.name = name; $f.ok = ok; $f.preload = preload; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.PreloadModule = function(name, loader) { return this.$val.PreloadModule(name, loader); }; OpenBase = function(L) { var L, _r, basemod, global, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; basemod = $f.basemod; global = $f.global; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: global = $assertType(L.Get(-10002), ptrType$1); $r = L.SetGlobal("_G", global); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.SetGlobal("_VERSION", new LString("Lua 5.1")); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.SetGlobal("_GOPHER_LUA_VERSION", new LString("GopherLua 0.1")); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = L.RegisterModule("_G", baseFuncs); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } basemod = _r; global.RawSetString("ipairs", L.NewClosure(baseIpairs, new sliceType$7([L.NewFunction(ipairsaux)]))); global.RawSetString("pairs", L.NewClosure(basePairs, new sliceType$7([L.NewFunction(pairsaux)]))); L.Push(basemod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenBase }; } $f.L = L; $f._r = _r; $f.basemod = basemod; $f.global = global; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenBase = OpenBase; baseAssert = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (!L.ToBool(1)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!L.ToBool(1)) { */ case 1: _r = L.OptString(2, "assertion failed!"); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = L.RaiseError(_r, new sliceType$6([])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* } */ case 2: $s = -1; return L.GetTop(); /* */ } return; } if ($f === undefined) { $f = { $blk: baseAssert }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; baseCollectGarbage = function(L) { var L; runtime.GC(); return 0; }; baseDoFile = function(L) { var L, _r, _r$1, _r$2, _tuple, err, fn, src, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; fn = $f.fn; src = $f.src; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.ToString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } src = _r; top = L.GetTop(); _r$1 = L.LoadFile(src); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; fn = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: _r$2 = err.Error(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$2))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.Panic(L); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: L.Push(fn); $r = L.Call(0, -1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return L.GetTop() - top >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: baseDoFile }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.fn = fn; $f.src = src; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; baseError = function(L) { var L, _r, _r$1, level, obj, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; level = $f.level; obj = $f.obj; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } obj = _r; _r$1 = L.OptInt(2, 1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } level = _r$1; $r = L.Error(obj, level); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: baseError }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.level = level; $f.obj = obj; $f.$s = $s; $f.$r = $r; return $f; }; baseGetFEnv = function(L) { var L, _tuple, _tuple$1, cf, fn, i, level, number, ok, ok$1, value; value = $ifaceNil; if (L.GetTop() === 0) { value = new LNumber(1); } else { value = L.Get(1); } _tuple = $assertType(value, ptrType$7, true); fn = _tuple[0]; ok = _tuple[1]; if (ok) { if (!fn.IsG) { L.Push(fn.Env); } else { L.Push(L.G.Global); } return 1; } _tuple$1 = $assertType(value, LNumber, true); number = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { level = (((number) >> 0)); if (level <= 0) { L.Push(L.Env); } else { cf = L.currentFrame; i = 0; while (true) { if (!(i < level && !(cf === ptrType$10.nil))) { break; } cf = cf.Parent; i = i + (1) >> 0; } if (cf === ptrType$10.nil || cf.Fn.IsG) { L.Push(L.G.Global); } else { L.Push(cf.Fn.Env); } } return 1; } L.Push(L.G.Global); return 1; }; baseGetMetatable = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.GetMetatable(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseGetMetatable }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; ipairsaux = function(L) { var L, _r, _r$1, i, tb, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; i = $f.i; tb = $f.tb; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } i = _r$1; i = i + (1) >> 0; v = tb.RawGetInt(i); /* */ if ($interfaceIsEqual(v, $pkg.LNil)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($interfaceIsEqual(v, $pkg.LNil)) { */ case 3: $s = -1; return 0; /* } else { */ case 4: $r = L.Pop(1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(new LNumber((i))); L.Push(new LNumber((i))); L.Push(v); $s = -1; return 2; /* } */ case 5: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: ipairsaux }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.tb = tb; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; baseIpairs = function(L) { var L, _r, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; L.Push(L.Get(UpvalueIndex(1))); L.Push(tb); L.Push(new LNumber(0)); $s = -1; return 3; /* */ } return; } if ($f === undefined) { $f = { $blk: baseIpairs }; } $f.L = L; $f._r = _r; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; loadaux = function(L, reader, chunkname) { var L, _r, _r$1, _tuple, chunkname, err, fn, reader, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; chunkname = $f.chunkname; err = $f.err; fn = $f.fn; reader = $f.reader; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.Load(reader, chunkname); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fn = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: L.Push($pkg.LNil); _r$1 = err.Error(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } else { */ case 3: L.Push(fn); $s = -1; return 1; /* } */ case 4: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: loadaux }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.chunkname = chunkname; $f.err = err; $f.fn = fn; $f.reader = reader; $f.$s = $s; $f.$r = $r; return $f; }; baseLoad = function(L) { var L, _r, _r$1, _r$2, _r$3, buf, chunkname, fn, ret, str, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; buf = $f.buf; chunkname = $f.chunkname; fn = $f.fn; ret = $f.ret; str = $f.str; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckFunction(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fn = _r; _r$1 = L.OptString(2, "?"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } chunkname = _r$1; top = L.GetTop(); buf = new sliceType$1([]); /* while (true) { */ case 3: L.SetTop(top); L.Push(fn); $r = L.Call(0, 1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret = L.reg.Pop(); /* */ if ($interfaceIsEqual(ret, $pkg.LNil)) { $s = 6; continue; } /* */ if (LVCanConvToString(ret)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(ret, $pkg.LNil)) { */ case 6: /* break; */ $s = 4; continue; $s = 9; continue; /* } else if (LVCanConvToString(ret)) { */ case 7: _r$2 = ret.String(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } str = _r$2; if (str.length > 0) { buf = $append(buf, (str)); } else { /* break; */ $s = 4; continue; } $s = 9; continue; /* } else { */ case 8: L.Push($pkg.LNil); L.Push(new LString("reader function must return a string")); $s = -1; return 2; /* } */ case 9: /* } */ $s = 3; continue; case 4: _r$3 = loadaux(L, strings.NewReader(strings.Join(buf, "")), chunkname); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $s = -1; return _r$3; /* */ } return; } if ($f === undefined) { $f = { $blk: baseLoad }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.buf = buf; $f.chunkname = chunkname; $f.fn = fn; $f.ret = ret; $f.str = str; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; baseLoadFile = function(L) { var L, _r, _r$1, _r$2, _r$3, _tuple, chunkname, err, reader, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; chunkname = $f.chunkname; err = $f.err; reader = $f.reader; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); reader = $ifaceNil; chunkname = ""; err = $ifaceNil; /* */ if (L.GetTop() < 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.GetTop() < 1) { */ case 1: reader = os.Stdin; chunkname = ""; $s = 3; continue; /* } else { */ case 2: _r = L.CheckString(1); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } chunkname = _r; _r$1 = os.Open(chunkname); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; reader = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: L.Push($pkg.LNil); _r$2 = fmt.Sprintf("can not open file: %v", new sliceType$6([new $String(chunkname)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$2))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 7: $deferred.push([$methodVal($assertType(reader, ptrType$2), "Close"), []]); /* } */ case 3: _r$3 = loadaux(L, reader, chunkname); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $s = -1; return _r$3; /* */ } return; } } catch(err) { $err = err; $s = -1; return 0; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: baseLoadFile }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.chunkname = chunkname; $f.err = err; $f.reader = reader; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; baseLoadString = function(L) { var L, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = L; _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = strings.NewReader(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = L.OptString(2, ""); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$2 = _r$2; _r$3 = loadaux(_arg, _arg$1, _arg$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $s = -1; return _r$3; /* */ } return; } if ($f === undefined) { $f = { $blk: baseLoadString }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.$s = $s; $f.$r = $r; return $f; }; baseNext = function(L) { var L, _r, _tuple, index, key, tb, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _tuple = $f._tuple; index = $f.index; key = $f.key; tb = $f.tb; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; index = $pkg.LNil; if (L.GetTop() >= 2) { index = L.Get(2); } _tuple = tb.Next(index); key = _tuple[0]; value = _tuple[1]; if ($interfaceIsEqual(key, $pkg.LNil)) { L.Push($pkg.LNil); $s = -1; return 1; } L.Push(key); L.Push(value); $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: baseNext }; } $f.L = L; $f._r = _r; $f._tuple = _tuple; $f.index = index; $f.key = key; $f.tb = tb; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; pairsaux = function(L) { var L, _r, _tuple, key, tb, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _tuple = $f._tuple; key = $f.key; tb = $f.tb; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; _tuple = tb.Next(L.Get(2)); key = _tuple[0]; value = _tuple[1]; /* */ if ($interfaceIsEqual(key, $pkg.LNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(key, $pkg.LNil)) { */ case 2: $s = -1; return 0; /* } else { */ case 3: $r = L.Pop(1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(key); L.Push(key); L.Push(value); $s = -1; return 2; /* } */ case 4: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: pairsaux }; } $f.L = L; $f._r = _r; $f._tuple = _tuple; $f.key = key; $f.tb = tb; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; basePairs = function(L) { var L, _r, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; L.Push(L.Get(UpvalueIndex(1))); L.Push(tb); L.Push($pkg.LNil); $s = -1; return 3; /* */ } return; } if ($f === undefined) { $f = { $blk: basePairs }; } $f.L = L; $f._r = _r; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; basePCall = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, aerr, err, nargs, ok, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; aerr = $f.aerr; err = $f.err; nargs = $f.nargs; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; v = L.Get(1); _r$1 = v.Type(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!((_r$1 === 4))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((_r$1 === 4))) { */ case 2: L.Push(new LBool($pkg.LFalse)); _r$2 = v.Type(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.Push(new LString(("attempt to call a " + _r$3 + " value"))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 3: nargs = L.GetTop() - 1 >> 0; _r$4 = L.PCall(nargs, -1, ptrType$7.nil); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err = _r$4; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: L.Push(new LBool($pkg.LFalse)); _tuple = $assertType(err, ptrType$11, true); aerr = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 12; continue; } /* */ $s = 13; continue; /* if (ok) { */ case 12: L.Push(aerr.Object); $s = 14; continue; /* } else { */ case 13: _r$5 = err.Error(); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$5))); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: $s = -1; return 2; /* } else { */ case 10: L.Insert(new LBool($pkg.LTrue), 1); $s = -1; return L.GetTop(); /* } */ case 11: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: basePCall }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.aerr = aerr; $f.err = err; $f.nargs = nargs; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; basePrint = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, i, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; i = $f.i; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: top = L.GetTop(); i = 1; /* while (true) { */ case 1: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 2; continue; } _r = L.ToStringMeta(L.Get(i)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = fmt.Print(new sliceType$6([new $String(_r$1)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* */ if (!((i === top))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!((i === top))) { */ case 6: _r$3 = fmt.Print(new sliceType$6([new $String("\t")])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 7: i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: _r$4 = fmt.Println(new sliceType$6([new $String("")])); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: basePrint }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.i = i; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; base_PrintRegs = function(L) { var L, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.printReg(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: base_PrintRegs }; } $f.L = L; $f.$s = $s; $f.$r = $r; return $f; }; baseRawEqual = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.CheckAny(2); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_r, _r$1)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(_r, _r$1)) { */ case 1: L.Push(new LBool($pkg.LTrue)); $s = 3; continue; /* } else { */ case 2: L.Push(new LBool($pkg.LFalse)); /* } */ case 3: $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseRawEqual }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; baseRawGet = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = L.CheckAny(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = L.RawGet(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseRawGet }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; baseRawSet = function(L) { var L, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = L.CheckAny(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = L.CheckAny(3); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$2 = _r$2; $r = L.RawSet(_arg, _arg$1, _arg$2); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: baseRawSet }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; baseSelect = function(L) { var L, _ref, idx, lv, lv$1, num, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _ref = $f._ref; idx = $f.idx; lv = $f.lv; lv$1 = $f.lv$1; num = $f.num; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.CheckTypes(1, new sliceType$8([2, 3])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = L.Get(1); /* */ if ($assertType(_ref, LNumber, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, LString, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, LNumber, true)[1]) { */ case 2: lv = _ref.$val; idx = ((lv >> 0)); num = (L.reg.Top() - L.indexToReg(((lv >> 0))) >> 0) - 1 >> 0; if (idx < 0) { num = num + (1) >> 0; } $s = -1; return num; /* } else if ($assertType(_ref, LString, true)[1]) { */ case 3: lv$1 = _ref.$val; /* */ if (!((lv$1) === "#")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!((lv$1) === "#")) { */ case 5: $r = L.ArgError(1, "invalid string '" + (lv$1) + "'"); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: L.Push(new LNumber(((L.GetTop() - 1 >> 0)))); $s = -1; return 1; /* } */ case 4: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: baseSelect }; } $f.L = L; $f._ref = _ref; $f.idx = idx; $f.lv = lv; $f.lv$1 = lv$1; $f.num = num; $f.$s = $s; $f.$r = $r; return $f; }; baseSetFEnv = function(L) { var L, _r, _tuple, _tuple$1, cf, env, fn, i, level, number, ok, ok$1, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cf = $f.cf; env = $f.env; fn = $f.fn; i = $f.i; level = $f.level; number = $f.number; ok = $f.ok; ok$1 = $f.ok$1; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = $ifaceNil; if (L.GetTop() === 0) { value = new LNumber(1); } else { value = L.Get(1); } _r = L.CheckTable(2); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } env = _r; _tuple = $assertType(value, ptrType$7, true); fn = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: /* */ if (fn.IsG) { $s = 4; continue; } /* */ $s = 5; continue; /* if (fn.IsG) { */ case 4: $r = L.RaiseError("cannot change the environment of given object", new sliceType$6([])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 6; continue; /* } else { */ case 5: fn.Env = env; L.Push(fn); $s = -1; return 1; /* } */ case 6: /* } */ case 3: _tuple$1 = $assertType(value, LNumber, true); number = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok$1) { */ case 8: level = (((number) >> 0)); if (level <= 0) { L.Env = env; $s = -1; return 0; } cf = L.currentFrame; i = 0; while (true) { if (!(i < level && !(cf === ptrType$10.nil))) { break; } cf = cf.Parent; i = i + (1) >> 0; } /* */ if (cf === ptrType$10.nil || cf.Fn.IsG) { $s = 10; continue; } /* */ $s = 11; continue; /* if (cf === ptrType$10.nil || cf.Fn.IsG) { */ case 10: $r = L.RaiseError("cannot change the environment of given object", new sliceType$6([])); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 12; continue; /* } else { */ case 11: cf.Fn.Env = env; L.Push(cf.Fn); $s = -1; return 1; /* } */ case 12: /* } */ case 9: $r = L.RaiseError("cannot change the environment of given object", new sliceType$6([])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: baseSetFEnv }; } $f.L = L; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cf = cf; $f.env = env; $f.fn = fn; $f.i = i; $f.level = level; $f.number = number; $f.ok = ok; $f.ok$1 = ok$1; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; baseSetMetatable = function(L) { var L, _r, _tuple, m, mt, obj, ok, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _tuple = $f._tuple; m = $f.m; mt = $f.mt; obj = $f.obj; ok = $f.ok; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.CheckTypes(2, new sliceType$8([0, 7])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } obj = L.Get(1); /* */ if ($interfaceIsEqual(obj, $pkg.LNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($interfaceIsEqual(obj, $pkg.LNil)) { */ case 2: $r = L.RaiseError("cannot set metatable to a nil object.", new sliceType$6([])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: mt = L.Get(2); _r = L.metatable(obj, true); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m = _r; /* */ if (!($interfaceIsEqual(m, $pkg.LNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(m, $pkg.LNil))) { */ case 6: _tuple = $assertType(m, ptrType$1, true); tb = _tuple[0]; ok = _tuple[1]; /* */ if (ok && !($interfaceIsEqual(tb.RawGetString("__metatable"), $pkg.LNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok && !($interfaceIsEqual(tb.RawGetString("__metatable"), $pkg.LNil))) { */ case 8: $r = L.RaiseError("cannot change a protected metatable", new sliceType$6([])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: /* } */ case 7: $r = L.SetMetatable(obj, mt); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.SetTop(1); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseSetMetatable }; } $f.L = L; $f._r = _r; $f._tuple = _tuple; $f.m = m; $f.mt = mt; $f.obj = obj; $f.ok = ok; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; baseToNumber = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _ref, _tmp, _tmp$1, _tuple, _tuple$1, _v, base, err, err$1, lv, lv$1, lv$2, noBase, str, v, v$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; base = $f.base; err = $f.err; err$1 = $f.err$1; lv = $f.lv; lv$1 = $f.lv$1; lv$2 = $f.lv$2; noBase = $f.noBase; str = $f.str; v = $f.v; v$1 = $f.v$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.OptInt(2, 10); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } base = _r; noBase = $interfaceIsEqual(L.Get(2), $pkg.LNil); _r$1 = L.CheckAny(1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _ref = _r$1; /* */ if ($assertType(_ref, LNumber, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, LString, true)[1]) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($assertType(_ref, LNumber, true)[1]) { */ case 3: lv = _ref.$val; L.Push(new LNumber(lv)); $s = 6; continue; /* } else if ($assertType(_ref, LString, true)[1]) { */ case 4: lv$1 = _ref.$val; _r$2 = strings.Trim((lv$1), " \n\t"); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } str = _r$2; /* */ if (strings.Index(str, ".") > -1) { $s = 8; continue; } /* */ $s = 9; continue; /* if (strings.Index(str, ".") > -1) { */ case 8: _tuple = strconv.ParseFloat(str, 64); v = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { L.Push($pkg.LNil); } else { L.Push(new LNumber((v))); } $s = 10; continue; /* } else { */ case 9: if (!(noBase)) { _v = false; $s = 13; continue s; } _r$3 = strings.ToLower(str); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = strings.HasPrefix(_r$3, "0x"); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _v = _r$4; case 13: /* */ if (_v) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_v) { */ case 11: _tmp = 16; _tmp$1 = $substring(str, 2); base = _tmp; str = _tmp$1; /* } */ case 12: _tuple$1 = strconv.ParseInt(str, base, 64); v$1 = _tuple$1[0]; err$1 = _tuple$1[1]; if (!($interfaceIsEqual(err$1, $ifaceNil))) { L.Push($pkg.LNil); } else { L.Push(new LNumber(($flatten64(v$1)))); } /* } */ case 10: $s = 6; continue; /* } else { */ case 5: lv$2 = _ref; L.Push($pkg.LNil); /* } */ case 6: $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseToNumber }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.base = base; $f.err = err; $f.err$1 = err$1; $f.lv = lv; $f.lv$1 = lv$1; $f.lv$2 = lv$2; $f.noBase = noBase; $f.str = str; $f.v = v; $f.v$1 = v$1; $f.$s = $s; $f.$r = $r; return $f; }; baseToString = function(L) { var L, _r, _r$1, v1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; v1 = $f.v1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v1 = _r; _r$1 = L.ToStringMeta(v1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseToString }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.v1 = v1; $f.$s = $s; $f.$r = $r; return $f; }; baseType = function(L) { var L, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.Type(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$2))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseType }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; baseUnpack = function(L) { var L, _r, _r$1, _r$2, end, i, ret, start, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; end = $f.end; i = $f.i; ret = $f.ret; start = $f.start; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tb = _r; _r$1 = L.OptInt(2, 1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } start = _r$1; _r$2 = L.OptInt(3, tb.Len()); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } end = _r$2; i = start; while (true) { if (!(i <= end)) { break; } L.Push(tb.RawGetInt(i)); i = i + (1) >> 0; } ret = (end - start >> 0) + 1 >> 0; if (ret < 0) { $s = -1; return 0; } $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: baseUnpack }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.end = end; $f.i = i; $f.ret = ret; $f.start = start; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; baseXPCall = function(L) { var L, _r, _r$1, _r$2, _r$3, _tuple, aerr, err, errfunc, fn, ok, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; aerr = $f.aerr; err = $f.err; errfunc = $f.errfunc; fn = $f.fn; ok = $f.ok; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckFunction(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fn = _r; _r$1 = L.CheckFunction(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } errfunc = _r$1; top = L.GetTop(); L.Push(fn); _r$2 = L.PCall(0, -1, errfunc); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: L.Push(new LBool($pkg.LFalse)); _tuple = $assertType(err, ptrType$11, true); aerr = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 7; continue; } /* */ $s = 8; continue; /* if (ok) { */ case 7: L.Push(aerr.Object); $s = 9; continue; /* } else { */ case 8: _r$3 = err.Error(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$3))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: $s = -1; return 2; /* } else { */ case 5: L.Insert(new LBool($pkg.LTrue), top + 1 >> 0); $s = -1; return L.GetTop() - top >> 0; /* } */ case 6: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: baseXPCall }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.aerr = aerr; $f.err = err; $f.errfunc = errfunc; $f.fn = fn; $f.ok = ok; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; loModule = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _tuple, caller, i, loaded, name, names, ok, pname, tb, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; caller = $f.caller; i = $f.i; loaded = $f.loaded; name = $f.name; names = $f.names; ok = $f.ok; pname = $f.pname; tb = $f.tb; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } name = _r; _r$1 = L.GetField(L.Get(-10000), "_LOADED"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } loaded = _r$1; _r$2 = L.GetField(loaded, name); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } tb = _r$2; _tuple = $assertType(tb, ptrType$1, true); ok = _tuple[1]; /* */ if (!ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok) { */ case 4: _r$3 = L.FindTable($assertType(L.Get(-10002), ptrType$1), name, 1); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } tb = _r$3; /* */ if ($interfaceIsEqual(tb, $pkg.LNil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(tb, $pkg.LNil)) { */ case 7: $r = L.RaiseError("name conflict for module: %v", new sliceType$6([new $String(name)])); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $r = L.SetField(loaded, name, tb); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: _r$4 = L.GetField(tb, "_NAME"); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if ($interfaceIsEqual(_r$4, $pkg.LNil)) { $s = 11; continue; } /* */ $s = 12; continue; /* if ($interfaceIsEqual(_r$4, $pkg.LNil)) { */ case 11: $r = L.SetField(tb, "_M", tb); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.SetField(tb, "_NAME", new LString((name))); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } names = strings.Split(name, "."); pname = ""; if (names.$length > 1) { pname = strings.Join($subslice(names, 0, (names.$length - 1 >> 0)), ".") + "."; } $r = L.SetField(tb, "_PACKAGE", new LString((pname))); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: caller = L.currentFrame.Parent; /* */ if (caller === ptrType$10.nil) { $s = 17; continue; } /* */ if (caller.Fn.IsG) { $s = 18; continue; } /* */ $s = 19; continue; /* if (caller === ptrType$10.nil) { */ case 17: $r = L.RaiseError("no calling stack.", new sliceType$6([])); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 19; continue; /* } else if (caller.Fn.IsG) { */ case 18: $r = L.RaiseError("module() can not be called from GFunctions.", new sliceType$6([])); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 19: $r = L.SetFEnv(caller.Fn, tb); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } top = L.GetTop(); i = 2; /* while (true) { */ case 23: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 24; continue; } L.Push(L.Get(i)); L.Push(tb); $r = L.Call(1, 0); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } i = i + (1) >> 0; /* } */ $s = 23; continue; case 24: L.Push(tb); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: loModule }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.caller = caller; $f.i = i; $f.loaded = loaded; $f.name = name; $f.names = names; $f.ok = ok; $f.pname = pname; $f.tb = tb; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; loRequire = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _ref, _tuple, i, loaded, loader, loaders, lv, messages, modasfunc, modv, name, ok, ret, ret$1, retv, retv$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _tuple = $f._tuple; i = $f.i; loaded = $f.loaded; loader = $f.loader; loaders = $f.loaders; lv = $f.lv; messages = $f.messages; modasfunc = $f.modasfunc; modv = $f.modv; name = $f.name; ok = $f.ok; ret = $f.ret; ret$1 = $f.ret$1; retv = $f.retv; retv$1 = $f.retv$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } name = _r; _r$1 = L.GetField(L.Get(-10000), "_LOADED"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } loaded = _r$1; _r$2 = L.GetField(loaded, name); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } lv = _r$2; /* */ if (LVAsBool(lv)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (LVAsBool(lv)) { */ case 4: /* */ if ($interfaceIsEqual(lv, loopdetection)) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($interfaceIsEqual(lv, loopdetection)) { */ case 6: $r = L.RaiseError("loop or previous error loading module: %s", new sliceType$6([new $String(name)])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: L.Push(lv); $s = -1; return 1; /* } */ case 5: _r$3 = L.GetField(L.Get(-10000), "_LOADERS"); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = $assertType(_r$3, ptrType$1, true); loaders = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!ok) { */ case 10: $r = L.RaiseError("package.loaders must be a table", new sliceType$6([])); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 11: messages = new sliceType$1([]); modasfunc = $ifaceNil; i = 1; /* while (true) { */ case 13: loader = L.RawGetInt(loaders, i); /* */ if ($interfaceIsEqual(loader, $pkg.LNil)) { $s = 15; continue; } /* */ $s = 16; continue; /* if ($interfaceIsEqual(loader, $pkg.LNil)) { */ case 15: $r = L.RaiseError("module %s not found:\n\t%s, ", new sliceType$6([new $String(name), new $String(strings.Join(messages, "\n\t"))])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 16: L.Push(loader); L.Push(new LString((name))); $r = L.Call(1, 1); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret = L.reg.Pop(); _ref = ret; /* */ if ($assertType(_ref, ptrType$7, true)[1]) { $s = 19; continue; } /* */ if ($assertType(_ref, LString, true)[1]) { $s = 20; continue; } /* */ $s = 21; continue; /* if ($assertType(_ref, ptrType$7, true)[1]) { */ case 19: retv = _ref.$val; modasfunc = retv; /* goto loopbreak */ $s = 22; continue; $s = 21; continue; /* } else if ($assertType(_ref, LString, true)[1]) { */ case 20: retv$1 = _ref.$val; messages = $append(messages, (retv$1)); /* } */ case 21: i = i + (1) >> 0; /* } */ $s = 13; continue; case 14: /* loopbreak: */ case 22: $r = L.SetField(loaded, name, loopdetection); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(modasfunc); L.Push(new LString((name))); $r = L.Call(1, 1); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret$1 = L.reg.Pop(); _r$4 = L.GetField(loaded, name); /* */ $s = 25; case 25: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } modv = _r$4; /* */ if (!($interfaceIsEqual(ret$1, $pkg.LNil)) && $interfaceIsEqual(modv, loopdetection)) { $s = 26; continue; } /* */ if ($interfaceIsEqual(modv, loopdetection)) { $s = 27; continue; } /* */ $s = 28; continue; /* if (!($interfaceIsEqual(ret$1, $pkg.LNil)) && $interfaceIsEqual(modv, loopdetection)) { */ case 26: $r = L.SetField(loaded, name, ret$1); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(ret$1); $s = 29; continue; /* } else if ($interfaceIsEqual(modv, loopdetection)) { */ case 27: $r = L.SetField(loaded, name, new LBool($pkg.LTrue)); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(new LBool($pkg.LTrue)); $s = 29; continue; /* } else { */ case 28: L.Push(modv); /* } */ case 29: $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: loRequire }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._tuple = _tuple; $f.i = i; $f.loaded = loaded; $f.loader = loader; $f.loaders = loaders; $f.lv = lv; $f.messages = messages; $f.modasfunc = modasfunc; $f.modv = modv; $f.name = name; $f.ok = ok; $f.ret = ret; $f.ret$1 = ret$1; $f.retv = retv; $f.retv$1 = retv$1; $f.$s = $s; $f.$r = $r; return $f; }; baseNewProxy = function(L) { var L, _arg, _arg$1, _r, _tuple, d, ok, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _tuple = $f._tuple; d = $f.d; ok = $f.ok; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ud = L.NewUserData(); L.SetTop(1); /* */ if ($interfaceIsEqual(L.Get(1), new LBool($pkg.LTrue))) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(L.Get(1), new LBool($pkg.LTrue))) { */ case 1: $r = L.SetMetatable(ud, L.NewTable()); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else { */ case 2: _tuple = $assertType(L.Get(1), ptrType$8, true); d = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 5; continue; } /* */ $s = 6; continue; /* if (ok) { */ case 5: _arg = ud; _r = L.GetMetatable(d); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = L.SetMetatable(_arg, _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: /* } */ case 3: L.Push(ud); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: baseNewProxy }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._tuple = _tuple; $f.d = d; $f.ok = ok; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; ecupdate = function(ec, ctype, reg, varargopt) { var ctype, ec, reg, varargopt; if (ec === _ecnone0 || ec === _ecnonem1 || ec === _ecnonem2) { $panic(new $String("can not update ec cache")); } ec.ctype = ctype; ec.reg = reg; ec.varargopt = varargopt; }; ecnone = function(varargopt) { var _1, varargopt; _1 = varargopt; if (_1 === (0)) { return _ecnone0; } else if (_1 === (-1)) { return _ecnonem1; } else if (_1 === (-2)) { return _ecnonem2; } return new expcontext.ptr(6, 256, varargopt); }; shouldmove = function(ec, reg) { var ec, reg; return (ec.ctype === 2) && !((ec.reg === 256)) && !((ec.reg === reg)); }; sline = function(pos) { var _r, pos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; pos = $f.pos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = pos.Line(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: sline }; } $f._r = _r; $f.pos = pos; $f.$s = $s; $f.$r = $r; return $f; }; eline = function(pos) { var _r, pos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; pos = $f.pos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = pos.LastLine(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: eline }; } $f._r = _r; $f.pos = pos; $f.$s = $s; $f.$r = $r; return $f; }; savereg = function(ec, reg) { var ec, reg; if (!((ec.ctype === 2)) || (ec.reg === 256)) { return reg; } return ec.reg; }; raiseCompileError = function(context$1, line, format, args) { var _r, args, context$1, format, line, msg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; args = $f.args; context$1 = $f.context$1; format = $f.format; line = $f.line; msg = $f.msg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fmt.Sprintf(format, args); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } msg = _r; $panic(new CompileError.ptr(context$1, line, msg)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: raiseCompileError }; } $f._r = _r; $f.args = args; $f.context$1 = context$1; $f.format = format; $f.line = line; $f.msg = msg; $f.$s = $s; $f.$r = $r; return $f; }; isVarArgReturnExpr = function(expr) { var _ref, ex, ex$1, expr; _ref = expr; if ($assertType(_ref, ptrType$13, true)[1]) { ex = _ref.$val; return !ex.AdjustRet; } else if ($assertType(_ref, ptrType$14, true)[1]) { ex$1 = _ref.$val; return true; } return false; }; lnumberValue = function(expr) { var _r, _tuple, _tuple$1, _tuple$2, err, ex, ex$1, expr, lv, ok, ok$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; ex = $f.ex; ex$1 = $f.ex$1; expr = $f.expr; lv = $f.lv; ok = $f.ok; ok$1 = $f.ok$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _tuple = $assertType(expr, ptrType$15, true); ex = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: _r = parseNumber(ex.Value); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; lv = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { lv = (math.NaN()); } $s = -1; return [lv, true]; /* } else { */ case 2: _tuple$2 = $assertType(expr, ptrType$16, true); ex$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; if (ok$1) { $s = -1; return [$assertType(ex$1.Value, LNumber), true]; } /* } */ case 3: $s = -1; return [0, false]; /* */ } return; } if ($f === undefined) { $f = { $blk: lnumberValue }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.ex = ex; $f.ex$1 = ex$1; $f.expr = expr; $f.lv = lv; $f.ok = ok; $f.ok$1 = ok$1; $f.$s = $s; $f.$r = $r; return $f; }; CompileError.ptr.prototype.Error = function() { var _r, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; _r = fmt.Sprintf("compile error near line(%v) %v: %v", new sliceType$6([new $Int(e.Line), new $String(e.context.Proto.SourceName), new $String(e.Message)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: CompileError.ptr.prototype.Error }; } $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; CompileError.prototype.Error = function() { return this.$val.Error(); }; codeStore.ptr.prototype.Add = function(inst, line) { var cd, inst, l, line, x, x$1, x$2, x$3; cd = this; l = cd.codes.$length; if (l <= 0 || (cd.pc === l)) { cd.codes = $append(cd.codes, inst); cd.lines = $append(cd.lines, line); } else { (x = cd.codes, x$1 = cd.pc, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = inst)); (x$2 = cd.lines, x$3 = cd.pc, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3] = line)); } cd.pc = cd.pc + (1) >> 0; }; codeStore.prototype.Add = function(inst, line) { return this.$val.Add(inst, line); }; codeStore.ptr.prototype.AddABC = function(op, a, b, c, line) { var a, b, c, cd, line, op; cd = this; cd.Add(opCreateABC(op, a, b, c), line); }; codeStore.prototype.AddABC = function(op, a, b, c, line) { return this.$val.AddABC(op, a, b, c, line); }; codeStore.ptr.prototype.AddABx = function(op, a, bx, line) { var a, bx, cd, line, op; cd = this; cd.Add(opCreateABx(op, a, bx), line); }; codeStore.prototype.AddABx = function(op, a, bx, line) { return this.$val.AddABx(op, a, bx, line); }; codeStore.ptr.prototype.AddASbx = function(op, a, sbx, line) { var a, cd, line, op, sbx; cd = this; cd.Add(opCreateASbx(op, a, sbx), line); }; codeStore.prototype.AddASbx = function(op, a, sbx, line) { return this.$val.AddASbx(op, a, sbx, line); }; codeStore.ptr.prototype.PropagateKMV = function(top, save, reg, inc) { var _1, cd, cindex, inc, lastinst, reg, save, top; cd = this; lastinst = cd.Last(); if (opGetArgA(lastinst) >= top) { _1 = opGetOpCode(lastinst); if (_1 === (2)) { cindex = opGetArgBx(lastinst); if (cindex <= 255) { cd.Pop(); save.$set(opRkAsk(cindex)); return; } } else if (_1 === (0)) { cd.Pop(); save.$set(opGetArgB(lastinst)); return; } } save.$set(reg.$get()); reg.$set(reg.$get() + inc >> 0); }; codeStore.prototype.PropagateKMV = function(top, save, reg, inc) { return this.$val.PropagateKMV(top, save, reg, inc); }; codeStore.ptr.prototype.PropagateMV = function(top, save, reg, inc) { var _1, cd, inc, lastinst, reg, save, top; cd = this; lastinst = cd.Last(); if (opGetArgA(lastinst) >= top) { _1 = opGetOpCode(lastinst); if (_1 === (0)) { cd.Pop(); save.$set(opGetArgB(lastinst)); return; } } save.$set(reg.$get()); reg.$set(reg.$get() + inc >> 0); }; codeStore.prototype.PropagateMV = function(top, save, reg, inc) { return this.$val.PropagateMV(top, save, reg, inc); }; codeStore.ptr.prototype.AddLoadNil = function(a, b, line) { var a, b, cd, last, line; cd = this; last = cd.Last(); if ((opGetOpCode(last) === 4) && (((opGetArgA(last) + opGetArgB(last) >> 0)) === a)) { cd.SetB(cd.LastPC(), b); } else { cd.AddABC(4, a, b, 0, line); } }; codeStore.prototype.AddLoadNil = function(a, b, line) { return this.$val.AddLoadNil(a, b, line); }; codeStore.ptr.prototype.SetOpCode = function(pc, v) { var cd, pc, v, x; cd = this; opSetOpCode((x = cd.codes, $indexPtr(x.$array, x.$offset + pc, ptrType$17)), v); }; codeStore.prototype.SetOpCode = function(pc, v) { return this.$val.SetOpCode(pc, v); }; codeStore.ptr.prototype.SetA = function(pc, v) { var cd, pc, v, x; cd = this; opSetArgA((x = cd.codes, $indexPtr(x.$array, x.$offset + pc, ptrType$17)), v); }; codeStore.prototype.SetA = function(pc, v) { return this.$val.SetA(pc, v); }; codeStore.ptr.prototype.SetB = function(pc, v) { var cd, pc, v, x; cd = this; opSetArgB((x = cd.codes, $indexPtr(x.$array, x.$offset + pc, ptrType$17)), v); }; codeStore.prototype.SetB = function(pc, v) { return this.$val.SetB(pc, v); }; codeStore.ptr.prototype.SetC = function(pc, v) { var cd, pc, v, x; cd = this; opSetArgC((x = cd.codes, $indexPtr(x.$array, x.$offset + pc, ptrType$17)), v); }; codeStore.prototype.SetC = function(pc, v) { return this.$val.SetC(pc, v); }; codeStore.ptr.prototype.SetBx = function(pc, v) { var cd, pc, v, x; cd = this; opSetArgBx((x = cd.codes, $indexPtr(x.$array, x.$offset + pc, ptrType$17)), v); }; codeStore.prototype.SetBx = function(pc, v) { return this.$val.SetBx(pc, v); }; codeStore.ptr.prototype.SetSbx = function(pc, v) { var cd, pc, v, x; cd = this; opSetArgSbx((x = cd.codes, $indexPtr(x.$array, x.$offset + pc, ptrType$17)), v); }; codeStore.prototype.SetSbx = function(pc, v) { return this.$val.SetSbx(pc, v); }; codeStore.ptr.prototype.At = function(pc) { var cd, pc, x; cd = this; return (x = cd.codes, ((pc < 0 || pc >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + pc])); }; codeStore.prototype.At = function(pc) { return this.$val.At(pc); }; codeStore.ptr.prototype.List = function() { var cd; cd = this; return $subslice(cd.codes, 0, cd.pc); }; codeStore.prototype.List = function() { return this.$val.List(); }; codeStore.ptr.prototype.PosList = function() { var cd; cd = this; return $subslice(cd.lines, 0, cd.pc); }; codeStore.prototype.PosList = function() { return this.$val.PosList(); }; codeStore.ptr.prototype.LastPC = function() { var cd; cd = this; return cd.pc - 1 >> 0; }; codeStore.prototype.LastPC = function() { return this.$val.LastPC(); }; codeStore.ptr.prototype.Last = function() { var cd, x, x$1; cd = this; if (cd.pc === 0) { return 4294967295; } return (x = cd.codes, x$1 = cd.pc - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); }; codeStore.prototype.Last = function() { return this.$val.Last(); }; codeStore.ptr.prototype.Pop = function() { var cd; cd = this; cd.pc = cd.pc - (1) >> 0; }; codeStore.prototype.Pop = function() { return this.$val.Pop(); }; newVarNamePool = function(offset) { var offset; return new varNamePool.ptr($makeSlice(sliceType$1, 0, 16), offset); }; varNamePool.ptr.prototype.Names = function() { var vp; vp = this; return vp.names; }; varNamePool.prototype.Names = function() { return this.$val.Names(); }; varNamePool.ptr.prototype.List = function() { var _i, _ref, i, name, result, vp; vp = this; result = $makeSlice(sliceType$9, vp.names.$length, vp.names.$length); _ref = vp.names; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ((i < 0 || i >= result.$length) ? ($throwRuntimeError("index out of range"), undefined) : result.$array[result.$offset + i]).Index = i + vp.offset >> 0; ((i < 0 || i >= result.$length) ? ($throwRuntimeError("index out of range"), undefined) : result.$array[result.$offset + i]).Name = name; _i++; } return result; }; varNamePool.prototype.List = function() { return this.$val.List(); }; varNamePool.ptr.prototype.LastIndex = function() { var vp; vp = this; return vp.offset + vp.names.$length >> 0; }; varNamePool.prototype.LastIndex = function() { return this.$val.LastIndex(); }; varNamePool.ptr.prototype.Find = function(name) { var i, name, vp, x; vp = this; i = vp.names.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if ((x = vp.names, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])) === name) { return i + vp.offset >> 0; } i = i - (1) >> 0; } return -1; }; varNamePool.prototype.Find = function(name) { return this.$val.Find(name); }; varNamePool.ptr.prototype.RegisterUnique = function(name) { var index, name, vp; vp = this; index = vp.Find(name); if (index < 0) { return vp.Register(name); } return index; }; varNamePool.prototype.RegisterUnique = function(name) { return this.$val.RegisterUnique(name); }; varNamePool.ptr.prototype.Register = function(name) { var name, vp; vp = this; vp.names = $append(vp.names, name); return (vp.names.$length - 1 >> 0) + vp.offset >> 0; }; varNamePool.prototype.Register = function(name) { return this.$val.Register(name); }; newCodeBlock = function(localvars, blabel, parent, pos) { var _r, _r$1, bl, blabel, localvars, parent, pos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; bl = $f.bl; blabel = $f.blabel; localvars = $f.localvars; parent = $f.parent; pos = $f.pos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: bl = new codeBlock.ptr(localvars, blabel, parent, false, 0, 0); /* */ if (!($interfaceIsEqual(pos, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(pos, $ifaceNil))) { */ case 1: _r = pos.Line(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } bl.LineStart = _r; _r$1 = pos.LastLine(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } bl.LastLine = _r$1; /* } */ case 2: $s = -1; return bl; /* */ } return; } if ($f === undefined) { $f = { $blk: newCodeBlock }; } $f._r = _r; $f._r$1 = _r$1; $f.bl = bl; $f.blabel = blabel; $f.localvars = localvars; $f.parent = parent; $f.pos = pos; $f.$s = $s; $f.$r = $r; return $f; }; newFuncContext = function(sourcename, parent) { var _r, fc, parent, sourcename, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fc = $f.fc; parent = $f.parent; sourcename = $f.sourcename; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = newCodeBlock(newVarNamePool(0), 0, ptrType$21.nil, $ifaceNil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fc = new funcContext.ptr(newFunctionProto(sourcename), new codeStore.ptr($makeSlice(sliceType$11, 0, 1024), $makeSlice(sliceType$12, 0, 1024), 0), parent, newVarNamePool(0), _r, sliceType$10.nil, 0, 1, $makeMap($Int.keyFor, [])); fc.Blocks = new sliceType$10([fc.Block]); $s = -1; return fc; /* */ } return; } if ($f === undefined) { $f = { $blk: newFuncContext }; } $f._r = _r; $f.fc = fc; $f.parent = parent; $f.sourcename = sourcename; $f.$s = $s; $f.$r = $r; return $f; }; funcContext.ptr.prototype.NewLabel = function() { var fc, ret; fc = this; ret = fc.labelId; fc.labelId = fc.labelId + (1) >> 0; return ret; }; funcContext.prototype.NewLabel = function() { return this.$val.NewLabel(); }; funcContext.ptr.prototype.SetLabelPc = function(label, pc) { var _key, fc, label, pc; fc = this; _key = label; (fc.labelPc || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key)] = { k: _key, v: pc }; }; funcContext.prototype.SetLabelPc = function(label, pc) { return this.$val.SetLabelPc(label, pc); }; funcContext.ptr.prototype.GetLabelPc = function(label) { var _entry, fc, label; fc = this; return (_entry = fc.labelPc[$Int.keyFor(label)], _entry !== undefined ? _entry.v : 0); }; funcContext.prototype.GetLabelPc = function(label) { return this.$val.GetLabelPc(label); }; funcContext.ptr.prototype.ConstIndex = function(value) { var _i, _r, _r$1, _ref, ctype, fc, i, lv, v, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; ctype = $f.ctype; fc = $f.fc; i = $f.i; lv = $f.lv; v = $f.v; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fc = this; _r = value.Type(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ctype = _r; _ref = fc.Proto.Constants; _i = 0; /* while (true) { */ case 2: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } i = _i; lv = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$1 = lv.Type(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if ((_r$1 === ctype) && $interfaceIsEqual(lv, value)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ((_r$1 === ctype) && $interfaceIsEqual(lv, value)) { */ case 4: $s = -1; return i; /* } */ case 5: _i++; /* } */ $s = 2; continue; case 3: fc.Proto.Constants = $append(fc.Proto.Constants, value); v = fc.Proto.Constants.$length - 1 >> 0; /* */ if (v > 262143) { $s = 7; continue; } /* */ $s = 8; continue; /* if (v > 262143) { */ case 7: $r = raiseCompileError(fc, fc.Proto.LineDefined, "too many constants", new sliceType$6([])); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = -1; return v; /* */ } return; } if ($f === undefined) { $f = { $blk: funcContext.ptr.prototype.ConstIndex }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.ctype = ctype; $f.fc = fc; $f.i = i; $f.lv = lv; $f.v = v; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; funcContext.prototype.ConstIndex = function(value) { return this.$val.ConstIndex(value); }; funcContext.ptr.prototype.RegisterLocalVar = function(name) { var fc, name, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; fc = $f.fc; name = $f.name; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fc = this; ret = fc.Block.LocalVars.Register(name); fc.Proto.DbgLocals = $append(fc.Proto.DbgLocals, new DbgLocalInfo.ptr(name, fc.Code.LastPC() + 1 >> 0, 0)); $r = fc.SetRegTop(fc.RegTop() + 1 >> 0); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: funcContext.ptr.prototype.RegisterLocalVar }; } $f.fc = fc; $f.name = name; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }; funcContext.prototype.RegisterLocalVar = function(name) { return this.$val.RegisterLocalVar(name); }; funcContext.ptr.prototype.FindLocalVarAndBlock = function(name) { var block, fc, index, name; fc = this; block = fc.Block; while (true) { if (!(!(block === ptrType$21.nil))) { break; } index = block.LocalVars.Find(name); if (index > -1) { return [index, block]; } block = block.Parent; } return [-1, ptrType$21.nil]; }; funcContext.prototype.FindLocalVarAndBlock = function(name) { return this.$val.FindLocalVarAndBlock(name); }; funcContext.ptr.prototype.FindLocalVar = function(name) { var _tuple, fc, idx, name; fc = this; _tuple = fc.FindLocalVarAndBlock(name); idx = _tuple[0]; return idx; }; funcContext.prototype.FindLocalVar = function(name) { return this.$val.FindLocalVar(name); }; funcContext.ptr.prototype.LocalVars = function() { var _i, _ref, block, fc, result; fc = this; result = $makeSlice(sliceType$9, 0, 32); _ref = fc.Blocks; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } block = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); result = $appendSlice(result, block.LocalVars.List()); _i++; } return result; }; funcContext.prototype.LocalVars = function() { return this.$val.LocalVars(); }; funcContext.ptr.prototype.EnterBlock = function(blabel, pos) { var _r, blabel, fc, pos, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; blabel = $f.blabel; fc = $f.fc; pos = $f.pos; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fc = this; _r = newCodeBlock(newVarNamePool(fc.RegTop()), blabel, fc.Block, pos); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fc.Block = _r; fc.Blocks = $append(fc.Blocks, fc.Block); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: funcContext.ptr.prototype.EnterBlock }; } $f._r = _r; $f.blabel = blabel; $f.fc = fc; $f.pos = pos; $f.$s = $s; $f.$r = $r; return $f; }; funcContext.prototype.EnterBlock = function(blabel, pos) { return this.$val.EnterBlock(blabel, pos); }; funcContext.ptr.prototype.CloseUpvalues = function() { var fc, n; fc = this; n = -1; if (fc.Block.RefUpvalue) { n = fc.Block.Parent.LocalVars.LastIndex(); fc.Code.AddABC(38, n, 0, 0, fc.Block.LastLine); } return n; }; funcContext.prototype.CloseUpvalues = function() { return this.$val.CloseUpvalues(); }; funcContext.ptr.prototype.LeaveBlock = function() { var closed, fc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; closed = $f.closed; fc = $f.fc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fc = this; closed = fc.CloseUpvalues(); fc.EndScope(); fc.Block = fc.Block.Parent; $r = fc.SetRegTop(fc.Block.LocalVars.LastIndex()); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return closed; /* */ } return; } if ($f === undefined) { $f = { $blk: funcContext.ptr.prototype.LeaveBlock }; } $f.closed = closed; $f.fc = fc; $f.$s = $s; $f.$r = $r; return $f; }; funcContext.prototype.LeaveBlock = function() { return this.$val.LeaveBlock(); }; funcContext.ptr.prototype.EndScope = function() { var _i, _ref, fc, vr, x, x$1; fc = this; _ref = fc.Block.LocalVars.List(); _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } vr = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), varNamePoolValue); (x = fc.Proto.DbgLocals, x$1 = vr.Index, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])).EndPc = fc.Code.LastPC(); _i++; } }; funcContext.prototype.EndScope = function() { return this.$val.EndScope(); }; funcContext.ptr.prototype.SetRegTop = function(top) { var fc, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; fc = $f.fc; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fc = this; /* */ if (top > 200) { $s = 1; continue; } /* */ $s = 2; continue; /* if (top > 200) { */ case 1: $r = raiseCompileError(fc, fc.Proto.LineDefined, "too many local variables", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: fc.regTop = top; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: funcContext.ptr.prototype.SetRegTop }; } $f.fc = fc; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; funcContext.prototype.SetRegTop = function(top) { return this.$val.SetRegTop(top); }; funcContext.ptr.prototype.RegTop = function() { var fc; fc = this; return fc.regTop; }; funcContext.prototype.RegTop = function() { return this.$val.RegTop(); }; compileChunk = function(context$1, chunk) { var _i, _ref, chunk, context$1, stmt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; chunk = $f.chunk; context$1 = $f.context$1; stmt = $f.stmt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = chunk; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } stmt = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = compileStmt(context$1, stmt); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileChunk }; } $f._i = _i; $f._ref = _ref; $f.chunk = chunk; $f.context$1 = context$1; $f.stmt = stmt; $f.$s = $s; $f.$r = $r; return $f; }; compileBlock = function(context$1, chunk) { var _i, _r, _r$1, _r$2, _ref, chunk, context$1, ph, stmt, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; chunk = $f.chunk; context$1 = $f.context$1; ph = $f.ph; stmt = $f.stmt; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (chunk.$length === 0) { $s = -1; return; } ph = new ast.Node.ptr(0, 0); _r = sline((0 >= chunk.$length ? ($throwRuntimeError("index out of range"), undefined) : chunk.$array[chunk.$offset + 0])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = ph.SetLine(_r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = eline((x = chunk.$length - 1 >> 0, ((x < 0 || x >= chunk.$length) ? ($throwRuntimeError("index out of range"), undefined) : chunk.$array[chunk.$offset + x]))); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = ph.SetLastLine(_r$1); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = context$1.EnterBlock(0, ph); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = chunk; _i = 0; /* while (true) { */ case 6: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 7; continue; } stmt = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); $r = compileStmt(context$1, stmt); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 6; continue; case 7: _r$2 = context$1.LeaveBlock(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileBlock }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.chunk = chunk; $f.context$1 = context$1; $f.ph = ph; $f.stmt = stmt; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; compileStmt = function(context$1, stmt) { var _r, _r$1, _ref, context$1, st, st$1, st$10, st$11, st$2, st$3, st$4, st$5, st$6, st$7, st$8, st$9, stmt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; context$1 = $f.context$1; st = $f.st; st$1 = $f.st$1; st$10 = $f.st$10; st$11 = $f.st$11; st$2 = $f.st$2; st$3 = $f.st$3; st$4 = $f.st$4; st$5 = $f.st$5; st$6 = $f.st$6; st$7 = $f.st$7; st$8 = $f.st$8; st$9 = $f.st$9; stmt = $f.stmt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = stmt; /* */ if ($assertType(_ref, ptrType$22, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$23, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$24, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$25, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$26, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$27, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref, ptrType$28, true)[1]) { $s = 7; continue; } /* */ if ($assertType(_ref, ptrType$29, true)[1]) { $s = 8; continue; } /* */ if ($assertType(_ref, ptrType$30, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref, ptrType$31, true)[1]) { $s = 10; continue; } /* */ if ($assertType(_ref, ptrType$32, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref, ptrType$33, true)[1]) { $s = 12; continue; } /* */ $s = 13; continue; /* if ($assertType(_ref, ptrType$22, true)[1]) { */ case 1: st = _ref.$val; $r = compileAssignStmt(context$1, st); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$23, true)[1]) { */ case 2: st$1 = _ref.$val; $r = compileLocalAssignStmt(context$1, st$1); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$24, true)[1]) { */ case 3: st$2 = _ref.$val; _r = compileFuncCallExpr(context$1, context$1.RegTop(), $assertType(st$2.Expr, ptrType$13), ecnone(-1)); /* */ $s = 16; case 16: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = 13; continue; /* } else if ($assertType(_ref, ptrType$25, true)[1]) { */ case 4: st$3 = _ref.$val; $r = context$1.EnterBlock(0, st$3); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = compileChunk(context$1, st$3.Stmts); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = context$1.LeaveBlock(); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; $s = 13; continue; /* } else if ($assertType(_ref, ptrType$26, true)[1]) { */ case 5: st$4 = _ref.$val; $r = compileWhileStmt(context$1, st$4); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$27, true)[1]) { */ case 6: st$5 = _ref.$val; $r = compileRepeatStmt(context$1, st$5); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$28, true)[1]) { */ case 7: st$6 = _ref.$val; $r = compileFuncDefStmt(context$1, st$6); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$29, true)[1]) { */ case 8: st$7 = _ref.$val; $r = compileReturnStmt(context$1, st$7); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$30, true)[1]) { */ case 9: st$8 = _ref.$val; $r = compileIfStmt(context$1, st$8); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$31, true)[1]) { */ case 10: st$9 = _ref.$val; $r = compileBreakStmt(context$1, st$9); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$32, true)[1]) { */ case 11: st$10 = _ref.$val; $r = compileNumberForStmt(context$1, st$10); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 13; continue; /* } else if ($assertType(_ref, ptrType$33, true)[1]) { */ case 12: st$11 = _ref.$val; $r = compileGenericForStmt(context$1, st$11); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileStmt }; } $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.context$1 = context$1; $f.st = st; $f.st$1 = st$1; $f.st$10 = st$10; $f.st$11 = st$11; $f.st$2 = st$2; $f.st$3 = st$3; $f.st$4 = st$4; $f.st$5 = st$5; $f.st$6 = st$6; $f.st$7 = st$7; $f.st$8 = st$8; $f.st$9 = st$9; $f.stmt = stmt; $f.$s = $s; $f.$r = $r; return $f; }; compileAssignStmtLeft = function(context$1, stmt) { var _1, _i, _r, _r$1, _ref, _ref$1, _tuple, ac, acs, context$1, ec, i, identtype, islast, lhs, ok, reg, st, st$1, st$2, stmt, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; ac = $f.ac; acs = $f.acs; context$1 = $f.context$1; ec = $f.ec; i = $f.i; identtype = $f.identtype; islast = $f.islast; lhs = $f.lhs; ok = $f.ok; reg = $f.reg; st = $f.st; st$1 = $f.st$1; st$2 = $f.st$2; stmt = $f.stmt; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = [reg]; reg[0] = context$1.RegTop(); acs = $makeSlice(sliceType$13, 0, stmt.Lhs.$length); _ref = stmt.Lhs; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } i = _i; lhs = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); islast = i === (stmt.Lhs.$length - 1 >> 0); _ref$1 = lhs; /* */ if ($assertType(_ref$1, ptrType$35, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref$1, ptrType$36, true)[1]) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($assertType(_ref$1, ptrType$35, true)[1]) { */ case 3: st = _ref$1.$val; identtype = getIdentRefType(context$1, context$1, st); ec = new expcontext.ptr(identtype, 256, 0); _1 = identtype; /* */ if (_1 === (0)) { $s = 8; continue; } /* */ if (_1 === (1)) { $s = 9; continue; } /* */ if (_1 === (2)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (0)) { */ case 8: _r = context$1.ConstIndex(new LString((st.Value))); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = 11; continue; /* } else if (_1 === (1)) { */ case 9: context$1.Upvalues.RegisterUnique(st.Value); $s = 11; continue; /* } else if (_1 === (2)) { */ case 10: if (islast) { ec.reg = context$1.FindLocalVar(st.Value); } /* } */ case 11: case 7: acs = $append(acs, new assigncontext.ptr(ec, 0, 0, false, false)); $s = 6; continue; /* } else if ($assertType(_ref$1, ptrType$36, true)[1]) { */ case 4: st$1 = _ref$1.$val; ac = new assigncontext.ptr(new expcontext.ptr(3, 256, 0), 0, 0, false, false); $r = compileExprWithKMVPropagation(context$1, st$1.Object, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (x = ac.ec, (x.$ptr_reg || (x.$ptr_reg = new ptrType$37(function() { return this.$target.reg; }, function($v) { this.$target.reg = $v; }, x))))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ac.keyrk = reg[0]; _r$1 = compileExpr(context$1, reg[0], st$1.Key, ecnone(0)); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } reg[0] = reg[0] + (_r$1) >> 0; _tuple = $assertType(st$1.Key, ptrType$38, true); ok = _tuple[1]; if (ok) { ac.keyks = true; } acs = $append(acs, ac); $s = 6; continue; /* } else { */ case 5: st$2 = _ref$1; $panic(new $String("invalid left expression.")); /* } */ case 6: _i++; /* } */ $s = 1; continue; case 2: $s = -1; return [reg[0], acs]; /* */ } return; } if ($f === undefined) { $f = { $blk: compileAssignStmtLeft }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.ac = ac; $f.acs = acs; $f.context$1 = context$1; $f.ec = ec; $f.i = i; $f.identtype = identtype; $f.islast = islast; $f.lhs = lhs; $f.ok = ok; $f.reg = reg; $f.st = st; $f.st$1 = st$1; $f.st$2 = st$2; $f.stmt = stmt; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; compileAssignStmtRight = function(context$1, stmt, reg, acs) { var _r, _r$1, _r$2, _r$3, _r$4, _tuple, ac, acs, context$1, ec, expr, i, i$1, idx, lenexprs, lennames, namesassigned, ok, reg, reginc, reginc$1, regstart, rightreg, stmt, varargopt, varargopt$1, x, x$1, x$2, x$3, x$4, x$5, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; ac = $f.ac; acs = $f.acs; context$1 = $f.context$1; ec = $f.ec; expr = $f.expr; i = $f.i; i$1 = $f.i$1; idx = $f.idx; lenexprs = $f.lenexprs; lennames = $f.lennames; namesassigned = $f.namesassigned; ok = $f.ok; reg = $f.reg; reginc = $f.reginc; reginc$1 = $f.reginc$1; regstart = $f.regstart; rightreg = $f.rightreg; stmt = $f.stmt; varargopt = $f.varargopt; varargopt$1 = $f.varargopt$1; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = [reg]; lennames = stmt.Lhs.$length; lenexprs = stmt.Rhs.$length; namesassigned = 0; /* while (true) { */ case 1: /* if (!(namesassigned < lennames)) { break; } */ if(!(namesassigned < lennames)) { $s = 2; continue; } ac = ((namesassigned < 0 || namesassigned >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + namesassigned]); ec = ac.ec; expr = $ifaceNil; /* */ if (namesassigned >= lenexprs) { $s = 3; continue; } /* */ if (isVarArgReturnExpr((x = stmt.Rhs, ((namesassigned < 0 || namesassigned >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + namesassigned]))) && (((lenexprs - namesassigned >> 0) - 1 >> 0)) <= 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (namesassigned >= lenexprs) { */ case 3: expr = new ast.NilExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)))); _r = sline((x$1 = stmt.Lhs, ((namesassigned < 0 || namesassigned >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + namesassigned]))); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = expr.SetLine(_r); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = eline((x$2 = stmt.Lhs, ((namesassigned < 0 || namesassigned >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + namesassigned]))); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = expr.SetLastLine(_r$1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (isVarArgReturnExpr((x = stmt.Rhs, ((namesassigned < 0 || namesassigned >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + namesassigned]))) && (((lenexprs - namesassigned >> 0) - 1 >> 0)) <= 0) { */ case 4: varargopt = (lennames - namesassigned >> 0) - 1 >> 0; regstart = reg[0]; _r$2 = compileExpr(context$1, reg[0], (x$3 = stmt.Rhs, ((namesassigned < 0 || namesassigned >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + namesassigned])), ecnone(varargopt)); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } reginc = _r$2; reg[0] = reg[0] + (reginc) >> 0; i = namesassigned; while (true) { if (!(i < (namesassigned + (reginc) >> 0))) { break; } ((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).needmove = true; if (((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).ec.ctype === 3) { ((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).valuerk = regstart + ((i - namesassigned >> 0)) >> 0; } i = i + (1) >> 0; } namesassigned = lennames; /* continue; */ $s = 1; continue; /* } */ case 5: if ($interfaceIsEqual(expr, $ifaceNil)) { expr = (x$4 = stmt.Rhs, ((namesassigned < 0 || namesassigned >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + namesassigned])); } idx = reg[0]; _r$3 = compileExpr(context$1, reg[0], expr, ec); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } reginc$1 = _r$3; if (ec.ctype === 3) { _tuple = $assertType(expr, ptrType$39, true); ok = _tuple[1]; if (!ok) { context$1.Code.PropagateKMV(context$1.RegTop(), (ac.$ptr_valuerk || (ac.$ptr_valuerk = new ptrType$37(function() { return this.$target.valuerk; }, function($v) { this.$target.valuerk = $v; }, ac))), (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), reginc$1); } else { ac.valuerk = idx; reg[0] = reg[0] + (reginc$1) >> 0; } } else { ac.needmove = !((reginc$1 === 0)); reg[0] = reg[0] + (reginc$1) >> 0; } namesassigned = namesassigned + (1) >> 0; /* } */ $s = 1; continue; case 2: rightreg = reg[0] - 1 >> 0; i$1 = namesassigned; /* while (true) { */ case 12: /* if (!(i$1 < lenexprs)) { break; } */ if(!(i$1 < lenexprs)) { $s = 13; continue; } varargopt$1 = -1; if (!((i$1 === (lenexprs - 1 >> 0)))) { varargopt$1 = 0; } _r$4 = compileExpr(context$1, reg[0], (x$5 = stmt.Rhs, ((i$1 < 0 || i$1 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i$1])), ecnone(varargopt$1)); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } reg[0] = reg[0] + (_r$4) >> 0; i$1 = i$1 + (1) >> 0; /* } */ $s = 12; continue; case 13: $s = -1; return [rightreg, acs]; /* */ } return; } if ($f === undefined) { $f = { $blk: compileAssignStmtRight }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.ac = ac; $f.acs = acs; $f.context$1 = context$1; $f.ec = ec; $f.expr = expr; $f.i = i; $f.i$1 = i$1; $f.idx = idx; $f.lenexprs = lenexprs; $f.lennames = lennames; $f.namesassigned = namesassigned; $f.ok = ok; $f.reg = reg; $f.reginc = reginc; $f.reginc$1 = reginc$1; $f.regstart = regstart; $f.rightreg = rightreg; $f.stmt = stmt; $f.varargopt = varargopt; $f.varargopt$1 = varargopt$1; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; }; compileAssignStmt = function(context$1, stmt) { var _1, _arg, _arg$1, _arg$10, _arg$11, _arg$12, _arg$13, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, acs, code, context$1, ex, i, lennames, opcode, reg, stmt, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$12 = $f._arg$12; _arg$13 = $f._arg$13; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; acs = $f.acs; code = $f.code; context$1 = $f.context$1; ex = $f.ex; i = $f.i; lennames = $f.lennames; opcode = $f.opcode; reg = $f.reg; stmt = $f.stmt; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = context$1.Code; lennames = stmt.Lhs.$length; _r = compileAssignStmtLeft(context$1, stmt); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; reg = _tuple[0]; acs = _tuple[1]; _r$1 = compileAssignStmtRight(context$1, stmt, reg, acs); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; reg = _tuple$1[0]; acs = _tuple$1[1]; i = lennames - 1 >> 0; /* while (true) { */ case 3: /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 4; continue; } ex = (x = stmt.Lhs, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); _1 = ((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).ec.ctype; /* */ if (_1 === (2)) { $s = 6; continue; } /* */ if (_1 === (0)) { $s = 7; continue; } /* */ if (_1 === (1)) { $s = 8; continue; } /* */ if (_1 === (3)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_1 === (2)) { */ case 6: /* */ if (((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).needmove) { $s = 11; continue; } /* */ $s = 12; continue; /* if (((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).needmove) { */ case 11: _arg = context$1.FindLocalVar($assertType(ex, ptrType$35).Value); _arg$1 = reg; _r$2 = sline(ex); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$2 = _r$2; $r = code.AddABC(0, _arg, _arg$1, 0, _arg$2); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg = reg - (1) >> 0; /* } */ case 12: $s = 10; continue; /* } else if (_1 === (0)) { */ case 7: _arg$3 = reg; _r$3 = context$1.ConstIndex(new LString(($assertType(ex, ptrType$35).Value))); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$4 = _r$3; _r$4 = sline(ex); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$5 = _r$4; $r = code.AddABx(9, _arg$3, _arg$4, _arg$5); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg = reg - (1) >> 0; $s = 10; continue; /* } else if (_1 === (1)) { */ case 8: _arg$6 = reg; _arg$7 = context$1.Upvalues.RegisterUnique($assertType(ex, ptrType$35).Value); _r$5 = sline(ex); /* */ $s = 18; case 18: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$8 = _r$5; $r = code.AddABC(10, _arg$6, _arg$7, 0, _arg$8); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg = reg - (1) >> 0; $s = 10; continue; /* } else if (_1 === (3)) { */ case 9: opcode = 11; if (((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).keyks) { opcode = 12; } _arg$9 = opcode; _arg$10 = ((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).ec.reg; _arg$11 = ((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).keyrk; _arg$12 = ((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).valuerk; _r$6 = sline(ex); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$13 = _r$6; $r = code.AddABC(_arg$9, _arg$10, _arg$11, _arg$12, _arg$13); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (!opIsK(((i < 0 || i >= acs.$length) ? ($throwRuntimeError("index out of range"), undefined) : acs.$array[acs.$offset + i]).valuerk)) { reg = reg - (1) >> 0; } /* } */ case 10: case 5: i = i - (1) >> 0; /* } */ $s = 3; continue; case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileAssignStmt }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$12 = _arg$12; $f._arg$13 = _arg$13; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.acs = acs; $f.code = code; $f.context$1 = context$1; $f.ex = ex; $f.i = i; $f.lennames = lennames; $f.opcode = opcode; $f.reg = reg; $f.stmt = stmt; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; compileRegAssignment = function(context$1, names, exprs, reg, nvars, line) { var _r, _r$1, _r$2, context$1, ec, exprs, i, lenexprs, lennames, line, names, namesassigned, nvars, reg, restleft, varargopt, varargopt$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; context$1 = $f.context$1; ec = $f.ec; exprs = $f.exprs; i = $f.i; lenexprs = $f.lenexprs; lennames = $f.lennames; line = $f.line; names = $f.names; namesassigned = $f.namesassigned; nvars = $f.nvars; reg = $f.reg; restleft = $f.restleft; varargopt = $f.varargopt; varargopt$1 = $f.varargopt$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lennames = names.$length; lenexprs = exprs.$length; namesassigned = 0; ec = new expcontext.ptr(0, 0, 0); /* while (true) { */ case 1: /* if (!(namesassigned < lennames && namesassigned < lenexprs)) { break; } */ if(!(namesassigned < lennames && namesassigned < lenexprs)) { $s = 2; continue; } /* */ if (isVarArgReturnExpr(((namesassigned < 0 || namesassigned >= exprs.$length) ? ($throwRuntimeError("index out of range"), undefined) : exprs.$array[exprs.$offset + namesassigned])) && (((lenexprs - namesassigned >> 0) - 1 >> 0)) <= 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (isVarArgReturnExpr(((namesassigned < 0 || namesassigned >= exprs.$length) ? ($throwRuntimeError("index out of range"), undefined) : exprs.$array[exprs.$offset + namesassigned])) && (((lenexprs - namesassigned >> 0) - 1 >> 0)) <= 0) { */ case 3: varargopt = nvars - namesassigned >> 0; ecupdate(ec, 4, reg, varargopt - 1 >> 0); _r = compileExpr(context$1, reg, ((namesassigned < 0 || namesassigned >= exprs.$length) ? ($throwRuntimeError("index out of range"), undefined) : exprs.$array[exprs.$offset + namesassigned]), ec); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; reg = reg + (varargopt) >> 0; namesassigned = lennames; $s = 5; continue; /* } else { */ case 4: ecupdate(ec, 2, reg, 0); _r$1 = compileExpr(context$1, reg, ((namesassigned < 0 || namesassigned >= exprs.$length) ? ($throwRuntimeError("index out of range"), undefined) : exprs.$array[exprs.$offset + namesassigned]), ec); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; reg = reg + (1) >> 0; namesassigned = namesassigned + (1) >> 0; /* } */ case 5: /* } */ $s = 1; continue; case 2: if (lennames > namesassigned) { restleft = (lennames - namesassigned >> 0) - 1 >> 0; context$1.Code.AddLoadNil(reg, reg + restleft >> 0, line); reg = reg + (restleft) >> 0; } i = namesassigned; /* while (true) { */ case 8: /* if (!(i < lenexprs)) { break; } */ if(!(i < lenexprs)) { $s = 9; continue; } varargopt$1 = -1; if (!((i === (lenexprs - 1 >> 0)))) { varargopt$1 = 0; } ecupdate(ec, 6, reg, varargopt$1); _r$2 = compileExpr(context$1, reg, ((i < 0 || i >= exprs.$length) ? ($throwRuntimeError("index out of range"), undefined) : exprs.$array[exprs.$offset + i]), ec); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } reg = reg + (_r$2) >> 0; i = i + (1) >> 0; /* } */ $s = 8; continue; case 9: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileRegAssignment }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.context$1 = context$1; $f.ec = ec; $f.exprs = exprs; $f.i = i; $f.lenexprs = lenexprs; $f.lennames = lennames; $f.line = line; $f.names = names; $f.namesassigned = namesassigned; $f.nvars = nvars; $f.reg = reg; $f.restleft = restleft; $f.varargopt = varargopt; $f.varargopt$1 = varargopt$1; $f.$s = $s; $f.$r = $r; return $f; }; compileLocalAssignStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$10, _arg$11, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _i, _r, _r$1, _r$2, _r$3, _ref, _tuple, context$1, name, ok, reg, stmt, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; context$1 = $f.context$1; name = $f.name; ok = $f.ok; reg = $f.reg; stmt = $f.stmt; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = context$1.RegTop(); /* */ if ((stmt.Names.$length === 1) && (stmt.Exprs.$length === 1)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((stmt.Names.$length === 1) && (stmt.Exprs.$length === 1)) { */ case 1: _tuple = $assertType((x = stmt.Exprs, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])), ptrType$40, true); ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r = context$1.RegisterLocalVar((x$1 = stmt.Names, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0]))); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _arg = context$1; _arg$1 = stmt.Names; _arg$2 = stmt.Exprs; _arg$3 = reg; _arg$4 = stmt.Names.$length; _r$1 = sline(stmt); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$5 = _r$1; $r = compileRegAssignment(_arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 4: /* } */ case 2: _arg$6 = context$1; _arg$7 = stmt.Names; _arg$8 = stmt.Exprs; _arg$9 = reg; _arg$10 = stmt.Names.$length; _r$2 = sline(stmt); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$11 = _r$2; $r = compileRegAssignment(_arg$6, _arg$7, _arg$8, _arg$9, _arg$10, _arg$11); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = stmt.Names; _i = 0; /* while (true) { */ case 10: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 11; continue; } name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$3 = context$1.RegisterLocalVar(name); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _i++; /* } */ $s = 10; continue; case 11: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileLocalAssignStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f.context$1 = context$1; $f.name = name; $f.ok = ok; $f.reg = reg; $f.stmt = stmt; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; compileReturnStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, a, code, context$1, count, ex, ex$1, expr, i, idx, lastisvaarg, lenexprs, reg, stmt, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; _ref$1 = $f._ref$1; a = $f.a; code = $f.code; context$1 = $f.context$1; count = $f.count; ex = $f.ex; ex$1 = $f.ex$1; expr = $f.expr; i = $f.i; idx = $f.idx; lastisvaarg = $f.lastisvaarg; lenexprs = $f.lenexprs; reg = $f.reg; stmt = $f.stmt; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lenexprs = stmt.Exprs.$length; code = context$1.Code; reg = context$1.RegTop(); a = reg; lastisvaarg = false; /* */ if (lenexprs === 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (lenexprs === 1) { */ case 1: _ref = (x = stmt.Exprs, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])); /* */ if ($assertType(_ref, ptrType$35, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$13, true)[1]) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($assertType(_ref, ptrType$35, true)[1]) { */ case 3: ex = _ref.$val; idx = context$1.FindLocalVar(ex.Value); /* */ if (idx > -1) { $s = 6; continue; } /* */ $s = 7; continue; /* if (idx > -1) { */ case 6: _arg = idx; _r = sline(stmt); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = code.AddABC(33, _arg, 2, 0, _arg$1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 7: $s = 5; continue; /* } else if ($assertType(_ref, ptrType$13, true)[1]) { */ case 4: ex$1 = _ref.$val; _r$1 = compileExpr(context$1, reg, ex$1, ecnone(-2)); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } reg = reg + (_r$1) >> 0; code.SetOpCode(code.LastPC(), 32); _arg$2 = a; _r$2 = sline(stmt); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$3 = _r$2; $r = code.AddABC(33, _arg$2, 0, 0, _arg$3); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 5: /* } */ case 2: _ref$1 = stmt.Exprs; _i = 0; /* while (true) { */ case 13: /* if (!(_i < _ref$1.$length)) { break; } */ if(!(_i < _ref$1.$length)) { $s = 14; continue; } i = _i; expr = ((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]); /* */ if ((i === (lenexprs - 1 >> 0)) && isVarArgReturnExpr(expr)) { $s = 15; continue; } /* */ $s = 16; continue; /* if ((i === (lenexprs - 1 >> 0)) && isVarArgReturnExpr(expr)) { */ case 15: _r$3 = compileExpr(context$1, reg, expr, ecnone(-2)); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; lastisvaarg = true; $s = 17; continue; /* } else { */ case 16: _r$4 = compileExpr(context$1, reg, expr, ecnone(0)); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } reg = reg + (_r$4) >> 0; /* } */ case 17: _i++; /* } */ $s = 13; continue; case 14: count = (reg - a >> 0) + 1 >> 0; if (lastisvaarg) { count = 0; } _arg$4 = a; _arg$5 = count; _r$5 = sline(stmt); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$6 = _r$5; $r = context$1.Code.AddABC(33, _arg$4, _arg$5, 0, _arg$6); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileReturnStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f._ref$1 = _ref$1; $f.a = a; $f.code = code; $f.context$1 = context$1; $f.count = count; $f.ex = ex; $f.ex$1 = ex$1; $f.expr = expr; $f.i = i; $f.idx = idx; $f.lastisvaarg = lastisvaarg; $f.lenexprs = lenexprs; $f.reg = reg; $f.stmt = stmt; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; compileIfStmt = function(context$1, stmt) { var _arg, _arg$1, _r, context$1, elselabel, endlabel, stmt, thenlabel, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; context$1 = $f.context$1; elselabel = $f.elselabel; endlabel = $f.endlabel; stmt = $f.stmt; thenlabel = $f.thenlabel; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: thenlabel = context$1.NewLabel(); elselabel = context$1.NewLabel(); endlabel = context$1.NewLabel(); $r = compileBranchCondition(context$1, context$1.RegTop(), stmt.Condition, thenlabel, elselabel, false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(thenlabel, context$1.Code.LastPC()); $r = compileBlock(context$1, stmt.Then); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (stmt.Else.$length > 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (stmt.Else.$length > 0) { */ case 3: _arg = endlabel; _r = sline(stmt); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = context$1.Code.AddASbx(25, 0, _arg, _arg$1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: context$1.SetLabelPc(elselabel, context$1.Code.LastPC()); /* */ if (stmt.Else.$length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (stmt.Else.$length > 0) { */ case 7: $r = compileBlock(context$1, stmt.Else); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(endlabel, context$1.Code.LastPC()); /* } */ case 8: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileIfStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.context$1 = context$1; $f.elselabel = elselabel; $f.endlabel = endlabel; $f.stmt = stmt; $f.thenlabel = thenlabel; $f.$s = $s; $f.$r = $r; return $f; }; compileBranchCondition = function(context$1, reg, expr, thenlabel, elselabel, hasnextcond) { var _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _r, _r$1, _r$2, _ref, a, code, context$1, elselabel, ex, ex$1, ex$2, ex$3, ex$4, expr, flip, hasnextcond, jumplabel, nextcondlabel, nextcondlabel$1, reg, thenlabel, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; a = $f.a; code = $f.code; context$1 = $f.context$1; elselabel = $f.elselabel; ex = $f.ex; ex$1 = $f.ex$1; ex$2 = $f.ex$2; ex$3 = $f.ex$3; ex$4 = $f.ex$4; expr = $f.expr; flip = $f.flip; hasnextcond = $f.hasnextcond; jumplabel = $f.jumplabel; nextcondlabel = $f.nextcondlabel; nextcondlabel$1 = $f.nextcondlabel$1; reg = $f.reg; thenlabel = $f.thenlabel; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = [a]; reg = [reg]; code = context$1.Code; flip = 0; jumplabel = elselabel; if (hasnextcond) { flip = 1; jumplabel = thenlabel; } _ref = expr; /* */ if ($assertType(_ref, ptrType$41, true)[1] || $assertType(_ref, ptrType$42, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$43, true)[1] || $assertType(_ref, ptrType$15, true)[1] || $assertType(_ref, ptrType$38, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$44, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$39, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$45, true)[1]) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($assertType(_ref, ptrType$41, true)[1] || $assertType(_ref, ptrType$42, true)[1]) { */ case 1: ex = _ref; /* */ if (!hasnextcond) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!hasnextcond) { */ case 7: _arg = elselabel; _r = sline(expr); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = code.AddASbx(25, 0, _arg, _arg$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 8: $s = 6; continue; /* } else if ($assertType(_ref, ptrType$43, true)[1] || $assertType(_ref, ptrType$15, true)[1] || $assertType(_ref, ptrType$38, true)[1]) { */ case 2: ex$1 = _ref; if (!hasnextcond) { $s = -1; return; } $s = 6; continue; /* } else if ($assertType(_ref, ptrType$44, true)[1]) { */ case 3: ex$2 = _ref.$val; $r = compileBranchCondition(context$1, reg[0], ex$2.Expr, elselabel, thenlabel, !hasnextcond); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else if ($assertType(_ref, ptrType$39, true)[1]) { */ case 4: ex$3 = _ref.$val; _1 = ex$3.Operator; /* */ if (_1 === ("and")) { $s = 13; continue; } /* */ if (_1 === ("or")) { $s = 14; continue; } /* */ $s = 15; continue; /* if (_1 === ("and")) { */ case 13: nextcondlabel = context$1.NewLabel(); $r = compileBranchCondition(context$1, reg[0], ex$3.Lhs, nextcondlabel, elselabel, false); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(nextcondlabel, context$1.Code.LastPC()); $r = compileBranchCondition(context$1, reg[0], ex$3.Rhs, thenlabel, elselabel, hasnextcond); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 15; continue; /* } else if (_1 === ("or")) { */ case 14: nextcondlabel$1 = context$1.NewLabel(); $r = compileBranchCondition(context$1, reg[0], ex$3.Lhs, thenlabel, nextcondlabel$1, true); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(nextcondlabel$1, context$1.Code.LastPC()); $r = compileBranchCondition(context$1, reg[0], ex$3.Rhs, thenlabel, elselabel, hasnextcond); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 15: case 12: $s = -1; return; /* } else if ($assertType(_ref, ptrType$45, true)[1]) { */ case 5: ex$4 = _ref.$val; $r = compileRelationalOpExprAux(context$1, reg[0], ex$4, flip, jumplabel); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 6: a[0] = reg[0]; $r = compileExprWithMVPropagation(context$1, expr, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (a.$ptr || (a.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, a)))); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$2 = a[0]; _arg$3 = (0 ^ flip) >> 0; _r$1 = sline(expr); /* */ $s = 22; case 22: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$4 = _r$1; $r = code.AddABC(29, _arg$2, 0, _arg$3, _arg$4); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$5 = jumplabel; _r$2 = sline(expr); /* */ $s = 24; case 24: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$6 = _r$2; $r = code.AddASbx(25, 0, _arg$5, _arg$6); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileBranchCondition }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.a = a; $f.code = code; $f.context$1 = context$1; $f.elselabel = elselabel; $f.ex = ex; $f.ex$1 = ex$1; $f.ex$2 = ex$2; $f.ex$3 = ex$3; $f.ex$4 = ex$4; $f.expr = expr; $f.flip = flip; $f.hasnextcond = hasnextcond; $f.jumplabel = jumplabel; $f.nextcondlabel = nextcondlabel; $f.nextcondlabel$1 = nextcondlabel$1; $f.reg = reg; $f.thenlabel = thenlabel; $f.$s = $s; $f.$r = $r; return $f; }; compileWhileStmt = function(context$1, stmt) { var _arg, _arg$1, _r, _r$1, condlabel, context$1, elselabel, stmt, thenlabel, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; condlabel = $f.condlabel; context$1 = $f.context$1; elselabel = $f.elselabel; stmt = $f.stmt; thenlabel = $f.thenlabel; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: thenlabel = context$1.NewLabel(); elselabel = context$1.NewLabel(); condlabel = context$1.NewLabel(); context$1.SetLabelPc(condlabel, context$1.Code.LastPC()); $r = compileBranchCondition(context$1, context$1.RegTop(), stmt.Condition, thenlabel, elselabel, false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(thenlabel, context$1.Code.LastPC()); $r = context$1.EnterBlock(elselabel, stmt); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = compileChunk(context$1, stmt.Stmts); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.CloseUpvalues(); _arg = condlabel; _r = eline(stmt); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = context$1.Code.AddASbx(25, 0, _arg, _arg$1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = context$1.LeaveBlock(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; context$1.SetLabelPc(elselabel, context$1.Code.LastPC()); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileWhileStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f.condlabel = condlabel; $f.context$1 = context$1; $f.elselabel = elselabel; $f.stmt = stmt; $f.thenlabel = thenlabel; $f.$s = $s; $f.$r = $r; return $f; }; compileRepeatStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _r, _r$1, _r$2, _r$3, context$1, elselabel, initlabel, label, n, stmt, thenlabel, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; context$1 = $f.context$1; elselabel = $f.elselabel; initlabel = $f.initlabel; label = $f.label; n = $f.n; stmt = $f.stmt; thenlabel = $f.thenlabel; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: initlabel = context$1.NewLabel(); thenlabel = context$1.NewLabel(); elselabel = context$1.NewLabel(); context$1.SetLabelPc(initlabel, context$1.Code.LastPC()); context$1.SetLabelPc(elselabel, context$1.Code.LastPC()); $r = context$1.EnterBlock(thenlabel, stmt); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = compileChunk(context$1, stmt.Stmts); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = compileBranchCondition(context$1, context$1.RegTop(), stmt.Condition, thenlabel, elselabel, false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(thenlabel, context$1.Code.LastPC()); _r = context$1.LeaveBlock(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; /* */ if (n > -1) { $s = 5; continue; } /* */ $s = 6; continue; /* if (n > -1) { */ case 5: label = context$1.NewLabel(); _arg = label; _r$1 = eline(stmt); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; $r = context$1.Code.AddASbx(25, 0, _arg, _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(elselabel, context$1.Code.LastPC()); _arg$2 = n; _r$2 = eline(stmt); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$3 = _r$2; $r = context$1.Code.AddABC(38, _arg$2, 0, 0, _arg$3); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$4 = initlabel; _r$3 = eline(stmt); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$5 = _r$3; $r = context$1.Code.AddASbx(25, 0, _arg$4, _arg$5); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(label, context$1.Code.LastPC()); /* } */ case 6: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileRepeatStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.context$1 = context$1; $f.elselabel = elselabel; $f.initlabel = initlabel; $f.label = label; $f.n = n; $f.stmt = stmt; $f.thenlabel = thenlabel; $f.$s = $s; $f.$r = $r; return $f; }; compileBreakStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _r, _r$1, _r$2, block, context$1, label, stmt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; block = $f.block; context$1 = $f.context$1; label = $f.label; stmt = $f.stmt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: block = context$1.Block; /* while (true) { */ case 1: /* if (!(!(block === ptrType$21.nil))) { break; } */ if(!(!(block === ptrType$21.nil))) { $s = 2; continue; } label = block.BreakLabel; /* */ if (!((label === 0))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!((label === 0))) { */ case 3: /* */ if (block.RefUpvalue) { $s = 5; continue; } /* */ $s = 6; continue; /* if (block.RefUpvalue) { */ case 5: _arg = block.Parent.LocalVars.LastIndex(); _r = sline(stmt); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = context$1.Code.AddABC(38, _arg, 0, 0, _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: _arg$2 = label; _r$1 = sline(stmt); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$3 = _r$1; $r = context$1.Code.AddASbx(25, 0, _arg$2, _arg$3); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 4: block = block.Parent; /* } */ $s = 1; continue; case 2: _arg$4 = context$1; _r$2 = sline(stmt); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$5 = _r$2; $r = raiseCompileError(_arg$4, _arg$5, "no loop to break", new sliceType$6([])); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileBreakStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.block = block; $f.context$1 = context$1; $f.label = label; $f.stmt = stmt; $f.$s = $s; $f.$r = $r; return $f; }; compileFuncDefStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _r$3, _r$4, _tmp, _tmp$1, astmt, context$1, kreg, reg, stmt, treg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; astmt = $f.astmt; context$1 = $f.context$1; kreg = $f.kreg; reg = $f.reg; stmt = $f.stmt; treg = $f.treg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = [reg]; treg = [treg]; /* */ if ($interfaceIsEqual(stmt.Name.Func, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(stmt.Name.Func, $ifaceNil)) { */ case 1: reg[0] = context$1.RegTop(); _tmp = 0; _tmp$1 = 0; treg[0] = _tmp; kreg = _tmp$1; $r = compileExprWithKMVPropagation(context$1, stmt.Name.Receiver, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (treg.$ptr || (treg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, treg)))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = loadRk(context$1, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), stmt.Func, new LString((stmt.Name.Method))); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } kreg = _r; _r$1 = compileExpr(context$1, reg[0], stmt.Func, ecfuncdef); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _arg = treg[0]; _arg$1 = kreg; _arg$2 = reg[0]; _r$2 = sline(stmt.Name.Receiver); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$3 = _r$2; $r = context$1.Code.AddABC(11, _arg, _arg$1, _arg$2, _arg$3); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else { */ case 2: astmt = new ast.AssignStmt.ptr(new ast.StmtBase.ptr(new ast.Node.ptr(0, 0)), new sliceType$14([stmt.Name.Func]), new sliceType$14([stmt.Func])); _r$3 = sline(stmt.Func); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = astmt.StmtBase.Node.SetLine(_r$3); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$4 = eline(stmt.Func); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = astmt.StmtBase.Node.SetLastLine(_r$4); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = compileAssignStmt(context$1, astmt); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileFuncDefStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.astmt = astmt; $f.context$1 = context$1; $f.kreg = kreg; $f.reg = reg; $f.stmt = stmt; $f.treg = treg; $f.$s = $s; $f.$r = $r; return $f; }; compileNumberForStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, bodypc, code, context$1, ec, endlabel, flpc, reg, rindex, rlimit, rstep, stmt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; bodypc = $f.bodypc; code = $f.code; context$1 = $f.context$1; ec = $f.ec; endlabel = $f.endlabel; flpc = $f.flpc; reg = $f.reg; rindex = $f.rindex; rlimit = $f.rlimit; rstep = $f.rstep; stmt = $f.stmt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = context$1.Code; endlabel = context$1.NewLabel(); ec = new expcontext.ptr(0, 0, 0); $r = context$1.EnterBlock(endlabel, stmt); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg = context$1.RegTop(); _r = context$1.RegisterLocalVar("(for index)"); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rindex = _r; ecupdate(ec, 2, rindex, 0); _r$1 = compileExpr(context$1, reg, stmt.Init, ec); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; reg = context$1.RegTop(); _r$2 = context$1.RegisterLocalVar("(for limit)"); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } rlimit = _r$2; ecupdate(ec, 2, rlimit, 0); _r$3 = compileExpr(context$1, reg, stmt.Limit, ec); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; reg = context$1.RegTop(); _r$4 = context$1.RegisterLocalVar("(for step)"); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } rstep = _r$4; /* */ if ($interfaceIsEqual(stmt.Step, $ifaceNil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if ($interfaceIsEqual(stmt.Step, $ifaceNil)) { */ case 7: stmt.Step = new ast.NumberExpr.ptr(new ast.ConstExprBase.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0))), "1"); _r$5 = sline(stmt.Init); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = stmt.Step.SetLine(_r$5); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: ecupdate(ec, 2, rstep, 0); _r$6 = compileExpr(context$1, reg, stmt.Step, ec); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; _arg = rindex; _r$7 = sline(stmt); /* */ $s = 12; case 12: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$1 = _r$7; $r = code.AddASbx(35, _arg, 0, _arg$1); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$8 = context$1.RegisterLocalVar(stmt.Name); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$8; bodypc = code.LastPC(); $r = compileChunk(context$1, stmt.Stmts); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$9 = context$1.LeaveBlock(); /* */ $s = 16; case 16: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$9; flpc = code.LastPC(); _arg$2 = rindex; _arg$3 = bodypc - ((flpc + 1 >> 0)) >> 0; _r$10 = sline(stmt); /* */ $s = 17; case 17: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$4 = _r$10; $r = code.AddASbx(34, _arg$2, _arg$3, _arg$4); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(endlabel, code.LastPC()); code.SetSbx(bodypc, flpc - bodypc >> 0); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileNumberForStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.bodypc = bodypc; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.endlabel = endlabel; $f.flpc = flpc; $f.reg = reg; $f.rindex = rindex; $f.rlimit = rlimit; $f.rstep = rstep; $f.stmt = stmt; $f.$s = $s; $f.$r = $r; return $f; }; compileGenericForStmt = function(context$1, stmt) { var _arg, _arg$1, _arg$10, _arg$11, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, bodylabel, code, context$1, endlabel, fllabel, name, nnames, rgen, stmt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; bodylabel = $f.bodylabel; code = $f.code; context$1 = $f.context$1; endlabel = $f.endlabel; fllabel = $f.fllabel; name = $f.name; nnames = $f.nnames; rgen = $f.rgen; stmt = $f.stmt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = context$1.Code; endlabel = context$1.NewLabel(); bodylabel = context$1.NewLabel(); fllabel = context$1.NewLabel(); nnames = stmt.Names.$length; $r = context$1.EnterBlock(endlabel, stmt); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = context$1.RegisterLocalVar("(for generator)"); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } rgen = _r; _r$1 = context$1.RegisterLocalVar("(for state)"); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _r$2 = context$1.RegisterLocalVar("(for control)"); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _arg = context$1; _arg$1 = stmt.Names; _arg$2 = stmt.Exprs; _arg$3 = context$1.RegTop() - 3 >> 0; _r$3 = sline(stmt); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$4 = _r$3; $r = compileRegAssignment(_arg, _arg$1, _arg$2, _arg$3, 3, _arg$4); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$5 = fllabel; _r$4 = sline(stmt); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$6 = _r$4; $r = code.AddASbx(25, 0, _arg$5, _arg$6); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref = stmt.Names; _i = 0; /* while (true) { */ case 9: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 10; continue; } name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$5 = context$1.RegisterLocalVar(name); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _r$5; _i++; /* } */ $s = 9; continue; case 10: context$1.SetLabelPc(bodylabel, code.LastPC()); $r = compileChunk(context$1, stmt.Stmts); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$6 = context$1.LeaveBlock(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$6; context$1.SetLabelPc(fllabel, code.LastPC()); _arg$7 = rgen; _arg$8 = nnames; _r$7 = sline(stmt); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$9 = _r$7; $r = code.AddABC(36, _arg$7, 0, _arg$8, _arg$9); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$10 = bodylabel; _r$8 = sline(stmt); /* */ $s = 16; case 16: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$11 = _r$8; $r = code.AddASbx(25, 0, _arg$10, _arg$11); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(endlabel, code.LastPC()); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileGenericForStmt }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f.bodylabel = bodylabel; $f.code = code; $f.context$1 = context$1; $f.endlabel = endlabel; $f.fllabel = fllabel; $f.name = name; $f.nnames = nnames; $f.rgen = rgen; $f.stmt = stmt; $f.$s = $s; $f.$r = $r; return $f; }; compileExpr = function(context$1, reg, expr, ec) { var _1, _arg, _arg$1, _arg$10, _arg$11, _arg$12, _arg$13, _arg$14, _arg$15, _arg$16, _arg$17, _arg$18, _arg$19, _arg$2, _arg$20, _arg$21, _arg$22, _arg$23, _arg$24, _arg$25, _arg$26, _arg$27, _arg$28, _arg$29, _arg$3, _arg$30, _arg$31, _arg$32, _arg$33, _arg$34, _arg$35, _arg$36, _arg$37, _arg$38, _arg$39, _arg$4, _arg$40, _arg$41, _arg$42, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _i, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _tuple, _tuple$1, _tuple$2, a, b, b$1, block, c, childcontext, code, context$1, ec, err, ex, ex$1, ex$10, ex$11, ex$12, ex$13, ex$14, ex$15, ex$16, ex$17, ex$2, ex$3, ex$4, ex$5, ex$6, ex$7, ex$8, ex$9, expr, localidx, num, ok, opcode, protono, reg, sreg, sused, upvalue, upvalueidx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$12 = $f._arg$12; _arg$13 = $f._arg$13; _arg$14 = $f._arg$14; _arg$15 = $f._arg$15; _arg$16 = $f._arg$16; _arg$17 = $f._arg$17; _arg$18 = $f._arg$18; _arg$19 = $f._arg$19; _arg$2 = $f._arg$2; _arg$20 = $f._arg$20; _arg$21 = $f._arg$21; _arg$22 = $f._arg$22; _arg$23 = $f._arg$23; _arg$24 = $f._arg$24; _arg$25 = $f._arg$25; _arg$26 = $f._arg$26; _arg$27 = $f._arg$27; _arg$28 = $f._arg$28; _arg$29 = $f._arg$29; _arg$3 = $f._arg$3; _arg$30 = $f._arg$30; _arg$31 = $f._arg$31; _arg$32 = $f._arg$32; _arg$33 = $f._arg$33; _arg$34 = $f._arg$34; _arg$35 = $f._arg$35; _arg$36 = $f._arg$36; _arg$37 = $f._arg$37; _arg$38 = $f._arg$38; _arg$39 = $f._arg$39; _arg$4 = $f._arg$4; _arg$40 = $f._arg$40; _arg$41 = $f._arg$41; _arg$42 = $f._arg$42; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$24 = $f._r$24; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; a = $f.a; b = $f.b; b$1 = $f.b$1; block = $f.block; c = $f.c; childcontext = $f.childcontext; code = $f.code; context$1 = $f.context$1; ec = $f.ec; err = $f.err; ex = $f.ex; ex$1 = $f.ex$1; ex$10 = $f.ex$10; ex$11 = $f.ex$11; ex$12 = $f.ex$12; ex$13 = $f.ex$13; ex$14 = $f.ex$14; ex$15 = $f.ex$15; ex$16 = $f.ex$16; ex$17 = $f.ex$17; ex$2 = $f.ex$2; ex$3 = $f.ex$3; ex$4 = $f.ex$4; ex$5 = $f.ex$5; ex$6 = $f.ex$6; ex$7 = $f.ex$7; ex$8 = $f.ex$8; ex$9 = $f.ex$9; expr = $f.expr; localidx = $f.localidx; num = $f.num; ok = $f.ok; opcode = $f.opcode; protono = $f.protono; reg = $f.reg; sreg = $f.sreg; sused = $f.sused; upvalue = $f.upvalue; upvalueidx = $f.upvalueidx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; c = [c]; reg = [reg]; code = context$1.Code; sreg = savereg(ec, reg[0]); sused = 1; if (sreg < reg[0]) { sused = 0; } _ref = expr; /* */ if ($assertType(_ref, ptrType$38, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$16, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$42, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$41, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$43, true)[1]) { $s = 6; continue; } /* */ if ($assertType(_ref, ptrType$35, true)[1]) { $s = 7; continue; } /* */ if ($assertType(_ref, ptrType$14, true)[1]) { $s = 8; continue; } /* */ if ($assertType(_ref, ptrType$36, true)[1]) { $s = 9; continue; } /* */ if ($assertType(_ref, ptrType$46, true)[1]) { $s = 10; continue; } /* */ if ($assertType(_ref, ptrType$47, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref, ptrType$48, true)[1]) { $s = 12; continue; } /* */ if ($assertType(_ref, ptrType$49, true)[1] || $assertType(_ref, ptrType$44, true)[1] || $assertType(_ref, ptrType$50, true)[1]) { $s = 13; continue; } /* */ if ($assertType(_ref, ptrType$45, true)[1]) { $s = 14; continue; } /* */ if ($assertType(_ref, ptrType$39, true)[1]) { $s = 15; continue; } /* */ if ($assertType(_ref, ptrType$13, true)[1]) { $s = 16; continue; } /* */ if ($assertType(_ref, ptrType$40, true)[1]) { $s = 17; continue; } /* */ $s = 18; continue; /* if ($assertType(_ref, ptrType$38, true)[1]) { */ case 1: ex = _ref.$val; _arg = sreg; _r = context$1.ConstIndex(new LString((ex.Value))); /* */ $s = 20; case 20: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; _r$1 = sline(ex); /* */ $s = 21; case 21: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$2 = _r$1; $r = code.AddABx(2, _arg, _arg$1, _arg$2); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$15, true)[1]) { */ case 2: ex$1 = _ref.$val; _r$2 = parseNumber(ex$1.Value); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; num = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { num = (math.NaN()); } _arg$3 = sreg; _r$3 = context$1.ConstIndex(new LNumber(num)); /* */ $s = 24; case 24: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$4 = _r$3; _r$4 = sline(ex$1); /* */ $s = 25; case 25: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$5 = _r$4; $r = code.AddABx(2, _arg$3, _arg$4, _arg$5); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$16, true)[1]) { */ case 3: ex$2 = _ref.$val; _arg$6 = sreg; _r$5 = context$1.ConstIndex(ex$2.Value); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$7 = _r$5; _r$6 = sline(ex$2); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$8 = _r$6; $r = code.AddABx(2, _arg$6, _arg$7, _arg$8); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$42, true)[1]) { */ case 4: ex$3 = _ref.$val; _arg$9 = sreg; _arg$10 = sreg; _r$7 = sline(ex$3); /* */ $s = 30; case 30: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$11 = _r$7; $r = code.AddLoadNil(_arg$9, _arg$10, _arg$11); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$41, true)[1]) { */ case 5: ex$4 = _ref.$val; _arg$12 = sreg; _r$8 = sline(ex$4); /* */ $s = 32; case 32: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$13 = _r$8; $r = code.AddABC(3, _arg$12, 0, 0, _arg$13); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$43, true)[1]) { */ case 6: ex$5 = _ref.$val; _arg$14 = sreg; _r$9 = sline(ex$5); /* */ $s = 34; case 34: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$15 = _r$9; $r = code.AddABC(3, _arg$14, 1, 0, _arg$15); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$35, true)[1]) { */ case 7: ex$6 = _ref.$val; _1 = getIdentRefType(context$1, context$1, ex$6); /* */ if (_1 === (0)) { $s = 37; continue; } /* */ if (_1 === (1)) { $s = 38; continue; } /* */ if (_1 === (2)) { $s = 39; continue; } /* */ $s = 40; continue; /* if (_1 === (0)) { */ case 37: _arg$16 = sreg; _r$10 = context$1.ConstIndex(new LString((ex$6.Value))); /* */ $s = 41; case 41: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$17 = _r$10; _r$11 = sline(ex$6); /* */ $s = 42; case 42: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$18 = _r$11; $r = code.AddABx(6, _arg$16, _arg$17, _arg$18); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 40; continue; /* } else if (_1 === (1)) { */ case 38: _arg$19 = sreg; _arg$20 = context$1.Upvalues.RegisterUnique(ex$6.Value); _r$12 = sline(ex$6); /* */ $s = 44; case 44: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _arg$21 = _r$12; $r = code.AddABC(5, _arg$19, _arg$20, 0, _arg$21); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 40; continue; /* } else if (_1 === (2)) { */ case 39: b$1 = context$1.FindLocalVar(ex$6.Value); _arg$22 = sreg; _arg$23 = b$1; _r$13 = sline(ex$6); /* */ $s = 46; case 46: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _arg$24 = _r$13; $r = code.AddABC(0, _arg$22, _arg$23, 0, _arg$24); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 40: case 36: $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$14, true)[1]) { */ case 8: ex$7 = _ref.$val; /* */ if (context$1.Proto.IsVarArg === 0) { $s = 48; continue; } /* */ $s = 49; continue; /* if (context$1.Proto.IsVarArg === 0) { */ case 48: _arg$25 = context$1; _r$14 = sline(ex$7); /* */ $s = 50; case 50: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _arg$26 = _r$14; $r = raiseCompileError(_arg$25, _arg$26, "cannot use '...' outside a vararg function", new sliceType$6([])); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 49: context$1.Proto.IsVarArg = (context$1.Proto.IsVarArg & (251)) >>> 0; _arg$27 = sreg; _arg$28 = 2 + ec.varargopt >> 0; _r$15 = sline(ex$7); /* */ $s = 52; case 52: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$29 = _r$15; $r = code.AddABC(40, _arg$27, _arg$28, 0, _arg$29); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (context$1.RegTop() > (((sreg + 2 >> 0) + ec.varargopt >> 0)) || ec.varargopt < -1) { $s = -1; return 0; } $s = -1; return (((sreg + 1 >> 0) + ec.varargopt >> 0)) - reg[0] >> 0; /* } else if ($assertType(_ref, ptrType$36, true)[1]) { */ case 9: ex$8 = _ref.$val; a = sreg; b[0] = reg[0]; $r = compileExprWithMVPropagation(context$1, ex$8.Object, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (b.$ptr || (b.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))); /* */ $s = 54; case 54: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, ex$8.Key, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (c.$ptr || (c.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))); /* */ $s = 55; case 55: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } opcode = 7; _tuple$1 = $assertType(ex$8.Key, ptrType$38, true); ok = _tuple$1[1]; if (ok) { opcode = 8; } _arg$30 = opcode; _arg$31 = a; _arg$32 = b[0]; _arg$33 = c[0]; _r$16 = sline(ex$8); /* */ $s = 56; case 56: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } _arg$34 = _r$16; $r = code.AddABC(_arg$30, _arg$31, _arg$32, _arg$33, _arg$34); /* */ $s = 57; case 57: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$46, true)[1]) { */ case 10: ex$9 = _ref.$val; $r = compileTableExpr(context$1, reg[0], ex$9, ec); /* */ $s = 58; case 58: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* } else if ($assertType(_ref, ptrType$47, true)[1]) { */ case 11: ex$10 = _ref.$val; $r = compileArithmeticOpExpr(context$1, reg[0], ex$10, ec); /* */ $s = 59; case 59: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$48, true)[1]) { */ case 12: ex$11 = _ref.$val; $r = compileStringConcatOpExpr(context$1, reg[0], ex$11, ec); /* */ $s = 60; case 60: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$49, true)[1] || $assertType(_ref, ptrType$44, true)[1] || $assertType(_ref, ptrType$50, true)[1]) { */ case 13: ex$12 = _ref; $r = compileUnaryOpExpr(context$1, reg[0], ex$12, ec); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$45, true)[1]) { */ case 14: ex$13 = _ref.$val; $r = compileRelationalOpExpr(context$1, reg[0], ex$13, ec); /* */ $s = 62; case 62: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$39, true)[1]) { */ case 15: ex$14 = _ref.$val; $r = compileLogicalOpExpr(context$1, reg[0], ex$14, ec); /* */ $s = 63; case 63: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return sused; /* } else if ($assertType(_ref, ptrType$13, true)[1]) { */ case 16: ex$15 = _ref.$val; _r$17 = compileFuncCallExpr(context$1, reg[0], ex$15, ec); /* */ $s = 64; case 64: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } $s = -1; return _r$17; /* } else if ($assertType(_ref, ptrType$40, true)[1]) { */ case 17: ex$16 = _ref.$val; _r$18 = newFuncContext(context$1.Proto.SourceName, context$1); /* */ $s = 65; case 65: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } childcontext = _r$18; $r = compileFunctionExpr(childcontext, ex$16, ec); /* */ $s = 66; case 66: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } protono = context$1.Proto.FunctionPrototypes.$length; context$1.Proto.FunctionPrototypes = $append(context$1.Proto.FunctionPrototypes, childcontext.Proto); _arg$35 = sreg; _arg$36 = protono; _r$19 = sline(ex$16); /* */ $s = 67; case 67: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } _arg$37 = _r$19; $r = code.AddABx(39, _arg$35, _arg$36, _arg$37); /* */ $s = 68; case 68: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _ref$1 = childcontext.Upvalues.List(); _i = 0; /* while (true) { */ case 69: /* if (!(_i < _ref$1.$length)) { break; } */ if(!(_i < _ref$1.$length)) { $s = 70; continue; } upvalue = $clone(((_i < 0 || _i >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i]), varNamePoolValue); _tuple$2 = context$1.FindLocalVarAndBlock(upvalue.Name); localidx = _tuple$2[0]; block = _tuple$2[1]; /* */ if (localidx > -1) { $s = 71; continue; } /* */ $s = 72; continue; /* if (localidx > -1) { */ case 71: _arg$38 = localidx; _r$20 = sline(ex$16); /* */ $s = 74; case 74: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } _arg$39 = _r$20; $r = code.AddABC(0, 0, _arg$38, 0, _arg$39); /* */ $s = 75; case 75: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } block.RefUpvalue = true; $s = 73; continue; /* } else { */ case 72: upvalueidx = context$1.Upvalues.Find(upvalue.Name); if (upvalueidx < 0) { upvalueidx = context$1.Upvalues.RegisterUnique(upvalue.Name); } _arg$40 = upvalueidx; _r$21 = sline(ex$16); /* */ $s = 76; case 76: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } _arg$41 = _r$21; $r = code.AddABC(5, 0, _arg$40, 0, _arg$41); /* */ $s = 77; case 77: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 73: _i++; /* } */ $s = 69; continue; case 70: $s = -1; return sused; /* } else { */ case 18: ex$17 = _ref; _r$22 = reflect.TypeOf(ex$17).Elem(); /* */ $s = 78; case 78: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } _r$23 = _r$22.Name(); /* */ $s = 79; case 79: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } _arg$42 = new $String(_r$23); _r$24 = fmt.Sprintf("expr %v not implemented.", new sliceType$6([_arg$42])); /* */ $s = 80; case 80: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } $panic(new $String(_r$24)); /* } */ case 19: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: compileExpr }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$12 = _arg$12; $f._arg$13 = _arg$13; $f._arg$14 = _arg$14; $f._arg$15 = _arg$15; $f._arg$16 = _arg$16; $f._arg$17 = _arg$17; $f._arg$18 = _arg$18; $f._arg$19 = _arg$19; $f._arg$2 = _arg$2; $f._arg$20 = _arg$20; $f._arg$21 = _arg$21; $f._arg$22 = _arg$22; $f._arg$23 = _arg$23; $f._arg$24 = _arg$24; $f._arg$25 = _arg$25; $f._arg$26 = _arg$26; $f._arg$27 = _arg$27; $f._arg$28 = _arg$28; $f._arg$29 = _arg$29; $f._arg$3 = _arg$3; $f._arg$30 = _arg$30; $f._arg$31 = _arg$31; $f._arg$32 = _arg$32; $f._arg$33 = _arg$33; $f._arg$34 = _arg$34; $f._arg$35 = _arg$35; $f._arg$36 = _arg$36; $f._arg$37 = _arg$37; $f._arg$38 = _arg$38; $f._arg$39 = _arg$39; $f._arg$4 = _arg$4; $f._arg$40 = _arg$40; $f._arg$41 = _arg$41; $f._arg$42 = _arg$42; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$24 = _r$24; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.a = a; $f.b = b; $f.b$1 = b$1; $f.block = block; $f.c = c; $f.childcontext = childcontext; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.err = err; $f.ex = ex; $f.ex$1 = ex$1; $f.ex$10 = ex$10; $f.ex$11 = ex$11; $f.ex$12 = ex$12; $f.ex$13 = ex$13; $f.ex$14 = ex$14; $f.ex$15 = ex$15; $f.ex$16 = ex$16; $f.ex$17 = ex$17; $f.ex$2 = ex$2; $f.ex$3 = ex$3; $f.ex$4 = ex$4; $f.ex$5 = ex$5; $f.ex$6 = ex$6; $f.ex$7 = ex$7; $f.ex$8 = ex$8; $f.ex$9 = ex$9; $f.expr = expr; $f.localidx = localidx; $f.num = num; $f.ok = ok; $f.opcode = opcode; $f.protono = protono; $f.reg = reg; $f.sreg = sreg; $f.sused = sused; $f.upvalue = upvalue; $f.upvalueidx = upvalueidx; $f.$s = $s; $f.$r = $r; return $f; }; compileExprWithPropagation = function(context$1, expr, reg, save, propergator) { var _r, _tuple, context$1, expr, ok, propergator, reg, reginc, save, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; context$1 = $f.context$1; expr = $f.expr; ok = $f.ok; propergator = $f.propergator; reg = $f.reg; reginc = $f.reginc; save = $f.save; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = compileExpr(context$1, reg.$get(), expr, ecnone(0)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } reginc = _r; _tuple = $assertType(expr, ptrType$39, true); ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: save.$set(reg.$get()); reg.$set(reg.$get() + reginc >> 0); $s = 4; continue; /* } else { */ case 3: $r = propergator(context$1.RegTop(), save, reg, reginc); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileExprWithPropagation }; } $f._r = _r; $f._tuple = _tuple; $f.context$1 = context$1; $f.expr = expr; $f.ok = ok; $f.propergator = propergator; $f.reg = reg; $f.reginc = reginc; $f.save = save; $f.$s = $s; $f.$r = $r; return $f; }; compileExprWithKMVPropagation = function(context$1, expr, reg, save) { var context$1, expr, reg, save, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; context$1 = $f.context$1; expr = $f.expr; reg = $f.reg; save = $f.save; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = compileExprWithPropagation(context$1, expr, reg, save, $methodVal(context$1.Code, "PropagateKMV")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileExprWithKMVPropagation }; } $f.context$1 = context$1; $f.expr = expr; $f.reg = reg; $f.save = save; $f.$s = $s; $f.$r = $r; return $f; }; compileExprWithMVPropagation = function(context$1, expr, reg, save) { var context$1, expr, reg, save, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; context$1 = $f.context$1; expr = $f.expr; reg = $f.reg; save = $f.save; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = compileExprWithPropagation(context$1, expr, reg, save, $methodVal(context$1.Code, "PropagateMV")); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileExprWithMVPropagation }; } $f.context$1 = context$1; $f.expr = expr; $f.reg = reg; $f.save = save; $f.$s = $s; $f.$r = $r; return $f; }; constFold = function(exp) { var _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _tuple, _tuple$1, _tuple$2, exp, expr, expr$1, expr$2, lisconst, lvalue, ok, retexpr, risconst, rvalue, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; exp = $f.exp; expr = $f.expr; expr$1 = $f.expr$1; expr$2 = $f.expr$2; lisconst = $f.lisconst; lvalue = $f.lvalue; ok = $f.ok; retexpr = $f.retexpr; risconst = $f.risconst; rvalue = $f.rvalue; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: retexpr = [retexpr]; _ref = exp; /* */ if ($assertType(_ref, ptrType$47, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$49, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$47, true)[1]) { */ case 1: expr = _ref.$val; _r = constFold(expr.Lhs); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = lnumberValue(_r); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; lvalue = _tuple[0]; lisconst = _tuple[1]; _r$2 = constFold(expr.Rhs); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = lnumberValue(_r$2); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; rvalue = _tuple$1[0]; risconst = _tuple$1[1]; /* */ if (lisconst && risconst) { $s = 9; continue; } /* */ $s = 10; continue; /* if (lisconst && risconst) { */ case 9: _1 = expr.Operator; /* */ if (_1 === ("+")) { $s = 13; continue; } /* */ if (_1 === ("-")) { $s = 14; continue; } /* */ if (_1 === ("*")) { $s = 15; continue; } /* */ if (_1 === ("/")) { $s = 16; continue; } /* */ if (_1 === ("%")) { $s = 17; continue; } /* */ if (_1 === ("^")) { $s = 18; continue; } /* */ $s = 19; continue; /* if (_1 === ("+")) { */ case 13: $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber(lvalue + rvalue)); /* } else if (_1 === ("-")) { */ case 14: $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber(lvalue - rvalue)); /* } else if (_1 === ("*")) { */ case 15: $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber(lvalue * rvalue)); /* } else if (_1 === ("/")) { */ case 16: $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber(lvalue / rvalue)); /* } else if (_1 === ("%")) { */ case 17: $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber(luaModulo(lvalue, rvalue))); /* } else if (_1 === ("^")) { */ case 18: $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber((math.Pow((lvalue), (rvalue))))); /* } else { */ case 19: _r$4 = fmt.Sprintf("unknown binop: %v", new sliceType$6([new $String(expr.Operator)])); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $panic(new $String(_r$4)); /* } */ case 20: case 12: $s = 11; continue; /* } else { */ case 10: retexpr[0] = $clone(expr, ast.ArithmeticOpExpr); _r$5 = constFold(expr.Lhs); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } retexpr[0].Lhs = _r$5; _r$6 = constFold(expr.Rhs); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } retexpr[0].Rhs = _r$6; $s = -1; return retexpr[0]; /* } */ case 11: $s = 4; continue; /* } else if ($assertType(_ref, ptrType$49, true)[1]) { */ case 2: expr$1 = _ref.$val; _r$7 = constFold(expr$1.Expr); /* */ $s = 24; case 24: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } expr$1.Expr = _r$7; _r$8 = lnumberValue(expr$1.Expr); /* */ $s = 25; case 25: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _tuple$2 = _r$8; value = _tuple$2[0]; ok = _tuple$2[1]; if (ok) { $s = -1; return new constLValueExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), new LNumber((-value))); } $s = -1; return expr$1; /* } else { */ case 3: expr$2 = _ref; $s = -1; return exp; /* } */ case 4: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: constFold }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.exp = exp; $f.expr = expr; $f.expr$1 = expr$1; $f.expr$2 = expr$2; $f.lisconst = lisconst; $f.lvalue = lvalue; $f.ok = ok; $f.retexpr = retexpr; $f.risconst = risconst; $f.rvalue = rvalue; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; compileFunctionExpr = function(context$1, funcexpr, ec) { var _arg, _i, _i$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, _tuple, clv, context$1, ec, funcexpr, name, ok, slv, sv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _i = $f._i; _i$1 = $f._i$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; clv = $f.clv; context$1 = $f.context$1; ec = $f.ec; funcexpr = $f.funcexpr; name = $f.name; ok = $f.ok; slv = $f.slv; sv = $f.sv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = sline(funcexpr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } context$1.Proto.LineDefined = _r; _r$1 = eline(funcexpr); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } context$1.Proto.LastLineDefined = _r$1; /* */ if (funcexpr.ParList.Names.$length > 200) { $s = 3; continue; } /* */ $s = 4; continue; /* if (funcexpr.ParList.Names.$length > 200) { */ case 3: $r = raiseCompileError(context$1, context$1.Proto.LineDefined, "register overflow", new sliceType$6([])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: context$1.Proto.NumParameters = ((funcexpr.ParList.Names.$length << 24 >>> 24)); /* */ if (ec.ctype === 5) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ec.ctype === 5) { */ case 6: context$1.Proto.NumParameters = context$1.Proto.NumParameters + (1) << 24 >>> 24; _r$2 = context$1.RegisterLocalVar("self"); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; /* } */ case 7: _ref = funcexpr.ParList.Names; _i = 0; /* while (true) { */ case 9: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 10; continue; } name = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$3 = context$1.RegisterLocalVar(name); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; _i++; /* } */ $s = 9; continue; case 10: /* */ if (funcexpr.ParList.HasVargs) { $s = 12; continue; } /* */ $s = 13; continue; /* if (funcexpr.ParList.HasVargs) { */ case 12: /* */ if ($pkg.CompatVarArg) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($pkg.CompatVarArg) { */ case 14: context$1.Proto.IsVarArg = 5; /* */ if (!(context$1.Parent === ptrType$12.nil)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!(context$1.Parent === ptrType$12.nil)) { */ case 16: _r$4 = context$1.RegisterLocalVar("arg"); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; /* } */ case 17: /* } */ case 15: context$1.Proto.IsVarArg = (context$1.Proto.IsVarArg | (2)) >>> 0; /* } */ case 13: $r = compileChunk(context$1, funcexpr.Stmts); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$5 = eline(funcexpr); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = _r$5; $r = context$1.Code.AddABC(33, 0, 1, 0, _arg); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.EndScope(); context$1.Proto.Code = context$1.Code.List(); context$1.Proto.DbgSourcePositions = context$1.Code.PosList(); context$1.Proto.DbgUpvalues = context$1.Upvalues.Names(); context$1.Proto.NumUpvalues = ((context$1.Proto.DbgUpvalues.$length << 24 >>> 24)); _ref$1 = context$1.Proto.Constants; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } clv = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); sv = ""; _tuple = $assertType(clv, LString, true); slv = _tuple[0]; ok = _tuple[1]; if (ok) { sv = (slv); } context$1.Proto.stringConstants = $append(context$1.Proto.stringConstants, sv); _i$1++; } $r = patchCode(context$1); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileFunctionExpr }; } $f._arg = _arg; $f._i = _i; $f._i$1 = _i$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.clv = clv; $f.context$1 = context$1; $f.ec = ec; $f.funcexpr = funcexpr; $f.name = name; $f.ok = ok; $f.slv = slv; $f.sv = sv; $f.$s = $s; $f.$r = $r; return $f; }; compileTableExpr = function(context$1, reg, ex, ec) { var _arg, _arg$1, _arg$10, _arg$11, _arg$12, _arg$13, _arg$14, _arg$15, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _i, _q, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _ref, _tuple, arraycount, b, b$1, c, c$1, code, context$1, ec, ex, field, flush, i, islast, lastvararg, line, num, ok, opcode, reg, regbase, regorg, tablepc, tablereg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$12 = $f._arg$12; _arg$13 = $f._arg$13; _arg$14 = $f._arg$14; _arg$15 = $f._arg$15; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _i = $f._i; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _ref = $f._ref; _tuple = $f._tuple; arraycount = $f.arraycount; b = $f.b; b$1 = $f.b$1; c = $f.c; c$1 = $f.c$1; code = $f.code; context$1 = $f.context$1; ec = $f.ec; ex = $f.ex; field = $f.field; flush = $f.flush; i = $f.i; islast = $f.islast; lastvararg = $f.lastvararg; line = $f.line; num = $f.num; ok = $f.ok; opcode = $f.opcode; reg = $f.reg; regbase = $f.regbase; regorg = $f.regorg; tablepc = $f.tablepc; tablereg = $f.tablereg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = [reg]; code = context$1.Code; tablereg = reg[0]; reg[0] = reg[0] + (1) >> 0; _arg = tablereg; _r = sline(ex); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = code.AddABC(13, _arg, 0, 0, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } tablepc = code.LastPC(); regbase = reg[0]; arraycount = 0; lastvararg = false; _ref = ex.Fields; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } b = [b]; c = [c]; i = _i; field = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); islast = i === (ex.Fields.$length - 1 >> 0); /* */ if ($interfaceIsEqual(field.Key, $ifaceNil)) { $s = 5; continue; } /* */ $s = 6; continue; /* if ($interfaceIsEqual(field.Key, $ifaceNil)) { */ case 5: /* */ if (islast && isVarArgReturnExpr(field.Value)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (islast && isVarArgReturnExpr(field.Value)) { */ case 8: _r$1 = compileExpr(context$1, reg[0], field.Value, ecnone(-2)); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } reg[0] = reg[0] + (_r$1) >> 0; lastvararg = true; $s = 10; continue; /* } else { */ case 9: _r$2 = compileExpr(context$1, reg[0], field.Value, ecnone(0)); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } reg[0] = reg[0] + (_r$2) >> 0; arraycount = arraycount + (1) >> 0; /* } */ case 10: $s = 7; continue; /* } else { */ case 6: regorg = reg[0]; b[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, field.Key, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (b.$ptr || (b.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, field.Value, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (c.$ptr || (c.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } opcode = 11; _tuple = $assertType(field.Key, ptrType$38, true); ok = _tuple[1]; if (ok) { opcode = 12; } _arg$2 = opcode; _arg$3 = tablereg; _arg$4 = b[0]; _arg$5 = c[0]; _r$3 = sline(ex); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$6 = _r$3; $r = code.AddABC(_arg$2, _arg$3, _arg$4, _arg$5, _arg$6); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg[0] = regorg; /* } */ case 7: flush = (_r$4 = arraycount % $pkg.FieldsPerFlush, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); /* */ if ((!((arraycount === 0)) && ((flush === 0) || islast)) || lastvararg) { $s = 17; continue; } /* */ $s = 18; continue; /* if ((!((arraycount === 0)) && ((flush === 0) || islast)) || lastvararg) { */ case 17: reg[0] = regbase; num = flush; if (num === 0) { num = $pkg.FieldsPerFlush; } c$1 = (_q = ((arraycount - 1 >> 0)) / $pkg.FieldsPerFlush, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; b$1 = num; if (islast && isVarArgReturnExpr(field.Value)) { b$1 = 0; } line = field.Value; if (!($interfaceIsEqual(field.Key, $ifaceNil))) { line = field.Key; } if (c$1 > 511) { c$1 = 0; } _arg$7 = tablereg; _arg$8 = b$1; _arg$9 = c$1; _r$5 = sline(line); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$10 = _r$5; $r = code.AddABC(37, _arg$7, _arg$8, _arg$9, _arg$10); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (c$1 === 0) { $s = 21; continue; } /* */ $s = 22; continue; /* if (c$1 === 0) { */ case 21: _arg$11 = ((c$1 >>> 0)); _r$6 = sline(line); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$12 = _r$6; $r = code.Add(_arg$11, _arg$12); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 22: /* } */ case 18: _i++; /* } */ $s = 3; continue; case 4: code.SetB(tablepc, int2Fb(arraycount)); code.SetC(tablepc, int2Fb(ex.Fields.$length - arraycount >> 0)); /* */ if (shouldmove(ec, tablereg)) { $s = 25; continue; } /* */ $s = 26; continue; /* if (shouldmove(ec, tablereg)) { */ case 25: _arg$13 = ec.reg; _arg$14 = tablereg; _r$7 = sline(ex); /* */ $s = 27; case 27: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$15 = _r$7; $r = code.AddABC(0, _arg$13, _arg$14, 0, _arg$15); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 26: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileTableExpr }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$12 = _arg$12; $f._arg$13 = _arg$13; $f._arg$14 = _arg$14; $f._arg$15 = _arg$15; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._i = _i; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._ref = _ref; $f._tuple = _tuple; $f.arraycount = arraycount; $f.b = b; $f.b$1 = b$1; $f.c = c; $f.c$1 = c$1; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.ex = ex; $f.field = field; $f.flush = flush; $f.i = i; $f.islast = islast; $f.lastvararg = lastvararg; $f.line = line; $f.num = num; $f.ok = ok; $f.opcode = opcode; $f.reg = reg; $f.regbase = regbase; $f.regorg = regorg; $f.tablepc = tablepc; $f.tablereg = tablereg; $f.$s = $s; $f.$r = $r; return $f; }; compileArithmeticOpExpr = function(context$1, reg, expr, ec) { var _1, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, a, b, c, context$1, ec, ex, exp, expr, ok, op, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; b = $f.b; c = $f.c; context$1 = $f.context$1; ec = $f.ec; ex = $f.ex; exp = $f.exp; expr = $f.expr; ok = $f.ok; op = $f.op; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; c = [c]; reg = [reg]; _r = constFold(expr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } exp = _r; _tuple = $assertType(exp, ptrType$16, true); ex = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: _r$1 = sline(expr); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = exp.SetLine(_r$1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = compileExpr(context$1, reg[0], ex, ec); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return; /* } */ case 3: _tuple$1 = $assertType(exp, ptrType$47, true); expr = _tuple$1[0]; a = savereg(ec, reg[0]); b[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, expr.Lhs, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (b.$ptr || (b.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, expr.Rhs, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (c.$ptr || (c.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } op = 0; _1 = expr.Operator; if (_1 === ("+")) { op = 15; } else if (_1 === ("-")) { op = 16; } else if (_1 === ("*")) { op = 17; } else if (_1 === ("/")) { op = 18; } else if (_1 === ("%")) { op = 19; } else if (_1 === ("^")) { op = 20; } _arg = op; _arg$1 = a; _arg$2 = b[0]; _arg$3 = c[0]; _r$3 = sline(expr); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$4 = _r$3; $r = context$1.Code.AddABC(_arg, _arg$1, _arg$2, _arg$3, _arg$4); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileArithmeticOpExpr }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.b = b; $f.c = c; $f.context$1 = context$1; $f.ec = ec; $f.ex = ex; $f.exp = exp; $f.expr = expr; $f.ok = ok; $f.op = op; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }; compileStringConcatOpExpr = function(context$1, reg, expr, ec) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _tuple, a, basereg, code, context$1, crange, current, ec, ex, expr, ok, pc, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; a = $f.a; basereg = $f.basereg; code = $f.code; context$1 = $f.context$1; crange = $f.crange; current = $f.current; ec = $f.ec; ex = $f.ex; expr = $f.expr; ok = $f.ok; pc = $f.pc; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = context$1.Code; crange = 1; current = expr.Rhs; while (true) { if (!(!($interfaceIsEqual(current, $ifaceNil)))) { break; } _tuple = $assertType(current, ptrType$48, true); ex = _tuple[0]; ok = _tuple[1]; if (ok) { crange = crange + (1) >> 0; current = ex.Rhs; } else { current = $ifaceNil; } } a = savereg(ec, reg); basereg = reg; _r = compileExpr(context$1, reg, expr.Lhs, ecnone(0)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } reg = reg + (_r) >> 0; _r$1 = compileExpr(context$1, reg, expr.Rhs, ecnone(0)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } reg = reg + (_r$1) >> 0; pc = code.LastPC(); while (true) { if (!(!((pc === 0)) && (opGetOpCode(code.At(pc)) === 24))) { break; } code.Pop(); pc = pc - (1) >> 0; } _arg = a; _arg$1 = basereg; _arg$2 = basereg + crange >> 0; _r$2 = sline(expr); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$3 = _r$2; $r = code.AddABC(24, _arg, _arg$1, _arg$2, _arg$3); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileStringConcatOpExpr }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.a = a; $f.basereg = basereg; $f.code = code; $f.context$1 = context$1; $f.crange = crange; $f.current = current; $f.ec = ec; $f.ex = ex; $f.expr = expr; $f.ok = ok; $f.pc = pc; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }; compileUnaryOpExpr = function(context$1, reg, expr, ec) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _ref, _ref$1, _tuple, _tuple$1, a, b, code, context$1, ec, ex, ex$1, ex$2, exp, expr, lvexpr, ok, opcode, operandexpr, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; a = $f.a; b = $f.b; code = $f.code; context$1 = $f.context$1; ec = $f.ec; ex = $f.ex; ex$1 = $f.ex$1; ex$2 = $f.ex$2; exp = $f.exp; expr = $f.expr; lvexpr = $f.lvexpr; ok = $f.ok; opcode = $f.opcode; operandexpr = $f.operandexpr; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; reg = [reg]; opcode = 0; code = context$1.Code; operandexpr = $ifaceNil; _ref = expr; /* */ if ($assertType(_ref, ptrType$49, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$44, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$50, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$49, true)[1]) { */ case 1: ex = _ref.$val; _r = constFold(ex); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } exp = _r; _tuple = $assertType(exp, ptrType$16, true); lvexpr = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok) { */ case 6: _r$1 = sline(expr); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = exp.SetLine(_r$1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = compileExpr(context$1, reg[0], lvexpr, ec); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; $s = -1; return; /* } */ case 7: _tuple$1 = $assertType(exp, ptrType$49, true); ex = _tuple$1[0]; operandexpr = ex.Expr; opcode = 21; $s = 4; continue; /* } else if ($assertType(_ref, ptrType$44, true)[1]) { */ case 2: ex$1 = _ref.$val; _ref$1 = ex$1.Expr; /* */ if ($assertType(_ref$1, ptrType$43, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref$1, ptrType$41, true)[1] || $assertType(_ref$1, ptrType$42, true)[1]) { $s = 12; continue; } /* */ $s = 13; continue; /* if ($assertType(_ref$1, ptrType$43, true)[1]) { */ case 11: _arg = savereg(ec, reg[0]); _r$3 = sline(expr); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = _r$3; $r = code.AddABC(3, _arg, 0, 0, _arg$1); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else if ($assertType(_ref$1, ptrType$41, true)[1] || $assertType(_ref$1, ptrType$42, true)[1]) { */ case 12: _arg$2 = savereg(ec, reg[0]); _r$4 = sline(expr); /* */ $s = 17; case 17: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$3 = _r$4; $r = code.AddABC(3, _arg$2, 1, 0, _arg$3); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else { */ case 13: opcode = 22; operandexpr = ex$1.Expr; /* } */ case 14: $s = 4; continue; /* } else if ($assertType(_ref, ptrType$50, true)[1]) { */ case 3: ex$2 = _ref.$val; opcode = 23; operandexpr = ex$2.Expr; /* } */ case 4: a = savereg(ec, reg[0]); b[0] = reg[0]; $r = compileExprWithMVPropagation(context$1, operandexpr, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (b.$ptr || (b.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg$4 = opcode; _arg$5 = a; _arg$6 = b[0]; _r$5 = sline(expr); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$7 = _r$5; $r = code.AddABC(_arg$4, _arg$5, _arg$6, 0, _arg$7); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileUnaryOpExpr }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.a = a; $f.b = b; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.ex = ex; $f.ex$1 = ex$1; $f.ex$2 = ex$2; $f.exp = exp; $f.expr = expr; $f.lvexpr = lvexpr; $f.ok = ok; $f.opcode = opcode; $f.operandexpr = operandexpr; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }; compileRelationalOpExprAux = function(context$1, reg, expr, flip, label) { var _1, _arg, _arg$1, _arg$10, _arg$11, _arg$12, _arg$13, _arg$14, _arg$15, _arg$16, _arg$17, _arg$18, _arg$19, _arg$2, _arg$20, _arg$21, _arg$22, _arg$23, _arg$24, _arg$25, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, b, c, code, context$1, expr, flip, label, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$12 = $f._arg$12; _arg$13 = $f._arg$13; _arg$14 = $f._arg$14; _arg$15 = $f._arg$15; _arg$16 = $f._arg$16; _arg$17 = $f._arg$17; _arg$18 = $f._arg$18; _arg$19 = $f._arg$19; _arg$2 = $f._arg$2; _arg$20 = $f._arg$20; _arg$21 = $f._arg$21; _arg$22 = $f._arg$22; _arg$23 = $f._arg$23; _arg$24 = $f._arg$24; _arg$25 = $f._arg$25; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; b = $f.b; c = $f.c; code = $f.code; context$1 = $f.context$1; expr = $f.expr; flip = $f.flip; label = $f.label; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; c = [c]; reg = [reg]; code = context$1.Code; b[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, expr.Lhs, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (b.$ptr || (b.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } c[0] = reg[0]; $r = compileExprWithKMVPropagation(context$1, expr.Rhs, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (c.$ptr || (c.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c)))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _1 = expr.Operator; /* */ if (_1 === ("<")) { $s = 4; continue; } /* */ if (_1 === (">")) { $s = 5; continue; } /* */ if (_1 === ("<=")) { $s = 6; continue; } /* */ if (_1 === (">=")) { $s = 7; continue; } /* */ if (_1 === ("==")) { $s = 8; continue; } /* */ if (_1 === ("~=")) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_1 === ("<")) { */ case 4: _arg = (0 ^ flip) >> 0; _arg$1 = b[0]; _arg$2 = c[0]; _r = sline(expr); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$3 = _r; $r = code.AddABC(27, _arg, _arg$1, _arg$2, _arg$3); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else if (_1 === (">")) { */ case 5: _arg$4 = (0 ^ flip) >> 0; _arg$5 = c[0]; _arg$6 = b[0]; _r$1 = sline(expr); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$7 = _r$1; $r = code.AddABC(27, _arg$4, _arg$5, _arg$6, _arg$7); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else if (_1 === ("<=")) { */ case 6: _arg$8 = (0 ^ flip) >> 0; _arg$9 = b[0]; _arg$10 = c[0]; _r$2 = sline(expr); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$11 = _r$2; $r = code.AddABC(28, _arg$8, _arg$9, _arg$10, _arg$11); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else if (_1 === (">=")) { */ case 7: _arg$12 = (0 ^ flip) >> 0; _arg$13 = c[0]; _arg$14 = b[0]; _r$3 = sline(expr); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$15 = _r$3; $r = code.AddABC(28, _arg$12, _arg$13, _arg$14, _arg$15); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else if (_1 === ("==")) { */ case 8: _arg$16 = (0 ^ flip) >> 0; _arg$17 = b[0]; _arg$18 = c[0]; _r$4 = sline(expr); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$19 = _r$4; $r = code.AddABC(26, _arg$16, _arg$17, _arg$18, _arg$19); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else if (_1 === ("~=")) { */ case 9: _arg$20 = (1 ^ flip) >> 0; _arg$21 = b[0]; _arg$22 = c[0]; _r$5 = sline(expr); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$23 = _r$5; $r = code.AddABC(26, _arg$20, _arg$21, _arg$22, _arg$23); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: case 3: _arg$24 = label; _r$6 = sline(expr); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$25 = _r$6; $r = code.AddASbx(25, 0, _arg$24, _arg$25); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileRelationalOpExprAux }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$12 = _arg$12; $f._arg$13 = _arg$13; $f._arg$14 = _arg$14; $f._arg$15 = _arg$15; $f._arg$16 = _arg$16; $f._arg$17 = _arg$17; $f._arg$18 = _arg$18; $f._arg$19 = _arg$19; $f._arg$2 = _arg$2; $f._arg$20 = _arg$20; $f._arg$21 = _arg$21; $f._arg$22 = _arg$22; $f._arg$23 = _arg$23; $f._arg$24 = _arg$24; $f._arg$25 = _arg$25; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.b = b; $f.c = c; $f.code = code; $f.context$1 = context$1; $f.expr = expr; $f.flip = flip; $f.label = label; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }; compileRelationalOpExpr = function(context$1, reg, expr, ec) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, a, code, context$1, ec, expr, jumplabel, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; a = $f.a; code = $f.code; context$1 = $f.context$1; ec = $f.ec; expr = $f.expr; jumplabel = $f.jumplabel; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = savereg(ec, reg); code = context$1.Code; jumplabel = context$1.NewLabel(); $r = compileRelationalOpExprAux(context$1, reg, expr, 1, jumplabel); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg = a; _r = sline(expr); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = code.AddABC(3, _arg, 0, 1, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(jumplabel, code.LastPC()); _arg$2 = a; _r$1 = sline(expr); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$3 = _r$1; $r = code.AddABC(3, _arg$2, 1, 0, _arg$3); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileRelationalOpExpr }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.expr = expr; $f.jumplabel = jumplabel; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }; compileLogicalOpExpr = function(context$1, reg, expr, ec) { var _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, a, code, context$1, ec, endlabel, expr, lastinst, lb, nextcondlabel, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; a = $f.a; code = $f.code; context$1 = $f.context$1; ec = $f.ec; endlabel = $f.endlabel; expr = $f.expr; lastinst = $f.lastinst; lb = $f.lb; nextcondlabel = $f.nextcondlabel; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: a = savereg(ec, reg); code = context$1.Code; endlabel = context$1.NewLabel(); lb = new lblabels.ptr(context$1.NewLabel(), context$1.NewLabel(), endlabel, false); nextcondlabel = context$1.NewLabel(); /* */ if (expr.Operator === "and") { $s = 1; continue; } /* */ $s = 2; continue; /* if (expr.Operator === "and") { */ case 1: $r = compileLogicalOpExprAux(context$1, reg, expr.Lhs, ec, nextcondlabel, endlabel, false, lb); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(nextcondlabel, code.LastPC()); $r = compileLogicalOpExprAux(context$1, reg, expr.Rhs, ec, endlabel, endlabel, false, lb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else { */ case 2: $r = compileLogicalOpExprAux(context$1, reg, expr.Lhs, ec, endlabel, nextcondlabel, true, lb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(nextcondlabel, code.LastPC()); $r = compileLogicalOpExprAux(context$1, reg, expr.Rhs, ec, endlabel, endlabel, false, lb); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: /* */ if (lb.b) { $s = 8; continue; } /* */ $s = 9; continue; /* if (lb.b) { */ case 8: context$1.SetLabelPc(lb.f, code.LastPC()); _arg = a; _r = sline(expr); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = code.AddABC(3, _arg, 0, 1, _arg$1); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(lb.t, code.LastPC()); _arg$2 = a; _r$1 = sline(expr); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$3 = _r$1; $r = code.AddABC(3, _arg$2, 1, 0, _arg$3); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 9: lastinst = code.Last(); if ((opGetOpCode(lastinst) === 25) && (opGetArgSbx(lastinst) === endlabel)) { code.Pop(); } context$1.SetLabelPc(endlabel, code.LastPC()); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileLogicalOpExpr }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.endlabel = endlabel; $f.expr = expr; $f.lastinst = lastinst; $f.lb = lb; $f.nextcondlabel = nextcondlabel; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }; compileLogicalOpExprAux = function(context$1, reg, expr, ec, thenlabel, elselabel, hasnextcond, lb) { var _1, _arg, _arg$1, _arg$10, _arg$11, _arg$12, _arg$13, _arg$14, _arg$15, _arg$16, _arg$17, _arg$18, _arg$19, _arg$2, _arg$20, _arg$21, _arg$22, _arg$23, _arg$24, _arg$25, _arg$26, _arg$27, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, a, code, context$1, ec, elselabel, ex, ex$1, ex$2, ex$3, ex$4, ex$5, expr, flip, hasnextcond, jumplabel, last, lb, nextcondlabel, nextcondlabel$1, reg, sreg, thenlabel, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$11 = $f._arg$11; _arg$12 = $f._arg$12; _arg$13 = $f._arg$13; _arg$14 = $f._arg$14; _arg$15 = $f._arg$15; _arg$16 = $f._arg$16; _arg$17 = $f._arg$17; _arg$18 = $f._arg$18; _arg$19 = $f._arg$19; _arg$2 = $f._arg$2; _arg$20 = $f._arg$20; _arg$21 = $f._arg$21; _arg$22 = $f._arg$22; _arg$23 = $f._arg$23; _arg$24 = $f._arg$24; _arg$25 = $f._arg$25; _arg$26 = $f._arg$26; _arg$27 = $f._arg$27; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; a = $f.a; code = $f.code; context$1 = $f.context$1; ec = $f.ec; elselabel = $f.elselabel; ex = $f.ex; ex$1 = $f.ex$1; ex$2 = $f.ex$2; ex$3 = $f.ex$3; ex$4 = $f.ex$4; ex$5 = $f.ex$5; expr = $f.expr; flip = $f.flip; hasnextcond = $f.hasnextcond; jumplabel = $f.jumplabel; last = $f.last; lb = $f.lb; nextcondlabel = $f.nextcondlabel; nextcondlabel$1 = $f.nextcondlabel$1; reg = $f.reg; sreg = $f.sreg; thenlabel = $f.thenlabel; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: code = context$1.Code; flip = 0; jumplabel = elselabel; if (hasnextcond) { flip = 1; jumplabel = thenlabel; } _ref = expr; /* */ if ($assertType(_ref, ptrType$41, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$42, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, ptrType$43, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, ptrType$15, true)[1] || $assertType(_ref, ptrType$38, true)[1]) { $s = 4; continue; } /* */ if ($assertType(_ref, ptrType$39, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, ptrType$45, true)[1]) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($assertType(_ref, ptrType$41, true)[1]) { */ case 1: ex = _ref.$val; /* */ if (elselabel === lb.e) { $s = 8; continue; } /* */ $s = 9; continue; /* if (elselabel === lb.e) { */ case 8: _arg = lb.f; _r = sline(expr); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = code.AddASbx(25, 0, _arg, _arg$1); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } lb.b = true; $s = 10; continue; /* } else { */ case 9: _arg$2 = elselabel; _r$1 = sline(expr); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$3 = _r$1; $r = code.AddASbx(25, 0, _arg$2, _arg$3); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: $s = -1; return; /* } else if ($assertType(_ref, ptrType$42, true)[1]) { */ case 2: ex$1 = _ref.$val; /* */ if (elselabel === lb.e) { $s = 15; continue; } /* */ $s = 16; continue; /* if (elselabel === lb.e) { */ case 15: _r$2 = compileExpr(context$1, reg, expr, ec); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$2; _arg$4 = lb.e; _r$3 = sline(expr); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$5 = _r$3; $r = code.AddASbx(25, 0, _arg$4, _arg$5); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 17; continue; /* } else { */ case 16: _arg$6 = elselabel; _r$4 = sline(expr); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$7 = _r$4; $r = code.AddASbx(25, 0, _arg$6, _arg$7); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 17: $s = -1; return; /* } else if ($assertType(_ref, ptrType$43, true)[1]) { */ case 3: ex$2 = _ref.$val; /* */ if (thenlabel === lb.e) { $s = 23; continue; } /* */ $s = 24; continue; /* if (thenlabel === lb.e) { */ case 23: _arg$8 = lb.t; _r$5 = sline(expr); /* */ $s = 26; case 26: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$9 = _r$5; $r = code.AddASbx(25, 0, _arg$8, _arg$9); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } lb.b = true; $s = 25; continue; /* } else { */ case 24: _arg$10 = thenlabel; _r$6 = sline(expr); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$11 = _r$6; $r = code.AddASbx(25, 0, _arg$10, _arg$11); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 25: $s = -1; return; /* } else if ($assertType(_ref, ptrType$15, true)[1] || $assertType(_ref, ptrType$38, true)[1]) { */ case 4: ex$3 = _ref; /* */ if (thenlabel === lb.e) { $s = 30; continue; } /* */ $s = 31; continue; /* if (thenlabel === lb.e) { */ case 30: _r$7 = compileExpr(context$1, reg, expr, ec); /* */ $s = 33; case 33: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$7; _arg$12 = lb.e; _r$8 = sline(expr); /* */ $s = 34; case 34: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$13 = _r$8; $r = code.AddASbx(25, 0, _arg$12, _arg$13); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 32; continue; /* } else { */ case 31: _arg$14 = thenlabel; _r$9 = sline(expr); /* */ $s = 36; case 36: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$15 = _r$9; $r = code.AddASbx(25, 0, _arg$14, _arg$15); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 32: $s = -1; return; /* } else if ($assertType(_ref, ptrType$39, true)[1]) { */ case 5: ex$4 = _ref.$val; _1 = ex$4.Operator; /* */ if (_1 === ("and")) { $s = 39; continue; } /* */ if (_1 === ("or")) { $s = 40; continue; } /* */ $s = 41; continue; /* if (_1 === ("and")) { */ case 39: nextcondlabel = context$1.NewLabel(); $r = compileLogicalOpExprAux(context$1, reg, ex$4.Lhs, ec, nextcondlabel, elselabel, false, lb); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(nextcondlabel, context$1.Code.LastPC()); $r = compileLogicalOpExprAux(context$1, reg, ex$4.Rhs, ec, thenlabel, elselabel, hasnextcond, lb); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 41; continue; /* } else if (_1 === ("or")) { */ case 40: nextcondlabel$1 = context$1.NewLabel(); $r = compileLogicalOpExprAux(context$1, reg, ex$4.Lhs, ec, thenlabel, nextcondlabel$1, true, lb); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.SetLabelPc(nextcondlabel$1, context$1.Code.LastPC()); $r = compileLogicalOpExprAux(context$1, reg, ex$4.Rhs, ec, thenlabel, elselabel, hasnextcond, lb); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 41: case 38: $s = -1; return; /* } else if ($assertType(_ref, ptrType$45, true)[1]) { */ case 6: ex$5 = _ref.$val; if (thenlabel === elselabel) { flip = (flip ^ (1)) >> 0; jumplabel = lb.t; lb.b = true; } else if (thenlabel === lb.e) { jumplabel = lb.t; lb.b = true; } else if (elselabel === lb.e) { jumplabel = lb.f; lb.b = true; } $r = compileRelationalOpExprAux(context$1, reg, ex$5, flip, jumplabel); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 7: a = reg; sreg = savereg(ec, a); /* */ if (!hasnextcond && (thenlabel === elselabel)) { $s = 47; continue; } /* */ $s = 48; continue; /* if (!hasnextcond && (thenlabel === elselabel)) { */ case 47: _r$10 = compileExpr(context$1, reg, expr, new expcontext.ptr(ec.ctype, intMax(a, sreg), ec.varargopt)); /* */ $s = 50; case 50: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } reg = reg + (_r$10) >> 0; last = context$1.Code.Last(); /* */ if ((opGetOpCode(last) === 0) && (opGetArgA(last) === a)) { $s = 51; continue; } /* */ $s = 52; continue; /* if ((opGetOpCode(last) === 0) && (opGetArgA(last) === a)) { */ case 51: context$1.Code.SetA(context$1.Code.LastPC(), sreg); $s = 53; continue; /* } else { */ case 52: _arg$16 = sreg; _arg$17 = a; _r$11 = sline(expr); /* */ $s = 54; case 54: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$18 = _r$11; $r = context$1.Code.AddABC(0, _arg$16, _arg$17, 0, _arg$18); /* */ $s = 55; case 55: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 53: $s = 49; continue; /* } else { */ case 48: _r$12 = compileExpr(context$1, reg, expr, ecnone(0)); /* */ $s = 56; case 56: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } reg = reg + (_r$12) >> 0; /* */ if (sreg === a) { $s = 57; continue; } /* */ $s = 58; continue; /* if (sreg === a) { */ case 57: _arg$19 = a; _arg$20 = (0 ^ flip) >> 0; _r$13 = sline(expr); /* */ $s = 60; case 60: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _arg$21 = _r$13; $r = code.AddABC(29, _arg$19, 0, _arg$20, _arg$21); /* */ $s = 61; case 61: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 59; continue; /* } else { */ case 58: _arg$22 = sreg; _arg$23 = a; _arg$24 = (0 ^ flip) >> 0; _r$14 = sline(expr); /* */ $s = 62; case 62: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } _arg$25 = _r$14; $r = code.AddABC(30, _arg$22, _arg$23, _arg$24, _arg$25); /* */ $s = 63; case 63: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 59: /* } */ case 49: _arg$26 = jumplabel; _r$15 = sline(expr); /* */ $s = 64; case 64: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } _arg$27 = _r$15; $r = code.AddASbx(25, 0, _arg$26, _arg$27); /* */ $s = 65; case 65: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: compileLogicalOpExprAux }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$11 = _arg$11; $f._arg$12 = _arg$12; $f._arg$13 = _arg$13; $f._arg$14 = _arg$14; $f._arg$15 = _arg$15; $f._arg$16 = _arg$16; $f._arg$17 = _arg$17; $f._arg$18 = _arg$18; $f._arg$19 = _arg$19; $f._arg$2 = _arg$2; $f._arg$20 = _arg$20; $f._arg$21 = _arg$21; $f._arg$22 = _arg$22; $f._arg$23 = _arg$23; $f._arg$24 = _arg$24; $f._arg$25 = _arg$25; $f._arg$26 = _arg$26; $f._arg$27 = _arg$27; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f.a = a; $f.code = code; $f.context$1 = context$1; $f.ec = ec; $f.elselabel = elselabel; $f.ex = ex; $f.ex$1 = ex$1; $f.ex$2 = ex$2; $f.ex$3 = ex$3; $f.ex$4 = ex$4; $f.ex$5 = ex$5; $f.expr = expr; $f.flip = flip; $f.hasnextcond = hasnextcond; $f.jumplabel = jumplabel; $f.last = last; $f.lb = lb; $f.nextcondlabel = nextcondlabel; $f.nextcondlabel$1 = nextcondlabel$1; $f.reg = reg; $f.sreg = sreg; $f.thenlabel = thenlabel; $f.$s = $s; $f.$r = $r; return $f; }; compileFuncCallExpr = function(context$1, reg, expr, ec) { var _arg, _arg$1, _arg$10, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _arg$7, _arg$8, _arg$9, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, ar, argc, b, b$1, c, context$1, ec, expr, funcreg, i, islastvararg, name, reg, reg2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$10 = $f._arg$10; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _arg$7 = $f._arg$7; _arg$8 = $f._arg$8; _arg$9 = $f._arg$9; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; ar = $f.ar; argc = $f.argc; b = $f.b; b$1 = $f.b$1; c = $f.c; context$1 = $f.context$1; ec = $f.ec; expr = $f.expr; funcreg = $f.funcreg; i = $f.i; islastvararg = $f.islastvararg; name = $f.name; reg = $f.reg; reg2 = $f.reg2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: b = [b]; reg = [reg]; funcreg = reg[0]; if ((ec.ctype === 2) && (ec.reg === ((((context$1.Proto.NumParameters >> 0)) - 1 >> 0)))) { funcreg = ec.reg; reg[0] = ec.reg; } argc = expr.Args.$length; islastvararg = false; name = "(anonymous)"; /* */ if (!($interfaceIsEqual(expr.Func, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(expr.Func, $ifaceNil))) { */ case 1: _r = compileExpr(context$1, reg[0], expr.Func, ecnone(0)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } reg[0] = reg[0] + (_r) >> 0; name = getExprName(context$1, expr.Func); $s = 3; continue; /* } else { */ case 2: b[0] = reg[0]; $r = compileExprWithMVPropagation(context$1, expr.Receiver, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), (b.$ptr || (b.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, b)))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = loadRk(context$1, (reg.$ptr || (reg.$ptr = new ptrType$37(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, reg))), expr, new LString((expr.Method))); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } c = _r$1; _arg = funcreg; _arg$1 = b[0]; _arg$2 = c; _r$2 = sline(expr); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$3 = _r$2; $r = context$1.Code.AddABC(14, _arg, _arg$1, _arg$2, _arg$3); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg[0] = b[0] + 1 >> 0; reg2 = funcreg + 2 >> 0; if (reg2 > reg[0]) { reg[0] = reg2; } argc = argc + (1) >> 0; name = (expr.Method); /* } */ case 3: _ref = expr.Args; _i = 0; /* while (true) { */ case 9: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 10; continue; } i = _i; ar = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); islastvararg = ((i === (expr.Args.$length - 1 >> 0))) && isVarArgReturnExpr(ar); /* */ if (islastvararg) { $s = 11; continue; } /* */ $s = 12; continue; /* if (islastvararg) { */ case 11: _r$3 = compileExpr(context$1, reg[0], ar, ecnone(-2)); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = 13; continue; /* } else { */ case 12: _r$4 = compileExpr(context$1, reg[0], ar, ecnone(0)); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } reg[0] = reg[0] + (_r$4) >> 0; /* } */ case 13: _i++; /* } */ $s = 9; continue; case 10: b$1 = argc + 1 >> 0; if (islastvararg) { b$1 = 0; } _arg$4 = funcreg; _arg$5 = b$1; _arg$6 = ec.varargopt + 2 >> 0; _r$5 = sline(expr); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$7 = _r$5; $r = context$1.Code.AddABC(31, _arg$4, _arg$5, _arg$6, _arg$7); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } context$1.Proto.DbgCalls = $append(context$1.Proto.DbgCalls, new DbgCall.ptr(name, context$1.Code.LastPC())); /* */ if ((ec.varargopt === 0) && shouldmove(ec, funcreg)) { $s = 18; continue; } /* */ $s = 19; continue; /* if ((ec.varargopt === 0) && shouldmove(ec, funcreg)) { */ case 18: _arg$8 = ec.reg; _arg$9 = funcreg; _r$6 = sline(expr); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$10 = _r$6; $r = context$1.Code.AddABC(0, _arg$8, _arg$9, 0, _arg$10); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* } */ case 19: if (context$1.RegTop() > (((funcreg + 2 >> 0) + ec.varargopt >> 0)) || ec.varargopt < -1) { $s = -1; return 0; } $s = -1; return ec.varargopt + 1 >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: compileFuncCallExpr }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$10 = _arg$10; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._arg$7 = _arg$7; $f._arg$8 = _arg$8; $f._arg$9 = _arg$9; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f.ar = ar; $f.argc = argc; $f.b = b; $f.b$1 = b$1; $f.c = c; $f.context$1 = context$1; $f.ec = ec; $f.expr = expr; $f.funcreg = funcreg; $f.i = i; $f.islastvararg = islastvararg; $f.name = name; $f.reg = reg; $f.reg2 = reg2; $f.$s = $s; $f.$r = $r; return $f; }; loadRk = function(context$1, reg, expr, cnst) { var _arg, _arg$1, _arg$2, _r, _r$1, cindex, cnst, context$1, expr, reg, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; cindex = $f.cindex; cnst = $f.cnst; context$1 = $f.context$1; expr = $f.expr; reg = $f.reg; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = context$1.ConstIndex(cnst); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } cindex = _r; /* */ if (cindex <= 255) { $s = 2; continue; } /* */ $s = 3; continue; /* if (cindex <= 255) { */ case 2: $s = -1; return opRkAsk(cindex); /* } else { */ case 3: ret = reg.$get(); reg.$set(reg.$get() + (1) >> 0); _arg = ret; _arg$1 = cindex; _r$1 = sline(expr); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$2 = _r$1; $r = context$1.Code.AddABx(2, _arg, _arg$1, _arg$2); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ret; /* } */ case 4: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: loadRk }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.cindex = cindex; $f.cnst = cnst; $f.context$1 = context$1; $f.expr = expr; $f.reg = reg; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }; getIdentRefType = function(context$1, current, expr) { var context$1, current, expr; if (current === ptrType$12.nil) { return 0; } else if (current.FindLocalVar(expr.Value) > -1) { if (current === context$1) { return 2; } return 1; } return getIdentRefType(context$1, current.Parent, expr); }; getExprName = function(context$1, expr) { var _ref, _ref$1, context$1, ex, ex$1, expr, kex; _ref = expr; if ($assertType(_ref, ptrType$35, true)[1]) { ex = _ref.$val; return ex.Value; } else if ($assertType(_ref, ptrType$36, true)[1]) { ex$1 = _ref.$val; _ref$1 = ex$1.Key; if ($assertType(_ref$1, ptrType$38, true)[1]) { kex = _ref$1.$val; return kex.Value; } return "?"; } return "?"; }; patchCode = function(context$1) { var _1, code, context$1, count, curop, d, distance, inst, jmp, maxreg, moven, np, pc, reg, reg$1, reg$2, reg$3, reg$4, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; code = $f.code; context$1 = $f.context$1; count = $f.count; curop = $f.curop; d = $f.d; distance = $f.distance; inst = $f.inst; jmp = $f.jmp; maxreg = $f.maxreg; moven = $f.moven; np = $f.np; pc = $f.pc; reg = $f.reg; reg$1 = $f.reg$1; reg$2 = $f.reg$2; reg$3 = $f.reg$3; reg$4 = $f.reg$4; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: maxreg = 1; np = ((context$1.Proto.NumParameters >> 0)); if (np > 1) { maxreg = np; } moven = 0; code = context$1.Code.List(); pc = 0; /* while (true) { */ case 1: /* if (!(pc < code.$length)) { break; } */ if(!(pc < code.$length)) { $s = 2; continue; } inst = ((pc < 0 || pc >= code.$length) ? ($throwRuntimeError("index out of range"), undefined) : code.$array[code.$offset + pc]); curop = opGetOpCode(inst); _1 = curop; /* */ if (_1 === (39)) { $s = 4; continue; } /* */ if ((_1 === (9)) || (_1 === (10)) || (_1 === (26)) || (_1 === (27)) || (_1 === (28)) || (_1 === (29)) || (_1 === (32)) || (_1 === (33)) || (_1 === (35)) || (_1 === (34)) || (_1 === (36)) || (_1 === (37)) || (_1 === (38))) { $s = 5; continue; } /* */ if (_1 === (31)) { $s = 6; continue; } /* */ if (_1 === (40)) { $s = 7; continue; } /* */ if (_1 === (14)) { $s = 8; continue; } /* */ if (_1 === (4)) { $s = 9; continue; } /* */ if (_1 === (25)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_1 === (39)) { */ case 4: pc = pc + ((((x = context$1.Proto.FunctionPrototypes, x$1 = opGetArgBx(inst), ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])).NumUpvalues >> 0))) >> 0; moven = 0; pc = pc + (1) >> 0; /* continue; */ $s = 1; continue; $s = 12; continue; /* } else if ((_1 === (9)) || (_1 === (10)) || (_1 === (26)) || (_1 === (27)) || (_1 === (28)) || (_1 === (29)) || (_1 === (32)) || (_1 === (33)) || (_1 === (35)) || (_1 === (34)) || (_1 === (36)) || (_1 === (37)) || (_1 === (38))) { */ case 5: $s = 12; continue; /* } else if (_1 === (31)) { */ case 6: reg = (opGetArgA(inst) + opGetArgC(inst) >> 0) - 2 >> 0; if (reg > maxreg) { maxreg = reg; } $s = 12; continue; /* } else if (_1 === (40)) { */ case 7: reg$1 = (opGetArgA(inst) + opGetArgB(inst) >> 0) - 1 >> 0; if (reg$1 > maxreg) { maxreg = reg$1; } $s = 12; continue; /* } else if (_1 === (14)) { */ case 8: reg$2 = opGetArgA(inst) + 1 >> 0; if (reg$2 > maxreg) { maxreg = reg$2; } $s = 12; continue; /* } else if (_1 === (4)) { */ case 9: reg$3 = opGetArgB(inst); if (reg$3 > maxreg) { maxreg = reg$3; } $s = 12; continue; /* } else if (_1 === (25)) { */ case 10: distance = 0; count = 0; jmp = inst; /* while (true) { */ case 13: /* if (!((opGetOpCode(jmp) === 25) && count < 5)) { break; } */ if(!((opGetOpCode(jmp) === 25) && count < 5)) { $s = 14; continue; } d = context$1.GetLabelPc(opGetArgSbx(jmp)) - pc >> 0; /* */ if (d > 131071) { $s = 15; continue; } /* */ $s = 16; continue; /* if (d > 131071) { */ case 15: /* */ if (distance === 0) { $s = 17; continue; } /* */ $s = 18; continue; /* if (distance === 0) { */ case 17: $r = raiseCompileError(context$1, context$1.Proto.LineDefined, "too long to jump.", new sliceType$6([])); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 18: /* break; */ $s = 14; continue; /* } */ case 16: distance = d; count = count + (1) >> 0; jmp = context$1.Code.At((pc + distance >> 0) + 1 >> 0); /* } */ $s = 13; continue; case 14: if (distance === 0) { context$1.Code.SetOpCode(pc, 41); } else { context$1.Code.SetSbx(pc, distance); } $s = 12; continue; /* } else { */ case 11: reg$4 = opGetArgA(inst); if (reg$4 > maxreg) { maxreg = reg$4; } /* } */ case 12: case 3: if (curop === 0) { moven = moven + (1) >> 0; } else { if (moven > 1) { context$1.Code.SetOpCode(pc - moven >> 0, 1); context$1.Code.SetC(pc - moven >> 0, intMin(moven - 1 >> 0, 511)); } moven = 0; } pc = pc + (1) >> 0; /* } */ $s = 1; continue; case 2: maxreg = maxreg + (1) >> 0; /* */ if (maxreg > 200) { $s = 20; continue; } /* */ $s = 21; continue; /* if (maxreg > 200) { */ case 20: $r = raiseCompileError(context$1, context$1.Proto.LineDefined, "register overflow(too many local variables)", new sliceType$6([])); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 21: context$1.Proto.NumUsedRegisters = ((maxreg << 24 >>> 24)); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: patchCode }; } $f._1 = _1; $f.code = code; $f.context$1 = context$1; $f.count = count; $f.curop = curop; $f.d = d; $f.distance = distance; $f.inst = inst; $f.jmp = jmp; $f.maxreg = maxreg; $f.moven = moven; $f.np = np; $f.pc = pc; $f.reg = reg; $f.reg$1 = reg$1; $f.reg$2 = reg$2; $f.reg$3 = reg$3; $f.reg$4 = reg$4; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; Compile = function(chunk, name) { var _r, chunk, context$1, err, funcexpr, name, parlist, proto, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; chunk = $f.chunk; context$1 = $f.context$1; err = $f.err; funcexpr = $f.funcexpr; name = $f.name; parlist = $f.parlist; proto = $f.proto; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); err = [err]; proto = ptrType$18.nil; err[0] = $ifaceNil; $deferred.push([(function(err) { return function() { var _tuple, ok, rcv; rcv = $recover(); if (!($interfaceIsEqual(rcv, $ifaceNil))) { _tuple = $assertType(rcv, ptrType$51, true); ok = _tuple[1]; if (ok) { err[0] = $assertType(rcv, $error); } else { $panic(rcv); } } }; })(err), []]); err[0] = $ifaceNil; parlist = new ast.ParList.ptr(true, new sliceType$1([])); funcexpr = new ast.FunctionExpr.ptr(new ast.ExprBase.ptr(new ast.Node.ptr(0, 0)), parlist, chunk); _r = newFuncContext(name, ptrType$12.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } context$1 = _r; $r = compileFunctionExpr(context$1, funcexpr, ecnone(0)); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } proto = context$1.Proto; $s = -1; return [proto, err[0]]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [proto, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Compile }; } $f._r = _r; $f.chunk = chunk; $f.context$1 = context$1; $f.err = err; $f.funcexpr = funcexpr; $f.name = name; $f.parlist = parlist; $f.proto = proto; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; $pkg.Compile = Compile; init$1 = function() { if (true) { $pkg.LuaOS = "unix"; $pkg.LuaLDir = "/usr/local/share/lua/5.1"; $pkg.LuaPathDefault = "./?.lua;" + $pkg.LuaLDir + "/?.lua;" + $pkg.LuaLDir + "/?/init.lua"; } else { $pkg.LuaOS = "windows"; $pkg.LuaLDir = "!\\lua"; $pkg.LuaPathDefault = ".\\?.lua;" + $pkg.LuaLDir + "\\?.lua;" + $pkg.LuaLDir + "\\?\\init.lua"; } }; OpenCoroutine = function(L) { var L, _r, mod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; mod = $f.mod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("coroutine", coFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mod = _r; L.Push(mod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenCoroutine }; } $f.L = L; $f._r = _r; $f.mod = mod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenCoroutine = OpenCoroutine; coCreate = function(L) { var L, _r, _r$1, _tuple, base, fn, newthread, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; base = $f.base; fn = $f.fn; newthread = $f.newthread; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckFunction(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fn = _r; _r$1 = L.NewThread(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; newthread = _tuple[0]; base = 0; newthread.stack.Push(new callFrame.ptr(0, fn, ptrType$10.nil, 0, base, base + 1 >> 0, base, 0, -1, 0)); L.Push(newthread); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: coCreate }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.base = base; $f.fn = fn; $f.newthread = newthread; $f.$s = $s; $f.$r = $r; return $f; }; coYield = function(L) { var L; return -1; }; coResume = function(L) { var L, _r, cf, msg, msg$1, nargs, nargs$1, th, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; cf = $f.cf; msg = $f.msg; msg$1 = $f.msg$1; nargs = $f.nargs; nargs$1 = $f.nargs$1; th = $f.th; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckThread(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } th = _r; /* */ if (L.G.CurrentThread === th) { $s = 2; continue; } /* */ $s = 3; continue; /* if (L.G.CurrentThread === th) { */ case 2: msg = "can not resume a running thread"; /* */ if (th.wrapped) { $s = 4; continue; } /* */ $s = 5; continue; /* if (th.wrapped) { */ case 4: $r = L.RaiseError(msg, new sliceType$6([])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* } */ case 5: L.Push(new LBool($pkg.LFalse)); L.Push(new LString((msg))); $s = -1; return 2; /* } */ case 3: /* */ if (th.Dead) { $s = 7; continue; } /* */ $s = 8; continue; /* if (th.Dead) { */ case 7: msg$1 = "can not resume a dead thread"; /* */ if (th.wrapped) { $s = 9; continue; } /* */ $s = 10; continue; /* if (th.wrapped) { */ case 9: $r = L.RaiseError(msg$1, new sliceType$6([])); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* } */ case 10: L.Push(new LBool($pkg.LFalse)); L.Push(new LString((msg$1))); $s = -1; return 2; /* } */ case 8: th.Parent = L; L.G.CurrentThread = th; if (!th.isStarted()) { cf = th.stack.Last(); th.currentFrame = cf; th.SetTop(0); nargs = L.GetTop() - 1 >> 0; L.XMoveTo(th, nargs); cf.NArgs = nargs; th.initCallFrame(cf); th.Panic = panicWithoutTraceback; } else { nargs$1 = L.GetTop() - 1 >> 0; L.XMoveTo(th, nargs$1); } top = L.GetTop(); $r = threadRun(th); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return L.GetTop() - top >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: coResume }; } $f.L = L; $f._r = _r; $f.cf = cf; $f.msg = msg; $f.msg$1 = msg$1; $f.nargs = nargs; $f.nargs$1 = nargs$1; $f.th = th; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; coRunning = function(L) { var L; if (L.G.MainThread === L) { L.Push($pkg.LNil); return 1; } L.Push(L.G.CurrentThread); return 1; }; coStatus = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckThread(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.Status(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: coStatus }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; wrapaux = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: L.Insert(L.ToThread(UpvalueIndex(1)), 1); _r = coResume(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: wrapaux }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; coWrap = function(L) { var L, _r, _r$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = coCreate(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; _r$1 = L.CheckThread(L.GetTop()); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1.wrapped = true; v = L.Get(L.GetTop()); $r = L.Pop(1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(L.NewClosure(wrapaux, new sliceType$7([v]))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: coWrap }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; OpenDebug = function(L) { var L, _r, dbgmod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; dbgmod = $f.dbgmod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("debug", debugFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } dbgmod = _r; L.Push(dbgmod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenDebug }; } $f.L = L; $f._r = _r; $f.dbgmod = dbgmod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenDebug = OpenDebug; debugGetFEnv = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.GetFEnv(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugGetFEnv }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; debugGetInfo = function(L) { var L, _r, _r$1, _r$2, _ref, _tuple, _tuple$1, _tuple$2, arg1, dbg, err, fn, lv, lv$1, ok, tbl, what, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; arg1 = $f.arg1; dbg = $f.dbg; err = $f.err; fn = $f.fn; lv = $f.lv; lv$1 = $f.lv$1; ok = $f.ok; tbl = $f.tbl; what = $f.what; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.CheckTypes(1, new sliceType$8([4, 2])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } arg1 = L.Get(1); _r = L.OptString(2, "Slunf"); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } what = _r; dbg = ptrType$53.nil; fn = $ifaceNil; err = $ifaceNil; ok = false; _ref = arg1; /* */ if ($assertType(_ref, ptrType$7, true)[1]) { $s = 3; continue; } /* */ if ($assertType(_ref, LNumber, true)[1]) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($assertType(_ref, ptrType$7, true)[1]) { */ case 3: lv = _ref.$val; dbg = new Debug.ptr(ptrType$10.nil, "", "", "", 0, 0, 0, 0); _r$1 = L.GetInfo(">" + what, dbg, lv); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; fn = _tuple[0]; err = _tuple[1]; $s = 5; continue; /* } else if ($assertType(_ref, LNumber, true)[1]) { */ case 4: lv$1 = _ref.$val; _tuple$1 = L.GetStack(((lv$1 >> 0))); dbg = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { L.Push($pkg.LNil); $s = -1; return 1; } _r$2 = L.GetInfo(what, dbg, $pkg.LNil); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; fn = _tuple$2[0]; err = _tuple$2[1]; /* } */ case 5: if (!($interfaceIsEqual(err, $ifaceNil))) { L.Push($pkg.LNil); $s = -1; return 1; } tbl = L.NewTable(); if (dbg.Name.length > 0) { tbl.RawSetString("name", new LString((dbg.Name))); } else { tbl.RawSetString("name", $pkg.LNil); } tbl.RawSetString("what", new LString((dbg.What))); tbl.RawSetString("source", new LString((dbg.Source))); tbl.RawSetString("currentline", new LNumber((dbg.CurrentLine))); tbl.RawSetString("nups", new LNumber((dbg.NUpvalues))); tbl.RawSetString("linedefined", new LNumber((dbg.LineDefined))); tbl.RawSetString("lastlinedefined", new LNumber((dbg.LastLineDefined))); tbl.RawSetString("func", fn); L.Push(tbl); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugGetInfo }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.arg1 = arg1; $f.dbg = dbg; $f.err = err; $f.fn = fn; $f.lv = lv; $f.lv$1 = lv$1; $f.ok = ok; $f.tbl = tbl; $f.what = what; $f.$s = $s; $f.$r = $r; return $f; }; debugGetLocal = function(L) { var L, _r, _r$1, _tuple, _tuple$1, dbg, idx, level, name, ok, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dbg = $f.dbg; idx = $f.idx; level = $f.level; name = $f.name; ok = $f.ok; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckInt(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } level = _r; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } idx = _r$1; _tuple = L.GetStack(level); dbg = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: $r = L.ArgError(1, "level out of range"); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: _tuple$1 = L.GetLocal(dbg, idx); name = _tuple$1[0]; value = _tuple$1[1]; if (name.length > 0) { L.Push(new LString((name))); L.Push(value); $s = -1; return 2; } L.Push($pkg.LNil); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugGetLocal }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dbg = dbg; $f.idx = idx; $f.level = level; $f.name = name; $f.ok = ok; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; debugGetMetatable = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.GetMetatable(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugGetMetatable }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; debugGetUpvalue = function(L) { var L, _r, _r$1, _tuple, fn, idx, name, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; fn = $f.fn; idx = $f.idx; name = $f.name; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckFunction(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fn = _r; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } idx = _r$1; _tuple = L.GetUpvalue(fn, idx); name = _tuple[0]; value = _tuple[1]; if (name.length > 0) { L.Push(new LString((name))); L.Push(value); $s = -1; return 2; } L.Push($pkg.LNil); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugGetUpvalue }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.fn = fn; $f.idx = idx; $f.name = name; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; debugSetFEnv = function(L) { var L, _arg, _arg$1, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckAny(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = L.CheckAny(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; $r = L.SetFEnv(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: debugSetFEnv }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; debugSetLocal = function(L) { var L, _r, _r$1, _r$2, _tuple, dbg, idx, level, name, ok, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; dbg = $f.dbg; idx = $f.idx; level = $f.level; name = $f.name; ok = $f.ok; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckInt(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } level = _r; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } idx = _r$1; _r$2 = L.CheckAny(3); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } value = _r$2; _tuple = L.GetStack(level); dbg = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok) { */ case 4: $r = L.ArgError(1, "level out of range"); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: name = L.SetLocal(dbg, idx, value); if (name.length > 0) { L.Push(new LString((name))); } else { L.Push($pkg.LNil); } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugSetLocal }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.dbg = dbg; $f.idx = idx; $f.level = level; $f.name = name; $f.ok = ok; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; debugSetMetatable = function(L) { var L, mt, obj, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; mt = $f.mt; obj = $f.obj; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.CheckTypes(2, new sliceType$8([0, 7])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } obj = L.Get(1); mt = L.Get(2); $r = L.SetMetatable(obj, mt); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.SetTop(1); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugSetMetatable }; } $f.L = L; $f.mt = mt; $f.obj = obj; $f.$s = $s; $f.$r = $r; return $f; }; debugSetUpvalue = function(L) { var L, _r, _r$1, _r$2, fn, idx, name, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; fn = $f.fn; idx = $f.idx; name = $f.name; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckFunction(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } fn = _r; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } idx = _r$1; _r$2 = L.CheckAny(3); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } value = _r$2; name = L.SetUpvalue(fn, idx, value); if (name.length > 0) { L.Push(new LString((name))); } else { L.Push($pkg.LNil); } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugSetUpvalue }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.fn = fn; $f.idx = idx; $f.name = name; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; debugTraceback = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, l, level, ls, msg, ok, ok$1, s, traceback, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; l = $f.l; level = $f.level; ls = $f.ls; msg = $f.msg; ok = $f.ok; ok$1 = $f.ok$1; s = $f.s; traceback = $f.traceback; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: msg = ""; _r = L.OptInt(2, 1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } level = _r; ls = L; /* */ if (L.GetTop() > 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (L.GetTop() > 0) { */ case 2: _r$1 = L.Get(1).assertString(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; s = _tuple[0]; ok = _tuple[1]; if (ok) { msg = s; } _tuple$1 = $assertType(L.Get(1), ptrType$9, true); l = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { ls = l; msg = ""; } /* } */ case 3: _r$2 = ls.stackTrace(level); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = strings.TrimSpace(_r$2); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } traceback = _r$3; /* */ if (msg.length > 0) { $s = 7; continue; } /* */ $s = 8; continue; /* if (msg.length > 0) { */ case 7: _r$4 = fmt.Sprintf("%s\n%s", new sliceType$6([new $String(msg), new $String(traceback)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } traceback = _r$4; /* } */ case 8: L.Push(new LString((traceback))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: debugTraceback }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.l = l; $f.level = level; $f.ls = ls; $f.msg = msg; $f.ok = ok; $f.ok$1 = ok$1; $f.s = s; $f.traceback = traceback; $f.$s = $s; $f.$r = $r; return $f; }; Upvalue.ptr.prototype.Value = function() { var uv, x, x$1; uv = this; if (uv.IsClosed()) { return uv.value; } return (x = uv.reg.array, x$1 = uv.index, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); }; Upvalue.prototype.Value = function() { return this.$val.Value(); }; Upvalue.ptr.prototype.SetValue = function(value) { var uv, value; uv = this; if (uv.IsClosed()) { uv.value = value; } else { uv.reg.Set(uv.index, value); } }; Upvalue.prototype.SetValue = function(value) { return this.$val.SetValue(value); }; Upvalue.ptr.prototype.Close = function() { var uv, value; uv = this; value = uv.Value(); uv.closed = true; uv.value = value; }; Upvalue.prototype.Close = function() { return this.$val.Close(); }; Upvalue.ptr.prototype.IsClosed = function() { var uv; uv = this; return uv.closed || uv.reg === ptrType$54.nil; }; Upvalue.prototype.IsClosed = function() { return this.$val.IsClosed(); }; UpvalueIndex = function(i) { var i; return -10002 - i >> 0; }; $pkg.UpvalueIndex = UpvalueIndex; newFunctionProto = function(name) { var name; return new FunctionProto.ptr(name, 0, 0, 0, 0, 0, 2, $makeSlice(sliceType$11, 0, 128), $makeSlice(sliceType$7, 0, 32), $makeSlice(sliceType$16, 0, 16), $makeSlice(sliceType$12, 0, 128), $makeSlice(sliceType$17, 0, 16), $makeSlice(sliceType$18, 0, 128), $makeSlice(sliceType$1, 0, 16), $makeSlice(sliceType$1, 0, 32)); }; FunctionProto.ptr.prototype.String = function() { var _r, fp, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fp = $f.fp; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fp = this; _r = fp.str(1, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: FunctionProto.ptr.prototype.String }; } $f._r = _r; $f.fp = fp; $f.$s = $s; $f.$r = $r; return $f; }; FunctionProto.prototype.String = function() { return this.$val.String(); }; FunctionProto.ptr.prototype.str = function(level, count) { var _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _i, _i$1, _i$2, _i$3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _ref$3, buf, code, conzt, count, fp, indent, inst, level, linfo, no, protono, reg, reg$1, reg$2, upvalue, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _i$3 = $f._i$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _ref$3 = $f._ref$3; buf = $f.buf; code = $f.code; conzt = $f.conzt; count = $f.count; fp = $f.fp; indent = $f.indent; inst = $f.inst; level = $f.level; linfo = $f.linfo; no = $f.no; protono = $f.protono; reg = $f.reg; reg$1 = $f.reg$1; reg$2 = $f.reg$2; upvalue = $f.upvalue; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fp = this; indent = strings.Repeat(" ", level - 1 >> 0); buf = new sliceType$1([]); _r = fmt.Sprintf("%v; function [%v] definition (level %v)\n", new sliceType$6([new $String(indent), new $Int(count), new $Int(level)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } buf = $append(buf, _r); _r$1 = fmt.Sprintf("%v; %v upvalues, %v params, %v stacks\n", new sliceType$6([new $String(indent), new $Uint8(fp.NumUpvalues), new $Uint8(fp.NumParameters), new $Uint8(fp.NumUsedRegisters)])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } buf = $append(buf, _r$1); _ref = fp.DbgLocals; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } reg = _i; linfo = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r$2 = fmt.Sprintf("%v.local %v ; %v\n", new sliceType$6([new $String(indent), new $String(linfo.Name), new $Int(reg)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } buf = $append(buf, _r$2); _i++; /* } */ $s = 3; continue; case 4: _ref$1 = fp.DbgUpvalues; _i$1 = 0; /* while (true) { */ case 6: /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 7; continue; } reg$1 = _i$1; upvalue = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); _r$3 = fmt.Sprintf("%v.upvalue %v ; %v\n", new sliceType$6([new $String(indent), new $String(upvalue), new $Int(reg$1)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } buf = $append(buf, _r$3); _i$1++; /* } */ $s = 6; continue; case 7: _ref$2 = fp.Constants; _i$2 = 0; /* while (true) { */ case 9: /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 10; continue; } reg$2 = _i$2; conzt = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]); _arg = new $String(indent); _r$4 = conzt.String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = new $String(_r$4); _arg$2 = new $Int(reg$2); _r$5 = fmt.Sprintf("%v.const %v ; %v\n", new sliceType$6([_arg, _arg$1, _arg$2])); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } buf = $append(buf, _r$5); _i$2++; /* } */ $s = 9; continue; case 10: buf = $append(buf, "\n"); protono = 0; _ref$3 = fp.Code; _i$3 = 0; /* while (true) { */ case 13: /* if (!(_i$3 < _ref$3.$length)) { break; } */ if(!(_i$3 < _ref$3.$length)) { $s = 14; continue; } no = _i$3; code = ((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]); inst = opGetOpCode(code); /* */ if (inst === 39) { $s = 15; continue; } /* */ $s = 16; continue; /* if (inst === 39) { */ case 15: buf = $append(buf, "\n"); _r$6 = (x = fp.FunctionPrototypes, ((protono < 0 || protono >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + protono])).str(level + 1 >> 0, protono); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } buf = $append(buf, _r$6); buf = $append(buf, "\n"); protono = protono + (1) >> 0; /* } */ case 16: _arg$3 = new $String(indent); _arg$4 = new $Int((no + 1 >> 0)); _r$7 = opToString(code); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$5 = new $String(_r$7); _arg$6 = new $Int((x$1 = fp.DbgSourcePositions, ((no < 0 || no >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + no]))); _r$8 = fmt.Sprintf("%v[%03d] %v (line:%v)\n", new sliceType$6([_arg$3, _arg$4, _arg$5, _arg$6])); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } buf = $append(buf, _r$8); _i$3++; /* } */ $s = 13; continue; case 14: _r$9 = fmt.Sprintf("%v; end of function\n", new sliceType$6([new $String(indent)])); /* */ $s = 20; case 20: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } buf = $append(buf, _r$9); $s = -1; return strings.Join(buf, ""); /* */ } return; } if ($f === undefined) { $f = { $blk: FunctionProto.ptr.prototype.str }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._i$3 = _i$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._ref$3 = _ref$3; $f.buf = buf; $f.code = code; $f.conzt = conzt; $f.count = count; $f.fp = fp; $f.indent = indent; $f.inst = inst; $f.level = level; $f.linfo = linfo; $f.no = no; $f.protono = protono; $f.reg = reg; $f.reg$1 = reg$1; $f.reg$2 = reg$2; $f.upvalue = upvalue; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; FunctionProto.prototype.str = function(level, count) { return this.$val.str(level, count); }; newLFunctionL = function(proto, env, nupvalue) { var env, nupvalue, proto; return new LFunction.ptr(false, env, proto, $throwNilPointerError, $makeSlice(sliceType$19, nupvalue)); }; newLFunctionG = function(gfunc, env, nupvalue) { var env, gfunc, nupvalue; return new LFunction.ptr(true, env, ptrType$18.nil, gfunc, $makeSlice(sliceType$19, nupvalue)); }; LFunction.ptr.prototype.LocalName = function(regno, pc) { var fn, i, p, pc, regno, x, x$1, x$2; fn = this; if (fn.IsG) { return ["", false]; } p = fn.Proto; i = 0; while (true) { if (!(i < p.DbgLocals.$length && (x = p.DbgLocals, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])).StartPc < pc)) { break; } if (pc < (x$1 = p.DbgLocals, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).EndPc) { regno = regno - (1) >> 0; if (regno === 0) { return [(x$2 = p.DbgLocals, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])).Name, true]; } } i = i + (1) >> 0; } return ["", false]; }; LFunction.prototype.LocalName = function(regno, pc) { return this.$val.LocalName(regno, pc); }; checkFile = function(L) { var L, _r, _tuple, file, ok, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _tuple = $f._tuple; file = $f.file; ok = $f.ok; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckUserData(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ud = _r; _tuple = $assertType(ud.Value, ptrType$57, true); file = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return file; } $r = L.ArgError(1, "file expected"); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ptrType$57.nil; /* */ } return; } if ($f === undefined) { $f = { $blk: checkFile }; } $f.L = L; $f._r = _r; $f._tuple = _tuple; $f.file = file; $f.ok = ok; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; errorIfFileIsClosed = function(L, file) { var L, file, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; file = $f.file; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (file.closed) { $s = 1; continue; } /* */ $s = 2; continue; /* if (file.closed) { */ case 1: $r = L.ArgError(1, "file is closed"); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: errorIfFileIsClosed }; } $f.L = L; $f.file = file; $f.$s = $s; $f.$r = $r; return $f; }; newFile = function(L, file, path, flag, perm, writable, readable) { var L, _arg, _arg$1, _r, _r$1, _tuple, err, file, flag, lfile, path, perm, readable, ud, writable, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; file = $f.file; flag = $f.flag; lfile = $f.lfile; path = $f.path; perm = $f.perm; readable = $f.readable; ud = $f.ud; writable = $f.writable; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ud = L.NewUserData(); err = $ifaceNil; /* */ if (file === ptrType$2.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (file === ptrType$2.nil) { */ case 1: _r = os.OpenFile(path, flag, perm); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; file = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$8.nil, err]; } /* } */ case 2: lfile = new lFile.ptr(file, ptrType$58.nil, $ifaceNil, ptrType$59.nil, $ifaceNil, false); ud.Value = lfile; if (writable) { lfile.writer = file; } if (readable) { lfile.reader = bufio.NewReaderSize(file, 4096); } _arg = ud; _r$1 = L.GetTypeMetatable("FILE*"); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; $r = L.SetMetatable(_arg, _arg$1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ud, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: newFile }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.file = file; $f.flag = flag; $f.lfile = lfile; $f.path = path; $f.perm = perm; $f.readable = readable; $f.ud = ud; $f.writable = writable; $f.$s = $s; $f.$r = $r; return $f; }; newProcess = function(L, cmd, writable, readable) { var L, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, _tuple$2, args, c, cmd, err, lfile, pp, readable, ud, writable, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; args = $f.args; c = $f.c; cmd = $f.cmd; err = $f.err; lfile = $f.lfile; pp = $f.pp; readable = $f.readable; ud = $f.ud; writable = $f.writable; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ud = L.NewUserData(); _tuple = popenArgs(cmd); c = _tuple[0]; args = _tuple[1]; _r = exec.Command(c, args); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } pp = _r; lfile = new lFile.ptr(ptrType$2.nil, pp, $ifaceNil, ptrType$59.nil, $ifaceNil, false); ud.Value = lfile; err = $ifaceNil; /* */ if (writable) { $s = 2; continue; } /* */ $s = 3; continue; /* if (writable) { */ case 2: _r$1 = pp.StdinPipe(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; lfile.writer = _tuple$1[0]; err = _tuple$1[1]; /* } */ case 3: /* */ if (readable) { $s = 5; continue; } /* */ $s = 6; continue; /* if (readable) { */ case 5: _r$2 = pp.StdoutPipe(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; lfile.stdout = _tuple$2[0]; err = _tuple$2[1]; lfile.reader = bufio.NewReaderSize(lfile.stdout, 4096); /* } */ case 6: if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$8.nil, err]; } _r$3 = pp.Start(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } err = _r$3; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return [ptrType$8.nil, err]; } _arg = ud; _r$4 = L.GetTypeMetatable("FILE*"); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = _r$4; $r = L.SetMetatable(_arg, _arg$1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return [ud, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: newProcess }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.args = args; $f.c = c; $f.cmd = cmd; $f.err = err; $f.lfile = lfile; $f.pp = pp; $f.readable = readable; $f.ud = ud; $f.writable = writable; $f.$s = $s; $f.$r = $r; return $f; }; lFile.ptr.prototype.Type = function() { var file; file = this; if (file.fp === ptrType$2.nil) { return 1; } return 0; }; lFile.prototype.Type = function() { return this.$val.Type(); }; lFile.ptr.prototype.Name = function() { var _1, _r, _r$1, file, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; file = $f.file; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file = this; _1 = file.Type(); /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (0)) { */ case 2: _r = fmt.Sprintf("file %s", new sliceType$6([new $String(file.fp.Name())])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else if (_1 === (1)) { */ case 3: _r$1 = fmt.Sprintf("process %s", new sliceType$6([new $String(file.pp.Path)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 4: case 1: $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: lFile.ptr.prototype.Name }; } $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f.file = file; $f.$s = $s; $f.$r = $r; return $f; }; lFile.prototype.Name = function() { return this.$val.Name(); }; lFile.ptr.prototype.AbandonReadBuffer = function() { var _r, _tuple, err, file, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; err = $f.err; file = $f.file; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file = this; /* */ if ((file.Type() === 0) && !(file.reader === ptrType$59.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ((file.Type() === 0) && !(file.reader === ptrType$59.nil)) { */ case 1: _r = file.fp.Seek((x = (new $Int64(0, file.reader.Buffered())), new $Int64(-x.$high, -x.$low)), 1); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return err; } file.reader = bufio.NewReaderSize(file.fp, 4096); /* } */ case 2: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: lFile.ptr.prototype.AbandonReadBuffer }; } $f._r = _r; $f._tuple = _tuple; $f.err = err; $f.file = file; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; lFile.prototype.AbandonReadBuffer = function() { return this.$val.AbandonReadBuffer(); }; fileDefOut = function(L) { var L; return $assertType($assertType(L.Get(UpvalueIndex(1)), ptrType$1).RawGetInt(1), ptrType$8); }; fileDefIn = function(L) { var L; return $assertType($assertType(L.Get(UpvalueIndex(1)), ptrType$1).RawGetInt(2), ptrType$8); }; fileIsWritable = function(L, file) { var L, _arg, _r, _r$1, file, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; file = $f.file; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if ($interfaceIsEqual(file.writer, $ifaceNil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($interfaceIsEqual(file.writer, $ifaceNil)) { */ case 1: L.Push($pkg.LNil); _r = file.Name(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = new $String(_r); _r$1 = fmt.Sprintf("%s is opened for only reading.", new sliceType$6([_arg])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(new LNumber(1)); $s = -1; return 3; /* } */ case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: fileIsWritable }; } $f.L = L; $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.file = file; $f.$s = $s; $f.$r = $r; return $f; }; fileIsReadable = function(L, file) { var L, _arg, _r, _r$1, file, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; file = $f.file; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (file.reader === ptrType$59.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (file.reader === ptrType$59.nil) { */ case 1: L.Push($pkg.LNil); _r = file.Name(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = new $String(_r); _r$1 = fmt.Sprintf("%s is opened for only writing.", new sliceType$6([_arg])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(new LNumber(1)); $s = -1; return 3; /* } */ case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: fileIsReadable }; } $f.L = L; $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f.file = file; $f.$s = $s; $f.$r = $r; return $f; }; OpenIo = function(L) { var L, _entry, _i, _i$1, _keys, _r, _r$1, _r$2, _ref, _ref$1, _tuple, file, finfo, fn, mod, mt, name, uv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _entry = $f._entry; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; file = $f.file; finfo = $f.finfo; fn = $f.fn; mod = $f.mod; mt = $f.mt; name = $f.name; uv = $f.uv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("io", $makeMap($String.keyFor, [])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mod = $assertType(_r, ptrType$1); _r$1 = L.NewTypeMetatable("FILE*"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mt = _r$1; mt.RawSetString("__index", mt); L.SetFuncs(mt, fileMethods, new sliceType$7([])); mt.RawSetString("lines", L.NewClosure(fileLines, new sliceType$7([L.NewFunction(fileLinesIter)]))); _ref = stdFiles; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } finfo = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), structType); _r$2 = newFile(L, finfo.file, "", 0, 0, finfo.writable, finfo.readable); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; file = _tuple[0]; mod.RawSetString(finfo.name, file); _i++; /* } */ $s = 3; continue; case 4: uv = L.CreateTable(2, 0); uv.RawSetInt(1, mod.RawGetString("stdout")); uv.RawSetInt(2, mod.RawGetString("stdin")); _ref$1 = ioFuncs; _i$1 = 0; _keys = $keys(_ref$1); while (true) { if (!(_i$1 < _keys.length)) { break; } _entry = _ref$1[_keys[_i$1]]; if (_entry === undefined) { _i$1++; continue; } name = _entry.k; fn = _entry.v; mod.RawSetString(name, L.NewClosure(fn, new sliceType$7([uv]))); _i$1++; } mod.RawSetString("lines", L.NewClosure(ioLines, new sliceType$7([uv, L.NewClosure(ioLinesIter, new sliceType$7([uv]))]))); L.Push(mod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenIo }; } $f.L = L; $f._entry = _entry; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.file = file; $f.finfo = finfo; $f.fn = fn; $f.mod = mod; $f.mt = mt; $f.name = name; $f.uv = uv; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenIo = OpenIo; fileToString = function(L) { var L, _r, file, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; file = $f.file; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } file = _r; if (file.Type() === 0) { if (file.closed) { L.Push(new LString("file (closed)")); } else { L.Push(new LString("file")); } } else { if (file.closed) { L.Push(new LString("process (closed)")); } else { L.Push(new LString("process")); } } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileToString }; } $f.L = L; $f._r = _r; $f.file = file; $f.$s = $s; $f.$r = $r; return $f; }; fileWriteAux = function(L, file, idx) { var L, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, err, file, i, idx, n, out, s, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; err = $f.err; file = $f.file; i = $f.i; idx = $f.idx; n = $f.n; out = $f.out; s = $f.s; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fileIsWritable(L, file); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; if (!((n === 0))) { $s = -1; return n; } $r = errorIfFileIsClosed(L, file); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } top = L.GetTop(); out = file.writer; err = $ifaceNil; i = idx; /* while (true) { */ case 3: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 4; continue; } $r = L.CheckTypes(i, new sliceType$8([2, 3])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$1 = LVAsString(L.Get(i)); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } s = _r$1; _r$2 = out.Write(unsafeFastStringToReadOnlyBytes(s)); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 8: /* goto errreturn */ $s = 10; continue; /* } */ case 9: i = i + (1) >> 0; /* } */ $s = 3; continue; case 4: _r$3 = file.AbandonReadBuffer(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* errreturn: */ case 10: _r$4 = file.AbandonReadBuffer(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$4; L.Push($pkg.LNil); _r$5 = err.Error(); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$5))); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(new LNumber(1)); $s = -1; return 3; /* */ } return; } if ($f === undefined) { $f = { $blk: fileWriteAux }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.err = err; $f.file = file; $f.i = i; $f.idx = idx; $f.n = n; $f.out = out; $f.s = s; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; fileCloseAux = function(L, file) { var L, _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, bwriter, e2, err, exitStatus, file, ok, ok$1, ok$2, s, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; bwriter = $f.bwriter; e2 = $f.e2; err = $f.err; exitStatus = $f.exitStatus; file = $f.file; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file.closed = true; err = $ifaceNil; /* */ if (!($interfaceIsEqual(file.writer, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(file.writer, $ifaceNil))) { */ case 1: _tuple = $assertType(file.writer, ptrType$60, true); bwriter = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r = bwriter.Flush(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err = _r; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: /* goto errreturn */ $s = 8; continue; /* } */ case 7: /* } */ case 4: /* } */ case 2: _r$1 = file.AbandonReadBuffer(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; _1 = file.Type(); /* */ if (_1 === (0)) { $s = 11; continue; } /* */ if (_1 === (1)) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_1 === (0)) { */ case 11: _r$2 = file.fp.Close(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 15: /* goto errreturn */ $s = 8; continue; /* } */ case 16: L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* } else if (_1 === (1)) { */ case 12: /* */ if (!($interfaceIsEqual(file.stdout, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(file.stdout, $ifaceNil))) { */ case 17: _r$3 = file.stdout.Close(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; /* } */ case 18: _r$4 = file.pp.Wait(); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err = _r$4; exitStatus = 0; if (!($interfaceIsEqual(err, $ifaceNil))) { _tuple$1 = $assertType(err, ptrType$61, true); e2 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { _tuple$2 = $assertType(e2.ProcessState.Sys(), syscall.WaitStatus, true); s = _tuple$2[0]; ok$2 = _tuple$2[1]; if (ok$2) { exitStatus = new syscall.WaitStatus(s).ExitStatus(); } else { err = errors.New("Unimplemented for system where exec.ExitError.Sys() is not syscall.WaitStatus"); } } } else { exitStatus = 0; } L.Push(new LNumber((exitStatus))); $s = -1; return 1; /* } */ case 13: case 10: /* errreturn: */ case 8: _r$5 = err.Error(); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.RaiseError(_r$5, new sliceType$6([])); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: fileCloseAux }; } $f.L = L; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.bwriter = bwriter; $f.e2 = e2; $f.err = err; $f.exitStatus = exitStatus; $f.file = file; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; }; fileFlushAux = function(L, file) { var L, _r, _r$1, _r$2, _tuple, bwriter, err, file, n, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; bwriter = $f.bwriter; err = $f.err; file = $f.file; n = $f.n; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fileIsWritable(L, file); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; if (!((n === 0))) { $s = -1; return n; } $r = errorIfFileIsClosed(L, file); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _tuple = $assertType(file.writer, ptrType$60, true); bwriter = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: _r$1 = bwriter.Flush(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: L.Push($pkg.LNil); _r$2 = err.Error(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$2))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 7: /* } */ case 4: L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileFlushAux }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.bwriter = bwriter; $f.err = err; $f.file = file; $f.n = n; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; fileReadAux = function(L, file, idx) { var L, _1, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _ref, _ref$1, _rune, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, buf, buf$1, buf$2, err, file, i, idx, iseof, iseof$1, lv, lv$1, n, opt, options, size, top, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _ref = $f._ref; _ref$1 = $f._ref$1; _rune = $f._rune; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; buf = $f.buf; buf$1 = $f.buf$1; buf$2 = $f.buf$2; err = $f.err; file = $f.file; i = $f.i; idx = $f.idx; iseof = $f.iseof; iseof$1 = $f.iseof$1; lv = $f.lv; lv$1 = $f.lv$1; n = $f.n; opt = $f.opt; options = $f.options; size = $f.size; top = $f.top; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fileIsReadable(L, file); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } n = _r; if (!((n === 0))) { $s = -1; return n; } $r = errorIfFileIsClosed(L, file); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (L.GetTop() === (idx - 1 >> 0)) { L.Push(new LString("*l")); } err = $ifaceNil; top = L.GetTop(); i = idx; /* while (true) { */ case 3: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 4; continue; } _ref = L.Get(i); /* */ if ($assertType(_ref, LNumber, true)[1]) { $s = 5; continue; } /* */ if ($assertType(_ref, LString, true)[1]) { $s = 6; continue; } /* */ $s = 7; continue; /* if ($assertType(_ref, LNumber, true)[1]) { */ case 5: lv = _ref.$val; size = (new $Int64(0, lv)); /* */ if ((size.$high === 0 && size.$low === 0)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ((size.$high === 0 && size.$low === 0)) { */ case 8: _r$1 = file.reader.ReadByte(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; err = _tuple[1]; /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 11; continue; } /* */ $s = 12; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 11: L.Push($pkg.LNil); /* goto normalreturn */ $s = 13; continue; /* } */ case 12: file.reader.UnreadByte(); /* } */ case 9: buf = sliceType$20.nil; iseof = false; _r$2 = readBufioSize(file.reader, size); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; buf = _tuple$1[0]; iseof = _tuple$1[1]; err = _tuple$1[2]; /* */ if (iseof) { $s = 15; continue; } /* */ $s = 16; continue; /* if (iseof) { */ case 15: L.Push($pkg.LNil); /* goto normalreturn */ $s = 13; continue; /* } */ case 16: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 17; continue; } /* */ $s = 18; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 17: /* goto errreturn */ $s = 19; continue; /* } */ case 18: L.Push(new LString((($bytesToString(buf))))); $s = 7; continue; /* } else if ($assertType(_ref, LString, true)[1]) { */ case 6: lv$1 = _ref.$val; _r$3 = L.CheckString(i); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } options = _r$3; /* */ if (options.length > 0 && !((options.charCodeAt(0) === 42))) { $s = 21; continue; } /* */ $s = 22; continue; /* if (options.length > 0 && !((options.charCodeAt(0) === 42))) { */ case 21: $r = L.ArgError(2, "invalid options:" + options); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 22: _ref$1 = $substring(options, 1); _i = 0; /* while (true) { */ case 24: /* if (!(_i < _ref$1.length)) { break; } */ if(!(_i < _ref$1.length)) { $s = 25; continue; } v = [v]; _rune = $decodeRune(_ref$1, _i); opt = _rune[0]; _1 = opt; /* */ if (_1 === (110)) { $s = 27; continue; } /* */ if (_1 === (97)) { $s = 28; continue; } /* */ if (_1 === (108)) { $s = 29; continue; } /* */ $s = 30; continue; /* if (_1 === (110)) { */ case 27: v[0] = 0; _r$4 = fmt.Fscanf(file.reader, "%f", new sliceType$6([(v.$ptr || (v.$ptr = new ptrType$62(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, v)))])); /* */ $s = 32; case 32: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$2 = _r$4; err = _tuple$2[1]; /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 33; continue; } /* */ $s = 34; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 33: L.Push($pkg.LNil); /* goto normalreturn */ $s = 13; continue; /* } */ case 34: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 35; continue; } /* */ $s = 36; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 35: /* goto errreturn */ $s = 19; continue; /* } */ case 36: L.Push(new LNumber(v[0])); $s = 31; continue; /* } else if (_1 === (97)) { */ case 28: buf$1 = sliceType$20.nil; _r$5 = ioutil.ReadAll(file.reader); /* */ $s = 37; case 37: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$3 = _r$5; buf$1 = _tuple$3[0]; err = _tuple$3[1]; /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 38; continue; } /* */ $s = 39; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 38: L.Push(new LString("")); /* goto normalreturn */ $s = 13; continue; /* } */ case 39: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 40; continue; } /* */ $s = 41; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 40: /* goto errreturn */ $s = 19; continue; /* } */ case 41: L.Push(new LString((($bytesToString(buf$1))))); $s = 31; continue; /* } else if (_1 === (108)) { */ case 29: buf$2 = sliceType$20.nil; iseof$1 = false; _r$6 = readBufioLine(file.reader); /* */ $s = 42; case 42: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _tuple$4 = _r$6; buf$2 = _tuple$4[0]; iseof$1 = _tuple$4[1]; err = _tuple$4[2]; /* */ if (iseof$1) { $s = 43; continue; } /* */ $s = 44; continue; /* if (iseof$1) { */ case 43: L.Push($pkg.LNil); /* goto normalreturn */ $s = 13; continue; /* } */ case 44: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 45; continue; } /* */ $s = 46; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 45: /* goto errreturn */ $s = 19; continue; /* } */ case 46: L.Push(new LString((($bytesToString(buf$2))))); $s = 31; continue; /* } else { */ case 30: $r = L.ArgError(2, "invalid options:" + ($encodeRune(opt))); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 31: case 26: _i += _rune[1]; /* } */ $s = 24; continue; case 25: /* } */ case 7: i = i + (1) >> 0; /* } */ $s = 3; continue; case 4: /* normalreturn: */ case 13: $s = -1; return L.GetTop() - top >> 0; /* errreturn: */ case 19: _r$7 = err.Error(); /* */ $s = 48; case 48: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = L.RaiseError(_r$7, new sliceType$6([])); /* */ $s = 49; case 49: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: fileReadAux }; } $f.L = L; $f._1 = _1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._ref = _ref; $f._ref$1 = _ref$1; $f._rune = _rune; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.buf = buf; $f.buf$1 = buf$1; $f.buf$2 = buf$2; $f.err = err; $f.file = file; $f.i = i; $f.idx = idx; $f.iseof = iseof; $f.iseof$1 = iseof$1; $f.lv = lv; $f.lv$1 = lv$1; $f.n = n; $f.opt = opt; $f.options = options; $f.size = size; $f.top = top; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; fileSeek = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, err, file, pos, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; err = $f.err; file = $f.file; pos = $f.pos; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } file = _r; if (!((file.Type() === 0))) { L.Push($pkg.LNil); L.Push(new LString("can not seek a process.")); $s = -1; return 2; } top = L.GetTop(); if (top === 1) { L.Push(new LString("cur")); L.Push(new LNumber(0)); } else if (top === 2) { L.Push(new LNumber(0)); } pos = new $Int64(0, 0); err = $ifaceNil; _r$1 = file.AbandonReadBuffer(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: /* goto errreturn */ $s = 5; continue; /* } */ case 4: _r$2 = L.CheckInt64(3); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = _r$2; _r$3 = L.CheckOption(2, fileSeekOptions); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = _r$3; _r$4 = file.fp.Seek(_arg, _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; pos = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: /* goto errreturn */ $s = 5; continue; /* } */ case 10: L.Push(new LNumber(($flatten64(pos)))); $s = -1; return 1; /* errreturn: */ case 5: L.Push($pkg.LNil); _r$5 = err.Error(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$5))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: fileSeek }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.err = err; $f.file = file; $f.pos = pos; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; fileWrite = function(L) { var L, _arg, _arg$1, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = L; _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; _r$1 = fileWriteAux(_arg, _arg$1, 2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileWrite }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; fileClose = function(L) { var L, _arg, _arg$1, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = L; _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; _r$1 = fileCloseAux(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileClose }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; fileFlush = function(L) { var L, _arg, _arg$1, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = L; _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; _r$1 = fileFlushAux(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileFlush }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; fileLinesIter = function(L) { var L, _r, _r$1, _tuple, _tuple$1, buf, err, file, ok, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; err = $f.err; file = $f.file; ok = $f.ok; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file = ptrType$57.nil; _tuple = $assertType(L.Get(1), ptrType$8, true); ud = _tuple[0]; ok = _tuple[1]; if (ok) { file = $assertType(ud.Value, ptrType$57); } else { file = $assertType($assertType(L.Get(UpvalueIndex(2)), ptrType$8).Value, ptrType$57); } _r = file.reader.ReadLine(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; buf = _tuple$1[0]; err = _tuple$1[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: if ($interfaceIsEqual(err, io.EOF)) { L.Push($pkg.LNil); $s = -1; return 1; } _r$1 = err.Error(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.RaiseError(_r$1, new sliceType$6([])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: L.Push(new LString((($bytesToString(buf))))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileLinesIter }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.err = err; $f.file = file; $f.ok = ok; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; fileLines = function(L) { var L, _r, _r$1, _r$2, file, n, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; file = $f.file; n = $f.n; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } file = _r; _r$1 = L.CheckUserData(1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } ud = _r$1; _r$2 = fileIsReadable(L, file); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } n = _r$2; if (!((n === 0))) { $s = -1; return 0; } L.Push(L.NewClosure(fileLinesIter, new sliceType$7([L.Get(UpvalueIndex(1)), ud]))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileLines }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.file = file; $f.n = n; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; fileRead = function(L) { var L, _arg, _arg$1, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _arg = L; _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; _r$1 = fileReadAux(_arg, _arg$1, 2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: fileRead }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; fileSetVBuf = function(L) { var L, _1, _2, _3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, bufsize, err, file, n, writer, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _2 = $f._2; _3 = $f._3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; bufsize = $f.bufsize; err = $f.err; file = $f.file; n = $f.n; writer = $f.writer; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = $ifaceNil; writer = $ifaceNil; _r = checkFile(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } file = _r; _r$1 = fileIsWritable(L, file); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } n = _r$1; if (!((n === 0))) { $s = -1; return n; } _r$2 = L.CheckOption(2, filebufOptions); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _1 = (x = _r$2, ((x < 0 || x >= filebufOptions.$length) ? ($throwRuntimeError("index out of range"), undefined) : filebufOptions.$array[filebufOptions.$offset + x])); /* */ if (_1 === ("no")) { $s = 5; continue; } /* */ if (_1 === ("full") || _1 === ("line")) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_1 === ("no")) { */ case 5: _2 = file.Type(); /* */ if (_2 === (0)) { $s = 9; continue; } /* */ if (_2 === (1)) { $s = 10; continue; } /* */ $s = 11; continue; /* if (_2 === (0)) { */ case 9: file.writer = file.fp; $s = 11; continue; /* } else if (_2 === (1)) { */ case 10: _r$3 = file.pp.StdinPipe(); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; file.writer = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 13: /* goto errreturn */ $s = 15; continue; /* } */ case 14: /* } */ case 11: case 8: $s = 7; continue; /* } else if (_1 === ("full") || _1 === ("line")) { */ case 6: _r$4 = L.OptInt(3, 4096); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } bufsize = _r$4; _3 = file.Type(); /* */ if (_3 === (0)) { $s = 18; continue; } /* */ if (_3 === (1)) { $s = 19; continue; } /* */ $s = 20; continue; /* if (_3 === (0)) { */ case 18: file.writer = bufio.NewWriterSize(file.fp, bufsize); $s = 20; continue; /* } else if (_3 === (1)) { */ case 19: _r$5 = file.pp.StdinPipe(); /* */ $s = 21; case 21: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$1 = _r$5; writer = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 22; continue; } /* */ $s = 23; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 22: /* goto errreturn */ $s = 15; continue; /* } */ case 23: file.writer = bufio.NewWriterSize(writer, bufsize); /* } */ case 20: case 17: /* } */ case 7: case 3: L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* errreturn: */ case 15: L.Push($pkg.LNil); _r$6 = err.Error(); /* */ $s = 24; case 24: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$6))); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: fileSetVBuf }; } $f.L = L; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.bufsize = bufsize; $f.err = err; $f.file = file; $f.n = n; $f.writer = writer; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ioInput = function(L) { var L, _arg, _r, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, err, file, lv, lv$1, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; file = $f.file; lv = $f.lv; lv$1 = $f.lv$1; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (L.GetTop() === 0) { L.Push(fileDefIn(L)); $s = -1; return 1; } _ref = L.Get(1); /* */ if ($assertType(_ref, LString, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$8, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, LString, true)[1]) { */ case 1: lv = _ref.$val; _r = newFile(L, ptrType$2.nil, (lv), 0, 384, false, true); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; file = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$1 = err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.RaiseError(_r$1, new sliceType$6([])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $assertType(L.Get(UpvalueIndex(1)), ptrType$1).RawSetInt(2, file); L.Push(file); $s = -1; return 1; /* } else if ($assertType(_ref, ptrType$8, true)[1]) { */ case 2: lv$1 = _ref.$val; _tuple$1 = $assertType(lv$1.Value, ptrType$57, true); ok = _tuple$1[1]; if (ok) { $assertType(L.Get(UpvalueIndex(1)), ptrType$1).RawSetInt(2, lv$1); L.Push(lv$1); $s = -1; return 1; } /* } */ case 3: _r$2 = L.Get(1).Type(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = "string or file expedted, but got " + _r$3; $r = L.ArgError(1, _arg); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: ioInput }; } $f.L = L; $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.file = file; $f.lv = lv; $f.lv$1 = lv$1; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; ioClose = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (L.GetTop() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.GetTop() === 0) { */ case 1: _r = fileCloseAux(L, $assertType(fileDefOut(L).Value, ptrType$57)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: _r$1 = fileClose(L); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: ioClose }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; ioFlush = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fileFlushAux(L, $assertType(fileDefOut(L).Value, ptrType$57)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ioFlush }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; ioLinesIter = function(L) { var L, _r, _r$1, _r$2, _tuple, _tuple$1, buf, err, file, ok, toclose, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; err = $f.err; file = $f.file; ok = $f.ok; toclose = $f.toclose; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: file = ptrType$57.nil; toclose = false; _tuple = $assertType(L.Get(1), ptrType$8, true); ud = _tuple[0]; ok = _tuple[1]; if (ok) { file = $assertType(ud.Value, ptrType$57); } else { file = $assertType($assertType(L.Get(UpvalueIndex(2)), ptrType$8).Value, ptrType$57); toclose = true; } _r = file.reader.ReadLine(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = _r; buf = _tuple$1[0]; err = _tuple$1[2]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: /* */ if ($interfaceIsEqual(err, io.EOF)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(err, io.EOF)) { */ case 4: /* */ if (toclose) { $s = 6; continue; } /* */ $s = 7; continue; /* if (toclose) { */ case 6: _r$1 = fileCloseAux(L, file); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; /* } */ case 7: L.Push($pkg.LNil); $s = -1; return 1; /* } */ case 5: _r$2 = err.Error(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.RaiseError(_r$2, new sliceType$6([])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: L.Push(new LString((($bytesToString(buf))))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: ioLinesIter }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.err = err; $f.file = file; $f.ok = ok; $f.toclose = toclose; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; ioLines = function(L) { var L, _r, _r$1, _tuple, err, path, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; path = $f.path; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (L.GetTop() === 0) { L.Push(L.Get(UpvalueIndex(2))); L.Push(fileDefIn(L)); $s = -1; return 2; } _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } path = _r; _r$1 = newFile(L, ptrType$2.nil, path, 0, 384, false, true); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; ud = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $s = -1; return 0; } L.Push(L.NewClosure(ioLinesIter, new sliceType$7([L.Get(UpvalueIndex(1)), ud]))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: ioLines }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.path = path; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; ioOpenFile = function(L) { var L, _1, _r, _r$1, _r$2, _r$3, _tuple, err, file, mode, path, perm, readable, writable, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; file = $f.file; mode = $f.mode; path = $f.path; perm = $f.perm; readable = $f.readable; writable = $f.writable; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } path = _r; if (L.GetTop() === 1) { L.Push(new LString("r")); } mode = 0; perm = 384; writable = true; readable = true; _r$1 = L.CheckOption(2, ioOpenOpions); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _1 = (x = _r$1, ((x < 0 || x >= ioOpenOpions.$length) ? ($throwRuntimeError("index out of range"), undefined) : ioOpenOpions.$array[ioOpenOpions.$offset + x])); if (_1 === ("r") || _1 === ("rb")) { mode = 0; writable = false; } else if (_1 === ("w") || _1 === ("wb")) { mode = 65; readable = false; } else if (_1 === ("a") || _1 === ("ab")) { mode = 1089; } else if (_1 === ("r+") || _1 === ("rb+")) { mode = 2; } else if (_1 === ("w+") || _1 === ("wb+")) { mode = 578; } else if (_1 === ("a+") || _1 === ("ab+")) { mode = 1090; } case 2: _r$2 = newFile(L, ptrType$2.nil, path, mode, ((perm >>> 0)), writable, readable); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; file = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: L.Push($pkg.LNil); _r$3 = err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$3))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(new LNumber(1)); $s = -1; return 3; /* } */ case 6: L.Push(file); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: ioOpenFile }; } $f.L = L; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.file = file; $f.mode = mode; $f.path = path; $f.perm = perm; $f.readable = readable; $f.writable = writable; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ioPopen = function(L) { var L, _1, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, cmd, err, file, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; cmd = $f.cmd; err = $f.err; file = $f.file; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } cmd = _r; if (L.GetTop() === 1) { L.Push(new LString("r")); } file = ptrType$8.nil; err = $ifaceNil; _r$1 = L.CheckOption(2, ioPopenOptions); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _1 = (x = _r$1, ((x < 0 || x >= ioPopenOptions.$length) ? ($throwRuntimeError("index out of range"), undefined) : ioPopenOptions.$array[ioPopenOptions.$offset + x])); /* */ if (_1 === ("r")) { $s = 4; continue; } /* */ if (_1 === ("w")) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_1 === ("r")) { */ case 4: _r$2 = newProcess(L, cmd, false, true); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; file = _tuple[0]; err = _tuple[1]; $s = 6; continue; /* } else if (_1 === ("w")) { */ case 5: _r$3 = newProcess(L, cmd, true, false); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$1 = _r$3; file = _tuple$1[0]; err = _tuple$1[1]; /* } */ case 6: case 2: /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 9; continue; } /* */ $s = 10; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 9: L.Push($pkg.LNil); _r$4 = err.Error(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$4))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 10: L.Push(file); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: ioPopen }; } $f.L = L; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.cmd = cmd; $f.err = err; $f.file = file; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; ioRead = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fileReadAux(L, $assertType(fileDefIn(L).Value, ptrType$57), 1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ioRead }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; ioType = function(L) { var L, _tuple, _tuple$1, file, ok, ud, udok; _tuple = $assertType(L.Get(1), ptrType$8, true); ud = _tuple[0]; udok = _tuple[1]; if (!udok) { L.Push($pkg.LNil); return 1; } _tuple$1 = $assertType(ud.Value, ptrType$57, true); file = _tuple$1[0]; ok = _tuple$1[1]; if (!ok) { L.Push($pkg.LNil); return 1; } if (file.closed) { L.Push(new LString("closed file")); return 1; } L.Push(new LString("file")); return 1; }; ioTmpFile = function(L) { var L, _r, _r$1, _r$2, _tuple, _tuple$1, err, file, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; file = $f.file; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = ioutil.TempFile("", ""); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; file = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: L.Push($pkg.LNil); _r$1 = err.Error(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 3: L.G.tempFiles = $append(L.G.tempFiles, file); _r$2 = newFile(L, file, "", 0, 0, true, true); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; ud = _tuple$1[0]; L.Push(ud); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: ioTmpFile }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.file = file; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; ioOutput = function(L) { var L, _arg, _r, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, err, file, lv, lv$1, ok, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; file = $f.file; lv = $f.lv; lv$1 = $f.lv$1; ok = $f.ok; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (L.GetTop() === 0) { L.Push(fileDefOut(L)); $s = -1; return 1; } _ref = L.Get(1); /* */ if ($assertType(_ref, LString, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$8, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, LString, true)[1]) { */ case 1: lv = _ref.$val; _r = newFile(L, ptrType$2.nil, (lv), 65, 384, true, false); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; file = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$1 = err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.RaiseError(_r$1, new sliceType$6([])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: $assertType(L.Get(UpvalueIndex(1)), ptrType$1).RawSetInt(1, file); L.Push(file); $s = -1; return 1; /* } else if ($assertType(_ref, ptrType$8, true)[1]) { */ case 2: lv$1 = _ref.$val; _tuple$1 = $assertType(lv$1.Value, ptrType$57, true); ok = _tuple$1[1]; if (ok) { $assertType(L.Get(UpvalueIndex(1)), ptrType$1).RawSetInt(1, lv$1); L.Push(lv$1); $s = -1; return 1; } /* } */ case 3: _r$2 = L.Get(1).Type(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = "string or file expedted, but got " + _r$3; $r = L.ArgError(1, _arg); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: ioOutput }; } $f.L = L; $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.file = file; $f.lv = lv; $f.lv$1 = lv$1; $f.ok = ok; $f.$s = $s; $f.$r = $r; return $f; }; ioWrite = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = fileWriteAux(L, $assertType(fileDefOut(L).Value, ptrType$57), 1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: ioWrite }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; LState.ptr.prototype.OpenLibs = function() { var _i, _ref, lib, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _ref = $f._ref; lib = $f.lib; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _ref = luaLibs; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } lib = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), luaLib); ls.Push(ls.NewFunction(lib.libFunc)); ls.Push(new LString((lib.libName))); $r = ls.Call(1, 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.OpenLibs }; } $f._i = _i; $f._ref = _ref; $f.lib = lib; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.OpenLibs = function() { return this.$val.OpenLibs(); }; loGetPath = function(env, defpath) { var _r, _r$1, _tuple, defpath, dir, env, err, path, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; defpath = $f.defpath; dir = $f.dir; env = $f.env; err = $f.err; path = $f.path; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = os.Getenv(env); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } path = _r; if (path.length === 0) { path = defpath; } path = strings.Replace(path, ";;", ";" + defpath + ";", -1); /* */ if (false) { $s = 2; continue; } /* */ $s = 3; continue; /* if (false) { */ case 2: _r$1 = filepath.Abs(filepath.Dir((x = os.Args, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; dir = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } path = strings.Replace(path, "!", dir, -1); /* } */ case 3: $s = -1; return path; /* */ } return; } if ($f === undefined) { $f = { $blk: loGetPath }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.defpath = defpath; $f.dir = dir; $f.env = env; $f.err = err; $f.path = path; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; loFindFile = function(L, name, pname) { var L, _i, _r, _r$1, _r$2, _r$3, _ref, _tuple, _tuple$1, err, luapath, lv, messages, name, ok, path, pattern, pname, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; luapath = $f.luapath; lv = $f.lv; messages = $f.messages; name = $f.name; ok = $f.ok; path = $f.path; pattern = $f.pattern; pname = $f.pname; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: name = strings.Replace(name, ".", "/", -1); _r = L.GetField(L.Get(-10001), "package"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.GetField(_r, pname); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } lv = _r$1; _tuple = $assertType(lv, LString, true); path = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: $r = L.RaiseError("package.%s must be a string", new sliceType$6([new $String(pname)])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: messages = new sliceType$1([]); _ref = strings.Split((path), ";"); _i = 0; /* while (true) { */ case 6: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 7; continue; } pattern = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); luapath = strings.Replace(pattern, "?", name, -1); _r$2 = os.Stat(luapath); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; err = _tuple$1[1]; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return [luapath, ""]; } _r$3 = err.Error(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } messages = $append(messages, _r$3); _i++; /* } */ $s = 6; continue; case 7: $s = -1; return ["", strings.Join(messages, "\n\t")]; /* */ } return; } if ($f === undefined) { $f = { $blk: loFindFile }; } $f.L = L; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.luapath = luapath; $f.lv = lv; $f.messages = messages; $f.name = name; $f.ok = ok; $f.path = path; $f.pattern = pattern; $f.pname = pname; $f.$s = $s; $f.$r = $r; return $f; }; OpenPackage = function(L) { var L, _arg, _arg$1, _i, _r, _r$1, _ref, i, loaded, loader, loaders, packagemod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; i = $f.i; loaded = $f.loaded; loader = $f.loader; loaders = $f.loaders; packagemod = $f.packagemod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("package", loFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } packagemod = _r; $r = L.SetField(packagemod, "preload", L.NewTable()); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } loaders = L.CreateTable(loLoaders.$length, 0); _ref = loLoaders; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; loader = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); L.RawSetInt(loaders, i + 1 >> 0, L.NewFunction(loader)); _i++; } $r = L.SetField(packagemod, "loaders", loaders); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.SetField(L.Get(-10000), "_LOADERS", loaders); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } loaded = L.NewTable(); $r = L.SetField(packagemod, "loaded", loaded); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.SetField(L.Get(-10000), "_LOADED", loaded); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _arg = packagemod; _r$1 = loGetPath($pkg.LuaPath, $pkg.LuaPathDefault); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = new LString((_r$1)); $r = L.SetField(_arg, "path", _arg$1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = L.SetField(packagemod, "cpath", new LString("")); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } L.Push(packagemod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenPackage }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.i = i; $f.loaded = loaded; $f.loader = loader; $f.loaders = loaders; $f.packagemod = packagemod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenPackage = OpenPackage; loLoaderPreload = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _tuple, lv, name, ok, preload, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; lv = $f.lv; name = $f.name; ok = $f.ok; preload = $f.preload; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } name = _r; _r$1 = L.GetField(L.Get(-10001), "package"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = L.GetField(_r$1, "preload"); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } preload = _r$2; _tuple = $assertType(preload, ptrType$1, true); ok = _tuple[1]; /* */ if (!ok) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!ok) { */ case 4: $r = L.RaiseError("package.preload must be a table", new sliceType$6([])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: _r$3 = L.GetField(preload, name); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } lv = _r$3; /* */ if ($interfaceIsEqual(lv, $pkg.LNil)) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($interfaceIsEqual(lv, $pkg.LNil)) { */ case 8: _r$4 = fmt.Sprintf("no field package.preload['%s']", new sliceType$6([new $String(name)])); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$4))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* } */ case 9: L.Push(lv); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: loLoaderPreload }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.lv = lv; $f.name = name; $f.ok = ok; $f.preload = preload; $f.$s = $s; $f.$r = $r; return $f; }; loLoaderLua = function(L) { var L, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, err1, fn, msg, name, path, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err1 = $f.err1; fn = $f.fn; msg = $f.msg; name = $f.name; path = $f.path; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } name = _r; _r$1 = loFindFile(L, name, "path"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; path = _tuple[0]; msg = _tuple[1]; if (path.length === 0) { L.Push(new LString((msg))); $s = -1; return 1; } _r$2 = L.LoadFile(path); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; fn = _tuple$1[0]; err1 = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err1, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err1, $ifaceNil))) { */ case 4: _r$3 = err1.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.RaiseError(_r$3, new sliceType$6([])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: L.Push(fn); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: loLoaderLua }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err1 = err1; $f.fn = fn; $f.msg = msg; $f.name = name; $f.path = path; $f.$s = $s; $f.$r = $r; return $f; }; loLoadLib = function(L) { var L, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.RaiseError("loadlib is not supported", new sliceType$6([])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: loLoadLib }; } $f.L = L; $f.$s = $s; $f.$r = $r; return $f; }; loSeeAll = function(L) { var L, _r, _r$1, mod, mt, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; mod = $f.mod; mt = $f.mt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mod = _r; _r$1 = L.GetMetatable(mod); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mt = _r$1; /* */ if ($interfaceIsEqual(mt, $pkg.LNil)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($interfaceIsEqual(mt, $pkg.LNil)) { */ case 3: mt = L.CreateTable(0, 1); $r = L.SetMetatable(mod, mt); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $r = L.SetField(mt, "__index", L.Get(-10002)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: loSeeAll }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.mod = mod; $f.mt = mt; $f.$s = $s; $f.$r = $r; return $f; }; OpenMath = function(L) { var L, _r, mod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; mod = $f.mod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("math", mathFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mod = $assertType(_r, ptrType$1); mod.RawSetString("pi", new LNumber(3.141592653589793)); mod.RawSetString("huge", new LNumber(1.7976931348623157e+308)); L.Push(mod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenMath }; } $f.L = L; $f._r = _r; $f.mod = mod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenMath = OpenMath; mathAbs = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Abs((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathAbs }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathAcos = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Acos((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathAcos }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathAsin = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Asin((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathAsin }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathAtan = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Atan((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathAtan }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathAtan2 = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = (_r); _r$1 = L.CheckNumber(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = (_r$1); _r$2 = math.Atan2(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$2))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathAtan2 }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; mathCeil = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Ceil((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathCeil }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathCos = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Cos((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathCos }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathCosh = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Cosh((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathCosh }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathDeg = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = L.Push(new LNumber(((_r) * 180 / 3.141592653589793))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathDeg }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; mathExp = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Exp((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathExp }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathFloor = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Floor((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathFloor }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathFmod = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = (_r); _r$1 = L.CheckNumber(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = (_r$1); _r$2 = math.Mod(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$2))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathFmod }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; mathFrexp = function(L) { var L, _r, _r$1, _tuple, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Frexp((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; v1 = _tuple[0]; v2 = _tuple[1]; L.Push(new LNumber((v1))); L.Push(new LNumber((v2))); $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: mathFrexp }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }; mathLdexp = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = (_r); _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = math.Ldexp(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$2))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathLdexp }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; mathLog = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Log((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathLog }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathLog10 = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Log10((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathLog10 }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathMax = function(L) { var L, _r, _r$1, i, max, top, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; i = $f.i; max = $f.max; top = $f.top; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (L.GetTop() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.GetTop() === 0) { */ case 1: $r = L.RaiseError("wrong number of arguments", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r = L.CheckNumber(1); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } max = _r; top = L.GetTop(); i = 2; /* while (true) { */ case 5: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 6; continue; } _r$1 = L.CheckNumber(i); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (v > max) { max = v; } i = i + (1) >> 0; /* } */ $s = 5; continue; case 6: L.Push(new LNumber(max)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathMax }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.max = max; $f.top = top; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; mathMin = function(L) { var L, _r, _r$1, i, min, top, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; i = $f.i; min = $f.min; top = $f.top; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (L.GetTop() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.GetTop() === 0) { */ case 1: $r = L.RaiseError("wrong number of arguments", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _r = L.CheckNumber(1); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } min = _r; top = L.GetTop(); i = 2; /* while (true) { */ case 5: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 6; continue; } _r$1 = L.CheckNumber(i); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (v < min) { min = v; } i = i + (1) >> 0; /* } */ $s = 5; continue; case 6: L.Push(new LNumber(min)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathMin }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.i = i; $f.min = min; $f.top = top; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; mathMod = function(L) { var L, _r, _r$1, lhs, rhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; lhs = $f.lhs; rhs = $f.rhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } lhs = _r; _r$1 = L.CheckNumber(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } rhs = _r$1; L.Push(new LNumber(luaModulo(lhs, rhs))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathMod }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.lhs = lhs; $f.rhs = rhs; $f.$s = $s; $f.$r = $r; return $f; }; mathModf = function(L) { var L, _r, _r$1, _tuple, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Modf((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; v1 = _tuple[0]; v2 = _tuple[1]; L.Push(new LNumber((v1))); L.Push(new LNumber((v2))); $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: mathModf }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }; mathPow = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = (_r); _r$1 = L.CheckNumber(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = (_r$1); _r$2 = math.Pow(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$2))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathPow }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; }; mathRad = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = L.Push(new LNumber(((_r) * 3.141592653589793 / 180))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathRad }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; mathRandom = function(L) { var L, _1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, max, min, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; max = $f.max; min = $f.min; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _1 = L.GetTop(); /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (1)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_1 === (0)) { */ case 2: _r = rand.Float64(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else if (_1 === (1)) { */ case 3: _r$1 = L.CheckInt(1); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } n = _r$1; _r$2 = rand.Intn(n); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LNumber(((_r$2 + 1 >> 0)))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else { */ case 4: _r$3 = L.CheckInt(1); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } min = _r$3; _r$4 = L.CheckInt(2); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } max = _r$4 + 1 >> 0; _r$5 = rand.Intn(max - min >> 0); /* */ $s = 13; case 13: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.Push(new LNumber(((_r$5 + min >> 0)))); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: case 1: $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathRandom }; } $f.L = L; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.max = max; $f.min = min; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; mathRandomseed = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckInt64(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = rand.Seed(_r); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: mathRandomseed }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; mathSin = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Sin((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathSin }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathSinh = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Sinh((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathSinh }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathSqrt = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Sqrt((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathSqrt }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathTan = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Tan((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathTan }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; mathTanh = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckNumber(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = math.Tanh((_r)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: mathTanh }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; opGetOpCode = function(inst) { var inst; return (((inst >>> 26 >>> 0) >> 0)); }; opSetOpCode = function(inst, opcode) { var inst, opcode; inst.$set(((((inst.$get() & 67108863) >>> 0)) | (((opcode << 26 >> 0) >>> 0))) >>> 0); }; opGetArgA = function(inst) { var inst; return (((inst >>> 18 >>> 0) >> 0)) & 255; }; opSetArgA = function(inst, arg) { var arg, inst; inst.$set(((((inst.$get() & 4228120575) >>> 0)) | (((((arg & 255)) << 18 >> 0) >>> 0))) >>> 0); }; opGetArgB = function(inst) { var inst; return ((((inst & 511) >>> 0) >> 0)); }; opSetArgB = function(inst, arg) { var arg, inst; inst.$set(((((inst.$get() & 4294966784) >>> 0)) | (((arg & 511) >>> 0))) >>> 0); }; opGetArgC = function(inst) { var inst; return (((inst >>> 9 >>> 0) >> 0)) & 511; }; opSetArgC = function(inst, arg) { var arg, inst; inst.$set(((((inst.$get() & 4294705663) >>> 0)) | (((((arg & 511)) << 9 >> 0) >>> 0))) >>> 0); }; opGetArgBx = function(inst) { var inst; return ((((inst & 262143) >>> 0) >> 0)); }; opSetArgBx = function(inst, arg) { var arg, inst; inst.$set(((((inst.$get() & 4294705152) >>> 0)) | (((arg & 262143) >>> 0))) >>> 0); }; opGetArgSbx = function(inst) { var inst; return opGetArgBx(inst) - 131071 >> 0; }; opSetArgSbx = function(inst, arg) { var arg, inst; opSetArgBx(inst, arg + 131071 >> 0); }; opCreateABC = function(op, a, b, c) { var a, b, c, inst, inst$24ptr, op; inst = 0; opSetOpCode((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), op); opSetArgA((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), a); opSetArgB((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), b); opSetArgC((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), c); return inst; }; opCreateABx = function(op, a, bx) { var a, bx, inst, inst$24ptr, op; inst = 0; opSetOpCode((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), op); opSetArgA((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), a); opSetArgBx((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), bx); return inst; }; opCreateASbx = function(op, a, sbx) { var a, inst, inst$24ptr, op, sbx; inst = 0; opSetOpCode((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), op); opSetArgA((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), a); opSetArgSbx((inst$24ptr || (inst$24ptr = new ptrType$17(function() { return inst; }, function($v) { inst = $v; }))), sbx); return inst; }; opIsK = function(value) { var value; return (!((((value & 256)) === 0))); }; opRkAsk = function(value) { var value; return value | 256; }; opToString = function(inst) { var _1, _2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$5, _r$6, _r$7, _r$8, _r$9, arga, argb, argbx, argc, argsbx, buf, inst, op, prop, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$24 = $f._r$24; _r$25 = $f._r$25; _r$26 = $f._r$26; _r$27 = $f._r$27; _r$28 = $f._r$28; _r$29 = $f._r$29; _r$3 = $f._r$3; _r$30 = $f._r$30; _r$31 = $f._r$31; _r$32 = $f._r$32; _r$33 = $f._r$33; _r$34 = $f._r$34; _r$35 = $f._r$35; _r$36 = $f._r$36; _r$37 = $f._r$37; _r$38 = $f._r$38; _r$39 = $f._r$39; _r$4 = $f._r$4; _r$40 = $f._r$40; _r$41 = $f._r$41; _r$42 = $f._r$42; _r$43 = $f._r$43; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; arga = $f.arga; argb = $f.argb; argbx = $f.argbx; argc = $f.argc; argsbx = $f.argsbx; buf = $f.buf; inst = $f.inst; op = $f.op; prop = $f.prop; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: op = opGetOpCode(inst); if (op > 41) { $s = -1; return ""; } prop = ((op < 0 || op >= opProps.$length) ? ($throwRuntimeError("index out of range"), undefined) : opProps.$array[opProps.$offset + op]); arga = opGetArgA(inst); argb = opGetArgB(inst); argc = opGetArgC(inst); argbx = opGetArgBx(inst); argsbx = opGetArgSbx(inst); buf = ""; _1 = prop.Type; /* */ if (_1 === (0)) { $s = 2; continue; } /* */ if (_1 === (1)) { $s = 3; continue; } /* */ if (_1 === (2)) { $s = 4; continue; } /* */ $s = 5; continue; /* if (_1 === (0)) { */ case 2: _r = fmt.Sprintf("%s | %d, %d, %d", new sliceType$6([new $String(prop.Name), new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } buf = _r; $s = 5; continue; /* } else if (_1 === (1)) { */ case 3: _r$1 = fmt.Sprintf("%s | %d, %d", new sliceType$6([new $String(prop.Name), new $Int(arga), new $Int(argbx)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } buf = _r$1; $s = 5; continue; /* } else if (_1 === (2)) { */ case 4: _r$2 = fmt.Sprintf("%s | %d, %d", new sliceType$6([new $String(prop.Name), new $Int(arga), new $Int(argsbx)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } buf = _r$2; /* } */ case 5: case 1: _2 = op; /* */ if (_2 === (0)) { $s = 10; continue; } /* */ if (_2 === (1)) { $s = 11; continue; } /* */ if (_2 === (2)) { $s = 12; continue; } /* */ if (_2 === (3)) { $s = 13; continue; } /* */ if (_2 === (4)) { $s = 14; continue; } /* */ if (_2 === (5)) { $s = 15; continue; } /* */ if (_2 === (6)) { $s = 16; continue; } /* */ if (_2 === (7)) { $s = 17; continue; } /* */ if (_2 === (8)) { $s = 18; continue; } /* */ if (_2 === (9)) { $s = 19; continue; } /* */ if (_2 === (10)) { $s = 20; continue; } /* */ if (_2 === (11)) { $s = 21; continue; } /* */ if (_2 === (12)) { $s = 22; continue; } /* */ if (_2 === (13)) { $s = 23; continue; } /* */ if (_2 === (14)) { $s = 24; continue; } /* */ if (_2 === (15)) { $s = 25; continue; } /* */ if (_2 === (16)) { $s = 26; continue; } /* */ if (_2 === (17)) { $s = 27; continue; } /* */ if (_2 === (18)) { $s = 28; continue; } /* */ if (_2 === (19)) { $s = 29; continue; } /* */ if (_2 === (20)) { $s = 30; continue; } /* */ if (_2 === (21)) { $s = 31; continue; } /* */ if (_2 === (22)) { $s = 32; continue; } /* */ if (_2 === (23)) { $s = 33; continue; } /* */ if (_2 === (24)) { $s = 34; continue; } /* */ if (_2 === (25)) { $s = 35; continue; } /* */ if (_2 === (26)) { $s = 36; continue; } /* */ if (_2 === (27)) { $s = 37; continue; } /* */ if (_2 === (28)) { $s = 38; continue; } /* */ if (_2 === (29)) { $s = 39; continue; } /* */ if (_2 === (30)) { $s = 40; continue; } /* */ if (_2 === (31)) { $s = 41; continue; } /* */ if (_2 === (32)) { $s = 42; continue; } /* */ if (_2 === (33)) { $s = 43; continue; } /* */ if (_2 === (34)) { $s = 44; continue; } /* */ if (_2 === (35)) { $s = 45; continue; } /* */ if (_2 === (36)) { $s = 46; continue; } /* */ if (_2 === (37)) { $s = 47; continue; } /* */ if (_2 === (38)) { $s = 48; continue; } /* */ if (_2 === (39)) { $s = 49; continue; } /* */ if (_2 === (40)) { $s = 50; continue; } /* */ if (_2 === (41)) { $s = 51; continue; } /* */ $s = 52; continue; /* if (_2 === (0)) { */ case 10: _r$3 = fmt.Sprintf("; R(%v) := R(%v)", new sliceType$6([new $Int(arga), new $Int(argb)])); /* */ $s = 53; case 53: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } buf = buf + (_r$3); $s = 52; continue; /* } else if (_2 === (1)) { */ case 11: _r$4 = fmt.Sprintf("; R(%v) := R(%v); followed by %v MOVE ops", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 54; case 54: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } buf = buf + (_r$4); $s = 52; continue; /* } else if (_2 === (2)) { */ case 12: _r$5 = fmt.Sprintf("; R(%v) := Kst(%v)", new sliceType$6([new $Int(arga), new $Int(argbx)])); /* */ $s = 55; case 55: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } buf = buf + (_r$5); $s = 52; continue; /* } else if (_2 === (3)) { */ case 13: _r$6 = fmt.Sprintf("; R(%v) := (Bool)%v; if (%v) pc++", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 56; case 56: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } buf = buf + (_r$6); $s = 52; continue; /* } else if (_2 === (4)) { */ case 14: _r$7 = fmt.Sprintf("; R(%v) := ... := R(%v) := nil", new sliceType$6([new $Int(arga), new $Int(argb)])); /* */ $s = 57; case 57: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } buf = buf + (_r$7); $s = 52; continue; /* } else if (_2 === (5)) { */ case 15: _r$8 = fmt.Sprintf("; R(%v) := UpValue[%v]", new sliceType$6([new $Int(arga), new $Int(argb)])); /* */ $s = 58; case 58: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } buf = buf + (_r$8); $s = 52; continue; /* } else if (_2 === (6)) { */ case 16: _r$9 = fmt.Sprintf("; R(%v) := Gbl[Kst(%v)]", new sliceType$6([new $Int(arga), new $Int(argbx)])); /* */ $s = 59; case 59: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } buf = buf + (_r$9); $s = 52; continue; /* } else if (_2 === (7)) { */ case 17: _r$10 = fmt.Sprintf("; R(%v) := R(%v)[RK(%v)]", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 60; case 60: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } buf = buf + (_r$10); $s = 52; continue; /* } else if (_2 === (8)) { */ case 18: _r$11 = fmt.Sprintf("; R(%v) := R(%v)[RK(%v)] ; RK(%v) is constant string", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc), new $Int(argc)])); /* */ $s = 61; case 61: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } buf = buf + (_r$11); $s = 52; continue; /* } else if (_2 === (9)) { */ case 19: _r$12 = fmt.Sprintf("; Gbl[Kst(%v)] := R(%v)", new sliceType$6([new $Int(argbx), new $Int(arga)])); /* */ $s = 62; case 62: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } buf = buf + (_r$12); $s = 52; continue; /* } else if (_2 === (10)) { */ case 20: _r$13 = fmt.Sprintf("; UpValue[%v] := R(%v)", new sliceType$6([new $Int(argb), new $Int(arga)])); /* */ $s = 63; case 63: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } buf = buf + (_r$13); $s = 52; continue; /* } else if (_2 === (11)) { */ case 21: _r$14 = fmt.Sprintf("; R(%v)[RK(%v)] := RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 64; case 64: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } buf = buf + (_r$14); $s = 52; continue; /* } else if (_2 === (12)) { */ case 22: _r$15 = fmt.Sprintf("; R(%v)[RK(%v)] := RK(%v) ; RK(%v) is constant string", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc), new $Int(argb)])); /* */ $s = 65; case 65: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } buf = buf + (_r$15); $s = 52; continue; /* } else if (_2 === (13)) { */ case 23: _r$16 = fmt.Sprintf("; R(%v) := {} (size = BC)", new sliceType$6([new $Int(arga)])); /* */ $s = 66; case 66: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } buf = buf + (_r$16); $s = 52; continue; /* } else if (_2 === (14)) { */ case 24: _r$17 = fmt.Sprintf("; R(%v+1) := R(%v); R(%v) := R(%v)[RK(%v)]", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 67; case 67: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } buf = buf + (_r$17); $s = 52; continue; /* } else if (_2 === (15)) { */ case 25: _r$18 = fmt.Sprintf("; R(%v) := RK(%v) + RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 68; case 68: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } buf = buf + (_r$18); $s = 52; continue; /* } else if (_2 === (16)) { */ case 26: _r$19 = fmt.Sprintf("; R(%v) := RK(%v) - RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 69; case 69: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } buf = buf + (_r$19); $s = 52; continue; /* } else if (_2 === (17)) { */ case 27: _r$20 = fmt.Sprintf("; R(%v) := RK(%v) * RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 70; case 70: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } buf = buf + (_r$20); $s = 52; continue; /* } else if (_2 === (18)) { */ case 28: _r$21 = fmt.Sprintf("; R(%v) := RK(%v) / RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 71; case 71: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } buf = buf + (_r$21); $s = 52; continue; /* } else if (_2 === (19)) { */ case 29: _r$22 = fmt.Sprintf("; R(%v) := RK(%v) %% RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 72; case 72: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } buf = buf + (_r$22); $s = 52; continue; /* } else if (_2 === (20)) { */ case 30: _r$23 = fmt.Sprintf("; R(%v) := RK(%v) ^ RK(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 73; case 73: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } buf = buf + (_r$23); $s = 52; continue; /* } else if (_2 === (21)) { */ case 31: _r$24 = fmt.Sprintf("; R(%v) := -R(%v)", new sliceType$6([new $Int(arga), new $Int(argb)])); /* */ $s = 74; case 74: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } buf = buf + (_r$24); $s = 52; continue; /* } else if (_2 === (22)) { */ case 32: _r$25 = fmt.Sprintf("; R(%v) := not R(%v)", new sliceType$6([new $Int(arga), new $Int(argb)])); /* */ $s = 75; case 75: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } buf = buf + (_r$25); $s = 52; continue; /* } else if (_2 === (23)) { */ case 33: _r$26 = fmt.Sprintf("; R(%v) := length of R(%v)", new sliceType$6([new $Int(arga), new $Int(argb)])); /* */ $s = 76; case 76: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } buf = buf + (_r$26); $s = 52; continue; /* } else if (_2 === (24)) { */ case 34: _r$27 = fmt.Sprintf("; R(%v) := R(%v).. ... ..R(%v)", new sliceType$6([new $Int(arga), new $Int(argb), new $Int(argc)])); /* */ $s = 77; case 77: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } buf = buf + (_r$27); $s = 52; continue; /* } else if (_2 === (25)) { */ case 35: _r$28 = fmt.Sprintf("; pc+=%v", new sliceType$6([new $Int(argsbx)])); /* */ $s = 78; case 78: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } buf = buf + (_r$28); $s = 52; continue; /* } else if (_2 === (26)) { */ case 36: _r$29 = fmt.Sprintf("; if ((RK(%v) == RK(%v)) ~= %v) then pc++", new sliceType$6([new $Int(argb), new $Int(argc), new $Int(arga)])); /* */ $s = 79; case 79: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } buf = buf + (_r$29); $s = 52; continue; /* } else if (_2 === (27)) { */ case 37: _r$30 = fmt.Sprintf("; if ((RK(%v) < RK(%v)) ~= %v) then pc++", new sliceType$6([new $Int(argb), new $Int(argc), new $Int(arga)])); /* */ $s = 80; case 80: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } buf = buf + (_r$30); $s = 52; continue; /* } else if (_2 === (28)) { */ case 38: _r$31 = fmt.Sprintf("; if ((RK(%v) <= RK(%v)) ~= %v) then pc++", new sliceType$6([new $Int(argb), new $Int(argc), new $Int(arga)])); /* */ $s = 81; case 81: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } buf = buf + (_r$31); $s = 52; continue; /* } else if (_2 === (29)) { */ case 39: _r$32 = fmt.Sprintf("; if not (R(%v) <=> %v) then pc++", new sliceType$6([new $Int(arga), new $Int(argc)])); /* */ $s = 82; case 82: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } buf = buf + (_r$32); $s = 52; continue; /* } else if (_2 === (30)) { */ case 40: _r$33 = fmt.Sprintf("; if (R(%v) <=> %v) then R(%v) := R(%v) else pc++", new sliceType$6([new $Int(argb), new $Int(argc), new $Int(arga), new $Int(argb)])); /* */ $s = 83; case 83: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } buf = buf + (_r$33); $s = 52; continue; /* } else if (_2 === (31)) { */ case 41: _r$34 = fmt.Sprintf("; R(%v) ... R(%v+%v-2) := R(%v)(R(%v+1) ... R(%v+%v-1))", new sliceType$6([new $Int(arga), new $Int(arga), new $Int(argc), new $Int(arga), new $Int(arga), new $Int(arga), new $Int(argb)])); /* */ $s = 84; case 84: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } buf = buf + (_r$34); $s = 52; continue; /* } else if (_2 === (32)) { */ case 42: _r$35 = fmt.Sprintf("; return R(%v)(R(%v+1) ... R(%v+%v-1))", new sliceType$6([new $Int(arga), new $Int(arga), new $Int(arga), new $Int(argb)])); /* */ $s = 85; case 85: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } buf = buf + (_r$35); $s = 52; continue; /* } else if (_2 === (33)) { */ case 43: _r$36 = fmt.Sprintf("; return R(%v) ... R(%v+%v-2)", new sliceType$6([new $Int(arga), new $Int(arga), new $Int(argb)])); /* */ $s = 86; case 86: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; } buf = buf + (_r$36); $s = 52; continue; /* } else if (_2 === (34)) { */ case 44: _r$37 = fmt.Sprintf("; R(%v)+=R(%v+2); if R(%v) =) R(%v)", new sliceType$6([new $Int(arga)])); /* */ $s = 91; case 91: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; } buf = buf + (_r$41); $s = 52; continue; /* } else if (_2 === (39)) { */ case 49: _r$42 = fmt.Sprintf("; R(%v) := closure(KPROTO[%v] R(%v) ... R(%v+n))", new sliceType$6([new $Int(arga), new $Int(argbx), new $Int(arga), new $Int(arga)])); /* */ $s = 92; case 92: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; } buf = buf + (_r$42); $s = 52; continue; /* } else if (_2 === (40)) { */ case 50: _r$43 = fmt.Sprintf("; R(%v) R(%v+1) ... R(%v+%v-1) = vararg", new sliceType$6([new $Int(arga), new $Int(arga), new $Int(arga), new $Int(argb)])); /* */ $s = 93; case 93: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; } buf = buf + (_r$43); $s = 52; continue; /* } else if (_2 === (41)) { */ case 51: /* } */ case 52: case 9: $s = -1; return buf; /* */ } return; } if ($f === undefined) { $f = { $blk: opToString }; } $f._1 = _1; $f._2 = _2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$24 = _r$24; $f._r$25 = _r$25; $f._r$26 = _r$26; $f._r$27 = _r$27; $f._r$28 = _r$28; $f._r$29 = _r$29; $f._r$3 = _r$3; $f._r$30 = _r$30; $f._r$31 = _r$31; $f._r$32 = _r$32; $f._r$33 = _r$33; $f._r$34 = _r$34; $f._r$35 = _r$35; $f._r$36 = _r$36; $f._r$37 = _r$37; $f._r$38 = _r$38; $f._r$39 = _r$39; $f._r$4 = _r$4; $f._r$40 = _r$40; $f._r$41 = _r$41; $f._r$42 = _r$42; $f._r$43 = _r$43; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.arga = arga; $f.argb = argb; $f.argbx = argbx; $f.argc = argc; $f.argsbx = argsbx; $f.buf = buf; $f.inst = inst; $f.op = op; $f.prop = prop; $f.$s = $s; $f.$r = $r; return $f; }; init$2 = function() { time.Time.copy(startedAt, time.Now()); }; getIntField = function(L, tb, key, v) { var L, _tuple, key, ln, ok, ret, tb, v; ret = tb.RawGetString(key); _tuple = $assertType(ret, LNumber, true); ln = _tuple[0]; ok = _tuple[1]; if (ok) { return ((ln >> 0)); } return v; }; getBoolField = function(L, tb, key, v) { var L, _tuple, key, lb, ok, ret, tb, v; ret = tb.RawGetString(key); _tuple = $assertType(ret, LBool, true); lb = _tuple[0]; ok = _tuple[1]; if (ok) { return (lb); } return v; }; OpenOs = function(L) { var L, _r, osmod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; osmod = $f.osmod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("os", osFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } osmod = _r; L.Push(osmod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenOs }; } $f.L = L; $f._r = _r; $f.osmod = osmod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenOs = OpenOs; osClock = function(L) { var L; L.Push(new LNumber((($flatten64($clone(time.Now(), time.Time).Sub($clone(startedAt, time.Time)))) / 1e+09))); return 1; }; osDiffTime = function(L) { var L, _r, _r$1, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckInt64(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = L.CheckInt64(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber(($flatten64((x = _r, x$1 = _r$1, new $Int64(x.$high - x$1.$high, x.$low - x$1.$low)))))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osDiffTime }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; osExecute = function(L) { var L, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, _tuple$2, args, cmd, err, procAttr, process, ps, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; args = $f.args; cmd = $f.cmd; err = $f.err; procAttr = $f.procAttr; process = $f.process; ps = $f.ps; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: procAttr = [procAttr]; procAttr[0] = new os.ProcAttr.ptr("", sliceType$1.nil, sliceType$21.nil, ptrType$63.nil); procAttr[0].Files = new sliceType$21([os.Stdin, os.Stdout, os.Stderr]); _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = popenArgs(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; cmd = _tuple[0]; args = _tuple[1]; args = $appendSlice(new sliceType$1([cmd]), args); _r$2 = os.StartProcess(cmd, args, procAttr[0]); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; process = _tuple$1[0]; err = _tuple$1[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { L.Push(new LNumber(1)); $s = -1; return 1; } _r$3 = process.Wait(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$2 = _r$3; ps = _tuple$2[0]; err = _tuple$2[1]; if (!($interfaceIsEqual(err, $ifaceNil)) || !ps.Success()) { L.Push(new LNumber(1)); $s = -1; return 1; } L.Push(new LNumber(0)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osExecute }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.args = args; $f.cmd = cmd; $f.err = err; $f.procAttr = procAttr; $f.process = process; $f.ps = ps; $f.$s = $s; $f.$r = $r; return $f; }; osExit = function(L) { var L, _r, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.Close(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r = L.OptInt(1, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = os.Exit(_r); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osExit }; } $f.L = L; $f._r = _r; $f.$s = $s; $f.$r = $r; return $f; }; osDate = function(L) { var L, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _arg$5, _arg$6, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, cfmt, ret, t, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _arg$4 = $f._arg$4; _arg$5 = $f._arg$5; _arg$6 = $f._arg$6; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; cfmt = $f.cfmt; ret = $f.ret; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: t = $clone(time.Now(), time.Time); cfmt = "%c"; /* */ if (L.GetTop() >= 1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.GetTop() >= 1) { */ case 1: _r = L.CheckString(1); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } cfmt = _r; /* */ if (strings.HasPrefix(cfmt, "!")) { $s = 4; continue; } /* */ $s = 5; continue; /* if (strings.HasPrefix(cfmt, "!")) { */ case 4: time.Time.copy(t, $clone(time.Now(), time.Time).UTC()); _r$1 = strings.TrimLeft(cfmt, "!"); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } cfmt = _r$1; /* } */ case 5: /* */ if (L.GetTop() >= 2) { $s = 7; continue; } /* */ $s = 8; continue; /* if (L.GetTop() >= 2) { */ case 7: _r$2 = L.CheckInt64(2); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = time.Unix(_r$2, new $Int64(0, 0)); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } time.Time.copy(t, _r$3); /* } */ case 8: /* */ if (strings.HasPrefix(cfmt, "*t")) { $s = 11; continue; } /* */ $s = 12; continue; /* if (strings.HasPrefix(cfmt, "*t")) { */ case 11: ret = L.NewTable(); _r$4 = $clone(t, time.Time).Year(); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg = new LNumber((_r$4)); $r = ret.RawSetString("year", _arg); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$5 = $clone(t, time.Time).Month(); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = new LNumber((_r$5)); $r = ret.RawSetString("month", _arg$1); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$6 = $clone(t, time.Time).Day(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg$2 = new LNumber((_r$6)); $r = ret.RawSetString("day", _arg$2); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$7 = $clone(t, time.Time).Hour(); /* */ $s = 19; case 19: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _arg$3 = new LNumber((_r$7)); $r = ret.RawSetString("hour", _arg$3); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$8 = $clone(t, time.Time).Minute(); /* */ $s = 21; case 21: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$4 = new LNumber((_r$8)); $r = ret.RawSetString("min", _arg$4); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$9 = $clone(t, time.Time).Second(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$5 = new LNumber((_r$9)); $r = ret.RawSetString("sec", _arg$5); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$10 = $clone(t, time.Time).Weekday(); /* */ $s = 25; case 25: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$6 = new LNumber(((_r$10 + 1 >> 0))); $r = ret.RawSetString("wday", _arg$6); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret.RawSetString("yday", new LNumber(0)); ret.RawSetString("isdst", new LBool($pkg.LFalse)); L.Push(ret); $s = -1; return 1; /* } */ case 12: /* } */ case 2: _r$11 = strftime($clone(t, time.Time), cfmt); /* */ $s = 27; case 27: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$11))); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osDate }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._arg$4 = _arg$4; $f._arg$5 = _arg$5; $f._arg$6 = _arg$6; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.cfmt = cfmt; $f.ret = ret; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; }; osGetEnv = function(L) { var L, _r, _r$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = os.Getenv(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } v = _r$1; if (v.length === 0) { L.Push($pkg.LNil); } else { L.Push(new LString((v))); } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osGetEnv }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; osRemove = function(L) { var L, _r, _r$1, _r$2, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = os.Remove(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3: L.Push($pkg.LNil); _r$2 = err.Error(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$2))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 4: L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osRemove }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; osRename = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, _r$3, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = L.CheckString(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = os.Rename(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: L.Push($pkg.LNil); _r$3 = err.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$3))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 5: L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osRename }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; osSetLocale = function(L) { var L; L.Push(new LBool($pkg.LFalse)); return 1; }; osSetEnv = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, _r$3, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = L.CheckString(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = os.Setenv(_arg, _arg$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } err = _r$2; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: L.Push($pkg.LNil); _r$3 = err.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$3))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 2; /* } */ case 5: L.Push(new LBool($pkg.LTrue)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osSetEnv }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; osTime = function(L) { var L, _r, _r$1, day, hour, isdst, min, month, sec, t, tbl, year, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; day = $f.day; hour = $f.hour; isdst = $f.isdst; min = $f.min; month = $f.month; sec = $f.sec; t = $f.t; tbl = $f.tbl; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: /* */ if (L.GetTop() === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.GetTop() === 0) { */ case 1: L.Push(new LNumber(($flatten64($clone(time.Now(), time.Time).Unix())))); $s = 3; continue; /* } else { */ case 2: _r = L.CheckTable(1); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tbl = _r; sec = getIntField(L, tbl, "sec", 0); min = getIntField(L, tbl, "min", 0); hour = getIntField(L, tbl, "hour", 12); day = getIntField(L, tbl, "day", -1); month = getIntField(L, tbl, "month", -1); year = getIntField(L, tbl, "year", -1); isdst = getBoolField(L, tbl, "isdst", false); _r$1 = time.Date(year, ((month >> 0)), day, hour, min, sec, 0, time.Local); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } t = $clone(_r$1, time.Time); if (false) { console.log(isdst); } L.Push(new LNumber(($flatten64($clone(t, time.Time).Unix())))); /* } */ case 3: $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osTime }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.day = day; $f.hour = hour; $f.isdst = isdst; $f.min = min; $f.month = month; $f.sec = sec; $f.t = t; $f.tbl = tbl; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; }; osTmpname = function(L) { var L, _r, _r$1, _tuple, err, file, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; file = $f.file; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = ioutil.TempFile("", ""); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; file = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: $r = L.RaiseError("unable to generate a unique filename", new sliceType$6([])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: _r$1 = file.Close(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$1; os.Remove(file.Name()); L.Push(new LString((file.Name()))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: osTmpname }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.file = file; $f.$s = $s; $f.$r = $r; return $f; }; newAPIError = function(code, object) { var code, object; return new APIError.ptr(code, object, "", $ifaceNil); }; newAPIErrorS = function(code, message) { var code, message; return newAPIError(code, new LString((message))); }; newAPIErrorE = function(code, err) { var _r, code, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; code = $f.code; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return new APIError.ptr(code, new LString((_r)), "", err); /* */ } return; } if ($f === undefined) { $f = { $blk: newAPIErrorE }; } $f._r = _r; $f.code = code; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; APIError.ptr.prototype.Error = function() { var _arg, _arg$1, _r, _r$1, _r$2, e, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: e = this; /* */ if (e.StackTrace.length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (e.StackTrace.length > 0) { */ case 1: _r = e.Object.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = new $String(_r); _arg$1 = new $String(e.StackTrace); _r$1 = fmt.Sprintf("%s\n%s", new sliceType$6([_arg, _arg$1])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 2: _r$2 = e.Object.String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: APIError.ptr.prototype.Error }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; }; APIError.prototype.Error = function() { return this.$val.Error(); }; newCallFrameStack = function(size) { var size; return new callFrameStack.ptr($makeSlice(sliceType$22, size), 0); }; callFrameStack.ptr.prototype.IsEmpty = function() { var cs; cs = this; return cs.sp === 0; }; callFrameStack.prototype.IsEmpty = function() { return this.$val.IsEmpty(); }; callFrameStack.ptr.prototype.Clear = function() { var cs; cs = this; cs.sp = 0; }; callFrameStack.prototype.Clear = function() { return this.$val.Clear(); }; callFrameStack.ptr.prototype.Push = function(v) { var cs, v, x, x$1, x$2, x$3; cs = this; callFrame.copy((x = cs.array, x$1 = cs.sp, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])), v); (x$2 = cs.array, x$3 = cs.sp, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])).Idx = cs.sp; cs.sp = cs.sp + (1) >> 0; }; callFrameStack.prototype.Push = function(v) { return this.$val.Push(v); }; callFrameStack.ptr.prototype.Remove = function(sp) { var cs, i, next, nsp, pre, psp, sp, x, x$1, x$2, x$3, x$4, x$5; cs = this; psp = sp - 1 >> 0; nsp = sp + 1 >> 0; pre = ptrType$10.nil; next = ptrType$10.nil; if (psp > 0) { pre = (x = cs.array, ((psp < 0 || psp >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + psp])); } if (nsp < cs.sp) { next = (x$1 = cs.array, ((nsp < 0 || nsp >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + nsp])); } if (!(next === ptrType$10.nil)) { next.Parent = pre; } i = sp; while (true) { if (!((i + 1 >> 0) < cs.sp)) { break; } callFrame.copy((x$4 = cs.array, ((i < 0 || i >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + i])), (x$2 = cs.array, x$3 = i + 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3]))); (x$5 = cs.array, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i])).Idx = i; cs.sp = i; i = i + (1) >> 0; } cs.sp = cs.sp + (1) >> 0; }; callFrameStack.prototype.Remove = function(sp) { return this.$val.Remove(sp); }; callFrameStack.ptr.prototype.Sp = function() { var cs; cs = this; return cs.sp; }; callFrameStack.prototype.Sp = function() { return this.$val.Sp(); }; callFrameStack.ptr.prototype.SetSp = function(sp) { var cs, sp; cs = this; cs.sp = sp; }; callFrameStack.prototype.SetSp = function(sp) { return this.$val.SetSp(sp); }; callFrameStack.ptr.prototype.Last = function() { var cs, x, x$1; cs = this; if (cs.sp === 0) { return ptrType$10.nil; } return (x = cs.array, x$1 = cs.sp - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); }; callFrameStack.prototype.Last = function() { return this.$val.Last(); }; callFrameStack.ptr.prototype.At = function(sp) { var cs, sp, x; cs = this; return (x = cs.array, ((sp < 0 || sp >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + sp])); }; callFrameStack.prototype.At = function(sp) { return this.$val.At(sp); }; callFrameStack.ptr.prototype.Pop = function() { var cs, x, x$1; cs = this; cs.sp = cs.sp - (1) >> 0; return (x = cs.array, x$1 = cs.sp, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); }; callFrameStack.prototype.Pop = function() { return this.$val.Pop(); }; newRegistry = function(size, alloc) { var alloc, size; return new registry.ptr($makeSlice(sliceType$7, size), 0, alloc); }; registry.ptr.prototype.SetTop = function(top) { var i, i$1, oldtop, rg, top, x, x$1; rg = this; oldtop = rg.top; rg.top = top; i = oldtop; while (true) { if (!(i < rg.top)) { break; } (x = rg.array, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = $pkg.LNil)); i = i + (1) >> 0; } i$1 = rg.top; while (true) { if (!(i$1 < oldtop)) { break; } (x$1 = rg.array, ((i$1 < 0 || i$1 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i$1] = $pkg.LNil)); i$1 = i$1 + (1) >> 0; } }; registry.prototype.SetTop = function(top) { return this.$val.SetTop(top); }; registry.ptr.prototype.Top = function() { var rg; rg = this; return rg.top; }; registry.prototype.Top = function() { return this.$val.Top(); }; registry.ptr.prototype.Push = function(v) { var rg, v, x, x$1; rg = this; (x = rg.array, x$1 = rg.top, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = v)); rg.top = rg.top + (1) >> 0; }; registry.prototype.Push = function(v) { return this.$val.Push(v); }; registry.ptr.prototype.Pop = function() { var rg, v, x, x$1, x$2, x$3; rg = this; v = (x = rg.array, x$1 = rg.top - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); (x$2 = rg.array, x$3 = rg.top - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3] = $pkg.LNil)); rg.top = rg.top - (1) >> 0; return v; }; registry.prototype.Pop = function() { return this.$val.Pop(); }; registry.ptr.prototype.Get = function(reg) { var reg, rg, x; rg = this; return (x = rg.array, ((reg < 0 || reg >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + reg])); }; registry.prototype.Get = function(reg) { return this.$val.Get(reg); }; registry.ptr.prototype.CopyRange = function(regv, start, limit, n) { var i, limit, n, regv, rg, start, tidx, x, x$1, x$2, x$3, x$4; rg = this; i = 0; while (true) { if (!(i < n)) { break; } tidx = start + i >> 0; if (tidx >= rg.top || limit > -1 && tidx >= limit || tidx < 0) { (x = rg.array, x$1 = regv + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); } else { (x$3 = rg.array, x$4 = regv + i >> 0, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = (x$2 = rg.array, ((tidx < 0 || tidx >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + tidx])))); } i = i + (1) >> 0; } rg.top = regv + n >> 0; }; registry.prototype.CopyRange = function(regv, start, limit, n) { return this.$val.CopyRange(regv, start, limit, n); }; registry.ptr.prototype.FillNil = function(regm, n) { var i, n, regm, rg, x, x$1; rg = this; i = 0; while (true) { if (!(i < n)) { break; } (x = rg.array, x$1 = regm + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); i = i + (1) >> 0; } rg.top = regm + n >> 0; }; registry.prototype.FillNil = function(regm, n) { return this.$val.FillNil(regm, n); }; registry.ptr.prototype.Insert = function(value, reg) { var reg, rg, top, value; rg = this; top = rg.Top(); if (reg >= top) { rg.Set(reg, value); return; } top = top - (1) >> 0; while (true) { if (!(top >= reg)) { break; } rg.Set(top + 1 >> 0, rg.Get(top)); top = top - (1) >> 0; } rg.Set(reg, value); }; registry.prototype.Insert = function(value, reg) { return this.$val.Insert(value, reg); }; registry.ptr.prototype.Set = function(reg, val) { var reg, rg, val, x; rg = this; (x = rg.array, ((reg < 0 || reg >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + reg] = val)); if (reg >= rg.top) { rg.top = reg + 1 >> 0; } }; registry.prototype.Set = function(reg, val) { return this.$val.Set(reg, val); }; registry.ptr.prototype.SetNumber = function(reg, val) { var reg, rg, val, x; rg = this; (x = rg.array, ((reg < 0 || reg >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + reg] = rg.alloc.LNumber2I(val))); if (reg >= rg.top) { rg.top = reg + 1 >> 0; } }; registry.prototype.SetNumber = function(reg, val) { return this.$val.SetNumber(reg, val); }; newGlobal = function() { return new Global.ptr(ptrType$9.nil, ptrType$9.nil, newLTable(0, 32), newLTable(0, 64), {}, $makeSlice(sliceType$21, 0, 10), 0); }; panicWithTraceback = function(L) { var L, _r, err, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; err = $f.err; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: err = newAPIError(2, L.Get(-1)); _r = L.stackTrace(0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } err.StackTrace = _r; $panic(err); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: panicWithTraceback }; } $f.L = L; $f._r = _r; $f.err = err; $f.$s = $s; $f.$r = $r; return $f; }; panicWithoutTraceback = function(L) { var L, err; err = newAPIError(2, L.Get(-1)); $panic(err); }; newLState = function(options) { var al, ls, options; al = newAllocator(32); ls = new LState.ptr(newGlobal(), ptrType$9.nil, ptrType$1.nil, panicWithTraceback, false, $clone(options, Options), 0, newRegistry(options.RegistrySize, al), newCallFrameStack(options.CallStackSize), al, ptrType$10.nil, false, ptrType$56.nil, false, mainLoop, $ifaceNil); ls.Env = ls.G.Global; return ls; }; LState.ptr.prototype.printReg = function() { var _r, i, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; console.log("-------------------------"); console.log("thread:", ls); console.log("top:", ls.reg.Top()); if (!(ls.currentFrame === ptrType$10.nil)) { console.log("function base:", ls.currentFrame.Base); console.log("return base:", ls.currentFrame.ReturnBase); } else { console.log("(vm not started)"); } console.log("local base:", ls.currentLocalBase()); i = 0; /* while (true) { */ case 1: /* if (!(i < ls.reg.Top())) { break; } */ if(!(i < ls.reg.Top())) { $s = 2; continue; } _r = ls.reg.Get(i).String(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } console.log(i, _r); i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: console.log("-------------------------"); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.printReg }; } $f._r = _r; $f.i = i; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.printReg = function() { return this.$val.printReg(); }; LState.ptr.prototype.closeAllUpvalues = function() { var cf, ls; ls = this; cf = ls.currentFrame; while (true) { if (!(!(cf === ptrType$10.nil))) { break; } if (!cf.Fn.IsG) { ls.closeUpvalues(cf.LocalBase); } cf = cf.Parent; } }; LState.prototype.closeAllUpvalues = function() { return this.$val.closeAllUpvalues(); }; LState.ptr.prototype.raiseError = function(level, format, args) { var _arg, _arg$1, _r, _r$1, _r$2, args, format, level, ls, message, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; args = $f.args; format = $f.format; level = $f.level; ls = $f.ls; message = $f.message; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; if (!ls.hasErrorFunc) { ls.closeAllUpvalues(); } message = format; /* */ if (args.$length > 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (args.$length > 0) { */ case 1: _r = fmt.Sprintf(format, args); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } message = _r; /* } */ case 2: /* */ if (level > 0) { $s = 4; continue; } /* */ $s = 5; continue; /* if (level > 0) { */ case 4: _r$1 = ls.where(level - 1 >> 0, true); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); _arg$1 = new $String(message); _r$2 = fmt.Sprintf("%v %v", new sliceType$6([_arg, _arg$1])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } message = _r$2; /* } */ case 5: ls.reg.Push(new LString((message))); $r = ls.Panic(ls); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.raiseError }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.args = args; $f.format = format; $f.level = level; $f.ls = ls; $f.message = message; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.raiseError = function(level, format, args) { return this.$val.raiseError(level, format, args); }; LState.ptr.prototype.findLocal = function(frame, no) { var _tuple, fn, frame, ls, name, no, ok, top; ls = this; fn = frame.Fn; if (!fn.IsG) { _tuple = fn.LocalName(no, frame.Pc - 1 >> 0); name = _tuple[0]; ok = _tuple[1]; if (ok) { return name; } } top = 0; if (ls.currentFrame === frame) { top = ls.reg.Top(); } else if ((frame.Idx + 1 >> 0) < ls.stack.Sp()) { top = ls.stack.At(frame.Idx + 1 >> 0).Base; } else { return ""; } if ((top - frame.LocalBase >> 0) >= no) { return "(*temporary)"; } return ""; }; LState.prototype.findLocal = function(frame, no) { return this.$val.findLocal(frame, no); }; LState.ptr.prototype.where = function(level, skipg) { var _r, _r$1, _r$2, _tuple, cf, dbg, level, line, ls, ok, proto, skipg, sourcename, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; cf = $f.cf; dbg = $f.dbg; level = $f.level; line = $f.line; ls = $f.ls; ok = $f.ok; proto = $f.proto; skipg = $f.skipg; sourcename = $f.sourcename; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = ls.GetStack(level); dbg = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return ""; } cf = dbg.frame; proto = cf.Fn.Proto; sourcename = "[G]"; /* */ if (!(proto === ptrType$18.nil)) { $s = 1; continue; } /* */ if (skipg) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!(proto === ptrType$18.nil)) { */ case 1: sourcename = proto.SourceName; $s = 3; continue; /* } else if (skipg) { */ case 2: _r = ls.where(level + 1 >> 0, skipg); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 3: line = ""; /* */ if (!(proto === ptrType$18.nil)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(proto === ptrType$18.nil)) { */ case 5: _r$1 = fmt.Sprintf("%v:", new sliceType$6([new $Int((x = proto.DbgSourcePositions, x$1 = cf.Pc - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])))])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } line = _r$1; /* } */ case 6: _r$2 = fmt.Sprintf("%v:%v", new sliceType$6([new $String(sourcename), new $String(line)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.where }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.cf = cf; $f.dbg = dbg; $f.level = level; $f.line = line; $f.ls = ls; $f.ok = ok; $f.proto = proto; $f.skipg = skipg; $f.sourcename = sourcename; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.where = function(level, skipg) { return this.$val.where(level, skipg); }; LState.ptr.prototype.stackTrace = function(level) { var _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _tuple, _tuple$1, buf, cf, dbg, header, i, level, ls, newbuf, ok, tc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; cf = $f.cf; dbg = $f.dbg; header = $f.header; i = $f.i; level = $f.level; ls = $f.ls; newbuf = $f.newbuf; ok = $f.ok; tc = $f.tc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; buf = new sliceType$1([]); header = "stack traceback:"; /* */ if (!(ls.currentFrame === ptrType$10.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(ls.currentFrame === ptrType$10.nil)) { */ case 1: i = 0; _tuple = ls.GetStack(i); dbg = _tuple[0]; ok = _tuple[1]; /* while (true) { */ case 3: /* if (!(ok)) { break; } */ if(!(ok)) { $s = 4; continue; } cf = dbg.frame; _r = ls.Where(i); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = new $String(_r); _r$1 = ls.formattedFrameFuncName(cf); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = new $String(_r$1); _r$2 = fmt.Sprintf("\t%v in %v", new sliceType$6([_arg, _arg$1])); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } buf = $append(buf, _r$2); if (!cf.Fn.IsG && cf.TailCall > 0) { tc = cf.TailCall; while (true) { if (!(tc > 0)) { break; } buf = $append(buf, "\t(tailcall): ?"); i = i + (1) >> 0; tc = tc - (1) >> 0; } } i = i + (1) >> 0; _tuple$1 = ls.GetStack(i); dbg = _tuple$1[0]; ok = _tuple$1[1]; /* } */ $s = 3; continue; case 4: /* } */ case 2: _r$3 = fmt.Sprintf("\t%v: %v", new sliceType$6([new $String("[G]"), new $String("?")])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } buf = $append(buf, _r$3); buf = $subslice(buf, intMax(0, intMin(level, buf.$length)), buf.$length); if (buf.$length > 20) { newbuf = $makeSlice(sliceType$1, 0, 20); newbuf = $appendSlice(newbuf, $subslice(buf, 0, 7)); newbuf = $append(newbuf, "\t..."); newbuf = $appendSlice(newbuf, $subslice(buf, (buf.$length - 7 >> 0), buf.$length)); buf = newbuf; } _r$4 = fmt.Sprintf("%s\n%s", new sliceType$6([new $String(header), new $String(strings.Join(buf, "\n"))])); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $s = -1; return _r$4; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.stackTrace }; } $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.cf = cf; $f.dbg = dbg; $f.header = header; $f.i = i; $f.level = level; $f.ls = ls; $f.newbuf = newbuf; $f.ok = ok; $f.tc = tc; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.stackTrace = function(level) { return this.$val.stackTrace(level); }; LState.ptr.prototype.formattedFrameFuncName = function(fr) { var _r, _r$1, _r$2, _tuple, fr, ischunk, ls, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; fr = $f.fr; ischunk = $f.ischunk; ls = $f.ls; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.frameFuncName(fr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; name = _tuple[0]; ischunk = _tuple[1]; if (ischunk) { $s = -1; return name; } /* */ if (!((name.charCodeAt(0) === 40)) && !((name.charCodeAt(0) === 60))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((name.charCodeAt(0) === 40)) && !((name.charCodeAt(0) === 60))) { */ case 2: _r$1 = fmt.Sprintf("function '%s'", new sliceType$6([new $String(name)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* } */ case 3: _r$2 = fmt.Sprintf("function %s", new sliceType$6([new $String(name)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $s = -1; return _r$2; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.formattedFrameFuncName }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.fr = fr; $f.ischunk = ischunk; $f.ls = ls; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.formattedFrameFuncName = function(fr) { return this.$val.formattedFrameFuncName(fr); }; LState.ptr.prototype.rawFrameFuncName = function(fr) { var _r, _tuple, fr, ls, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; fr = $f.fr; ls = $f.ls; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.frameFuncName(fr); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; name = _tuple[0]; $s = -1; return name; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.rawFrameFuncName }; } $f._r = _r; $f._tuple = _tuple; $f.fr = fr; $f.ls = ls; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.rawFrameFuncName = function(fr) { return this.$val.rawFrameFuncName(fr); }; LState.ptr.prototype.frameFuncName = function(fr) { var _i, _r, _r$1, _ref, call, fr, frame, ls, name, pc, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; call = $f.call; fr = $f.fr; frame = $f.frame; ls = $f.ls; name = $f.name; pc = $f.pc; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; frame = fr.Parent; if (frame === ptrType$10.nil) { if (ls.Parent === ptrType$9.nil) { $s = -1; return ["main chunk", true]; } $s = -1; return ["corountine", true]; } /* */ if (!frame.Fn.IsG) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!frame.Fn.IsG) { */ case 1: pc = frame.Pc - 1 >> 0; _ref = frame.Fn.Proto.DbgCalls; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } call = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), DbgCall); /* */ if (call.Pc === pc) { $s = 5; continue; } /* */ $s = 6; continue; /* if (call.Pc === pc) { */ case 5: name = call.Name; /* */ if ((name === "?" || fr.TailCall > 0) && !fr.Fn.IsG) { $s = 7; continue; } /* */ $s = 8; continue; /* if ((name === "?" || fr.TailCall > 0) && !fr.Fn.IsG) { */ case 7: _r = fmt.Sprintf("<%v:%v>", new sliceType$6([new $String(fr.Fn.Proto.SourceName), new $Int(fr.Fn.Proto.LineDefined)])); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } name = _r; /* } */ case 8: $s = -1; return [name, false]; /* } */ case 6: _i++; /* } */ $s = 3; continue; case 4: /* } */ case 2: /* */ if (!fr.Fn.IsG) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!fr.Fn.IsG) { */ case 10: _r$1 = fmt.Sprintf("<%v:%v>", new sliceType$6([new $String(fr.Fn.Proto.SourceName), new $Int(fr.Fn.Proto.LineDefined)])); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return [_r$1, false]; /* } */ case 11: $s = -1; return ["(anonymous)", false]; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.frameFuncName }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.call = call; $f.fr = fr; $f.frame = frame; $f.ls = ls; $f.name = name; $f.pc = pc; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.frameFuncName = function(fr) { return this.$val.frameFuncName(fr); }; LState.ptr.prototype.isStarted = function() { var ls; ls = this; return !(ls.currentFrame === ptrType$10.nil); }; LState.prototype.isStarted = function() { return this.$val.isStarted(); }; LState.ptr.prototype.kill = function() { var ls; ls = this; ls.Dead = true; }; LState.prototype.kill = function() { return this.$val.kill(); }; LState.ptr.prototype.indexToReg = function(idx) { var base, idx, ls, tidx; ls = this; base = ls.currentLocalBase(); if (idx > 0) { return (base + idx >> 0) - 1 >> 0; } else if (idx === 0) { return -1; } else { tidx = ls.reg.Top() + idx >> 0; if (tidx < base) { return -1; } return tidx; } }; LState.prototype.indexToReg = function(idx) { return this.$val.indexToReg(idx); }; LState.ptr.prototype.currentLocalBase = function() { var base, ls; ls = this; base = 0; if (!(ls.currentFrame === ptrType$10.nil)) { base = ls.currentFrame.LocalBase; } return base; }; LState.prototype.currentLocalBase = function() { return this.$val.currentLocalBase(); }; LState.ptr.prototype.currentEnv = function() { var ls; ls = this; return ls.Env; }; LState.prototype.currentEnv = function() { return this.$val.currentEnv(); }; LState.ptr.prototype.rkValue = function(idx) { var idx, ls, x, x$1, x$2, x$3; ls = this; if (!((((idx & 256)) === 0))) { return (x = ls.currentFrame.Fn.Proto.Constants, x$1 = idx & -257, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); } return (x$2 = ls.reg.array, x$3 = ls.currentFrame.LocalBase + idx >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])); }; LState.prototype.rkValue = function(idx) { return this.$val.rkValue(idx); }; LState.ptr.prototype.rkString = function(idx) { var idx, ls, x, x$1, x$2, x$3; ls = this; if (!((((idx & 256)) === 0))) { return (x = ls.currentFrame.Fn.Proto.stringConstants, x$1 = idx & -257, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); } return ($assertType((x$2 = ls.reg.array, x$3 = ls.currentFrame.LocalBase + idx >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])), LString)); }; LState.prototype.rkString = function(idx) { return this.$val.rkString(idx); }; LState.ptr.prototype.closeUpvalues = function(idx) { var idx, ls, prev, uv; ls = this; if (!(ls.uvcache === ptrType$56.nil)) { prev = ptrType$56.nil; uv = ls.uvcache; while (true) { if (!(!(uv === ptrType$56.nil))) { break; } if (uv.index >= idx) { if (!(prev === ptrType$56.nil)) { prev.next = ptrType$56.nil; } else { ls.uvcache = ptrType$56.nil; } uv.Close(); } prev = uv; uv = uv.next; } } }; LState.prototype.closeUpvalues = function(idx) { return this.$val.closeUpvalues(idx); }; LState.ptr.prototype.findUpvalue = function(idx) { var idx, ls, next, prev, uv, uv$1; ls = this; prev = ptrType$56.nil; next = ptrType$56.nil; if (!(ls.uvcache === ptrType$56.nil)) { uv = ls.uvcache; while (true) { if (!(!(uv === ptrType$56.nil))) { break; } if (uv.index === idx) { return uv; } if (uv.index > idx) { next = uv; break; } prev = uv; uv = uv.next; } } uv$1 = new Upvalue.ptr(ptrType$56.nil, ls.reg, idx, $ifaceNil, false); if (!(prev === ptrType$56.nil)) { prev.next = uv$1; } else { ls.uvcache = uv$1; } if (!(next === ptrType$56.nil)) { uv$1.next = next; } return uv$1; }; LState.prototype.findUpvalue = function(idx) { return this.$val.findUpvalue(idx); }; LState.ptr.prototype.metatable = function(lvalue, rawget) { var _entry, _r, _ref, _tuple, _tuple$1, ls, lvalue, metatable, obj, obj$1, obj$2, ok, ok$1, oldmt, rawget, table, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; ls = $f.ls; lvalue = $f.lvalue; metatable = $f.metatable; obj = $f.obj; obj$1 = $f.obj$1; obj$2 = $f.obj$2; ok = $f.ok; ok$1 = $f.ok$1; oldmt = $f.oldmt; rawget = $f.rawget; table = $f.table; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; metatable = $pkg.LNil; _ref = lvalue; /* */ if ($assertType(_ref, ptrType$1, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, ptrType$8, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, ptrType$1, true)[1]) { */ case 1: obj = _ref.$val; metatable = obj.Metatable; $s = 4; continue; /* } else if ($assertType(_ref, ptrType$8, true)[1]) { */ case 2: obj$1 = _ref.$val; metatable = obj$1.Metatable; $s = 4; continue; /* } else { */ case 3: obj$2 = _ref; _r = obj$2.Type(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = (_entry = ls.G.builtinMts[$Int.keyFor(((_r >> 0)))], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); table = _tuple[0]; ok = _tuple[1]; if (ok) { metatable = table; } /* } */ case 4: if (!rawget && !($interfaceIsEqual(metatable, $pkg.LNil))) { oldmt = metatable; _tuple$1 = $assertType(metatable, ptrType$1, true); tb = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { metatable = tb.RawGetString("__metatable"); if ($interfaceIsEqual(metatable, $pkg.LNil)) { metatable = oldmt; } } } $s = -1; return metatable; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.metatable }; } $f._entry = _entry; $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.ls = ls; $f.lvalue = lvalue; $f.metatable = metatable; $f.obj = obj; $f.obj$1 = obj$1; $f.obj$2 = obj$2; $f.ok = ok; $f.ok$1 = ok$1; $f.oldmt = oldmt; $f.rawget = rawget; $f.table = table; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.metatable = function(lvalue, rawget) { return this.$val.metatable(lvalue, rawget); }; LState.ptr.prototype.metaOp1 = function(lvalue, event) { var _r, _tuple, event, ls, lvalue, mt, ok, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; event = $f.event; ls = $f.ls; lvalue = $f.lvalue; mt = $f.mt; ok = $f.ok; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.metatable(lvalue, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mt = _r; if (!($interfaceIsEqual(mt, $pkg.LNil))) { _tuple = $assertType(mt, ptrType$1, true); tb = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return tb.RawGetString(event); } } $s = -1; return $pkg.LNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.metaOp1 }; } $f._r = _r; $f._tuple = _tuple; $f.event = event; $f.ls = ls; $f.lvalue = lvalue; $f.mt = mt; $f.ok = ok; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.metaOp1 = function(lvalue, event) { return this.$val.metaOp1(lvalue, event); }; LState.ptr.prototype.metaOp2 = function(value1, value2, event) { var _r, _r$1, _tuple, _tuple$1, event, ls, mt, mt$1, ok, ok$1, ret, tb, tb$1, value1, value2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; event = $f.event; ls = $f.ls; mt = $f.mt; mt$1 = $f.mt$1; ok = $f.ok; ok$1 = $f.ok$1; ret = $f.ret; tb = $f.tb; tb$1 = $f.tb$1; value1 = $f.value1; value2 = $f.value2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.metatable(value1, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mt = _r; if (!($interfaceIsEqual(mt, $pkg.LNil))) { _tuple = $assertType(mt, ptrType$1, true); tb = _tuple[0]; ok = _tuple[1]; if (ok) { ret = tb.RawGetString(event); if (!($interfaceIsEqual(ret, $pkg.LNil))) { $s = -1; return ret; } } } _r$1 = ls.metatable(value2, true); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } mt$1 = _r$1; if (!($interfaceIsEqual(mt$1, $pkg.LNil))) { _tuple$1 = $assertType(mt$1, ptrType$1, true); tb$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { $s = -1; return tb$1.RawGetString(event); } } $s = -1; return $pkg.LNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.metaOp2 }; } $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.event = event; $f.ls = ls; $f.mt = mt; $f.mt$1 = mt$1; $f.ok = ok; $f.ok$1 = ok$1; $f.ret = ret; $f.tb = tb; $f.tb$1 = tb$1; $f.value1 = value1; $f.value2 = value2; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.metaOp2 = function(value1, value2, event) { return this.$val.metaOp2(value1, value2, event); }; LState.ptr.prototype.metaCall = function(lvalue) { var _r, _tuple, _tuple$1, fn, fn$1, ls, lvalue, ok, ok$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; fn = $f.fn; fn$1 = $f.fn$1; ls = $f.ls; lvalue = $f.lvalue; ok = $f.ok; ok$1 = $f.ok$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = $assertType(lvalue, ptrType$7, true); fn = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return [fn, false]; } _r = ls.metaOp1(lvalue, "__call"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$1 = $assertType(_r, ptrType$7, true); fn$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { $s = -1; return [fn$1, true]; } $s = -1; return [ptrType$7.nil, false]; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.metaCall }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.fn = fn; $f.fn$1 = fn$1; $f.ls = ls; $f.lvalue = lvalue; $f.ok = ok; $f.ok$1 = ok$1; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.metaCall = function(lvalue) { return this.$val.metaCall(lvalue); }; LState.ptr.prototype.initCallFrame = function(cf) { var argtb, cf, i, i$1, i$2, i$3, ls, maxreg, nargs, np, nvarargs, proto, x, x$1, x$10, x$11, x$12, x$13, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; ls = this; if (cf.Fn.IsG) { ls.reg.SetTop(cf.LocalBase + cf.NArgs >> 0); } else { proto = cf.Fn.Proto; nargs = cf.NArgs; np = ((proto.NumParameters >> 0)); i = nargs; while (true) { if (!(i < np)) { break; } (x = ls.reg.array, x$1 = cf.LocalBase + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); nargs = np; i = i + (1) >> 0; } if ((((proto.IsVarArg & 2) >>> 0)) === 0) { if (nargs < ((proto.NumUsedRegisters >> 0))) { nargs = ((proto.NumUsedRegisters >> 0)); } i$1 = np; while (true) { if (!(i$1 < nargs)) { break; } (x$2 = ls.reg.array, x$3 = cf.LocalBase + i$1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3] = $pkg.LNil)); i$1 = i$1 + (1) >> 0; } ls.reg.top = cf.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; } else { nvarargs = nargs - np >> 0; if (nvarargs < 0) { nvarargs = 0; } ls.reg.SetTop((cf.LocalBase + nargs >> 0) + np >> 0); i$2 = 0; while (true) { if (!(i$2 < np)) { break; } (x$6 = ls.reg.array, x$7 = (cf.LocalBase + nargs >> 0) + i$2 >> 0, ((x$7 < 0 || x$7 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$7] = (x$4 = ls.reg.array, x$5 = cf.LocalBase + i$2 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])))); (x$8 = ls.reg.array, x$9 = cf.LocalBase + i$2 >> 0, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9] = $pkg.LNil)); i$2 = i$2 + (1) >> 0; } if ($pkg.CompatVarArg) { ls.reg.SetTop(((cf.LocalBase + nargs >> 0) + np >> 0) + 1 >> 0); if (!(((((proto.IsVarArg & 4) >>> 0)) === 0))) { argtb = newLTable(nvarargs, 0); i$3 = 0; while (true) { if (!(i$3 < nvarargs)) { break; } argtb.RawSetInt(i$3 + 1 >> 0, ls.reg.Get((cf.LocalBase + np >> 0) + i$3 >> 0)); i$3 = i$3 + (1) >> 0; } argtb.RawSetString("n", new LNumber((nvarargs))); (x$10 = ls.reg.array, x$11 = (cf.LocalBase + nargs >> 0) + np >> 0, ((x$11 < 0 || x$11 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + x$11] = argtb)); } else { (x$12 = ls.reg.array, x$13 = (cf.LocalBase + nargs >> 0) + np >> 0, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13] = $pkg.LNil)); } } cf.LocalBase = cf.LocalBase + (nargs) >> 0; maxreg = cf.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; ls.reg.SetTop(maxreg); } } }; LState.prototype.initCallFrame = function(cf) { return this.$val.initCallFrame(cf); }; LState.ptr.prototype.pushCallFrame = function(cf, fn, meta) { var argtb, cf, cf$1, cs, fn, i, i$1, i$2, i$3, ls, maxreg, meta, nargs, newcf, np, nvarargs, proto, v, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; argtb = $f.argtb; cf = $f.cf; cf$1 = $f.cf$1; cs = $f.cs; fn = $f.fn; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; ls = $f.ls; maxreg = $f.maxreg; meta = $f.meta; nargs = $f.nargs; newcf = $f.newcf; np = $f.np; nvarargs = $f.nvarargs; proto = $f.proto; v = $f.v; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$16 = $f.x$16; x$17 = $f.x$17; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; if (meta) { cf.NArgs = cf.NArgs + (1) >> 0; ls.reg.Insert(fn, cf.LocalBase); } /* */ if (cf.Fn === ptrType$7.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (cf.Fn === ptrType$7.nil) { */ case 1: $r = ls.RaiseError("attempt to call a non-function object", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: /* */ if (ls.stack.sp === ls.Options.CallStackSize) { $s = 4; continue; } /* */ $s = 5; continue; /* if (ls.stack.sp === ls.Options.CallStackSize) { */ case 4: $r = ls.RaiseError("stack overflow", new sliceType$6([])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: cs = ls.stack; v = $clone(cf, callFrame); callFrame.copy((x = cs.array, x$1 = cs.sp, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])), v); (x$2 = cs.array, x$3 = cs.sp, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])).Idx = cs.sp; cs.sp = cs.sp + (1) >> 0; newcf = ls.stack.Last(); cf$1 = newcf; if (cf$1.Fn.IsG) { ls.reg.SetTop(cf$1.LocalBase + cf$1.NArgs >> 0); } else { proto = cf$1.Fn.Proto; nargs = cf$1.NArgs; np = ((proto.NumParameters >> 0)); i = nargs; while (true) { if (!(i < np)) { break; } (x$4 = ls.reg.array, x$5 = cf$1.LocalBase + i >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = $pkg.LNil)); nargs = np; i = i + (1) >> 0; } if ((((proto.IsVarArg & 2) >>> 0)) === 0) { if (nargs < ((proto.NumUsedRegisters >> 0))) { nargs = ((proto.NumUsedRegisters >> 0)); } i$1 = np; while (true) { if (!(i$1 < nargs)) { break; } (x$6 = ls.reg.array, x$7 = cf$1.LocalBase + i$1 >> 0, ((x$7 < 0 || x$7 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$7] = $pkg.LNil)); i$1 = i$1 + (1) >> 0; } ls.reg.top = cf$1.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; } else { nvarargs = nargs - np >> 0; if (nvarargs < 0) { nvarargs = 0; } ls.reg.SetTop((cf$1.LocalBase + nargs >> 0) + np >> 0); i$2 = 0; while (true) { if (!(i$2 < np)) { break; } (x$10 = ls.reg.array, x$11 = (cf$1.LocalBase + nargs >> 0) + i$2 >> 0, ((x$11 < 0 || x$11 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + x$11] = (x$8 = ls.reg.array, x$9 = cf$1.LocalBase + i$2 >> 0, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9])))); (x$12 = ls.reg.array, x$13 = cf$1.LocalBase + i$2 >> 0, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13] = $pkg.LNil)); i$2 = i$2 + (1) >> 0; } if ($pkg.CompatVarArg) { ls.reg.SetTop(((cf$1.LocalBase + nargs >> 0) + np >> 0) + 1 >> 0); if (!(((((proto.IsVarArg & 4) >>> 0)) === 0))) { argtb = newLTable(nvarargs, 0); i$3 = 0; while (true) { if (!(i$3 < nvarargs)) { break; } argtb.RawSetInt(i$3 + 1 >> 0, ls.reg.Get((cf$1.LocalBase + np >> 0) + i$3 >> 0)); i$3 = i$3 + (1) >> 0; } argtb.RawSetString("n", new LNumber((nvarargs))); (x$14 = ls.reg.array, x$15 = (cf$1.LocalBase + nargs >> 0) + np >> 0, ((x$15 < 0 || x$15 >= x$14.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$14.$array[x$14.$offset + x$15] = argtb)); } else { (x$16 = ls.reg.array, x$17 = (cf$1.LocalBase + nargs >> 0) + np >> 0, ((x$17 < 0 || x$17 >= x$16.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$16.$array[x$16.$offset + x$17] = $pkg.LNil)); } } cf$1.LocalBase = cf$1.LocalBase + (nargs) >> 0; maxreg = cf$1.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; ls.reg.SetTop(maxreg); } } ls.currentFrame = newcf; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.pushCallFrame }; } $f.argtb = argtb; $f.cf = cf; $f.cf$1 = cf$1; $f.cs = cs; $f.fn = fn; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.ls = ls; $f.maxreg = maxreg; $f.meta = meta; $f.nargs = nargs; $f.newcf = newcf; $f.np = np; $f.nvarargs = nvarargs; $f.proto = proto; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$16 = x$16; $f.x$17 = x$17; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.pushCallFrame = function(cf, fn, meta) { return this.$val.pushCallFrame(cf, fn, meta); }; LState.ptr.prototype.callR = function(nargs, nret, rbase) { var _r, _tuple, base, fn, ls, lv, meta, nargs, nret, rbase, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; base = $f.base; fn = $f.fn; ls = $f.ls; lv = $f.lv; meta = $f.meta; nargs = $f.nargs; nret = $f.nret; rbase = $f.rbase; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; base = (ls.reg.Top() - nargs >> 0) - 1 >> 0; if (rbase < 0) { rbase = base; } lv = ls.reg.Get(base); _r = ls.metaCall(lv); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fn = _tuple[0]; meta = _tuple[1]; $r = ls.pushCallFrame(new callFrame.ptr(0, fn, ls.currentFrame, 0, base, base + 1 >> 0, rbase, nargs, nret, 0), lv, meta); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* */ if (ls.G.MainThread === ptrType$9.nil) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ls.G.MainThread === ptrType$9.nil) { */ case 3: ls.G.MainThread = ls; ls.G.CurrentThread = ls; $r = ls.mainLoop(ls, ptrType$10.nil); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 5; continue; /* } else { */ case 4: $r = ls.mainLoop(ls, ls.currentFrame); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: if (!((nret === -1))) { ls.reg.SetTop(rbase + nret >> 0); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.callR }; } $f._r = _r; $f._tuple = _tuple; $f.base = base; $f.fn = fn; $f.ls = ls; $f.lv = lv; $f.meta = meta; $f.nargs = nargs; $f.nret = nret; $f.rbase = rbase; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.callR = function(nargs, nret, rbase) { return this.$val.callR(nargs, nret, rbase); }; LState.ptr.prototype.getField = function(obj, key) { var _arg, _r, _r$1, _r$2, _r$3, _tuple, curobj, i, istable, key, ls, metaindex, obj, ret, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; curobj = $f.curobj; i = $f.i; istable = $f.istable; key = $f.key; ls = $f.ls; metaindex = $f.metaindex; obj = $f.obj; ret = $f.ret; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; curobj = obj; i = 0; /* while (true) { */ case 1: /* if (!(i < $pkg.MaxTableGetLoop)) { break; } */ if(!(i < $pkg.MaxTableGetLoop)) { $s = 2; continue; } _tuple = $assertType(curobj, ptrType$1, true); tb = _tuple[0]; istable = _tuple[1]; if (istable) { ret = tb.RawGet(key); if (!($interfaceIsEqual(ret, $pkg.LNil))) { $s = -1; return ret; } } _r = ls.metaOp1(curobj, "__index"); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } metaindex = _r; /* */ if ($interfaceIsEqual(metaindex, $pkg.LNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(metaindex, $pkg.LNil)) { */ case 4: /* */ if (!istable) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!istable) { */ case 6: _r$1 = curobj.Type(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = new $String(_r$2); $r = ls.RaiseError("attempt to index a non-table object(%v)", new sliceType$6([_arg])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: $s = -1; return $pkg.LNil; /* } */ case 5: _r$3 = metaindex.Type(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 4) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$3 === 4) { */ case 11: ls.reg.Push(metaindex); ls.reg.Push(curobj); ls.reg.Push(key); $r = ls.Call(2, 1); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ls.reg.Pop(); /* } */ case 12: curobj = metaindex; i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $r = ls.RaiseError("too many recursions in gettable", new sliceType$6([])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.getField }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.curobj = curobj; $f.i = i; $f.istable = istable; $f.key = key; $f.ls = ls; $f.metaindex = metaindex; $f.obj = obj; $f.ret = ret; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.getField = function(obj, key) { return this.$val.getField(obj, key); }; LState.ptr.prototype.getFieldString = function(obj, key) { var _arg, _r, _r$1, _r$2, _r$3, _tuple, curobj, i, istable, key, ls, metaindex, obj, ret, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; curobj = $f.curobj; i = $f.i; istable = $f.istable; key = $f.key; ls = $f.ls; metaindex = $f.metaindex; obj = $f.obj; ret = $f.ret; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; curobj = obj; i = 0; /* while (true) { */ case 1: /* if (!(i < $pkg.MaxTableGetLoop)) { break; } */ if(!(i < $pkg.MaxTableGetLoop)) { $s = 2; continue; } _tuple = $assertType(curobj, ptrType$1, true); tb = _tuple[0]; istable = _tuple[1]; if (istable) { ret = tb.RawGetString(key); if (!($interfaceIsEqual(ret, $pkg.LNil))) { $s = -1; return ret; } } _r = ls.metaOp1(curobj, "__index"); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } metaindex = _r; /* */ if ($interfaceIsEqual(metaindex, $pkg.LNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(metaindex, $pkg.LNil)) { */ case 4: /* */ if (!istable) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!istable) { */ case 6: _r$1 = curobj.Type(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = new $String(_r$2); $r = ls.RaiseError("attempt to index a non-table object(%v)", new sliceType$6([_arg])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: $s = -1; return $pkg.LNil; /* } */ case 5: _r$3 = metaindex.Type(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 4) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$3 === 4) { */ case 11: ls.reg.Push(metaindex); ls.reg.Push(curobj); ls.reg.Push(new LString((key))); $r = ls.Call(2, 1); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return ls.reg.Pop(); /* } */ case 12: curobj = metaindex; i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $r = ls.RaiseError("too many recursions in gettable", new sliceType$6([])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.getFieldString }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.curobj = curobj; $f.i = i; $f.istable = istable; $f.key = key; $f.ls = ls; $f.metaindex = metaindex; $f.obj = obj; $f.ret = ret; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.getFieldString = function(obj, key) { return this.$val.getFieldString(obj, key); }; LState.ptr.prototype.setField = function(obj, key, value) { var _arg, _r, _r$1, _r$2, _r$3, _tuple, curobj, i, istable, key, ls, metaindex, obj, tb, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; curobj = $f.curobj; i = $f.i; istable = $f.istable; key = $f.key; ls = $f.ls; metaindex = $f.metaindex; obj = $f.obj; tb = $f.tb; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; curobj = obj; i = 0; /* while (true) { */ case 1: /* if (!(i < $pkg.MaxTableGetLoop)) { break; } */ if(!(i < $pkg.MaxTableGetLoop)) { $s = 2; continue; } _tuple = $assertType(curobj, ptrType$1, true); tb = _tuple[0]; istable = _tuple[1]; /* */ if (istable) { $s = 3; continue; } /* */ $s = 4; continue; /* if (istable) { */ case 3: /* */ if (!($interfaceIsEqual(tb.RawGet(key), $pkg.LNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(tb.RawGet(key), $pkg.LNil))) { */ case 5: $r = ls.RawSet(tb, key, value); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 6: /* } */ case 4: _r = ls.metaOp1(curobj, "__newindex"); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } metaindex = _r; /* */ if ($interfaceIsEqual(metaindex, $pkg.LNil)) { $s = 9; continue; } /* */ $s = 10; continue; /* if ($interfaceIsEqual(metaindex, $pkg.LNil)) { */ case 9: /* */ if (!istable) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!istable) { */ case 11: _r$1 = curobj.Type(); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 14; case 14: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = new $String(_r$2); $r = ls.RaiseError("attempt to index a non-table object(%v)", new sliceType$6([_arg])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: $r = ls.RawSet(tb, key, value); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 10: _r$3 = metaindex.Type(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 4) { $s = 17; continue; } /* */ $s = 18; continue; /* if (_r$3 === 4) { */ case 17: ls.reg.Push(metaindex); ls.reg.Push(curobj); ls.reg.Push(key); ls.reg.Push(value); $r = ls.Call(3, 0); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 18: curobj = metaindex; i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $r = ls.RaiseError("too many recursions in settable", new sliceType$6([])); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.setField }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.curobj = curobj; $f.i = i; $f.istable = istable; $f.key = key; $f.ls = ls; $f.metaindex = metaindex; $f.obj = obj; $f.tb = tb; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.setField = function(obj, key, value) { return this.$val.setField(obj, key, value); }; LState.ptr.prototype.setFieldString = function(obj, key, value) { var _arg, _r, _r$1, _r$2, _r$3, _tuple, curobj, i, istable, key, ls, metaindex, obj, tb, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; curobj = $f.curobj; i = $f.i; istable = $f.istable; key = $f.key; ls = $f.ls; metaindex = $f.metaindex; obj = $f.obj; tb = $f.tb; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; curobj = obj; i = 0; /* while (true) { */ case 1: /* if (!(i < $pkg.MaxTableGetLoop)) { break; } */ if(!(i < $pkg.MaxTableGetLoop)) { $s = 2; continue; } _tuple = $assertType(curobj, ptrType$1, true); tb = _tuple[0]; istable = _tuple[1]; if (istable) { if (!($interfaceIsEqual(tb.RawGetString(key), $pkg.LNil))) { tb.RawSetString(key, value); $s = -1; return; } } _r = ls.metaOp1(curobj, "__newindex"); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } metaindex = _r; /* */ if ($interfaceIsEqual(metaindex, $pkg.LNil)) { $s = 4; continue; } /* */ $s = 5; continue; /* if ($interfaceIsEqual(metaindex, $pkg.LNil)) { */ case 4: /* */ if (!istable) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!istable) { */ case 6: _r$1 = curobj.Type(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = new $String(_r$2); $r = ls.RaiseError("attempt to index a non-table object(%v)", new sliceType$6([_arg])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: tb.RawSetString(key, value); $s = -1; return; /* } */ case 5: _r$3 = metaindex.Type(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 4) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$3 === 4) { */ case 11: ls.reg.Push(metaindex); ls.reg.Push(curobj); ls.reg.Push(new LString((key))); ls.reg.Push(value); $r = ls.Call(3, 0); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 12: curobj = metaindex; i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $r = ls.RaiseError("too many recursions in settable", new sliceType$6([])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.setFieldString }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.curobj = curobj; $f.i = i; $f.istable = istable; $f.key = key; $f.ls = ls; $f.metaindex = metaindex; $f.obj = obj; $f.tb = tb; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.setFieldString = function(obj, key, value) { return this.$val.setFieldString(obj, key, value); }; NewState = function(opts) { var ls, opts, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ls = $f.ls; opts = $f.opts; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = ptrType$9.nil; /* */ if (opts.$length === 0) { $s = 1; continue; } /* */ $s = 2; continue; /* if (opts.$length === 0) { */ case 1: ls = newLState(new Options.ptr($pkg.CallStackSize, $pkg.RegistrySize, false, false)); $r = ls.OpenLibs(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else { */ case 2: if ((0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]).CallStackSize < 1) { (0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]).CallStackSize = $pkg.CallStackSize; } if ((0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]).RegistrySize < 128) { (0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]).RegistrySize = $pkg.RegistrySize; } ls = newLState($clone((0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]), Options)); /* */ if (!(0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]).SkipOpenLibs) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!(0 >= opts.$length ? ($throwRuntimeError("index out of range"), undefined) : opts.$array[opts.$offset + 0]).SkipOpenLibs) { */ case 5: $r = ls.OpenLibs(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: /* } */ case 3: $s = -1; return ls; /* */ } return; } if ($f === undefined) { $f = { $blk: NewState }; } $f.ls = ls; $f.opts = opts; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.NewState = NewState; LState.ptr.prototype.Close = function() { var _i, _r, _ref, file, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; file = $f.file; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; atomic.AddInt32((ls.$ptr_stop || (ls.$ptr_stop = new ptrType$67(function() { return this.$target.stop; }, function($v) { this.$target.stop = $v; }, ls))), 1); _ref = ls.G.tempFiles; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } file = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _r = file.Close(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; os.Remove(file.Name()); _i++; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Close }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.file = file; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Close = function() { return this.$val.Close(); }; LState.ptr.prototype.GetTop = function() { var ls; ls = this; return ls.reg.Top() - ls.currentLocalBase() >> 0; }; LState.prototype.GetTop = function() { return this.$val.GetTop(); }; LState.ptr.prototype.SetTop = function(idx) { var base, idx, ls, newtop; ls = this; base = ls.currentLocalBase(); newtop = ls.indexToReg(idx) + 1 >> 0; if (newtop < base) { ls.reg.SetTop(base); } ls.reg.SetTop(newtop); }; LState.prototype.SetTop = function(idx) { return this.$val.SetTop(idx); }; LState.ptr.prototype.Replace = function(idx, value) { var _1, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, _tuple$2, base, fn, idx, index, ls, ok, ok$1, ok$2, reg, tb, tb$1, tb$2, tidx, value, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; base = $f.base; fn = $f.fn; idx = $f.idx; index = $f.index; ls = $f.ls; ok = $f.ok; ok$1 = $f.ok$1; ok$2 = $f.ok$2; reg = $f.reg; tb = $f.tb; tb$1 = $f.tb$1; tb$2 = $f.tb$2; tidx = $f.tidx; value = $f.value; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; base = ls.currentLocalBase(); /* */ if (idx > 0) { $s = 1; continue; } /* */ if (idx === 0) { $s = 2; continue; } /* */ if (idx > -10000) { $s = 3; continue; } /* */ $s = 4; continue; /* if (idx > 0) { */ case 1: reg = (base + idx >> 0) - 1 >> 0; if (reg < ls.reg.Top()) { ls.reg.Set(reg, value); } $s = 5; continue; /* } else if (idx === 0) { */ case 2: $s = 5; continue; /* } else if (idx > -10000) { */ case 3: tidx = ls.reg.Top() + idx >> 0; if (tidx >= base) { ls.reg.Set(tidx, value); } $s = 5; continue; /* } else { */ case 4: _1 = idx; /* */ if (_1 === (-10000)) { $s = 7; continue; } /* */ if (_1 === (-10001)) { $s = 8; continue; } /* */ if (_1 === (-10002)) { $s = 9; continue; } /* */ $s = 10; continue; /* if (_1 === (-10000)) { */ case 7: _tuple = $assertType(value, ptrType$1, true); tb = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 12; continue; } /* */ $s = 13; continue; /* if (ok) { */ case 12: ls.G.Registry = tb; $s = 14; continue; /* } else { */ case 13: _r = value.Type(); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = new LValueType(_r).String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); $r = ls.RaiseError("registry must be a table(%v)", new sliceType$6([_arg])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: $s = 11; continue; /* } else if (_1 === (-10001)) { */ case 8: /* */ if (ls.currentFrame === ptrType$10.nil) { $s = 18; continue; } /* */ $s = 19; continue; /* if (ls.currentFrame === ptrType$10.nil) { */ case 18: $r = ls.RaiseError("no calling environment", new sliceType$6([])); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 19: _tuple$1 = $assertType(value, ptrType$1, true); tb$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 21; continue; } /* */ $s = 22; continue; /* if (ok$1) { */ case 21: ls.currentFrame.Fn.Env = tb$1; $s = 23; continue; /* } else { */ case 22: _r$2 = value.Type(); /* */ $s = 24; case 24: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 25; case 25: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$1 = new $String(_r$3); $r = ls.RaiseError("environment must be a table(%v)", new sliceType$6([_arg$1])); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 23: $s = 11; continue; /* } else if (_1 === (-10002)) { */ case 9: _tuple$2 = $assertType(value, ptrType$1, true); tb$2 = _tuple$2[0]; ok$2 = _tuple$2[1]; /* */ if (ok$2) { $s = 27; continue; } /* */ $s = 28; continue; /* if (ok$2) { */ case 27: ls.G.Global = tb$2; $s = 29; continue; /* } else { */ case 28: _r$4 = value.Type(); /* */ $s = 30; case 30: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new LValueType(_r$4).String(); /* */ $s = 31; case 31: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$2 = new $String(_r$5); $r = ls.RaiseError("_G must be a table(%v)", new sliceType$6([_arg$2])); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 29: $s = 11; continue; /* } else { */ case 10: fn = ls.currentFrame.Fn; index = (-10002 - idx >> 0) - 1 >> 0; if (index < fn.Upvalues.$length) { (x = fn.Upvalues, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index])).SetValue(value); } /* } */ case 11: case 6: /* } */ case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Replace }; } $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.base = base; $f.fn = fn; $f.idx = idx; $f.index = index; $f.ls = ls; $f.ok = ok; $f.ok$1 = ok$1; $f.ok$2 = ok$2; $f.reg = reg; $f.tb = tb; $f.tb$1 = tb$1; $f.tb$2 = tb$2; $f.tidx = tidx; $f.value = value; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Replace = function(idx, value) { return this.$val.Replace(idx, value); }; LState.ptr.prototype.Get = function(idx) { var _1, base, fn, idx, index, ls, reg, tidx, x; ls = this; base = ls.currentLocalBase(); if (idx > 0) { reg = (base + idx >> 0) - 1 >> 0; if (reg < ls.reg.Top()) { return ls.reg.Get(reg); } return $pkg.LNil; } else if (idx === 0) { return $pkg.LNil; } else if (idx > -10000) { tidx = ls.reg.Top() + idx >> 0; if (tidx < base) { return $pkg.LNil; } return ls.reg.Get(tidx); } else { _1 = idx; if (_1 === (-10000)) { return ls.G.Registry; } else if (_1 === (-10001)) { if (ls.currentFrame === ptrType$10.nil) { return ls.Env; } return ls.currentFrame.Fn.Env; } else if (_1 === (-10002)) { return ls.G.Global; } else { fn = ls.currentFrame.Fn; index = (-10002 - idx >> 0) - 1 >> 0; if (index < fn.Upvalues.$length) { return (x = fn.Upvalues, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index])).Value(); } return $pkg.LNil; } } }; LState.prototype.Get = function(idx) { return this.$val.Get(idx); }; LState.ptr.prototype.Push = function(value) { var ls, value; ls = this; ls.reg.Push(value); }; LState.prototype.Push = function(value) { return this.$val.Push(value); }; LState.ptr.prototype.Pop = function(n) { var i, ls, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; i = $f.i; ls = $f.ls; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; i = 0; /* while (true) { */ case 1: /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } /* */ if (ls.GetTop() === 0) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ls.GetTop() === 0) { */ case 3: $r = ls.RaiseError("register underflow", new sliceType$6([])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: ls.reg.Pop(); i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Pop }; } $f.i = i; $f.ls = ls; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Pop = function(n) { return this.$val.Pop(n); }; LState.ptr.prototype.Insert = function(value, index) { var index, ls, reg, top, value; ls = this; reg = ls.indexToReg(index); top = ls.reg.Top(); if (reg >= top) { ls.reg.Set(reg, value); return; } if (reg <= ls.currentLocalBase()) { reg = ls.currentLocalBase(); } top = top - (1) >> 0; while (true) { if (!(top >= reg)) { break; } ls.reg.Set(top + 1 >> 0, ls.reg.Get(top)); top = top - (1) >> 0; } ls.reg.Set(reg, value); }; LState.prototype.Insert = function(value, index) { return this.$val.Insert(value, index); }; LState.ptr.prototype.Remove = function(index) { var i, index, ls, reg, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; i = $f.i; index = $f.index; ls = $f.ls; reg = $f.reg; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; reg = ls.indexToReg(index); top = ls.reg.Top(); /* */ if (reg >= top) { $s = 2; continue; } /* */ if (reg < ls.currentLocalBase()) { $s = 3; continue; } /* */ if ((reg === (top - 1 >> 0))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (reg >= top) { */ case 2: $s = -1; return; /* } else if (reg < ls.currentLocalBase()) { */ case 3: $s = -1; return; /* } else if ((reg === (top - 1 >> 0))) { */ case 4: $r = ls.Pop(1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } */ case 5: case 1: i = reg; while (true) { if (!(i < (top - 1 >> 0))) { break; } ls.reg.Set(i, ls.reg.Get(i + 1 >> 0)); i = i + (1) >> 0; } ls.reg.SetTop(top - 1 >> 0); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Remove }; } $f.i = i; $f.index = index; $f.ls = ls; $f.reg = reg; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Remove = function(index) { return this.$val.Remove(index); }; LState.ptr.prototype.NewTable = function() { var ls; ls = this; return newLTable(32, 32); }; LState.prototype.NewTable = function() { return this.$val.NewTable(); }; LState.ptr.prototype.CreateTable = function(acap, hcap) { var acap, hcap, ls; ls = this; return newLTable(acap, hcap); }; LState.prototype.CreateTable = function(acap, hcap) { return this.$val.CreateTable(acap, hcap); }; LState.ptr.prototype.NewThread = function() { var _r, _tuple, f, ls, thread, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; f = $f.f; ls = $f.ls; thread = $f.thread; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; thread = newLState($clone(ls.Options, Options)); thread.G = ls.G; thread.Env = ls.Env; f = $throwNilPointerError; /* */ if (!($interfaceIsEqual(ls.ctx, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(ls.ctx, $ifaceNil))) { */ case 1: thread.mainLoop = mainLoopWithContext; _r = context.WithCancel(ls.ctx); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; thread.ctx = _tuple[0]; f = _tuple[1]; /* } */ case 2: $s = -1; return [thread, f]; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.NewThread }; } $f._r = _r; $f._tuple = _tuple; $f.f = f; $f.ls = ls; $f.thread = thread; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.NewThread = function() { return this.$val.NewThread(); }; LState.ptr.prototype.NewFunctionFromProto = function(proto) { var ls, proto; ls = this; return newLFunctionL(proto, ls.Env, ((proto.NumUpvalues >> 0))); }; LState.prototype.NewFunctionFromProto = function(proto) { return this.$val.NewFunctionFromProto(proto); }; LState.ptr.prototype.NewUserData = function() { var ls; ls = this; return new LUserData.ptr($ifaceNil, ls.currentEnv(), $pkg.LNil); }; LState.prototype.NewUserData = function() { return this.$val.NewUserData(); }; LState.ptr.prototype.NewFunction = function(fn) { var fn, ls; ls = this; return newLFunctionG(fn, ls.currentEnv(), 0); }; LState.prototype.NewFunction = function(fn) { return this.$val.NewFunction(fn); }; LState.ptr.prototype.NewClosure = function(fn, upvalues) { var _i, _ref, cl, fn, i, ls, lv, upvalues, x, x$1, x$2; ls = this; cl = newLFunctionG(fn, ls.currentEnv(), upvalues.$length); _ref = upvalues; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } i = _i; lv = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); (x = cl.Upvalues, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = new Upvalue.ptr(ptrType$56.nil, ptrType$54.nil, 0, $ifaceNil, false))); (x$1 = cl.Upvalues, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])).Close(); (x$2 = cl.Upvalues, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])).SetValue(lv); _i++; } return cl; }; LState.prototype.NewClosure = function(fn, upvalues) { return this.$val.NewClosure(fn, upvalues); }; LState.ptr.prototype.ToBool = function(n) { var ls, n; ls = this; return LVAsBool(ls.Get(n)); }; LState.prototype.ToBool = function(n) { return this.$val.ToBool(n); }; LState.ptr.prototype.ToInt = function(n) { var _r, _tuple, _tuple$1, _tuple$2, err, ls, lv, lv$1, n, num, ok, ok$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; ls = $f.ls; lv = $f.lv; lv$1 = $f.lv$1; n = $f.n; num = $f.num; ok = $f.ok; ok$1 = $f.ok$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = $assertType(ls.Get(n), LNumber, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return ((lv >> 0)); } _tuple$1 = $assertType(ls.Get(n), LString, true); lv$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok$1) { */ case 1: _r = parseNumber((lv$1)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$2 = _r; num = _tuple$2[0]; err = _tuple$2[1]; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return ((num >> 0)); } /* } */ case 2: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ToInt }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.ls = ls; $f.lv = lv; $f.lv$1 = lv$1; $f.n = n; $f.num = num; $f.ok = ok; $f.ok$1 = ok$1; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ToInt = function(n) { return this.$val.ToInt(n); }; LState.ptr.prototype.ToInt64 = function(n) { var _r, _tuple, _tuple$1, _tuple$2, err, ls, lv, lv$1, n, num, ok, ok$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; ls = $f.ls; lv = $f.lv; lv$1 = $f.lv$1; n = $f.n; num = $f.num; ok = $f.ok; ok$1 = $f.ok$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = $assertType(ls.Get(n), LNumber, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { $s = -1; return (new $Int64(0, lv)); } _tuple$1 = $assertType(ls.Get(n), LString, true); lv$1 = _tuple$1[0]; ok$1 = _tuple$1[1]; /* */ if (ok$1) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok$1) { */ case 1: _r = parseNumber((lv$1)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple$2 = _r; num = _tuple$2[0]; err = _tuple$2[1]; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return (new $Int64(0, num)); } /* } */ case 2: $s = -1; return new $Int64(0, 0); /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ToInt64 }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.ls = ls; $f.lv = lv; $f.lv$1 = lv$1; $f.n = n; $f.num = num; $f.ok = ok; $f.ok$1 = ok$1; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ToInt64 = function(n) { return this.$val.ToInt64(n); }; LState.ptr.prototype.ToNumber = function(n) { var _r, ls, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = LVAsNumber(ls.Get(n)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ToNumber }; } $f._r = _r; $f.ls = ls; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ToNumber = function(n) { return this.$val.ToNumber(n); }; LState.ptr.prototype.ToString = function(n) { var _r, ls, n, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = LVAsString(ls.Get(n)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ToString }; } $f._r = _r; $f.ls = ls; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ToString = function(n) { return this.$val.ToString(n); }; LState.ptr.prototype.ToTable = function(n) { var _tuple, ls, lv, n, ok; ls = this; _tuple = $assertType(ls.Get(n), ptrType$1, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { return lv; } return ptrType$1.nil; }; LState.prototype.ToTable = function(n) { return this.$val.ToTable(n); }; LState.ptr.prototype.ToFunction = function(n) { var _tuple, ls, lv, n, ok; ls = this; _tuple = $assertType(ls.Get(n), ptrType$7, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { return lv; } return ptrType$7.nil; }; LState.prototype.ToFunction = function(n) { return this.$val.ToFunction(n); }; LState.ptr.prototype.ToUserData = function(n) { var _tuple, ls, lv, n, ok; ls = this; _tuple = $assertType(ls.Get(n), ptrType$8, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { return lv; } return ptrType$8.nil; }; LState.prototype.ToUserData = function(n) { return this.$val.ToUserData(n); }; LState.ptr.prototype.ToThread = function(n) { var _tuple, ls, lv, n, ok; ls = this; _tuple = $assertType(ls.Get(n), ptrType$9, true); lv = _tuple[0]; ok = _tuple[1]; if (ok) { return lv; } return ptrType$9.nil; }; LState.prototype.ToThread = function(n) { return this.$val.ToThread(n); }; LState.ptr.prototype.RaiseError = function(format, args) { var args, format, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; args = $f.args; format = $f.format; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = ls.raiseError(1, format, args); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.RaiseError }; } $f.args = args; $f.format = format; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.RaiseError = function(format, args) { return this.$val.RaiseError(format, args); }; LState.ptr.prototype.Error = function(lv, level) { var _tuple, level, ls, lv, ok, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; level = $f.level; ls = $f.ls; lv = $f.lv; ok = $f.ok; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = $assertType(lv, LString, true); str = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: $r = ls.raiseError(level, (str), new sliceType$6([])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else { */ case 2: if (!ls.hasErrorFunc) { ls.closeAllUpvalues(); } ls.Push(lv); $r = ls.Panic(ls); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Error }; } $f._tuple = _tuple; $f.level = level; $f.ls = ls; $f.lv = lv; $f.ok = ok; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Error = function(lv, level) { return this.$val.Error(lv, level); }; LState.ptr.prototype.GetInfo = function(what, dbg, fn) { var _1, _i, _r, _ref, _rune, _tuple, c, dbg, f, fn, ls, ok, retfn, what, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _i = $f._i; _r = $f._r; _ref = $f._ref; _rune = $f._rune; _tuple = $f._tuple; c = $f.c; dbg = $f.dbg; f = $f.f; fn = $f.fn; ls = $f.ls; ok = $f.ok; retfn = $f.retfn; what = $f.what; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; if (!strings.HasPrefix(what, ">")) { fn = dbg.frame.Fn; } else { what = $substring(what, 1); } _tuple = $assertType(fn, ptrType$7, true); f = _tuple[0]; ok = _tuple[1]; if (!ok) { $s = -1; return [$pkg.LNil, newAPIErrorS(2, "can not get debug info(an object in not a function)")]; } retfn = false; _ref = what; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.length)) { break; } */ if(!(_i < _ref.length)) { $s = 2; continue; } _rune = $decodeRune(_ref, _i); c = _rune[0]; _1 = c; /* */ if (_1 === (102)) { $s = 4; continue; } /* */ if (_1 === (83)) { $s = 5; continue; } /* */ if (_1 === (108)) { $s = 6; continue; } /* */ if (_1 === (117)) { $s = 7; continue; } /* */ if (_1 === (110)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_1 === (102)) { */ case 4: retfn = true; $s = 10; continue; /* } else if (_1 === (83)) { */ case 5: if (!(dbg.frame === ptrType$10.nil) && dbg.frame.Parent === ptrType$10.nil) { dbg.What = "main"; } else if (f.IsG) { dbg.What = "G"; } else if (!(dbg.frame === ptrType$10.nil) && dbg.frame.TailCall > 0) { dbg.What = "tail"; } else { dbg.What = "Lua"; } if (!f.IsG) { dbg.Source = f.Proto.SourceName; dbg.LineDefined = f.Proto.LineDefined; dbg.LastLineDefined = f.Proto.LastLineDefined; } $s = 10; continue; /* } else if (_1 === (108)) { */ case 6: if (!f.IsG && !(dbg.frame === ptrType$10.nil)) { if (dbg.frame.Pc > 0) { dbg.CurrentLine = (x = f.Proto.DbgSourcePositions, x$1 = dbg.frame.Pc - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); } } else { dbg.CurrentLine = -1; } $s = 10; continue; /* } else if (_1 === (117)) { */ case 7: dbg.NUpvalues = f.Upvalues.$length; $s = 10; continue; /* } else if (_1 === (110)) { */ case 8: /* */ if (!(dbg.frame === ptrType$10.nil)) { $s = 11; continue; } /* */ $s = 12; continue; /* if (!(dbg.frame === ptrType$10.nil)) { */ case 11: _r = ls.rawFrameFuncName(dbg.frame); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } dbg.Name = _r; /* } */ case 12: $s = 10; continue; /* } else { */ case 9: $s = -1; return [$pkg.LNil, newAPIErrorS(2, "invalid what: " + ($encodeRune(c)))]; /* } */ case 10: case 3: _i += _rune[1]; /* } */ $s = 1; continue; case 2: if (retfn) { $s = -1; return [f, $ifaceNil]; } $s = -1; return [$pkg.LNil, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetInfo }; } $f._1 = _1; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._rune = _rune; $f._tuple = _tuple; $f.c = c; $f.dbg = dbg; $f.f = f; $f.fn = fn; $f.ls = ls; $f.ok = ok; $f.retfn = retfn; $f.what = what; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetInfo = function(what, dbg, fn) { return this.$val.GetInfo(what, dbg, fn); }; LState.ptr.prototype.GetStack = function(level) { var frame, level, ls; ls = this; frame = ls.currentFrame; while (true) { if (!(level > 0 && !(frame === ptrType$10.nil))) { break; } level = level - (1) >> 0; if (!frame.Fn.IsG) { level = level - (frame.TailCall) >> 0; } frame = frame.Parent; } if ((level === 0) && !(frame === ptrType$10.nil)) { return [new Debug.ptr(frame, "", "", "", 0, 0, 0, 0), true]; } else if (level < 0 && ls.stack.Sp() > 0) { return [new Debug.ptr(ls.stack.At(0), "", "", "", 0, 0, 0, 0), true]; } return [new Debug.ptr(ptrType$10.nil, "", "", "", 0, 0, 0, 0), false]; }; LState.prototype.GetStack = function(level) { return this.$val.GetStack(level); }; LState.ptr.prototype.GetLocal = function(dbg, no) { var dbg, frame, ls, name, no; ls = this; frame = dbg.frame; name = ls.findLocal(frame, no); if (name.length > 0) { return [name, ls.reg.Get((frame.LocalBase + no >> 0) - 1 >> 0)]; } return ["", $pkg.LNil]; }; LState.prototype.GetLocal = function(dbg, no) { return this.$val.GetLocal(dbg, no); }; LState.ptr.prototype.SetLocal = function(dbg, no, lv) { var dbg, frame, ls, lv, name, no; ls = this; frame = dbg.frame; name = ls.findLocal(frame, no); if (name.length > 0) { ls.reg.Set((frame.LocalBase + no >> 0) - 1 >> 0, lv); return name; } return ""; }; LState.prototype.SetLocal = function(dbg, no, lv) { return this.$val.SetLocal(dbg, no, lv); }; LState.ptr.prototype.GetUpvalue = function(fn, no) { var fn, ls, no, x, x$1; ls = this; if (fn.IsG) { return ["", $pkg.LNil]; } no = no - (1) >> 0; if (no >= 0 && no < fn.Upvalues.$length) { return [(x = fn.Proto.DbgUpvalues, ((no < 0 || no >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + no])), (x$1 = fn.Upvalues, ((no < 0 || no >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + no])).Value()]; } return ["", $pkg.LNil]; }; LState.prototype.GetUpvalue = function(fn, no) { return this.$val.GetUpvalue(fn, no); }; LState.ptr.prototype.SetUpvalue = function(fn, no, lv) { var fn, ls, lv, no, x, x$1; ls = this; if (fn.IsG) { return ""; } no = no - (1) >> 0; if (no >= 0 && no < fn.Upvalues.$length) { (x = fn.Upvalues, ((no < 0 || no >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + no])).SetValue(lv); return (x$1 = fn.Proto.DbgUpvalues, ((no < 0 || no >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + no])); } return ""; }; LState.prototype.SetUpvalue = function(fn, no, lv) { return this.$val.SetUpvalue(fn, no, lv); }; LState.ptr.prototype.GetFEnv = function(obj) { var _ref, ls, lv, lv$1, lv$2, obj; ls = this; _ref = obj; if ($assertType(_ref, ptrType$7, true)[1]) { lv = _ref.$val; return lv.Env; } else if ($assertType(_ref, ptrType$8, true)[1]) { lv$1 = _ref.$val; return lv$1.Env; } else if ($assertType(_ref, ptrType$9, true)[1]) { lv$2 = _ref.$val; return lv$2.Env; } return $pkg.LNil; }; LState.prototype.GetFEnv = function(obj) { return this.$val.GetFEnv(obj); }; LState.ptr.prototype.SetFEnv = function(obj, env) { var _arg, _r, _r$1, _ref, _tuple, env, ls, lv, lv$1, lv$2, obj, ok, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tuple = $f._tuple; env = $f.env; ls = $f.ls; lv = $f.lv; lv$1 = $f.lv$1; lv$2 = $f.lv$2; obj = $f.obj; ok = $f.ok; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = $assertType(env, ptrType$1, true); tb = _tuple[0]; ok = _tuple[1]; /* */ if (!ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!ok) { */ case 1: _r = env.Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = new LValueType(_r).String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); $r = ls.RaiseError("cannot use %v as an environment", new sliceType$6([_arg])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: _ref = obj; if ($assertType(_ref, ptrType$7, true)[1]) { lv = _ref.$val; lv.Env = tb; } else if ($assertType(_ref, ptrType$8, true)[1]) { lv$1 = _ref.$val; lv$1.Env = tb; } else if ($assertType(_ref, ptrType$9, true)[1]) { lv$2 = _ref.$val; lv$2.Env = tb; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.SetFEnv }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tuple = _tuple; $f.env = env; $f.ls = ls; $f.lv = lv; $f.lv$1 = lv$1; $f.lv$2 = lv$2; $f.obj = obj; $f.ok = ok; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.SetFEnv = function(obj, env) { return this.$val.SetFEnv(obj, env); }; LState.ptr.prototype.RawGet = function(tb, key) { var key, ls, tb; ls = this; return tb.RawGet(key); }; LState.prototype.RawGet = function(tb, key) { return this.$val.RawGet(tb, key); }; LState.ptr.prototype.RawGetInt = function(tb, key) { var key, ls, tb; ls = this; return tb.RawGetInt(key); }; LState.prototype.RawGetInt = function(tb, key) { return this.$val.RawGetInt(tb, key); }; LState.ptr.prototype.GetField = function(obj, skey) { var _r, ls, obj, skey, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; obj = $f.obj; skey = $f.skey; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.getFieldString(obj, skey); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetField }; } $f._r = _r; $f.ls = ls; $f.obj = obj; $f.skey = skey; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetField = function(obj, skey) { return this.$val.GetField(obj, skey); }; LState.ptr.prototype.GetTable = function(obj, key) { var _r, key, ls, obj, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; key = $f.key; ls = $f.ls; obj = $f.obj; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.getField(obj, key); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetTable }; } $f._r = _r; $f.key = key; $f.ls = ls; $f.obj = obj; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetTable = function(obj, key) { return this.$val.GetTable(obj, key); }; LState.ptr.prototype.RawSet = function(tb, key, value) { var _tuple, key, ls, n, ok, tb, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _tuple = $f._tuple; key = $f.key; ls = $f.ls; n = $f.n; ok = $f.ok; tb = $f.tb; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _tuple = $assertType(key, LNumber, true); n = _tuple[0]; ok = _tuple[1]; /* */ if (ok && math.IsNaN((n))) { $s = 1; continue; } /* */ if ($interfaceIsEqual(key, $pkg.LNil)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok && math.IsNaN((n))) { */ case 1: $r = ls.RaiseError("table index is NaN", new sliceType$6([])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 3; continue; /* } else if ($interfaceIsEqual(key, $pkg.LNil)) { */ case 2: $r = ls.RaiseError("table index is nil", new sliceType$6([])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: tb.RawSet(key, value); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.RawSet }; } $f._tuple = _tuple; $f.key = key; $f.ls = ls; $f.n = n; $f.ok = ok; $f.tb = tb; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.RawSet = function(tb, key, value) { return this.$val.RawSet(tb, key, value); }; LState.ptr.prototype.RawSetInt = function(tb, key, value) { var key, ls, tb, value; ls = this; tb.RawSetInt(key, value); }; LState.prototype.RawSetInt = function(tb, key, value) { return this.$val.RawSetInt(tb, key, value); }; LState.ptr.prototype.SetField = function(obj, key, value) { var key, ls, obj, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; key = $f.key; ls = $f.ls; obj = $f.obj; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = ls.setFieldString(obj, key, value); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.SetField }; } $f.key = key; $f.ls = ls; $f.obj = obj; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.SetField = function(obj, key, value) { return this.$val.SetField(obj, key, value); }; LState.ptr.prototype.SetTable = function(obj, key, value) { var key, ls, obj, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; key = $f.key; ls = $f.ls; obj = $f.obj; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = ls.setField(obj, key, value); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.SetTable }; } $f.key = key; $f.ls = ls; $f.obj = obj; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.SetTable = function(obj, key, value) { return this.$val.SetTable(obj, key, value); }; LState.ptr.prototype.ForEach = function(tb, cb) { var cb, ls, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; cb = $f.cb; ls = $f.ls; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = tb.ForEach(cb); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ForEach }; } $f.cb = cb; $f.ls = ls; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ForEach = function(tb, cb) { return this.$val.ForEach(tb, cb); }; LState.ptr.prototype.GetGlobal = function(name) { var _r, ls, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.GetField(ls.Get(-10002), name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetGlobal }; } $f._r = _r; $f.ls = ls; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetGlobal = function(name) { return this.$val.GetGlobal(name); }; LState.ptr.prototype.SetGlobal = function(name, value) { var ls, name, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ls = $f.ls; name = $f.name; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = ls.SetField(ls.Get(-10002), name, value); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.SetGlobal }; } $f.ls = ls; $f.name = name; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.SetGlobal = function(name, value) { return this.$val.SetGlobal(name, value); }; LState.ptr.prototype.Next = function(tb, key) { var key, ls, tb; ls = this; return tb.Next(key); }; LState.prototype.Next = function(tb, key) { return this.$val.Next(tb, key); }; LState.ptr.prototype.ObjLen = function(v1) { var _r, _r$1, _r$2, _r$3, _r$4, ls, op, ret, v1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; ls = $f.ls; op = $f.op; ret = $f.ret; v1 = $f.v1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = v1.Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r === 3) { $s = 1; continue; } /* */ $s = 2; continue; /* if (_r === 3) { */ case 1: $s = -1; return ($assertType(v1, LString)).length; /* } */ case 2: _r$1 = ls.metaOp1(v1, "__len"); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } op = _r$1; _r$2 = op.Type(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2 === 4) { $s = 5; continue; } _r$3 = v1.Type(); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 7) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$2 === 4) { */ case 5: ls.Push(op); ls.Push(v1); $r = ls.Call(1, 1); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret = ls.reg.Pop(); _r$4 = ret.Type(); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 === 2) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_r$4 === 2) { */ case 11: $s = -1; return (($assertType(ret, LNumber) >> 0)); /* } */ case 12: $s = 7; continue; /* } else if (_r$3 === 7) { */ case 6: $s = -1; return $assertType(v1, ptrType$1).Len(); /* } */ case 7: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.ObjLen }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.ls = ls; $f.op = op; $f.ret = ret; $f.v1 = v1; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.ObjLen = function(v1) { return this.$val.ObjLen(v1); }; LState.ptr.prototype.Concat = function(values) { var _i, _r, _r$1, _ref, ls, ret, top, value, values, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; ls = $f.ls; ret = $f.ret; top = $f.top; value = $f.value; values = $f.values; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; top = ls.reg.Top(); _ref = values; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } value = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ls.reg.Push(value); _i++; } _r = stringConcat(ls, values.$length, ls.reg.Top() - 1 >> 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; ls.reg.SetTop(top); _r$1 = LVAsString(ret); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Concat }; } $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.ls = ls; $f.ret = ret; $f.top = top; $f.value = value; $f.values = values; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Concat = function(values) { return this.$val.Concat(values); }; LState.ptr.prototype.LessThan = function(lhs, rhs) { var _r, lhs, ls, rhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; lhs = $f.lhs; ls = $f.ls; rhs = $f.rhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = lessThan(ls, lhs, rhs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.LessThan }; } $f._r = _r; $f.lhs = lhs; $f.ls = ls; $f.rhs = rhs; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.LessThan = function(lhs, rhs) { return this.$val.LessThan(lhs, rhs); }; LState.ptr.prototype.Equal = function(lhs, rhs) { var _r, lhs, ls, rhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; lhs = $f.lhs; ls = $f.ls; rhs = $f.rhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = equals(ls, lhs, rhs, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Equal }; } $f._r = _r; $f.lhs = lhs; $f.ls = ls; $f.rhs = rhs; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Equal = function(lhs, rhs) { return this.$val.Equal(lhs, rhs); }; LState.ptr.prototype.RawEqual = function(lhs, rhs) { var _r, lhs, ls, rhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; lhs = $f.lhs; ls = $f.ls; rhs = $f.rhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = equals(ls, lhs, rhs, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.RawEqual }; } $f._r = _r; $f.lhs = lhs; $f.ls = ls; $f.rhs = rhs; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.RawEqual = function(lhs, rhs) { return this.$val.RawEqual(lhs, rhs); }; LState.ptr.prototype.Register = function(name, fn) { var fn, ls, name, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; fn = $f.fn; ls = $f.ls; name = $f.name; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = ls.SetGlobal(name, ls.NewFunction(fn)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Register }; } $f.fn = fn; $f.ls = ls; $f.name = name; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Register = function(name, fn) { return this.$val.Register(name, fn); }; LState.ptr.prototype.Load = function(reader, name) { var _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, chunk, err, ls, name, proto, reader, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; chunk = $f.chunk; err = $f.err; ls = $f.ls; name = $f.name; proto = $f.proto; reader = $f.reader; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = parse.Parse(reader, name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; chunk = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2: _r$1 = newAPIErrorE(0, err); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return [ptrType$7.nil, _r$1]; /* } */ case 3: _r$2 = Compile(chunk, name); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; proto = _tuple$1[0]; err = _tuple$1[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$3 = newAPIErrorE(0, err); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $s = -1; return [ptrType$7.nil, _r$3]; /* } */ case 7: $s = -1; return [newLFunctionL(proto, ls.currentEnv(), 0), $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Load }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.chunk = chunk; $f.err = err; $f.ls = ls; $f.name = name; $f.proto = proto; $f.reader = reader; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Load = function(reader, name) { return this.$val.Load(reader, name); }; LState.ptr.prototype.Call = function(nargs, nret) { var ls, nargs, nret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ls = $f.ls; nargs = $f.nargs; nret = $f.nret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; $r = ls.callR(nargs, nret, -1); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Call }; } $f.ls = ls; $f.nargs = nargs; $f.nret = nret; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Call = function(nargs, nret) { return this.$val.Call(nargs, nret); }; LState.ptr.prototype.PCall = function(nargs, nret, errfunc) { var base, err, errfunc, ls, nargs, nret, oldpanic, sp, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; base = $f.base; err = $f.err; errfunc = $f.errfunc; ls = $f.ls; nargs = $f.nargs; nret = $f.nret; oldpanic = $f.oldpanic; sp = $f.sp; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); base = [base]; err = [err]; errfunc = [errfunc]; ls = [ls]; oldpanic = [oldpanic]; sp = [sp]; err[0] = $ifaceNil; ls[0] = this; err[0] = $ifaceNil; sp[0] = ls[0].stack.Sp(); base[0] = (ls[0].reg.Top() - nargs >> 0) - 1 >> 0; oldpanic[0] = ls[0].Panic; ls[0].Panic = panicWithoutTraceback; if (!(errfunc[0] === ptrType$7.nil)) { ls[0].hasErrorFunc = true; } $deferred.push([(function(base, err, errfunc, ls, oldpanic, sp) { return function $b() { var _arg, _r, _r$1, _r$2, _r$3, _r$4, _tuple, buf, ok, rcv, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; buf = $f.buf; ok = $f.ok; rcv = $f.rcv; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); ls[0].Panic = oldpanic[0]; ls[0].hasErrorFunc = false; rcv = $recover(); /* */ if (!($interfaceIsEqual(rcv, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(rcv, $ifaceNil))) { */ case 1: _tuple = $assertType(rcv, ptrType$11, true); ok = _tuple[1]; /* */ if (!ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok) { */ case 3: _r = fmt.Sprint(new sliceType$6([rcv])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg = _r; _r$1 = newAPIErrorS(4, _arg); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err[0] = _r$1; /* */ if (ls[0].Options.IncludeGoStackTrace) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ls[0].Options.IncludeGoStackTrace) { */ case 8: buf = $makeSlice(sliceType$20, 4096); runtime.Stack(buf, false); _r$2 = strings.Trim(($bytesToString(buf)), "\x00"); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = ls[0].stackTrace(0); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $assertType(err[0], ptrType$11).StackTrace = _r$2 + "\n" + _r$3; /* } */ case 9: $s = 5; continue; /* } else { */ case 4: err[0] = $assertType(rcv, ptrType$11); /* } */ case 5: /* */ if (!(errfunc[0] === ptrType$7.nil)) { $s = 12; continue; } /* */ if ($assertType(err[0], ptrType$11).StackTrace.length === 0) { $s = 13; continue; } /* */ $s = 14; continue; /* if (!(errfunc[0] === ptrType$7.nil)) { */ case 12: ls[0].Push(errfunc[0]); ls[0].Push($assertType(err[0], ptrType$11).Object); ls[0].Panic = panicWithoutTraceback; $deferred.push([(function(base, err, errfunc, ls, oldpanic, sp) { return function $b() { var _arg$1, _r$4, _r$5, _r$6, _r$7, _r$8, _tuple$1, buf$1, ok$1, rcv$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg$1 = $f._arg$1; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _tuple$1 = $f._tuple$1; buf$1 = $f.buf$1; ok$1 = $f.ok$1; rcv$1 = $f.rcv$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls[0].Panic = oldpanic[0]; rcv$1 = $recover(); /* */ if (!($interfaceIsEqual(rcv$1, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(rcv$1, $ifaceNil))) { */ case 1: _tuple$1 = $assertType(rcv$1, ptrType$11, true); ok$1 = _tuple$1[1]; /* */ if (!ok$1) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!ok$1) { */ case 3: _r$4 = fmt.Sprint(new sliceType$6([rcv$1])); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = _r$4; _r$5 = newAPIErrorS(4, _arg$1); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } err[0] = _r$5; /* */ if (ls[0].Options.IncludeGoStackTrace) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ls[0].Options.IncludeGoStackTrace) { */ case 8: buf$1 = $makeSlice(sliceType$20, 4096); runtime.Stack(buf$1, false); _r$6 = strings.Trim(($bytesToString(buf$1)), "\x00"); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = ls[0].stackTrace(0); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $assertType(err[0], ptrType$11).StackTrace = _r$6 + _r$7; /* } */ case 9: $s = 5; continue; /* } else { */ case 4: err[0] = $assertType(rcv$1, ptrType$11); _r$8 = ls[0].stackTrace(0); /* */ $s = 12; case 12: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $assertType(err[0], ptrType$11).StackTrace = _r$8; /* } */ case 5: /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._arg$1 = _arg$1; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._tuple$1 = _tuple$1; $f.buf$1 = buf$1; $f.ok$1 = ok$1; $f.rcv$1 = rcv$1; $f.$s = $s; $f.$r = $r; return $f; }; })(base, err, errfunc, ls, oldpanic, sp), []]); $r = ls[0].Call(1, 1); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } err[0] = newAPIError(3, ls[0].Get(-1)); $s = 14; continue; /* } else if ($assertType(err[0], ptrType$11).StackTrace.length === 0) { */ case 13: _r$4 = ls[0].stackTrace(0); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $assertType(err[0], ptrType$11).StackTrace = _r$4; /* } */ case 14: ls[0].stack.SetSp(sp[0]); ls[0].currentFrame = ls[0].stack.Last(); ls[0].reg.SetTop(base[0]); /* } */ case 2: ls[0].stack.SetSp(sp[0]); if (sp[0] === 0) { ls[0].currentFrame = ptrType$10.nil; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f._arg = _arg; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.buf = buf; $f.ok = ok; $f.rcv = rcv; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; })(base, err, errfunc, ls, oldpanic, sp), []]); $r = ls[0].Call(nargs, nret); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return err[0]; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err[0]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: LState.ptr.prototype.PCall }; } $f.base = base; $f.err = err; $f.errfunc = errfunc; $f.ls = ls; $f.nargs = nargs; $f.nret = nret; $f.oldpanic = oldpanic; $f.sp = sp; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; LState.prototype.PCall = function(nargs, nret, errfunc) { return this.$val.PCall(nargs, nret, errfunc); }; LState.ptr.prototype.GPCall = function(fn, data) { var _r, data, fn, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; data = $f.data; fn = $f.fn; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; ls.Push(newLFunctionG(fn, ls.currentEnv(), 0)); ls.Push(data); _r = ls.PCall(1, -1, ptrType$7.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GPCall }; } $f._r = _r; $f.data = data; $f.fn = fn; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GPCall = function(fn, data) { return this.$val.GPCall(fn, data); }; LState.ptr.prototype.CallByParam = function(cp, args) { var _i, _r, _ref, arg, args, cp, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _r = $f._r; _ref = $f._ref; arg = $f.arg; args = $f.args; cp = $f.cp; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; ls.Push(cp.Fn); _ref = args; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ls.Push(arg); _i++; } /* */ if (cp.Protect) { $s = 1; continue; } /* */ $s = 2; continue; /* if (cp.Protect) { */ case 1: _r = ls.PCall(args.$length, cp.NRet, cp.Handler); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: $r = ls.Call(args.$length, cp.NRet); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.CallByParam }; } $f._i = _i; $f._r = _r; $f._ref = _ref; $f.arg = arg; $f.args = args; $f.cp = cp; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.CallByParam = function(cp, args) { return this.$val.CallByParam(cp, args); }; LState.ptr.prototype.GetMetatable = function(obj) { var _r, ls, obj, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; obj = $f.obj; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = ls.metatable(obj, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.GetMetatable }; } $f._r = _r; $f.ls = ls; $f.obj = obj; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.GetMetatable = function(obj) { return this.$val.GetMetatable(obj); }; LState.ptr.prototype.SetMetatable = function(obj, mt) { var _arg, _key, _r, _r$1, _r$2, _ref, _ref$1, ls, mt, obj, v, v$1, v$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _arg = $f._arg; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; ls = $f.ls; mt = $f.mt; obj = $f.obj; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _ref = mt; /* */ if ($assertType(_ref, ptrType$68, true)[1] || $assertType(_ref, ptrType$1, true)[1]) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($assertType(_ref, ptrType$68, true)[1] || $assertType(_ref, ptrType$1, true)[1]) { */ case 1: $s = 3; continue; /* } else { */ case 2: _r = mt.Type(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = new LValueType(_r).String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = new $String(_r$1); $r = ls.RaiseError("metatable must be a table or nil, but got %v", new sliceType$6([_arg])); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: _ref$1 = obj; /* */ if ($assertType(_ref$1, ptrType$1, true)[1]) { $s = 7; continue; } /* */ if ($assertType(_ref$1, ptrType$8, true)[1]) { $s = 8; continue; } /* */ $s = 9; continue; /* if ($assertType(_ref$1, ptrType$1, true)[1]) { */ case 7: v = _ref$1.$val; v.Metatable = mt; $s = 10; continue; /* } else if ($assertType(_ref$1, ptrType$8, true)[1]) { */ case 8: v$1 = _ref$1.$val; v$1.Metatable = mt; $s = 10; continue; /* } else { */ case 9: v$2 = _ref$1; _r$2 = obj.Type(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _key = ((_r$2 >> 0)); (ls.G.builtinMts || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key)] = { k: _key, v: mt }; /* } */ case 10: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.SetMetatable }; } $f._arg = _arg; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f.ls = ls; $f.mt = mt; $f.obj = obj; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.SetMetatable = function(obj, mt) { return this.$val.SetMetatable(obj, mt); }; LState.ptr.prototype.Status = function(th) { var ls, status, th; ls = this; status = "suspended"; if (th.Dead) { status = "dead"; } else if (ls.G.CurrentThread === th) { status = "running"; } else if (ls.Parent === th) { status = "normal"; } return status; }; LState.prototype.Status = function(th) { return this.$val.Status(th); }; LState.ptr.prototype.Resume = function(th, fn, args) { var _i, _i$1, _ref, _ref$1, arg, arg$1, args, base, cf, fn, haserror, idx, isstarted, ls, ret, th, top, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _i = $f._i; _i$1 = $f._i$1; _ref = $f._ref; _ref$1 = $f._ref$1; arg = $f.arg; arg$1 = $f.arg$1; args = $f.args; base = $f.base; cf = $f.cf; fn = $f.fn; haserror = $f.haserror; idx = $f.idx; isstarted = $f.isstarted; ls = $f.ls; ret = $f.ret; th = $f.th; top = $f.top; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; isstarted = th.isStarted(); if (!isstarted) { base = 0; th.stack.Push(new callFrame.ptr(0, fn, ptrType$10.nil, 0, base, base + 1 >> 0, base, 0, -1, 0)); } if (ls.G.CurrentThread === th) { $s = -1; return [2, newAPIErrorS(2, "can not resume a running thread"), sliceType$7.nil]; } if (th.Dead) { $s = -1; return [2, newAPIErrorS(2, "can not resume a dead thread"), sliceType$7.nil]; } th.Parent = ls; ls.G.CurrentThread = th; if (!isstarted) { cf = th.stack.Last(); th.currentFrame = cf; th.SetTop(0); _ref = args; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } arg = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); th.Push(arg); _i++; } cf.NArgs = args.$length; th.initCallFrame(cf); th.Panic = panicWithoutTraceback; } else { _ref$1 = args; _i$1 = 0; while (true) { if (!(_i$1 < _ref$1.$length)) { break; } arg$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]); th.Push(arg$1); _i$1++; } } top = ls.GetTop(); $r = threadRun(th); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } haserror = LVIsFalse(ls.Get(top + 1 >> 0)); ret = $makeSlice(sliceType$7, 0, ls.GetTop()); idx = top + 2 >> 0; while (true) { if (!(idx <= ls.GetTop())) { break; } ret = $append(ret, ls.Get(idx)); idx = idx + (1) >> 0; } if (ret.$length === 0) { ret = $append(ret, $pkg.LNil); } ls.SetTop(top); if (haserror) { $s = -1; return [2, newAPIError(2, (0 >= ret.$length ? ($throwRuntimeError("index out of range"), undefined) : ret.$array[ret.$offset + 0])), sliceType$7.nil]; } else if (th.stack.IsEmpty()) { $s = -1; return [0, $ifaceNil, ret]; } $s = -1; return [1, $ifaceNil, ret]; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.Resume }; } $f._i = _i; $f._i$1 = _i$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f.arg = arg; $f.arg$1 = arg$1; $f.args = args; $f.base = base; $f.cf = cf; $f.fn = fn; $f.haserror = haserror; $f.idx = idx; $f.isstarted = isstarted; $f.ls = ls; $f.ret = ret; $f.th = th; $f.top = top; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.Resume = function(th, fn, args) { return this.$val.Resume(th, fn, args); }; LState.ptr.prototype.Yield = function(values) { var _i, _ref, ls, lv, values; ls = this; ls.SetTop(0); _ref = values; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } lv = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); ls.Push(lv); _i++; } return -1; }; LState.prototype.Yield = function(values) { return this.$val.Yield(values); }; LState.ptr.prototype.XMoveTo = function(other, n) { var i, ls, n, other, top; ls = this; if (ls === other) { return; } top = ls.GetTop(); n = intMin(n, top); i = n; while (true) { if (!(i > 0)) { break; } other.Push(ls.Get((top - i >> 0) + 1 >> 0)); i = i - (1) >> 0; } ls.SetTop(top - n >> 0); }; LState.prototype.XMoveTo = function(other, n) { return this.$val.XMoveTo(other, n); }; LState.ptr.prototype.SetMx = function(mx) { var ls, mx, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; ls = $f.ls; mx = $f.mx; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = [ls]; mx = [mx]; ls[0] = this; /* */ if (!(ls[0].Parent === ptrType$9.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(ls[0].Parent === ptrType$9.nil)) { */ case 1: $r = ls[0].RaiseError("sub threads are not allowed to set a memory limit", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $go((function(ls, mx) { return function $b() { var _r, limit, s, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; limit = $f.limit; s = $f.s; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: s = [s]; limit = (new $Uint64(0, ($imul(($imul(mx[0], 1024)), 1024)))); s[0] = new runtime.MemStats.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), arrayType$2.zero(), arrayType$2.zero(), 0, 0, false, false, arrayType$3.zero()); /* while (true) { */ case 1: /* if (!(ls[0].stop === 0)) { break; } */ if(!(ls[0].stop === 0)) { $s = 2; continue; } runtime.ReadMemStats(s[0]); /* */ if ((x = s[0].Alloc, (x.$high > limit.$high || (x.$high === limit.$high && x.$low >= limit.$low)))) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((x = s[0].Alloc, (x.$high > limit.$high || (x.$high === limit.$high && x.$low >= limit.$low)))) { */ case 3: _r = fmt.Println(new sliceType$6([new $String("out of memory")])); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; os.Exit(3); /* } */ case 4: $r = time.Sleep(new time.Duration(0, 100000000)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ $s = 1; continue; case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r = _r; $f.limit = limit; $f.s = s; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; })(ls, mx), []); $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.SetMx }; } $f.ls = ls; $f.mx = mx; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.SetMx = function(mx) { return this.$val.SetMx(mx); }; LState.ptr.prototype.SetContext = function(ctx) { var ctx, ls; ls = this; ls.mainLoop = mainLoopWithContext; ls.ctx = ctx; }; LState.prototype.SetContext = function(ctx) { return this.$val.SetContext(ctx); }; LState.ptr.prototype.Context = function() { var ls; ls = this; return ls.ctx; }; LState.prototype.Context = function() { return this.$val.Context(); }; LState.ptr.prototype.RemoveContext = function() { var ls, oldctx; ls = this; oldctx = ls.ctx; ls.mainLoop = mainLoop; ls.ctx = $ifaceNil; return oldctx; }; LState.prototype.RemoveContext = function() { return this.$val.RemoveContext(); }; OpenString = function(L) { var L, _key, _r, gmatch, mod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _key = $f._key; _r = $f._r; gmatch = $f.gmatch; mod = $f.mod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: mod = ptrType$1.nil; _r = L.RegisterModule("string", strFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } mod = $assertType(_r, ptrType$1); gmatch = L.NewClosure(strGmatch, new sliceType$7([L.NewFunction(strGmatchIter)])); mod.RawSetString("gmatch", gmatch); mod.RawSetString("gfind", gmatch); mod.RawSetString("__index", mod); _key = 3; (L.G.builtinMts || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key)] = { k: _key, v: mod }; L.Push(mod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenString }; } $f.L = L; $f._key = _key; $f._r = _r; $f.gmatch = gmatch; $f.mod = mod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenString = OpenString; strByte = function(L) { var L, _r, _r$1, _r$2, end, i, l, start, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; end = $f.end; i = $f.i; l = $f.l; start = $f.start; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = L.OptInt(2, 1); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } start = _r$1 - 1 >> 0; _r$2 = L.OptInt(3, -1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } end = _r$2; l = str.length; if (start < 0) { start = (l + start >> 0) + 1 >> 0; } if (end < 0) { end = (l + end >> 0) + 1 >> 0; } if (L.GetTop() === 2) { if (start < 0 || start >= l) { $s = -1; return 0; } L.Push(new LNumber((str.charCodeAt(start)))); $s = -1; return 1; } start = intMax(start, 0); end = intMin(end, l); if (end < 0 || end <= start || start >= l) { $s = -1; return 0; } i = start; while (true) { if (!(i < end)) { break; } L.Push(new LNumber((str.charCodeAt(i)))); i = i + (1) >> 0; } $s = -1; return end - start >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: strByte }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.end = end; $f.i = i; $f.l = l; $f.start = start; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strChar = function(L) { var L, _r, bytes, i, top, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; bytes = $f.bytes; i = $f.i; top = $f.top; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: top = L.GetTop(); bytes = $makeSlice(sliceType$20, L.GetTop()); i = 1; /* while (true) { */ case 1: /* if (!(i <= top)) { break; } */ if(!(i <= top)) { $s = 2; continue; } _r = L.CheckInt(i); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } (x = i - 1 >> 0, ((x < 0 || x >= bytes.$length) ? ($throwRuntimeError("index out of range"), undefined) : bytes.$array[bytes.$offset + x] = ((_r << 24 >>> 24)))); i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: L.Push(new LString((($bytesToString(bytes))))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strChar }; } $f.L = L; $f._r = _r; $f.bytes = bytes; $f.i = i; $f.top = top; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; strDump = function(L) { var L, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = L.RaiseError("GopherLua does not support the string.dump", new sliceType$6([])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: strDump }; } $f.L = L; $f.$s = $s; $f.$r = $r; return $f; }; strFind = function(L) { var L, _arg, _arg$1, _q, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, err, i, init$4, md, mds, pattern, plain, pos, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; err = $f.err; i = $f.i; init$4 = $f.init$4; md = $f.md; mds = $f.mds; pattern = $f.pattern; plain = $f.plain; pos = $f.pos; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = L.CheckString(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } pattern = _r$1; if (pattern.length === 0) { L.Push(new LNumber(1)); L.Push(new LNumber(0)); $s = -1; return 2; } _arg = str; _r$2 = L.OptInt(3, 1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; _r$3 = luaIndex2StringIndex(_arg, _arg$1, true); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } init$4 = _r$3; plain = false; if (L.GetTop() === 4) { plain = LVAsBool(L.Get(4)); } if (plain) { pos = strings.Index($substring(str, init$4), pattern); if (pos < 0) { L.Push($pkg.LNil); $s = -1; return 1; } L.Push(new LNumber(((init$4 + pos >> 0)) + 1)); L.Push(new LNumber((((init$4 + pos >> 0) + pattern.length >> 0)))); $s = -1; return 2; } _r$4 = pm.Find(pattern, unsafeFastStringToReadOnlyBytes(str), init$4, 1); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; mds = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: _r$5 = err.Error(); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.RaiseError(_r$5, new sliceType$6([])); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: if (mds.$length === 0) { L.Push($pkg.LNil); $s = -1; return 1; } md = (0 >= mds.$length ? ($throwRuntimeError("index out of range"), undefined) : mds.$array[mds.$offset + 0]); L.Push(new LNumber(((md.Capture(0) + 1 >> 0)))); L.Push(new LNumber((md.Capture(1)))); i = 2; while (true) { if (!(i < md.CaptureLength())) { break; } if (md.IsPosCapture(i)) { L.Push(new LNumber((md.Capture(i)))); } else { L.Push(new LString(($substring(str, md.Capture(i), md.Capture(i + 1 >> 0))))); } i = i + (2) >> 0; } $s = -1; return (_q = md.CaptureLength() / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: strFind }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f.err = err; $f.i = i; $f.init$4 = init$4; $f.md = md; $f.mds = mds; $f.pattern = pattern; $f.plain = plain; $f.pos = pos; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strFormat = function(L) { var L, _r, _r$1, args, i, npat, str, top, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; args = $f.args; i = $f.i; npat = $f.npat; str = $f.str; top = $f.top; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; args = $makeSlice(sliceType$6, (L.GetTop() - 1 >> 0)); top = L.GetTop(); i = 2; while (true) { if (!(i <= top)) { break; } (x = i - 2 >> 0, ((x < 0 || x >= args.$length) ? ($throwRuntimeError("index out of range"), undefined) : args.$array[args.$offset + x] = L.Get(i))); i = i + (1) >> 0; } npat = strings.Count(str, "%") - strings.Count(str, "%%") >> 0; _r$1 = fmt.Sprintf(str, $subslice(args, 0, intMin(npat, args.$length))); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strFormat }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.args = args; $f.i = i; $f.npat = npat; $f.str = str; $f.top = top; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; strGsub = function(L) { var L, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, _tuple, err, limit, lv, lv$1, lv$2, mds, pat, repl, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; _tuple = $f._tuple; err = $f.err; limit = $f.limit; lv = $f.lv; lv$1 = $f.lv$1; lv$2 = $f.lv$2; mds = $f.mds; pat = $f.pat; repl = $f.repl; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = L.CheckString(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } pat = _r$1; $r = L.CheckTypes(3, new sliceType$8([3, 7, 4])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = L.CheckAny(3); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } repl = _r$2; _r$3 = L.OptInt(4, -1); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } limit = _r$3; _r$4 = pm.Find(pat, unsafeFastStringToReadOnlyBytes(str), 0, limit); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple = _r$4; mds = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 7: _r$5 = err.Error(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } $r = L.RaiseError(_r$5, new sliceType$6([])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: if (mds.$length === 0) { L.SetTop(1); L.Push(new LNumber(0)); $s = -1; return 2; } _ref = repl; /* */ if ($assertType(_ref, LString, true)[1]) { $s = 11; continue; } /* */ if ($assertType(_ref, ptrType$1, true)[1]) { $s = 12; continue; } /* */ if ($assertType(_ref, ptrType$7, true)[1]) { $s = 13; continue; } /* */ $s = 14; continue; /* if ($assertType(_ref, LString, true)[1]) { */ case 11: lv = _ref.$val; _r$6 = strGsubStr(L, str, (lv), mds); /* */ $s = 15; case 15: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$6))); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 14; continue; /* } else if ($assertType(_ref, ptrType$1, true)[1]) { */ case 12: lv$1 = _ref.$val; _r$7 = strGsubTable(L, str, lv$1, mds); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$7))); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 14; continue; /* } else if ($assertType(_ref, ptrType$7, true)[1]) { */ case 13: lv$2 = _ref.$val; _r$8 = strGsubFunc(L, str, lv$2, mds); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$8))); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 14: L.Push(new LNumber((mds.$length))); $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: strGsub }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f._tuple = _tuple; $f.err = err; $f.limit = limit; $f.lv = lv; $f.lv$1 = lv$1; $f.lv$2 = lv$2; $f.mds = mds; $f.pat = pat; $f.repl = repl; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; checkCaptureIndex = function(L, m, idx) { var L, idx, m, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; idx = $f.idx; m = $f.m; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: if (idx <= 2) { $s = -1; return; } /* */ if (idx >= m.CaptureLength()) { $s = 1; continue; } /* */ $s = 2; continue; /* if (idx >= m.CaptureLength()) { */ case 1: $r = L.RaiseError("invalid capture index", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: checkCaptureIndex }; } $f.L = L; $f.idx = idx; $f.m = m; $f.$s = $s; $f.$r = $r; return $f; }; capturedString = function(L, m, str, idx) { var L, _r, idx, m, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; idx = $f.idx; m = $f.m; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = checkCaptureIndex(L, m, idx); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (idx >= m.CaptureLength() && (idx === 2)) { idx = 0; } /* */ if (m.IsPosCapture(idx)) { $s = 2; continue; } /* */ $s = 3; continue; /* if (m.IsPosCapture(idx)) { */ case 2: _r = fmt.Sprint(new sliceType$6([new $Int(m.Capture(idx))])); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 3: $s = -1; return $substring(str, m.Capture(idx), m.Capture(idx + 1 >> 0)); /* */ } return; } if ($f === undefined) { $f = { $blk: capturedString }; } $f.L = L; $f._r = _r; $f.idx = idx; $f.m = m; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strGsubDoReplace = function(str, info) { var _i, _ref, b1, b2, buf, index2, info, offset, oldlen, replace, str, x, x$1; offset = 0; buf = (new sliceType$20($stringToBytes(str))); _ref = info; _i = 0; while (true) { if (!(_i < _ref.$length)) { break; } replace = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), replaceInfo); oldlen = buf.$length; b1 = $appendSlice((new sliceType$20($stringToBytes(""))), $subslice(buf, 0, (offset + (x = replace.Indicies, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])) >> 0))); b2 = (new sliceType$20($stringToBytes(""))); index2 = offset + (x$1 = replace.Indicies, (1 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 1])) >> 0; if (index2 <= buf.$length) { b2 = $appendSlice(b2, $subslice(buf, index2, buf.$length)); } buf = $appendSlice(b1, replace.String); buf = $appendSlice(buf, b2); offset = offset + ((buf.$length - oldlen >> 0)) >> 0; _i++; } return ($bytesToString(buf)); }; strGsubStr = function(L, str, repl, matches) { var L, _i, _r, _ref, _tmp, _tmp$1, _tuple, _tuple$1, c, end, eos, infoList, match, matches, repl, sc, start, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; c = $f.c; end = $f.end; eos = $f.eos; infoList = $f.infoList; match = $f.match; matches = $f.matches; repl = $f.repl; sc = $f.sc; start = $f.start; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: infoList = $makeSlice(sliceType$23, 0, matches.$length); _ref = matches; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } match = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tmp = match.Capture(0); _tmp$1 = match.Capture(1); start = _tmp; end = _tmp$1; sc = newFlagScanner(37, "", "", repl); _tuple = sc.Next(); c = _tuple[0]; eos = _tuple[1]; /* while (true) { */ case 3: /* if (!(!eos)) { break; } */ if(!(!eos)) { $s = 4; continue; } /* */ if (!sc.ChangeFlag) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!sc.ChangeFlag) { */ case 5: /* */ if (sc.HasFlag) { $s = 7; continue; } /* */ $s = 8; continue; /* if (sc.HasFlag) { */ case 7: /* */ if (c >= 48 && c <= 57) { $s = 10; continue; } /* */ $s = 11; continue; /* if (c >= 48 && c <= 57) { */ case 10: _r = capturedString(L, match, str, $imul(2, ((((c >> 0)) - 48 >> 0)))); /* */ $s = 13; case 13: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = sc.AppendString(_r); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 12; continue; /* } else { */ case 11: sc.AppendChar(37); sc.AppendChar(c); /* } */ case 12: sc.HasFlag = false; $s = 9; continue; /* } else { */ case 8: sc.AppendChar(c); /* } */ case 9: /* } */ case 6: _tuple$1 = sc.Next(); c = _tuple$1[0]; eos = _tuple$1[1]; /* } */ $s = 3; continue; case 4: infoList = $append(infoList, new replaceInfo.ptr(new sliceType$12([start, end]), sc.String())); _i++; /* } */ $s = 1; continue; case 2: $s = -1; return strGsubDoReplace(str, infoList); /* */ } return; } if ($f === undefined) { $f = { $blk: strGsubStr }; } $f.L = L; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.c = c; $f.end = end; $f.eos = eos; $f.infoList = infoList; $f.match = match; $f.matches = matches; $f.repl = repl; $f.sc = sc; $f.start = start; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strGsubTable = function(L, str, repl, matches) { var L, _i, _r, _r$1, _r$2, _ref, idx, infoList, match, matches, repl, str, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; idx = $f.idx; infoList = $f.infoList; match = $f.match; matches = $f.matches; repl = $f.repl; str = $f.str; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: infoList = $makeSlice(sliceType$23, 0, matches.$length); _ref = matches; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } match = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); idx = 0; if (match.CaptureLength() > 2) { idx = 2; } value = $ifaceNil; /* */ if (match.IsPosCapture(idx)) { $s = 3; continue; } /* */ $s = 4; continue; /* if (match.IsPosCapture(idx)) { */ case 3: _r = L.GetTable(repl, new LNumber((match.Capture(idx)))); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } value = _r; $s = 5; continue; /* } else { */ case 4: _r$1 = L.GetField(repl, $substring(str, match.Capture(idx), match.Capture(idx + 1 >> 0))); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } value = _r$1; /* } */ case 5: /* */ if (!LVIsFalse(value)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!LVIsFalse(value)) { */ case 8: _r$2 = LVAsString(value); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } infoList = $append(infoList, new replaceInfo.ptr(new sliceType$12([match.Capture(0), match.Capture(1)]), _r$2)); /* } */ case 9: _i++; /* } */ $s = 1; continue; case 2: $s = -1; return strGsubDoReplace(str, infoList); /* */ } return; } if ($f === undefined) { $f = { $blk: strGsubTable }; } $f.L = L; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f.idx = idx; $f.infoList = infoList; $f.match = match; $f.matches = matches; $f.repl = repl; $f.str = str; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; strGsubFunc = function(L, str, repl, matches) { var L, _i, _r, _r$1, _r$2, _ref, _tmp, _tmp$1, end, i, infoList, match, matches, nargs, repl, ret, start, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; end = $f.end; i = $f.i; infoList = $f.infoList; match = $f.match; matches = $f.matches; nargs = $f.nargs; repl = $f.repl; ret = $f.ret; start = $f.start; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: infoList = $makeSlice(sliceType$23, 0, matches.$length); _ref = matches; _i = 0; /* while (true) { */ case 1: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } match = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); _tmp = match.Capture(0); _tmp$1 = match.Capture(1); start = _tmp; end = _tmp$1; L.Push(repl); nargs = 0; /* */ if (match.CaptureLength() > 2) { $s = 3; continue; } /* */ $s = 4; continue; /* if (match.CaptureLength() > 2) { */ case 3: i = 2; /* while (true) { */ case 6: /* if (!(i < match.CaptureLength())) { break; } */ if(!(i < match.CaptureLength())) { $s = 7; continue; } /* */ if (match.IsPosCapture(i)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (match.IsPosCapture(i)) { */ case 8: L.Push(new LNumber((match.Capture(i)))); $s = 10; continue; /* } else { */ case 9: _r = capturedString(L, match, str, i); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = L.Push(new LString((_r))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: nargs = nargs + (1) >> 0; i = i + (2) >> 0; /* } */ $s = 6; continue; case 7: $s = 5; continue; /* } else { */ case 4: _r$1 = capturedString(L, match, str, 0); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } nargs = nargs + (1) >> 0; /* } */ case 5: $r = L.Call(nargs, 1); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret = L.reg.Pop(); /* */ if (!LVIsFalse(ret)) { $s = 16; continue; } /* */ $s = 17; continue; /* if (!LVIsFalse(ret)) { */ case 16: _r$2 = LVAsString(ret); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } infoList = $append(infoList, new replaceInfo.ptr(new sliceType$12([start, end]), _r$2)); /* } */ case 17: _i++; /* } */ $s = 1; continue; case 2: $s = -1; return strGsubDoReplace(str, infoList); /* */ } return; } if ($f === undefined) { $f = { $blk: strGsubFunc }; } $f.L = L; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.end = end; $f.i = i; $f.infoList = infoList; $f.match = match; $f.matches = matches; $f.nargs = nargs; $f.repl = repl; $f.ret = ret; $f.start = start; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strGmatchIter = function(L) { var L, _q, _r, i, idx, match, matches, md, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _q = $f._q; _r = $f._r; i = $f.i; idx = $f.idx; match = $f.match; matches = $f.matches; md = $f.md; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckUserData(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } md = $assertType(_r.Value, ptrType$69); str = md.str; matches = md.matches; idx = md.pos; md.pos = md.pos + (1) >> 0; if (idx === matches.$length) { $s = -1; return 0; } L.Push(L.Get(1)); match = ((idx < 0 || idx >= matches.$length) ? ($throwRuntimeError("index out of range"), undefined) : matches.$array[matches.$offset + idx]); if (match.CaptureLength() === 2) { L.Push(new LString(($substring(str, match.Capture(0), match.Capture(1))))); $s = -1; return 1; } i = 2; while (true) { if (!(i < match.CaptureLength())) { break; } if (match.IsPosCapture(i)) { L.Push(new LNumber((match.Capture(i)))); } else { L.Push(new LString(($substring(str, match.Capture(i), match.Capture(i + 1 >> 0))))); } i = i + (2) >> 0; } $s = -1; return (_q = match.CaptureLength() / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) - 1 >> 0; /* */ } return; } if ($f === undefined) { $f = { $blk: strGmatchIter }; } $f.L = L; $f._q = _q; $f._r = _r; $f.i = i; $f.idx = idx; $f.match = match; $f.matches = matches; $f.md = md; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strGmatch = function(L) { var L, _r, _r$1, _r$2, _r$3, _tuple, err, mds, pattern, str, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; err = $f.err; mds = $f.mds; pattern = $f.pattern; str = $f.str; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = L.CheckString(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } pattern = _r$1; _r$2 = pm.Find(pattern, (new sliceType$20($stringToBytes(str))), 0, -1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple = _r$2; mds = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 4; continue; } /* */ $s = 5; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 4: _r$3 = err.Error(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.RaiseError(_r$3, new sliceType$6([])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: L.Push(L.Get(UpvalueIndex(1))); ud = L.NewUserData(); ud.Value = new strMatchData.ptr(str, 0, mds); L.Push(ud); $s = -1; return 2; /* */ } return; } if ($f === undefined) { $f = { $blk: strGmatch }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.err = err; $f.mds = mds; $f.pattern = pattern; $f.str = str; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; strLen = function(L) { var L, _r, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; L.Push(new LNumber((str.length))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strLen }; } $f.L = L; $f._r = _r; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strLower = function(L) { var L, _r, _r$1, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = strings.ToLower(str); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strLower }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strMatch = function(L) { var L, _1, _q, _r, _r$1, _r$2, _r$3, _r$4, _tuple, err, i, l, md, mds, nsubs, offset, pattern, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; err = $f.err; i = $f.i; l = $f.l; md = $f.md; mds = $f.mds; nsubs = $f.nsubs; offset = $f.offset; pattern = $f.pattern; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = L.CheckString(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } pattern = _r$1; _r$2 = L.OptInt(3, 1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } offset = _r$2; l = str.length; if (offset < 0) { offset = (l + offset >> 0) + 1 >> 0; } offset = offset - (1) >> 0; if (offset < 0) { offset = 0; } _r$3 = pm.Find(pattern, unsafeFastStringToReadOnlyBytes(str), offset, 1); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; mds = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 5: _r$4 = err.Error(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } $r = L.RaiseError(_r$4, new sliceType$6([])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: if (mds.$length === 0) { L.Push($pkg.LNil); $s = -1; return 0; } md = (0 >= mds.$length ? ($throwRuntimeError("index out of range"), undefined) : mds.$array[mds.$offset + 0]); nsubs = (_q = md.CaptureLength() / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); _1 = nsubs; if (_1 === (1)) { L.Push(new LString(($substring(str, md.Capture(0), md.Capture(1))))); $s = -1; return 1; } else { i = 2; while (true) { if (!(i < md.CaptureLength())) { break; } if (md.IsPosCapture(i)) { L.Push(new LNumber((md.Capture(i)))); } else { L.Push(new LString(($substring(str, md.Capture(i), md.Capture(i + 1 >> 0))))); } i = i + (2) >> 0; } $s = -1; return nsubs - 1 >> 0; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: strMatch }; } $f.L = L; $f._1 = _1; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.err = err; $f.i = i; $f.l = l; $f.md = md; $f.mds = mds; $f.nsubs = nsubs; $f.offset = offset; $f.pattern = pattern; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strRep = function(L) { var L, _r, _r$1, n, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; n = $f.n; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } n = _r$1; if (n < 0) { L.Push(new LString("")); } else { L.Push(new LString((strings.Repeat(str, n)))); } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strRep }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.n = n; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strReverse = function(L) { var L, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, bts, i, j, out, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; bts = $f.bts; i = $f.i; j = $f.j; out = $f.out; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; bts = (new sliceType$20($stringToBytes(str))); out = $makeSlice(sliceType$20, bts.$length); _tmp = 0; _tmp$1 = bts.$length - 1 >> 0; i = _tmp; j = _tmp$1; while (true) { if (!(j >= 0)) { break; } ((i < 0 || i >= out.$length) ? ($throwRuntimeError("index out of range"), undefined) : out.$array[out.$offset + i] = ((j < 0 || j >= bts.$length) ? ($throwRuntimeError("index out of range"), undefined) : bts.$array[bts.$offset + j])); _tmp$2 = i + 1 >> 0; _tmp$3 = j - 1 >> 0; i = _tmp$2; j = _tmp$3; } L.Push(new LString((($bytesToString(out))))); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strReverse }; } $f.L = L; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.bts = bts; $f.i = i; $f.j = j; $f.out = out; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strSub = function(L) { var L, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _r$3, _r$4, end, l, start, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; end = $f.end; l = $f.l; start = $f.start; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _arg = str; _r$1 = L.CheckInt(2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg$1 = _r$1; _r$2 = luaIndex2StringIndex(_arg, _arg$1, true); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } start = _r$2; _arg$2 = str; _r$3 = L.OptInt(3, -1); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg$3 = _r$3; _r$4 = luaIndex2StringIndex(_arg$2, _arg$3, false); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } end = _r$4; l = str.length; if (start >= l || end < start) { L.Push(new LString("")); } else { L.Push(new LString(($substring(str, start, end)))); } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strSub }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.end = end; $f.l = l; $f.start = start; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; strUpper = function(L) { var L, _r, _r$1, str, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; str = $f.str; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckString(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } str = _r; _r$1 = strings.ToUpper(str); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LString((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: strUpper }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.str = str; $f.$s = $s; $f.$r = $r; return $f; }; luaIndex2StringIndex = function(str, i, start) { var i, l, start, str; if (start && !((i === 0))) { i = i - (1) >> 0; } l = str.length; if (i < 0) { i = (l + i >> 0) + 1 >> 0; } i = intMax(0, i); if (!start && i > l) { i = l; } return i; }; lValueArraySorter.ptr.prototype.Len = function() { var lv; lv = this; return lv.Values.$length; }; lValueArraySorter.prototype.Len = function() { return this.$val.Len(); }; lValueArraySorter.ptr.prototype.Swap = function(i, j) { var _tmp, _tmp$1, i, j, lv, x, x$1, x$2, x$3; lv = this; _tmp = (x = lv.Values, ((j < 0 || j >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + j])); _tmp$1 = (x$1 = lv.Values, ((i < 0 || i >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + i])); (x$2 = lv.Values, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i] = _tmp)); (x$3 = lv.Values, ((j < 0 || j >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + j] = _tmp$1)); }; lValueArraySorter.prototype.Swap = function(i, j) { return this.$val.Swap(i, j); }; lValueArraySorter.ptr.prototype.Less = function(i, j) { var _r, i, j, lv, x, x$1, x$2, x$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; i = $f.i; j = $f.j; lv = $f.lv; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: lv = this; /* */ if (!(lv.Fn === ptrType$7.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(lv.Fn === ptrType$7.nil)) { */ case 1: lv.L.Push(lv.Fn); lv.L.Push((x = lv.Values, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i]))); lv.L.Push((x$1 = lv.Values, ((j < 0 || j >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + j]))); $r = lv.L.Call(2, 1); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return LVAsBool(lv.L.reg.Pop()); /* } */ case 2: _r = lessThan(lv.L, (x$2 = lv.Values, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])), (x$3 = lv.Values, ((j < 0 || j >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + j]))); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: lValueArraySorter.ptr.prototype.Less }; } $f._r = _r; $f.i = i; $f.j = j; $f.lv = lv; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; }; lValueArraySorter.prototype.Less = function(i, j) { return this.$val.Less(i, j); }; newLTable = function(acap, hcap) { var acap, hcap, tb; if (acap < 0) { acap = 0; } if (hcap < 0) { hcap = 0; } tb = new LTable.ptr($ifaceNil, sliceType$7.nil, false, false, sliceType$7.nil, false); tb.Metatable = $pkg.LNil; if (!((acap === 0))) { tb.array = $makeSlice(sliceType$7, 0, acap); } if (!((hcap === 0))) { tb.strdict = ((hcap < 0 || hcap > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {}); } return tb; }; LTable.ptr.prototype.Len = function() { var i, prev, tb, v, x; tb = this; if (tb.array === sliceType$7.nil) { return 0; } prev = $pkg.LNil; i = tb.array.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } v = (x = tb.array, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])); if ($interfaceIsEqual(prev, $pkg.LNil) && !($interfaceIsEqual(v, $pkg.LNil))) { return i + 1 >> 0; } prev = v; i = i - (1) >> 0; } return 0; }; LTable.prototype.Len = function() { return this.$val.Len(); }; LTable.ptr.prototype.Append = function(value) { var tb, value; tb = this; if ($interfaceIsEqual(value, $pkg.LNil)) { return; } if (tb.array === sliceType$7.nil) { tb.array = $makeSlice(sliceType$7, 0, 32); } tb.array = $append(tb.array, value); }; LTable.prototype.Append = function(value) { return this.$val.Append(value); }; LTable.ptr.prototype.Insert = function(i, value) { var i, tb, value, x; tb = this; if (tb.array === sliceType$7.nil) { tb.array = $makeSlice(sliceType$7, 0, 32); } if (i > tb.array.$length) { tb.RawSetInt(i, value); return; } if (i <= 0) { tb.RawSet(new LNumber((i)), value); return; } i = i - (1) >> 0; tb.array = $append(tb.array, $pkg.LNil); $copySlice($subslice(tb.array, (i + 1 >> 0)), $subslice(tb.array, i)); (x = tb.array, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = value)); }; LTable.prototype.Insert = function(i, value) { return this.$val.Insert(i, value); }; LTable.ptr.prototype.MaxN = function() { var i, tb, x; tb = this; if (tb.array === sliceType$7.nil) { return 0; } i = tb.array.$length - 1 >> 0; while (true) { if (!(i >= 0)) { break; } if (!($interfaceIsEqual((x = tb.array, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])), $pkg.LNil))) { return i + 1 >> 0; } i = i - (1) >> 0; } return 0; }; LTable.prototype.MaxN = function() { return this.$val.MaxN(); }; LTable.ptr.prototype.Remove = function(pos) { var i, larray, oldval, pos, tb, x, x$1, x$2, x$3, x$4; tb = this; if (tb.array === sliceType$7.nil) { return $pkg.LNil; } larray = tb.array.$length; if (larray === 0) { return $pkg.LNil; } i = pos - 1 >> 0; oldval = $pkg.LNil; if (i >= larray) { } else if ((i === (larray - 1 >> 0)) || i < 0) { oldval = (x = tb.array, x$1 = larray - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); tb.array = $subslice(tb.array, 0, (larray - 1 >> 0)); } else { oldval = (x$2 = tb.array, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])); $copySlice($subslice(tb.array, i), $subslice(tb.array, (i + 1 >> 0))); (x$3 = tb.array, x$4 = larray - 1 >> 0, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = $ifaceNil)); tb.array = $subslice(tb.array, 0, (larray - 1 >> 0)); } return oldval; }; LTable.prototype.Remove = function(pos) { return this.$val.Remove(pos); }; LTable.ptr.prototype.RawSet = function(key, value) { var _ref, alen, i, index, key, tb, v, v$1, value, x; tb = this; _ref = key; if ($assertType(_ref, LNumber, true)[1]) { v = _ref.$val; if (isArrayKey(v)) { if (tb.array === sliceType$7.nil) { tb.array = $makeSlice(sliceType$7, 0, 32); } index = ((v >> 0)) - 1 >> 0; alen = tb.array.$length; if ((index === alen)) { tb.array = $append(tb.array, value); } else if (index > alen) { i = 0; while (true) { if (!(i < ((index - alen >> 0)))) { break; } tb.array = $append(tb.array, $pkg.LNil); i = i + (1) >> 0; } tb.array = $append(tb.array, value); } else if (index < alen) { (x = tb.array, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index] = value)); } return; } } else if ($assertType(_ref, LString, true)[1]) { v$1 = _ref.$val; tb.RawSetString((v$1), value); return; } tb.RawSetH(key, value); }; LTable.prototype.RawSet = function(key, value) { return this.$val.RawSet(key, value); }; LTable.ptr.prototype.RawSetInt = function(key, value) { var alen, i, index, key, tb, value, x; tb = this; if (key < 1 || key >= $pkg.MaxArrayIndex) { tb.RawSetH(new LNumber((key)), value); return; } if (tb.array === sliceType$7.nil) { tb.array = $makeSlice(sliceType$7, 0, 32); } index = key - 1 >> 0; alen = tb.array.$length; if ((index === alen)) { tb.array = $append(tb.array, value); } else if (index > alen) { i = 0; while (true) { if (!(i < ((index - alen >> 0)))) { break; } tb.array = $append(tb.array, $pkg.LNil); i = i + (1) >> 0; } tb.array = $append(tb.array, value); } else if (index < alen) { (x = tb.array, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index] = value)); } }; LTable.prototype.RawSetInt = function(key, value) { return this.$val.RawSetInt(key, value); }; LTable.ptr.prototype.RawSetString = function(key, value) { var _entry, _key, _key$1, _tuple, key, lkey, ok, tb, value; tb = this; if (tb.strdict === false) { tb.strdict = {}; } if (tb.keys === sliceType$7.nil) { tb.keys = new sliceType$7([]); tb.k2i = $makeMap(LValue.keyFor, []); } if ($interfaceIsEqual(value, $pkg.LNil)) { delete tb.strdict[$String.keyFor(key)]; } else { _key = key; (tb.strdict || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: value }; lkey = (key); _tuple = (_entry = tb.k2i[LValue.keyFor(new LString(lkey))], _entry !== undefined ? [_entry.v, true] : [0, false]); ok = _tuple[1]; if (!ok) { _key$1 = new LString(lkey); (tb.k2i || $throwRuntimeError("assignment to entry in nil map"))[LValue.keyFor(_key$1)] = { k: _key$1, v: tb.keys.$length }; tb.keys = $append(tb.keys, new LString(lkey)); } } }; LTable.prototype.RawSetString = function(key, value) { return this.$val.RawSetString(key, value); }; LTable.ptr.prototype.RawSetH = function(key, value) { var _entry, _key, _key$1, _tuple, _tuple$1, key, ok, ok$1, s, tb, value, x; tb = this; _tuple = $assertType(key, LString, true); s = _tuple[0]; ok = _tuple[1]; if (ok) { tb.RawSetString((s), value); return; } if (tb.dict === false) { tb.dict = (x = $keys(tb.strdict).length, ((x < 0 || x > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {})); } if (tb.keys === sliceType$7.nil) { tb.keys = new sliceType$7([]); tb.k2i = $makeMap(LValue.keyFor, []); } if ($interfaceIsEqual(value, $pkg.LNil)) { delete tb.dict[LValue.keyFor(key)]; } else { _key = key; (tb.dict || $throwRuntimeError("assignment to entry in nil map"))[LValue.keyFor(_key)] = { k: _key, v: value }; _tuple$1 = (_entry = tb.k2i[LValue.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); ok$1 = _tuple$1[1]; if (!ok$1) { _key$1 = key; (tb.k2i || $throwRuntimeError("assignment to entry in nil map"))[LValue.keyFor(_key$1)] = { k: _key$1, v: tb.keys.$length }; tb.keys = $append(tb.keys, key); } } }; LTable.prototype.RawSetH = function(key, value) { return this.$val.RawSetH(key, value); }; LTable.ptr.prototype.RawGet = function(key) { var _entry, _entry$1, _ref, _tuple, _tuple$1, index, key, ok, ok$1, ret, tb, v, v$1, v$2, x; tb = this; _ref = key; if ($assertType(_ref, LNumber, true)[1]) { v = _ref.$val; if (isArrayKey(v)) { if (tb.array === sliceType$7.nil) { return $pkg.LNil; } index = ((v >> 0)) - 1 >> 0; if (index >= tb.array.$length) { return $pkg.LNil; } return (x = tb.array, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index])); } } else if ($assertType(_ref, LString, true)[1]) { v$1 = _ref.$val; if (tb.strdict === false) { return $pkg.LNil; } _tuple = (_entry = tb.strdict[$String.keyFor((v$1))], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); ret = _tuple[0]; ok = _tuple[1]; if (ok) { return ret; } return $pkg.LNil; } if (tb.dict === false) { return $pkg.LNil; } _tuple$1 = (_entry$1 = tb.dict[LValue.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [$ifaceNil, false]); v$2 = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { return v$2; } return $pkg.LNil; }; LTable.prototype.RawGet = function(key) { return this.$val.RawGet(key); }; LTable.ptr.prototype.RawGetInt = function(key) { var index, key, tb, x; tb = this; if (tb.array === sliceType$7.nil) { return $pkg.LNil; } index = (key) - 1 >> 0; if (index >= tb.array.$length || index < 0) { return $pkg.LNil; } return (x = tb.array, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index])); }; LTable.prototype.RawGetInt = function(key) { return this.$val.RawGetInt(key); }; LTable.ptr.prototype.RawGetH = function(key) { var _entry, _entry$1, _tuple, _tuple$1, _tuple$2, key, ok, s, sok, tb, v, v$1, vok; tb = this; _tuple = $assertType(key, LString, true); s = _tuple[0]; sok = _tuple[1]; if (sok) { if (tb.strdict === false) { return $pkg.LNil; } _tuple$1 = (_entry = tb.strdict[$String.keyFor((s))], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); v = _tuple$1[0]; vok = _tuple$1[1]; if (vok) { return v; } return $pkg.LNil; } if (tb.dict === false) { return $pkg.LNil; } _tuple$2 = (_entry$1 = tb.dict[LValue.keyFor(key)], _entry$1 !== undefined ? [_entry$1.v, true] : [$ifaceNil, false]); v$1 = _tuple$2[0]; ok = _tuple$2[1]; if (ok) { return v$1; } return $pkg.LNil; }; LTable.prototype.RawGetH = function(key) { return this.$val.RawGetH(key); }; LTable.ptr.prototype.RawGetString = function(key) { var _entry, _tuple, key, tb, v, vok; tb = this; if (tb.strdict === false) { return $pkg.LNil; } _tuple = (_entry = tb.strdict[$String.keyFor((key))], _entry !== undefined ? [_entry.v, true] : [$ifaceNil, false]); v = _tuple[0]; vok = _tuple[1]; if (vok) { return v; } return $pkg.LNil; }; LTable.prototype.RawGetString = function(key) { return this.$val.RawGetString(key); }; LTable.ptr.prototype.ForEach = function(cb) { var _entry, _entry$1, _i, _i$1, _i$2, _keys, _keys$1, _ref, _ref$1, _ref$2, cb, i, k, k$1, tb, v, v$1, v$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _keys = $f._keys; _keys$1 = $f._keys$1; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; cb = $f.cb; i = $f.i; k = $f.k; k$1 = $f.k$1; tb = $f.tb; v = $f.v; v$1 = $f.v$1; v$2 = $f.v$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: tb = this; /* */ if (!(tb.array === sliceType$7.nil)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(tb.array === sliceType$7.nil)) { */ case 1: _ref = tb.array; _i = 0; /* while (true) { */ case 3: /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } i = _i; v = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]); /* */ if (!($interfaceIsEqual(v, $pkg.LNil))) { $s = 5; continue; } /* */ $s = 6; continue; /* if (!($interfaceIsEqual(v, $pkg.LNil))) { */ case 5: $r = cb(new LNumber(((i + 1 >> 0))), v); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 6: _i++; /* } */ $s = 3; continue; case 4: /* } */ case 2: /* */ if (!(tb.strdict === false)) { $s = 8; continue; } /* */ $s = 9; continue; /* if (!(tb.strdict === false)) { */ case 8: _ref$1 = tb.strdict; _i$1 = 0; _keys = $keys(_ref$1); /* while (true) { */ case 10: /* if (!(_i$1 < _keys.length)) { break; } */ if(!(_i$1 < _keys.length)) { $s = 11; continue; } _entry = _ref$1[_keys[_i$1]]; if (_entry === undefined) { _i$1++; /* continue; */ $s = 10; continue; } k = _entry.k; v$1 = _entry.v; /* */ if (!($interfaceIsEqual(v$1, $pkg.LNil))) { $s = 12; continue; } /* */ $s = 13; continue; /* if (!($interfaceIsEqual(v$1, $pkg.LNil))) { */ case 12: $r = cb(new LString((k)), v$1); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 13: _i$1++; /* } */ $s = 10; continue; case 11: /* } */ case 9: /* */ if (!(tb.dict === false)) { $s = 15; continue; } /* */ $s = 16; continue; /* if (!(tb.dict === false)) { */ case 15: _ref$2 = tb.dict; _i$2 = 0; _keys$1 = $keys(_ref$2); /* while (true) { */ case 17: /* if (!(_i$2 < _keys$1.length)) { break; } */ if(!(_i$2 < _keys$1.length)) { $s = 18; continue; } _entry$1 = _ref$2[_keys$1[_i$2]]; if (_entry$1 === undefined) { _i$2++; /* continue; */ $s = 17; continue; } k$1 = _entry$1.k; v$2 = _entry$1.v; /* */ if (!($interfaceIsEqual(v$2, $pkg.LNil))) { $s = 19; continue; } /* */ $s = 20; continue; /* if (!($interfaceIsEqual(v$2, $pkg.LNil))) { */ case 19: $r = cb(k$1, v$2); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 20: _i$2++; /* } */ $s = 17; continue; case 18: /* } */ case 16: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LTable.ptr.prototype.ForEach }; } $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._keys = _keys; $f._keys$1 = _keys$1; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f.cb = cb; $f.i = i; $f.k = k; $f.k$1 = k$1; $f.tb = tb; $f.v = v; $f.v$1 = v$1; $f.v$2 = v$2; $f.$s = $s; $f.$r = $r; return $f; }; LTable.prototype.ForEach = function(cb) { return this.$val.ForEach(cb); }; LTable.ptr.prototype.Next = function(key) { var _entry, _tuple, i, index, init$4, key, key$1, kv, ok, tb, v, v$1, v$2, x, x$1, x$2; tb = this; init$4 = false; if ($interfaceIsEqual(key, $pkg.LNil)) { key = new LNumber(0); init$4 = true; } if (init$4 || !($interfaceIsEqual(key, new LNumber(0)))) { _tuple = $assertType(key, LNumber, true); kv = _tuple[0]; ok = _tuple[1]; if (ok && isInteger(kv) && ((kv >> 0)) >= 0 && kv < ($pkg.MaxArrayIndex)) { index = ((kv >> 0)); if (!(tb.array === sliceType$7.nil)) { while (true) { if (!(index < tb.array.$length)) { break; } v = (x = tb.array, ((index < 0 || index >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + index])); if (!($interfaceIsEqual(v, $pkg.LNil))) { return [new LNumber(((index + 1 >> 0))), v]; } index = index + (1) >> 0; } } if (tb.array === sliceType$7.nil || (index === tb.array.$length)) { if ((tb.dict === false || ($keys(tb.dict).length === 0)) && (tb.strdict === false || ($keys(tb.strdict).length === 0))) { return [$pkg.LNil, $pkg.LNil]; } key = (x$1 = tb.keys, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])); v$1 = tb.RawGetH(key); if (!($interfaceIsEqual(v$1, $pkg.LNil))) { return [key, v$1]; } } } } i = (_entry = tb.k2i[LValue.keyFor(key)], _entry !== undefined ? _entry.v : 0) + 1 >> 0; while (true) { if (!(i < tb.keys.$length)) { break; } key$1 = (x$2 = tb.keys, ((i < 0 || i >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + i])); v$2 = tb.RawGetH(key$1); if (!($interfaceIsEqual(v$2, $pkg.LNil))) { return [key$1, v$2]; } i = i + (1) >> 0; } return [$pkg.LNil, $pkg.LNil]; }; LTable.prototype.Next = function(key) { return this.$val.Next(key); }; OpenTable = function(L) { var L, _r, tabmod, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; tabmod = $f.tabmod; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.RegisterModule("table", tableFuncs); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tabmod = _r; L.Push(tabmod); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: OpenTable }; } $f.L = L; $f._r = _r; $f.tabmod = tabmod; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.OpenTable = OpenTable; tableSort = function(L) { var L, _r, _r$1, sorter, tbl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; sorter = $f.sorter; tbl = $f.tbl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tbl = _r; sorter = new lValueArraySorter.ptr(L, ptrType$7.nil, tbl.array); /* */ if (!((L.GetTop() === 1))) { $s = 2; continue; } /* */ $s = 3; continue; /* if (!((L.GetTop() === 1))) { */ case 2: _r$1 = L.CheckFunction(2); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } sorter.Fn = _r$1; /* } */ case 3: $r = sort.Sort(new sorter.constructor.elem(sorter)); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: tableSort }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.sorter = sorter; $f.tbl = tbl; $f.$s = $s; $f.$r = $r; return $f; }; tableGetN = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.Len(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: tableGetN }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; tableMaxN = function(L) { var L, _r, _r$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = _r.MaxN(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $r = L.Push(new LNumber((_r$1))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: tableMaxN }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.$s = $s; $f.$r = $r; return $f; }; tableRemove = function(L) { var L, _r, _r$1, _r$2, tbl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; tbl = $f.tbl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tbl = _r; /* */ if (L.GetTop() === 1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (L.GetTop() === 1) { */ case 2: L.Push(tbl.Remove(-1)); $s = 4; continue; /* } else { */ case 3: _r$1 = L.CheckInt(2); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = tbl.Remove(_r$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = L.Push(_r$2); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: tableRemove }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.tbl = tbl; $f.$s = $s; $f.$r = $r; return $f; }; tableConcat = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, i, j, retbottom, sep, tbl, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; i = $f.i; j = $f.j; retbottom = $f.retbottom; sep = $f.sep; tbl = $f.tbl; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tbl = _r; _r$1 = L.OptString(2, ""); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } sep = (_r$1); _r$2 = L.OptInt(3, 1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } i = _r$2; _r$3 = L.OptInt(4, tbl.Len()); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } j = _r$3; if (L.GetTop() === 3) { if (i > tbl.Len() || i < 1) { L.Push(new LString("")); $s = -1; return 1; } } i = intMax(intMin(i, tbl.Len()), 1); j = intMin(intMin(j, tbl.Len()), tbl.Len()); if (i > j) { L.Push(new LString("")); $s = -1; return 1; } retbottom = L.GetTop(); /* while (true) { */ case 5: /* if (!(i <= j)) { break; } */ if(!(i <= j)) { $s = 6; continue; } v = tbl.RawGetInt(i); /* */ if (!LVCanConvToString(v)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!LVCanConvToString(v)) { */ case 7: _r$4 = v.Type(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new LValueType(_r$4).String(); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg = new $String(_r$5); _arg$1 = new $Int(i); $r = L.RaiseError("invalid value (%s) at index %d in table for concat", new sliceType$6([_arg, _arg$1])); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: L.Push(v); if (!((i === j))) { L.Push(new LString(sep)); } i = i + (1) >> 0; /* } */ $s = 5; continue; case 6: _r$6 = stringConcat(L, L.GetTop() - retbottom >> 0, L.reg.Top() - 1 >> 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } $r = L.Push(_r$6); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: tableConcat }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.i = i; $f.j = j; $f.retbottom = retbottom; $f.sep = sep; $f.tbl = tbl; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; tableInsert = function(L) { var L, _arg, _arg$1, _r, _r$1, _r$2, nargs, tbl, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; nargs = $f.nargs; tbl = $f.tbl; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.CheckTable(1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } tbl = _r; nargs = L.GetTop(); /* */ if (nargs === 1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (nargs === 1) { */ case 2: $r = L.RaiseError("wrong number of arguments", new sliceType$6([])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: if (L.GetTop() === 2) { tbl.Append(L.Get(2)); $s = -1; return 0; } _r$1 = L.CheckInt(2); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _arg = (_r$1); _r$2 = L.CheckAny(3); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; $r = tbl.Insert(_arg, _arg$1); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: tableInsert }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.nargs = nargs; $f.tbl = tbl; $f.$s = $s; $f.$r = $r; return $f; }; intMin = function(a, b) { var a, b; if (a < b) { return a; } return b; }; intMax = function(a, b) { var a, b; if (a > b) { return a; } return b; }; defaultFormat = function(v, f, c) { var _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, buf, c, f, format, i, ok, ok$1, p, v, w, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; buf = $f.buf; c = $f.c; f = $f.f; format = $f.format; i = $f.i; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; v = $f.v; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: buf = $makeSlice(sliceType$1, 0, 10); buf = $append(buf, "%"); i = 0; /* while (true) { */ case 1: /* if (!(i < 128)) { break; } */ if(!(i < 128)) { $s = 2; continue; } _r = f.Flag(i); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } /* */ if (_r) { $s = 3; continue; } /* */ $s = 4; continue; /* if (_r) { */ case 3: buf = $append(buf, ($encodeRune(i))); /* } */ case 4: i = i + (1) >> 0; /* } */ $s = 1; continue; case 2: _r$1 = f.Width(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple = _r$1; w = _tuple[0]; ok = _tuple[1]; if (ok) { buf = $append(buf, strconv.Itoa(w)); } _r$2 = f.Precision(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; p = _tuple$1[0]; ok$1 = _tuple$1[1]; if (ok$1) { buf = $append(buf, "." + strconv.Itoa(p)); } buf = $append(buf, ($encodeRune(c))); format = strings.Join(buf, ""); _r$3 = fmt.Fprintf(f, format, new sliceType$6([v])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$3; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: defaultFormat }; } $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.c = c; $f.f = f; $f.format = format; $f.i = i; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.v = v; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; }; newFlagScanner = function(flag, start, end, str) { var end, flag, start, str; return new flagScanner.ptr(flag, start, end, $makeSlice(sliceType$20, 0, str.length), str, str.length, 0, false, false); }; flagScanner.ptr.prototype.AppendString = function(str) { var fs, str; fs = this; fs.buf = $appendSlice(fs.buf, str); }; flagScanner.prototype.AppendString = function(str) { return this.$val.AppendString(str); }; flagScanner.ptr.prototype.AppendChar = function(ch) { var ch, fs; fs = this; fs.buf = $append(fs.buf, ch); }; flagScanner.prototype.AppendChar = function(ch) { return this.$val.AppendChar(ch); }; flagScanner.ptr.prototype.String = function() { var fs; fs = this; return ($bytesToString(fs.buf)); }; flagScanner.prototype.String = function() { return this.$val.String(); }; flagScanner.ptr.prototype.Next = function() { var c, fs; fs = this; c = 0; fs.ChangeFlag = false; if (fs.Pos === fs.Length) { if (fs.HasFlag) { fs.AppendString(fs.end); } return [c, true]; } c = fs.str.charCodeAt(fs.Pos); if (c === fs.flag) { if (fs.Pos < ((fs.Length - 1 >> 0)) && (fs.str.charCodeAt((fs.Pos + 1 >> 0)) === fs.flag)) { fs.HasFlag = false; fs.AppendChar(fs.flag); fs.Pos = fs.Pos + (2) >> 0; return fs.Next(); } else if (!((fs.Pos === (fs.Length - 1 >> 0)))) { if (fs.HasFlag) { fs.AppendString(fs.end); } fs.AppendString(fs.start); fs.ChangeFlag = true; fs.HasFlag = true; } } fs.Pos = fs.Pos + (1) >> 0; return [c, false]; }; flagScanner.prototype.Next = function() { return this.$val.Next(); }; strftime = function(t, cfmt) { var _1, _entry, _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, c, cfmt, eos, ok, sc, t, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _entry = $f._entry; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; c = $f.c; cfmt = $f.cfmt; eos = $f.eos; ok = $f.ok; sc = $f.sc; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: sc = newFlagScanner(37, "", "", cfmt); _tuple = sc.Next(); c = _tuple[0]; eos = _tuple[1]; /* while (true) { */ case 1: /* if (!(!eos)) { break; } */ if(!(!eos)) { $s = 2; continue; } /* */ if (!sc.ChangeFlag) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!sc.ChangeFlag) { */ case 3: /* */ if (sc.HasFlag) { $s = 5; continue; } /* */ $s = 6; continue; /* if (sc.HasFlag) { */ case 5: _tuple$1 = (_entry = cDateFlagToGo[$Uint8.keyFor(c)], _entry !== undefined ? [_entry.v, true] : ["", false]); v = _tuple$1[0]; ok = _tuple$1[1]; /* */ if (ok) { $s = 8; continue; } /* */ $s = 9; continue; /* if (ok) { */ case 8: _r = $clone(t, time.Time).Format(v); /* */ $s = 11; case 11: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = sc.AppendString(_r); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 10; continue; /* } else { */ case 9: _1 = c; /* */ if (_1 === (119)) { $s = 14; continue; } /* */ $s = 15; continue; /* if (_1 === (119)) { */ case 14: _r$1 = $clone(t, time.Time).Weekday(); /* */ $s = 17; case 17: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = fmt.Sprint(new sliceType$6([new $Int(((_r$1 >> 0)))])); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } $r = sc.AppendString(_r$2); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 16; continue; /* } else { */ case 15: sc.AppendChar(37); sc.AppendChar(c); /* } */ case 16: case 13: /* } */ case 10: sc.HasFlag = false; $s = 7; continue; /* } else { */ case 6: sc.AppendChar(c); /* } */ case 7: /* } */ case 4: _tuple$2 = sc.Next(); c = _tuple$2[0]; eos = _tuple$2[1]; /* } */ $s = 1; continue; case 2: $s = -1; return sc.String(); /* */ } return; } if ($f === undefined) { $f = { $blk: strftime }; } $f._1 = _1; $f._entry = _entry; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.c = c; $f.cfmt = cfmt; $f.eos = eos; $f.ok = ok; $f.sc = sc; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; isInteger = function(v) { var v; return (v) === ($flatten64((new $Int64(0, v)))); }; isArrayKey = function(v) { var v; return isInteger(v) && v < 2.147483647e+09 && v > 0 && v < ($pkg.MaxArrayIndex); }; parseNumber = function(number) { var _r, _tuple, _tuple$1, err, err2, number, v, v2, value, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; err = $f.err; err2 = $f.err2; number = $f.number; v = $f.v; v2 = $f.v2; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: value = 0; _r = strings.Trim(number, " \t\n"); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } number = _r; _tuple = strconv.ParseInt(number, 0, 64); v = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { _tuple$1 = strconv.ParseFloat(number, 64); v2 = _tuple$1[0]; err2 = _tuple$1[1]; if (!($interfaceIsEqual(err2, $ifaceNil))) { $s = -1; return [0, err2]; } value = (v2); } else { value = ($flatten64(v)); } $s = -1; return [value, $ifaceNil]; /* */ } return; } if ($f === undefined) { $f = { $blk: parseNumber }; } $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.err = err; $f.err2 = err2; $f.number = number; $f.v = v; $f.v2 = v2; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; }; popenArgs = function(arg) { var arg, args, cmd; cmd = "/bin/sh"; args = new sliceType$1(["-c"]); if ($pkg.LuaOS === "windows") { cmd = "C:\\Windows\\system32\\cmd.exe"; args = new sliceType$1(["/c"]); } args = $append(args, arg); return [cmd, args]; }; readBufioSize = function(reader, size) { var _r, _tuple, buf, e, err, n, read, reader, result, size, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; e = $f.e; err = $f.err; n = $f.n; read = $f.read; reader = $f.reader; result = $f.result; size = $f.size; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: result = new sliceType$20([]); read = new $Int64(0, 0); err = $ifaceNil; n = 0; /* while (true) { */ case 1: /* if (!(!((read.$high === size.$high && read.$low === size.$low)))) { break; } */ if(!(!((read.$high === size.$high && read.$low === size.$low)))) { $s = 2; continue; } buf = $makeSlice(sliceType$20, $flatten64(new $Int64(size.$high - read.$high, size.$low - read.$low))); _r = reader.Read(buf); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; n = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 2; continue; } read = (x = (new $Int64(0, n)), new $Int64(read.$high + x.$high, read.$low + x.$low)); result = $appendSlice(result, $subslice(buf, 0, n)); /* } */ $s = 1; continue; case 2: e = err; if (!($interfaceIsEqual(e, $ifaceNil)) && $interfaceIsEqual(e, io.EOF)) { e = $ifaceNil; } $s = -1; return [result, (result.$length === 0) && $interfaceIsEqual(err, io.EOF), e]; /* */ } return; } if ($f === undefined) { $f = { $blk: readBufioSize }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.e = e; $f.err = err; $f.n = n; $f.read = read; $f.reader = reader; $f.result = result; $f.size = size; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; readBufioLine = function(reader) { var _r, _tuple, buf, e, err, isprefix, reader, result, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; e = $f.e; err = $f.err; isprefix = $f.isprefix; reader = $f.reader; result = $f.result; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: result = new sliceType$20([]); buf = sliceType$20.nil; err = $ifaceNil; isprefix = true; /* while (true) { */ case 1: /* if (!(isprefix)) { break; } */ if(!(isprefix)) { $s = 2; continue; } _r = reader.ReadLine(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; buf = _tuple[0]; isprefix = _tuple[1]; err = _tuple[2]; if (!($interfaceIsEqual(err, $ifaceNil))) { /* break; */ $s = 2; continue; } result = $appendSlice(result, buf); /* } */ $s = 1; continue; case 2: e = err; if (!($interfaceIsEqual(e, $ifaceNil)) && $interfaceIsEqual(e, io.EOF)) { e = $ifaceNil; } $s = -1; return [result, (result.$length === 0) && $interfaceIsEqual(err, io.EOF), e]; /* */ } return; } if ($f === undefined) { $f = { $blk: readBufioLine }; } $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.e = e; $f.err = err; $f.isprefix = isprefix; $f.reader = reader; $f.result = result; $f.$s = $s; $f.$r = $r; return $f; }; int2Fb = function(val) { var e, val, x; e = 0; x = val; while (true) { if (!(x >= 16)) { break; } x = ((x + 1 >> 0)) >> 1 >> 0; e = e + (1) >> 0; } if (x < 8) { return x; } return ((((e + 1 >> 0)) << 3 >> 0)) | ((x - 8 >> 0)); }; strCmp = function(s1, s2) { var c1, c2, i, len1, len2, s1, s2; len1 = s1.length; len2 = s2.length; i = 0; while (true) { c1 = -1; if (i < len1) { c1 = ((s1.charCodeAt(i) >> 0)); } c2 = -1; if (!((i === len2))) { c2 = ((s2.charCodeAt(i) >> 0)); } if (c1 < c2) { return -1; } else if (c1 > c2) { return 1; } else if (c1 < 0) { return 0; } i = i + (1) >> 0; } }; unsafeFastStringToReadOnlyBytes = function(s) { var bh, s, s$24ptr, sh; sh = ($pointerOfStructConversion(((s$24ptr || (s$24ptr = new ptrType$71(function() { return s; }, function($v) { s = $v; })))), ptrType$70)); bh = new reflect.SliceHeader.ptr(sh.Data, sh.Len, sh.Len); return bh; }; LValueType.prototype.String = function() { var vt, x; vt = this.$val; return (x = ((vt >> 0)), ((x < 0 || x >= lValueNames.length) ? ($throwRuntimeError("index out of range"), undefined) : lValueNames[x])); }; $ptrType(LValueType).prototype.String = function() { return new LValueType(this.$get()).String(); }; LVIsFalse = function(v) { var v; return $interfaceIsEqual(v, $pkg.LNil) || $interfaceIsEqual(v, new LBool($pkg.LFalse)); }; $pkg.LVIsFalse = LVIsFalse; LVAsBool = function(v) { var v; return !($interfaceIsEqual(v, $pkg.LNil)) && !($interfaceIsEqual(v, new LBool($pkg.LFalse))); }; $pkg.LVAsBool = LVAsBool; LVAsString = function(v) { var _r, _ref, sn, sn$1, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _ref = $f._ref; sn = $f.sn; sn$1 = $f.sn$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = v; /* */ if ($assertType(_ref, LString, true)[1] || $assertType(_ref, LNumber, true)[1]) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($assertType(_ref, LString, true)[1] || $assertType(_ref, LNumber, true)[1]) { */ case 1: sn = _ref; _r = sn.String(); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } else { */ case 2: sn$1 = _ref; $s = -1; return ""; /* } */ case 3: $s = -1; return ""; /* */ } return; } if ($f === undefined) { $f = { $blk: LVAsString }; } $f._r = _r; $f._ref = _ref; $f.sn = sn; $f.sn$1 = sn$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.LVAsString = LVAsString; LVCanConvToString = function(v) { var _ref, v; _ref = v; if ($assertType(_ref, LString, true)[1] || $assertType(_ref, LNumber, true)[1]) { return true; } else { return false; } }; $pkg.LVCanConvToString = LVCanConvToString; LVAsNumber = function(v) { var _r, _ref, _tuple, err, lv, lv$1, num, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _ref = $f._ref; _tuple = $f._tuple; err = $f.err; lv = $f.lv; lv$1 = $f.lv$1; num = $f.num; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _ref = v; /* */ if ($assertType(_ref, LNumber, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, LString, true)[1]) { $s = 2; continue; } /* */ $s = 3; continue; /* if ($assertType(_ref, LNumber, true)[1]) { */ case 1: lv = _ref.$val; $s = -1; return lv; /* } else if ($assertType(_ref, LString, true)[1]) { */ case 2: lv$1 = _ref.$val; _r = parseNumber((lv$1)); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; num = _tuple[0]; err = _tuple[1]; if ($interfaceIsEqual(err, $ifaceNil)) { $s = -1; return num; } /* } */ case 3: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: LVAsNumber }; } $f._r = _r; $f._ref = _ref; $f._tuple = _tuple; $f.err = err; $f.lv = lv; $f.lv$1 = lv$1; $f.num = num; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; $pkg.LVAsNumber = LVAsNumber; LNilType.ptr.prototype.String = function() { var nl; nl = this; return "nil"; }; LNilType.prototype.String = function() { return this.$val.String(); }; LNilType.ptr.prototype.Type = function() { var nl; nl = this; return 0; }; LNilType.prototype.Type = function() { return this.$val.Type(); }; LNilType.ptr.prototype.assertFloat64 = function() { var nl; nl = this; return [0, false]; }; LNilType.prototype.assertFloat64 = function() { return this.$val.assertFloat64(); }; LNilType.ptr.prototype.assertString = function() { var nl; nl = this; return ["", false]; }; LNilType.prototype.assertString = function() { return this.$val.assertString(); }; LNilType.ptr.prototype.assertFunction = function() { var nl; nl = this; return [ptrType$7.nil, false]; }; LNilType.prototype.assertFunction = function() { return this.$val.assertFunction(); }; LBool.prototype.String = function() { var bl; bl = this.$val; if ((bl)) { return "true"; } return "false"; }; $ptrType(LBool).prototype.String = function() { return new LBool(this.$get()).String(); }; LBool.prototype.Type = function() { var bl; bl = this.$val; return 1; }; $ptrType(LBool).prototype.Type = function() { return new LBool(this.$get()).Type(); }; LBool.prototype.assertFloat64 = function() { var bl; bl = this.$val; return [0, false]; }; $ptrType(LBool).prototype.assertFloat64 = function() { return new LBool(this.$get()).assertFloat64(); }; LBool.prototype.assertString = function() { var bl; bl = this.$val; return ["", false]; }; $ptrType(LBool).prototype.assertString = function() { return new LBool(this.$get()).assertString(); }; LBool.prototype.assertFunction = function() { var bl; bl = this.$val; return [ptrType$7.nil, false]; }; $ptrType(LBool).prototype.assertFunction = function() { return new LBool(this.$get()).assertFunction(); }; LString.prototype.String = function() { var st; st = this.$val; return (st); }; $ptrType(LString).prototype.String = function() { return new LString(this.$get()).String(); }; LString.prototype.Type = function() { var st; st = this.$val; return 3; }; $ptrType(LString).prototype.Type = function() { return new LString(this.$get()).Type(); }; LString.prototype.assertFloat64 = function() { var st; st = this.$val; return [0, false]; }; $ptrType(LString).prototype.assertFloat64 = function() { return new LString(this.$get()).assertFloat64(); }; LString.prototype.assertString = function() { var st; st = this.$val; return [(st), true]; }; $ptrType(LString).prototype.assertString = function() { return new LString(this.$get()).assertString(); }; LString.prototype.assertFunction = function() { var st; st = this.$val; return [ptrType$7.nil, false]; }; $ptrType(LString).prototype.assertFunction = function() { return new LString(this.$get()).assertFunction(); }; LString.prototype.Format = function(f, c) { var _1, _r, _tuple, c, err, f, nm, st, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; _tuple = $f._tuple; c = $f.c; err = $f.err; f = $f.f; nm = $f.nm; st = $f.st; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: st = this.$val; _1 = c; /* */ if ((_1 === (100)) || (_1 === (105))) { $s = 2; continue; } /* */ $s = 3; continue; /* if ((_1 === (100)) || (_1 === (105))) { */ case 2: _r = parseNumber((st)); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; nm = _tuple[0]; err = _tuple[1]; /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; } /* */ $s = 7; continue; /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6: $r = defaultFormat(new LNumber(nm), f, 100); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else { */ case 7: $r = defaultFormat(new $String((st)), f, 115); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = 4; continue; /* } else { */ case 3: $r = defaultFormat(new $String((st)), f, c); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LString.prototype.Format }; } $f._1 = _1; $f._r = _r; $f._tuple = _tuple; $f.c = c; $f.err = err; $f.f = f; $f.nm = nm; $f.st = st; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(LString).prototype.Format = function(f, c) { return new LString(this.$get()).Format(f, c); }; LNumber.prototype.String = function() { var _r, _r$1, nm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _r$1 = $f._r$1; nm = $f.nm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: nm = this.$val; /* */ if (isInteger(nm)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (isInteger(nm)) { */ case 1: _r = fmt.Sprint(new sliceType$6([(new $Int64(0, nm))])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* } */ case 2: _r$1 = fmt.Sprint(new sliceType$6([new $Float64((nm))])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } $s = -1; return _r$1; /* */ } return; } if ($f === undefined) { $f = { $blk: LNumber.prototype.String }; } $f._r = _r; $f._r$1 = _r$1; $f.nm = nm; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(LNumber).prototype.String = function() { return new LNumber(this.$get()).String(); }; LNumber.prototype.Type = function() { var nm; nm = this.$val; return 2; }; $ptrType(LNumber).prototype.Type = function() { return new LNumber(this.$get()).Type(); }; LNumber.prototype.assertFloat64 = function() { var nm; nm = this.$val; return [(nm), true]; }; $ptrType(LNumber).prototype.assertFloat64 = function() { return new LNumber(this.$get()).assertFloat64(); }; LNumber.prototype.assertString = function() { var nm; nm = this.$val; return ["", false]; }; $ptrType(LNumber).prototype.assertString = function() { return new LNumber(this.$get()).assertString(); }; LNumber.prototype.assertFunction = function() { var nm; nm = this.$val; return [ptrType$7.nil, false]; }; $ptrType(LNumber).prototype.assertFunction = function() { return new LNumber(this.$get()).assertFunction(); }; LNumber.prototype.Format = function(f, c) { var _1, _r, c, f, nm, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _r = $f._r; c = $f.c; f = $f.f; nm = $f.nm; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: nm = this.$val; _1 = c; /* */ if ((_1 === (113)) || (_1 === (115))) { $s = 2; continue; } /* */ if ((_1 === (98)) || (_1 === (99)) || (_1 === (100)) || (_1 === (111)) || (_1 === (120)) || (_1 === (88)) || (_1 === (85))) { $s = 3; continue; } /* */ if ((_1 === (101)) || (_1 === (69)) || (_1 === (102)) || (_1 === (70)) || (_1 === (103)) || (_1 === (71))) { $s = 4; continue; } /* */ if (_1 === (105)) { $s = 5; continue; } /* */ if (isInteger(nm)) { $s = 6; continue; } /* */ $s = 7; continue; /* if ((_1 === (113)) || (_1 === (115))) { */ case 2: _r = new LNumber(nm).String(); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $r = defaultFormat(new $String(_r), f, c); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else if ((_1 === (98)) || (_1 === (99)) || (_1 === (100)) || (_1 === (111)) || (_1 === (120)) || (_1 === (88)) || (_1 === (85))) { */ case 3: $r = defaultFormat((new $Int64(0, nm)), f, c); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else if ((_1 === (101)) || (_1 === (69)) || (_1 === (102)) || (_1 === (70)) || (_1 === (103)) || (_1 === (71))) { */ case 4: $r = defaultFormat(new $Float64((nm)), f, c); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else if (_1 === (105)) { */ case 5: $r = defaultFormat((new $Int64(0, nm)), f, 100); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else if (isInteger(nm)) { */ case 6: $r = defaultFormat((new $Int64(0, nm)), f, c); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 8; continue; /* } else { */ case 7: $r = defaultFormat(new $Float64((nm)), f, c); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: case 1: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: LNumber.prototype.Format }; } $f._1 = _1; $f._r = _r; $f.c = c; $f.f = f; $f.nm = nm; $f.$s = $s; $f.$r = $r; return $f; }; $ptrType(LNumber).prototype.Format = function(f, c) { return new LNumber(this.$get()).Format(f, c); }; LTable.ptr.prototype.String = function() { var _r, tb, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; tb = $f.tb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: tb = this; _r = fmt.Sprintf("table: %p", new sliceType$6([tb])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LTable.ptr.prototype.String }; } $f._r = _r; $f.tb = tb; $f.$s = $s; $f.$r = $r; return $f; }; LTable.prototype.String = function() { return this.$val.String(); }; LTable.ptr.prototype.Type = function() { var tb; tb = this; return 7; }; LTable.prototype.Type = function() { return this.$val.Type(); }; LTable.ptr.prototype.assertFloat64 = function() { var tb; tb = this; return [0, false]; }; LTable.prototype.assertFloat64 = function() { return this.$val.assertFloat64(); }; LTable.ptr.prototype.assertString = function() { var tb; tb = this; return ["", false]; }; LTable.prototype.assertString = function() { return this.$val.assertString(); }; LTable.ptr.prototype.assertFunction = function() { var tb; tb = this; return [ptrType$7.nil, false]; }; LTable.prototype.assertFunction = function() { return this.$val.assertFunction(); }; LFunction.ptr.prototype.String = function() { var _r, fn, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: fn = this; _r = fmt.Sprintf("function: %p", new sliceType$6([fn])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LFunction.ptr.prototype.String }; } $f._r = _r; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; }; LFunction.prototype.String = function() { return this.$val.String(); }; LFunction.ptr.prototype.Type = function() { var fn; fn = this; return 4; }; LFunction.prototype.Type = function() { return this.$val.Type(); }; LFunction.ptr.prototype.assertFloat64 = function() { var fn; fn = this; return [0, false]; }; LFunction.prototype.assertFloat64 = function() { return this.$val.assertFloat64(); }; LFunction.ptr.prototype.assertString = function() { var fn; fn = this; return ["", false]; }; LFunction.prototype.assertString = function() { return this.$val.assertString(); }; LFunction.ptr.prototype.assertFunction = function() { var fn; fn = this; return [fn, true]; }; LFunction.prototype.assertFunction = function() { return this.$val.assertFunction(); }; LState.ptr.prototype.String = function() { var _r, ls, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ls = $f.ls; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ls = this; _r = fmt.Sprintf("thread: %p", new sliceType$6([ls])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LState.ptr.prototype.String }; } $f._r = _r; $f.ls = ls; $f.$s = $s; $f.$r = $r; return $f; }; LState.prototype.String = function() { return this.$val.String(); }; LState.ptr.prototype.Type = function() { var ls; ls = this; return 6; }; LState.prototype.Type = function() { return this.$val.Type(); }; LState.ptr.prototype.assertFloat64 = function() { var ls; ls = this; return [0, false]; }; LState.prototype.assertFloat64 = function() { return this.$val.assertFloat64(); }; LState.ptr.prototype.assertString = function() { var ls; ls = this; return ["", false]; }; LState.prototype.assertString = function() { return this.$val.assertString(); }; LState.ptr.prototype.assertFunction = function() { var ls; ls = this; return [ptrType$7.nil, false]; }; LState.prototype.assertFunction = function() { return this.$val.assertFunction(); }; LUserData.ptr.prototype.String = function() { var _r, ud, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; ud = $f.ud; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: ud = this; _r = fmt.Sprintf("userdata: %p", new sliceType$6([ud])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } $s = -1; return _r; /* */ } return; } if ($f === undefined) { $f = { $blk: LUserData.ptr.prototype.String }; } $f._r = _r; $f.ud = ud; $f.$s = $s; $f.$r = $r; return $f; }; LUserData.prototype.String = function() { return this.$val.String(); }; LUserData.ptr.prototype.Type = function() { var ud; ud = this; return 5; }; LUserData.prototype.Type = function() { return this.$val.Type(); }; LUserData.ptr.prototype.assertFloat64 = function() { var ud; ud = this; return [0, false]; }; LUserData.prototype.assertFloat64 = function() { return this.$val.assertFloat64(); }; LUserData.ptr.prototype.assertString = function() { var ud; ud = this; return ["", false]; }; LUserData.prototype.assertString = function() { return this.$val.assertString(); }; LUserData.ptr.prototype.assertFunction = function() { var ud; ud = this; return [ptrType$7.nil, false]; }; LUserData.prototype.assertFunction = function() { return this.$val.assertFunction(); }; mainLoop = function(L, baseframe) { var L, _r, _r$1, baseframe, cf, inst, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: inst = 0; cf = ptrType$10.nil; if (L.stack.IsEmpty()) { $s = -1; return; } L.currentFrame = L.stack.Last(); /* */ if (L.currentFrame.Fn.IsG) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.currentFrame.Fn.IsG) { */ case 1: _r = callGFunction(L, false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* } */ case 2: /* while (true) { */ case 4: cf = L.currentFrame; inst = (x = cf.Fn.Proto.Code, x$1 = cf.Pc, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); cf.Pc = cf.Pc + (1) >> 0; _r$1 = (x$2 = (((inst >>> 26 >>> 0) >> 0)), ((x$2 < 0 || x$2 >= jumpTable.length) ? ($throwRuntimeError("index out of range"), undefined) : jumpTable[x$2]))(L, inst, baseframe); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1 === 1) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$1 === 1) { */ case 6: $s = -1; return; /* } */ case 7: /* } */ $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: mainLoop }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; mainLoopWithContext = function(L, baseframe) { var L, _r, _r$1, _r$2, _r$3, _r$4, _selection, baseframe, cf, inst, x, x$1, x$2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _selection = $f._selection; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: inst = 0; cf = ptrType$10.nil; if (L.stack.IsEmpty()) { $s = -1; return; } L.currentFrame = L.stack.Last(); /* */ if (L.currentFrame.Fn.IsG) { $s = 1; continue; } /* */ $s = 2; continue; /* if (L.currentFrame.Fn.IsG) { */ case 1: _r = callGFunction(L, false); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r; $s = -1; return; /* } */ case 2: /* while (true) { */ case 4: cf = L.currentFrame; inst = (x = cf.Fn.Proto.Code, x$1 = cf.Pc, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); cf.Pc = cf.Pc + (1) >> 0; _r$1 = L.ctx.Done(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _selection = $select([[_r$1], []]); /* */ if (_selection[0] === 0) { $s = 7; continue; } /* */ if (_selection[0] === 1) { $s = 8; continue; } /* */ $s = 9; continue; /* if (_selection[0] === 0) { */ case 7: _r$2 = L.ctx.Err(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = _r$2.Error(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } $r = L.RaiseError(_r$3, new sliceType$6([])); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* } else if (_selection[0] === 1) { */ case 8: _r$4 = (x$2 = (((inst >>> 26 >>> 0) >> 0)), ((x$2 < 0 || x$2 >= jumpTable.length) ? ($throwRuntimeError("index out of range"), undefined) : jumpTable[x$2]))(L, inst, baseframe); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } /* */ if (_r$4 === 1) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_r$4 === 1) { */ case 13: $s = -1; return; /* } */ case 14: /* } */ case 9: /* } */ $s = 4; continue; case 5: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: mainLoopWithContext }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._selection = _selection; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; }; switchToParentThread = function(L, nargs, haserror, kill) { var L, haserror, kill, nargs, offset, parent, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; haserror = $f.haserror; kill = $f.kill; nargs = $f.nargs; offset = $f.offset; parent = $f.parent; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: parent = L.Parent; /* */ if (parent === ptrType$9.nil) { $s = 1; continue; } /* */ $s = 2; continue; /* if (parent === ptrType$9.nil) { */ case 1: $r = L.RaiseError("can not yield from outside of a coroutine", new sliceType$6([])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 2: L.G.CurrentThread = parent; L.Parent = ptrType$9.nil; if (!L.wrapped) { if (haserror) { parent.Push(new LBool($pkg.LFalse)); } else { parent.Push(new LBool($pkg.LTrue)); } } L.XMoveTo(parent, nargs); L.stack.Pop(); offset = L.currentFrame.LocalBase - L.currentFrame.ReturnBase >> 0; L.currentFrame = L.stack.Last(); L.reg.SetTop(L.reg.Top() - offset >> 0); if (kill) { L.kill(); } $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: switchToParentThread }; } $f.L = L; $f.haserror = haserror; $f.kill = kill; $f.nargs = nargs; $f.offset = offset; $f.parent = parent; $f.$s = $s; $f.$r = $r; return $f; }; callGFunction = function(L, tailcall) { var L, _r, frame, gfnret, i, limit, n, regv, rg, start, tailcall, tidx, wantret, x, x$1, x$2, x$3, x$4, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; frame = $f.frame; gfnret = $f.gfnret; i = $f.i; limit = $f.limit; n = $f.n; regv = $f.regv; rg = $f.rg; start = $f.start; tailcall = $f.tailcall; tidx = $f.tidx; wantret = $f.wantret; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: frame = L.currentFrame; _r = frame.Fn.GFunction(L); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } gfnret = _r; if (tailcall) { L.stack.Remove(L.stack.Sp() - 2 >> 0); L.currentFrame = L.stack.Last(); } /* */ if (gfnret < 0) { $s = 2; continue; } /* */ $s = 3; continue; /* if (gfnret < 0) { */ case 2: $r = switchToParentThread(L, L.GetTop(), false, false); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } */ case 3: wantret = frame.NRet; if (wantret === -1) { wantret = gfnret; } /* */ if (tailcall && !(L.Parent === ptrType$9.nil) && (L.stack.Sp() === 1)) { $s = 5; continue; } /* */ $s = 6; continue; /* if (tailcall && !(L.Parent === ptrType$9.nil) && (L.stack.Sp() === 1)) { */ case 5: $r = switchToParentThread(L, wantret, false, true); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return true; /* } */ case 6: rg = L.reg; regv = frame.ReturnBase; start = L.reg.Top() - gfnret >> 0; limit = -1; n = wantret; i = 0; while (true) { if (!(i < n)) { break; } tidx = start + i >> 0; if (tidx >= rg.top || limit > -1 && tidx >= limit || tidx < 0) { (x = rg.array, x$1 = regv + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); } else { (x$3 = rg.array, x$4 = regv + i >> 0, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = (x$2 = rg.array, ((tidx < 0 || tidx >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + tidx])))); } i = i + (1) >> 0; } rg.top = regv + n >> 0; L.stack.Pop(); L.currentFrame = L.stack.Last(); $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: callGFunction }; } $f.L = L; $f._r = _r; $f.frame = frame; $f.gfnret = gfnret; $f.i = i; $f.limit = limit; $f.n = n; $f.regv = regv; $f.rg = rg; $f.start = start; $f.tailcall = tailcall; $f.tidx = tidx; $f.wantret = wantret; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; }; threadRun = function(L) { var L, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); L = [L]; if (L[0].stack.IsEmpty()) { $s = -1; return; } $deferred.push([(function(L) { return function $b() { var _r, _tuple, lv, ok, parent, rcv, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _r = $f._r; _tuple = $f._tuple; lv = $f.lv; ok = $f.ok; parent = $f.parent; rcv = $f.rcv; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rcv = $recover(); /* */ if (!($interfaceIsEqual(rcv, $ifaceNil))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!($interfaceIsEqual(rcv, $ifaceNil))) { */ case 1: lv = $ifaceNil; _tuple = $assertType(rcv, ptrType$11, true); v = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok) { */ case 3: lv = v.Object; $s = 5; continue; /* } else { */ case 4: _r = fmt.Sprint(new sliceType$6([rcv])); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } lv = new LString((_r)); /* } */ case 5: parent = L[0].Parent; /* */ if (!(parent === ptrType$9.nil)) { $s = 7; continue; } /* */ $s = 8; continue; /* if (!(parent === ptrType$9.nil)) { */ case 7: /* */ if (L[0].wrapped) { $s = 10; continue; } /* */ $s = 11; continue; /* if (L[0].wrapped) { */ case 10: L[0].Push(lv); $r = parent.Panic(L[0]); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = 12; continue; /* } else { */ case 11: L[0].SetTop(0); L[0].Push(lv); $r = switchToParentThread(L[0], 1, true, true); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: $s = 9; continue; /* } else { */ case 8: $panic(rcv); /* } */ case 9: /* } */ case 2: $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._r = _r; $f._tuple = _tuple; $f.lv = lv; $f.ok = ok; $f.parent = parent; $f.rcv = rcv; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }; })(L), []]); $r = L[0].mainLoop(L[0], ptrType$10.nil); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: threadRun }; } $f.L = L; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }; init$3 = function() { arrayType$1.copy(jumpTable, $toNativeArray($kindFunc, [(function(L, inst, baseframe) { var A, B, L, RA, baseframe, cf, inst, lbase, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); reg.Set(RA, reg.Get(lbase + B >> 0)); return 0; }), (function(L, inst, baseframe) { var A, B, C, L, baseframe, cf, code, i, inst, lbase, pc, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; reg.Set(lbase + A >> 0, reg.Get(lbase + B >> 0)); code = cf.Fn.Proto.Code; pc = cf.Pc; i = 0; while (true) { if (!(i < C)) { break; } inst = ((pc < 0 || pc >= code.$length) ? ($throwRuntimeError("index out of range"), undefined) : code.$array[code.$offset + pc]); pc = pc + (1) >> 0; A = (((inst >>> 18 >>> 0) >> 0)) & 255; B = ((((inst & 511) >>> 0) >> 0)); reg.Set(lbase + A >> 0, reg.Get(lbase + B >> 0)); i = i + (1) >> 0; } cf.Pc = pc; return 0; }), (function(L, inst, baseframe) { var A, Bx, L, RA, baseframe, cf, inst, lbase, reg, x; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; Bx = ((((inst & 262143) >>> 0) >> 0)); reg.Set(RA, (x = cf.Fn.Proto.Constants, ((Bx < 0 || Bx >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + Bx]))); return 0; }), (function(L, inst, baseframe) { var A, B, C, L, RA, baseframe, cf, inst, lbase, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; if (!((B === 0))) { reg.Set(RA, new LBool($pkg.LTrue)); } else { reg.Set(RA, new LBool($pkg.LFalse)); } if (!((C === 0))) { cf.Pc = cf.Pc + (1) >> 0; } return 0; }), (function(L, inst, baseframe) { var A, B, L, RA, baseframe, cf, i, inst, lbase, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); i = RA; while (true) { if (!(i <= (lbase + B >> 0))) { break; } reg.Set(i, $pkg.LNil); i = i + (1) >> 0; } return 0; }), (function(L, inst, baseframe) { var A, B, L, RA, baseframe, cf, inst, lbase, reg, x; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); reg.Set(RA, (x = cf.Fn.Upvalues, ((B < 0 || B >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + B])).Value()); return 0; }), (function $b(L, inst, baseframe) { var A, Bx, L, RA, _arg, _arg$1, _r, baseframe, cf, inst, lbase, reg, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; Bx = $f.Bx; L = $f.L; RA = $f.RA; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; Bx = ((((inst & 262143) >>> 0) >> 0)); _arg = RA; _r = L.getFieldString(cf.Fn.Env, (x = cf.Fn.Proto.stringConstants, ((Bx < 0 || Bx >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + Bx]))); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = reg.Set(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.Bx = Bx; $f.L = L; $f.RA = RA; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, _arg, _arg$1, _r, baseframe, cf, inst, lbase, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; _arg = RA; _r = L.getField(reg.Get(lbase + B >> 0), L.rkValue(C)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = reg.Set(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, _arg, _arg$1, _r, baseframe, cf, inst, lbase, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; _arg = RA; _r = L.getFieldString(reg.Get(lbase + B >> 0), L.rkString(C)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = reg.Set(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, Bx, L, RA, baseframe, cf, inst, lbase, reg, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; Bx = $f.Bx; L = $f.L; RA = $f.RA; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; Bx = ((((inst & 262143) >>> 0) >> 0)); $r = L.setFieldString(cf.Fn.Env, (x = cf.Fn.Proto.stringConstants, ((Bx < 0 || Bx >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + Bx])), reg.Get(RA)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.Bx = Bx; $f.L = L; $f.RA = RA; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }), (function(L, inst, baseframe) { var A, B, L, RA, baseframe, cf, inst, lbase, reg, x; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); (x = cf.Fn.Upvalues, ((B < 0 || B >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + B])).SetValue(reg.Get(RA)); return 0; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, baseframe, cf, inst, lbase, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; $r = L.setField(reg.Get(RA), L.rkValue(B), L.rkValue(C)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, baseframe, cf, inst, lbase, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; $r = L.setFieldString(reg.Get(RA), L.rkString(B), L.rkValue(C)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }), (function(L, inst, baseframe) { var A, B, C, L, RA, baseframe, cf, inst, lbase, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; reg.Set(RA, newLTable(B, C)); return 0; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, _arg, _arg$1, _r, baseframe, cf, inst, lbase, reg, selfobj, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; selfobj = $f.selfobj; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; selfobj = reg.Get(lbase + B >> 0); _arg = RA; _r = L.getFieldString(selfobj, L.rkString(C)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = reg.Set(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg.Set(RA + 1 >> 0, selfobj); $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.selfobj = selfobj; $f.$s = $s; $f.$r = $r; return $f; }), opArith, opArith, opArith, opArith, opArith, opArith, (function $b(L, inst, baseframe) { var A, B, L, RA, _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, baseframe, cf, err, inst, lbase, nm, num, ok, ok1, op, reg, str, unaryv, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; L = $f.L; RA = $f.RA; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; baseframe = $f.baseframe; cf = $f.cf; err = $f.err; inst = $f.inst; lbase = $f.lbase; nm = $f.nm; num = $f.num; ok = $f.ok; ok1 = $f.ok1; op = $f.op; reg = $f.reg; str = $f.str; unaryv = $f.unaryv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); unaryv = L.rkValue(B); _tuple = $assertType(unaryv, LNumber, true); nm = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 1; continue; } /* */ $s = 2; continue; /* if (ok) { */ case 1: reg.SetNumber(RA, -nm); $s = 3; continue; /* } else { */ case 2: _r = L.metaOp1(unaryv, "__unm"); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } op = _r; _r$1 = op.Type(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1 === 4) { $s = 5; continue; } /* */ $s = 6; continue; /* if (_r$1 === 4) { */ case 5: reg.Push(op); reg.Push(unaryv); $r = L.Call(1, 1); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } reg.Set(RA, reg.Pop()); $s = 7; continue; /* } else { */ case 6: _tuple$1 = $assertType(unaryv, LString, true); str = _tuple$1[0]; ok1 = _tuple$1[1]; /* */ if (ok1) { $s = 10; continue; } /* */ $s = 11; continue; /* if (ok1) { */ case 10: _r$2 = parseNumber((str)); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; num = _tuple$2[0]; err = _tuple$2[1]; /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 14; continue; } /* */ $s = 15; continue; /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 14: reg.Set(RA, new LNumber(-num)); $s = 16; continue; /* } else { */ case 15: $r = L.RaiseError("__unm undefined", new sliceType$6([])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 16: $s = 12; continue; /* } else { */ case 11: $r = L.RaiseError("__unm undefined", new sliceType$6([])); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: /* } */ case 7: /* } */ case 3: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.L = L; $f.RA = RA; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.baseframe = baseframe; $f.cf = cf; $f.err = err; $f.inst = inst; $f.lbase = lbase; $f.nm = nm; $f.num = num; $f.ok = ok; $f.ok1 = ok1; $f.op = op; $f.reg = reg; $f.str = str; $f.unaryv = unaryv; $f.$s = $s; $f.$r = $r; return $f; }), (function(L, inst, baseframe) { var A, B, L, RA, baseframe, cf, inst, lbase, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); if (LVIsFalse(reg.Get(lbase + B >> 0))) { reg.Set(RA, new LBool($pkg.LTrue)); } else { reg.Set(RA, new LBool($pkg.LFalse)); } return 0; }), (function $b(L, inst, baseframe) { var A, B, L, RA, _r, _r$1, _r$2, _r$3, _ref, baseframe, cf, inst, lbase, lv, lv$1, op, reg, ret, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; L = $f.L; RA = $f.RA; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; lv = $f.lv; lv$1 = $f.lv$1; op = $f.op; reg = $f.reg; ret = $f.ret; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); _ref = L.rkValue(B); /* */ if ($assertType(_ref, LString, true)[1]) { $s = 1; continue; } /* */ $s = 2; continue; /* if ($assertType(_ref, LString, true)[1]) { */ case 1: lv = _ref.$val; reg.SetNumber(RA, (lv.length)); $s = 3; continue; /* } else { */ case 2: lv$1 = _ref; _r = L.metaOp1(lv$1, "__len"); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } op = _r; _r$1 = op.Type(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1 === 4) { $s = 5; continue; } _r$2 = lv$1.Type(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2 === 7) { $s = 6; continue; } /* */ $s = 7; continue; /* if (_r$1 === 4) { */ case 5: reg.Push(op); reg.Push(lv$1); $r = L.Call(1, 1); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } ret = reg.Pop(); _r$3 = ret.Type(); /* */ $s = 15; case 15: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } /* */ if (_r$3 === 2) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_r$3 === 2) { */ case 12: reg.SetNumber(RA, $assertType(ret, LNumber)); $s = 14; continue; /* } else { */ case 13: reg.SetNumber(RA, 0); /* } */ case 14: $s = 8; continue; /* } else if (_r$2 === 7) { */ case 6: reg.SetNumber(RA, ($assertType(lv$1, ptrType$1).Len())); $s = 8; continue; /* } else { */ case 7: $r = L.RaiseError("__len undefined", new sliceType$6([])); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: /* } */ case 3: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.L = L; $f.RA = RA; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.lv = lv; $f.lv$1 = lv$1; $f.op = op; $f.reg = reg; $f.ret = ret; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, RB, RC, _arg, _arg$1, _r, baseframe, cf, inst, lbase, reg, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; RB = $f.RB; RC = $f.RC; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; reg = $f.reg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; RC = lbase + C >> 0; RB = lbase + B >> 0; _arg = RA; _r = stringConcat(L, (RC - RB >> 0) + 1 >> 0, RC); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _arg$1 = _r; $r = reg.Set(_arg, _arg$1); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f.RB = RB; $f.RC = RC; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.reg = reg; $f.$s = $s; $f.$r = $r; return $f; }), (function(L, inst, baseframe) { var L, Sbx, baseframe, cf, inst; cf = L.currentFrame; Sbx = ((((inst & 262143) >>> 0) >> 0)) - 131071 >> 0; cf.Pc = cf.Pc + (Sbx) >> 0; return 0; }), (function $b(L, inst, baseframe) { var A, B, C, L, _r, baseframe, cf, inst, ret, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; ret = $f.ret; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cf = L.currentFrame; A = (((inst >>> 18 >>> 0) >> 0)) & 255; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; _r = equals(L, L.rkValue(B), L.rkValue(C), false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; v = 1; if (ret) { v = 0; } if (v === A) { cf.Pc = cf.Pc + (1) >> 0; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.ret = ret; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, C, L, _r, baseframe, cf, inst, ret, v, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; _r = $f._r; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; ret = $f.ret; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cf = L.currentFrame; A = (((inst >>> 18 >>> 0) >> 0)) & 255; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; _r = lessThan(L, L.rkValue(B), L.rkValue(C)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } ret = _r; v = 1; if (ret) { v = 0; } if (v === A) { cf.Pc = cf.Pc + (1) >> 0; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f._r = _r; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.ret = ret; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, C, L, _1, _2, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, baseframe, cf, inst, lhs, ok1, ok2, ret, rhs, v, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; _1 = $f._1; _2 = $f._2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lhs = $f.lhs; ok1 = $f.ok1; ok2 = $f.ok2; ret = $f.ret; rhs = $f.rhs; v = $f.v; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: cf = L.currentFrame; A = (((inst >>> 18 >>> 0) >> 0)) & 255; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; lhs = L.rkValue(B); rhs = L.rkValue(C); ret = false; _r = lhs.assertFloat64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; v1 = _tuple[0]; ok1 = _tuple[1]; /* */ if (ok1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok1) { */ case 2: _r$1 = rhs.assertFloat64(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; v2 = _tuple$1[0]; ok2 = _tuple$1[1]; /* */ if (ok2) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok2) { */ case 6: ret = v1 <= v2; $s = 8; continue; /* } else { */ case 7: _r$2 = lhs.Type(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = new $String(_r$3); _r$4 = rhs.Type(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new LValueType(_r$4).String(); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = new $String(_r$5); $r = L.RaiseError("attempt to compare %v with %v", new sliceType$6([_arg, _arg$1])); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = 4; continue; /* } else { */ case 3: _r$6 = lhs.Type(); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = rhs.Type(); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (!((_r$6 === _r$7))) { $s = 14; continue; } /* */ $s = 15; continue; /* if (!((_r$6 === _r$7))) { */ case 14: _r$8 = lhs.Type(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = new LValueType(_r$8).String(); /* */ $s = 19; case 19: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$2 = new $String(_r$9); _r$10 = rhs.Type(); /* */ $s = 20; case 20: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = new LValueType(_r$10).String(); /* */ $s = 21; case 21: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$3 = new $String(_r$11); $r = L.RaiseError("attempt to compare %v with %v", new sliceType$6([_arg$2, _arg$3])); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 15: _r$12 = lhs.Type(); /* */ $s = 24; case 24: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _1 = _r$12; /* */ if (_1 === (3)) { $s = 25; continue; } /* */ $s = 26; continue; /* if (_1 === (3)) { */ case 25: ret = strCmp(($assertType(lhs, LString)), ($assertType(rhs, LString))) <= 0; $s = 27; continue; /* } else { */ case 26: _r$13 = objectRational(L, lhs, rhs, "__le"); /* */ $s = 29; case 29: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } _2 = _r$13; /* */ if (_2 === (1)) { $s = 30; continue; } /* */ if (_2 === (0)) { $s = 31; continue; } /* */ $s = 32; continue; /* if (_2 === (1)) { */ case 30: ret = true; $s = 33; continue; /* } else if (_2 === (0)) { */ case 31: ret = false; $s = 33; continue; /* } else { */ case 32: _r$14 = objectRationalWithError(L, rhs, lhs, "__lt"); /* */ $s = 34; case 34: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } ret = !_r$14; /* } */ case 33: case 28: /* } */ case 27: case 23: /* } */ case 4: v = 1; if (ret) { v = 0; } if (v === A) { cf.Pc = cf.Pc + (1) >> 0; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f._1 = _1; $f._2 = _2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lhs = lhs; $f.ok1 = ok1; $f.ok2 = ok2; $f.ret = ret; $f.rhs = rhs; $f.v = v; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }), (function(L, inst, baseframe) { var A, C, L, RA, baseframe, cf, inst, lbase, reg; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; C = (((inst >>> 9 >>> 0) >> 0)) & 511; if (LVAsBool(reg.Get(RA)) === ((C === 0))) { cf.Pc = cf.Pc + (1) >> 0; } return 0; }), (function(L, inst, baseframe) { var A, B, C, L, RA, baseframe, cf, inst, lbase, reg, value; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; value = reg.Get(lbase + B >> 0); if (!(LVAsBool(value) === ((C === 0)))) { reg.Set(RA, value); } else { cf.Pc = cf.Pc + (1) >> 0; } return 0; }), (function $b(L, inst, baseframe) { var A, B, C, L, RA, _r, _r$1, _r$2, _tuple, _tuple$1, _v, argtb, baseframe, callable, cf, cf$1, cf$2, cs, fn, fn$1, i, i$1, i$2, i$3, inst, lbase, ls, lv, maxreg, meta, nargs, nargs$1, newcf, np, nret, nvarargs, ok, proto, reg, v, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; argtb = $f.argtb; baseframe = $f.baseframe; callable = $f.callable; cf = $f.cf; cf$1 = $f.cf$1; cf$2 = $f.cf$2; cs = $f.cs; fn = $f.fn; fn$1 = $f.fn$1; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; inst = $f.inst; lbase = $f.lbase; ls = $f.ls; lv = $f.lv; maxreg = $f.maxreg; meta = $f.meta; nargs = $f.nargs; nargs$1 = $f.nargs$1; newcf = $f.newcf; np = $f.np; nret = $f.nret; nvarargs = $f.nvarargs; ok = $f.ok; proto = $f.proto; reg = $f.reg; v = $f.v; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$16 = $f.x$16; x$17 = $f.x$17; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; nargs = B - 1 >> 0; if (B === 0) { nargs = reg.Top() - ((RA + 1 >> 0)) >> 0; } lv = reg.Get(RA); nret = C - 1 >> 0; callable = ptrType$7.nil; meta = false; _r = lv.assertFunction(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fn = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: callable = fn; meta = false; $s = 4; continue; /* } else { */ case 3: _r$1 = L.metaCall(lv); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; callable = _tuple$1[0]; meta = _tuple$1[1]; /* } */ case 4: ls = L; cf$1 = new callFrame.ptr(0, callable, cf, 0, RA, RA + 1 >> 0, RA, nargs, nret, 0); fn$1 = lv; if (meta) { cf$1.NArgs = cf$1.NArgs + (1) >> 0; ls.reg.Insert(fn$1, cf$1.LocalBase); } /* */ if (cf$1.Fn === ptrType$7.nil) { $s = 6; continue; } /* */ $s = 7; continue; /* if (cf$1.Fn === ptrType$7.nil) { */ case 6: $r = ls.RaiseError("attempt to call a non-function object", new sliceType$6([])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: /* */ if (ls.stack.sp === ls.Options.CallStackSize) { $s = 9; continue; } /* */ $s = 10; continue; /* if (ls.stack.sp === ls.Options.CallStackSize) { */ case 9: $r = ls.RaiseError("stack overflow", new sliceType$6([])); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 10: cs = ls.stack; v = $clone(cf$1, callFrame); callFrame.copy((x = cs.array, x$1 = cs.sp, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])), v); (x$2 = cs.array, x$3 = cs.sp, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])).Idx = cs.sp; cs.sp = cs.sp + (1) >> 0; newcf = ls.stack.Last(); cf$2 = newcf; if (cf$2.Fn.IsG) { ls.reg.SetTop(cf$2.LocalBase + cf$2.NArgs >> 0); } else { proto = cf$2.Fn.Proto; nargs$1 = cf$2.NArgs; np = ((proto.NumParameters >> 0)); i = nargs$1; while (true) { if (!(i < np)) { break; } (x$4 = ls.reg.array, x$5 = cf$2.LocalBase + i >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = $pkg.LNil)); nargs$1 = np; i = i + (1) >> 0; } if ((((proto.IsVarArg & 2) >>> 0)) === 0) { if (nargs$1 < ((proto.NumUsedRegisters >> 0))) { nargs$1 = ((proto.NumUsedRegisters >> 0)); } i$1 = np; while (true) { if (!(i$1 < nargs$1)) { break; } (x$6 = ls.reg.array, x$7 = cf$2.LocalBase + i$1 >> 0, ((x$7 < 0 || x$7 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$7] = $pkg.LNil)); i$1 = i$1 + (1) >> 0; } ls.reg.top = cf$2.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; } else { nvarargs = nargs$1 - np >> 0; if (nvarargs < 0) { nvarargs = 0; } ls.reg.SetTop((cf$2.LocalBase + nargs$1 >> 0) + np >> 0); i$2 = 0; while (true) { if (!(i$2 < np)) { break; } (x$10 = ls.reg.array, x$11 = (cf$2.LocalBase + nargs$1 >> 0) + i$2 >> 0, ((x$11 < 0 || x$11 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + x$11] = (x$8 = ls.reg.array, x$9 = cf$2.LocalBase + i$2 >> 0, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9])))); (x$12 = ls.reg.array, x$13 = cf$2.LocalBase + i$2 >> 0, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13] = $pkg.LNil)); i$2 = i$2 + (1) >> 0; } if ($pkg.CompatVarArg) { ls.reg.SetTop(((cf$2.LocalBase + nargs$1 >> 0) + np >> 0) + 1 >> 0); if (!(((((proto.IsVarArg & 4) >>> 0)) === 0))) { argtb = newLTable(nvarargs, 0); i$3 = 0; while (true) { if (!(i$3 < nvarargs)) { break; } argtb.RawSetInt(i$3 + 1 >> 0, ls.reg.Get((cf$2.LocalBase + np >> 0) + i$3 >> 0)); i$3 = i$3 + (1) >> 0; } argtb.RawSetString("n", new LNumber((nvarargs))); (x$14 = ls.reg.array, x$15 = (cf$2.LocalBase + nargs$1 >> 0) + np >> 0, ((x$15 < 0 || x$15 >= x$14.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$14.$array[x$14.$offset + x$15] = argtb)); } else { (x$16 = ls.reg.array, x$17 = (cf$2.LocalBase + nargs$1 >> 0) + np >> 0, ((x$17 < 0 || x$17 >= x$16.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$16.$array[x$16.$offset + x$17] = $pkg.LNil)); } } cf$2.LocalBase = cf$2.LocalBase + (nargs$1) >> 0; maxreg = cf$2.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; ls.reg.SetTop(maxreg); } } ls.currentFrame = newcf; if (!(callable.IsG)) { _v = false; $s = 14; continue s; } _r$2 = callGFunction(L, false); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _v = _r$2; case 14: /* */ if (_v) { $s = 12; continue; } /* */ $s = 13; continue; /* if (_v) { */ case 12: $s = -1; return 1; /* } */ case 13: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.argtb = argtb; $f.baseframe = baseframe; $f.callable = callable; $f.cf = cf; $f.cf$1 = cf$1; $f.cf$2 = cf$2; $f.cs = cs; $f.fn = fn; $f.fn$1 = fn$1; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.inst = inst; $f.lbase = lbase; $f.ls = ls; $f.lv = lv; $f.maxreg = maxreg; $f.meta = meta; $f.nargs = nargs; $f.nargs$1 = nargs$1; $f.newcf = newcf; $f.np = np; $f.nret = nret; $f.nvarargs = nvarargs; $f.ok = ok; $f.proto = proto; $f.reg = reg; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$16 = x$16; $f.x$17 = x$17; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, L, RA, _r, _r$1, _r$2, _tuple, _tuple$1, argtb, base, baseframe, callable, cf, fn, i, i$1, i$2, i$3, i$4, idx, inst, lbase, lbase$1, limit, ls, ls$1, luaframe, lv, maxreg, meta, n, nargs, nargs$1, np, nvarargs, ok, prev, proto, reg, regv, rg, start, tidx, uv, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; L = $f.L; RA = $f.RA; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; argtb = $f.argtb; base = $f.base; baseframe = $f.baseframe; callable = $f.callable; cf = $f.cf; fn = $f.fn; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; i$4 = $f.i$4; idx = $f.idx; inst = $f.inst; lbase = $f.lbase; lbase$1 = $f.lbase$1; limit = $f.limit; ls = $f.ls; ls$1 = $f.ls$1; luaframe = $f.luaframe; lv = $f.lv; maxreg = $f.maxreg; meta = $f.meta; n = $f.n; nargs = $f.nargs; nargs$1 = $f.nargs$1; np = $f.np; nvarargs = $f.nvarargs; ok = $f.ok; prev = $f.prev; proto = $f.proto; reg = $f.reg; regv = $f.regv; rg = $f.rg; start = $f.start; tidx = $f.tidx; uv = $f.uv; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$16 = $f.x$16; x$17 = $f.x$17; x$18 = $f.x$18; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); nargs = B - 1 >> 0; if (B === 0) { nargs = reg.Top() - ((RA + 1 >> 0)) >> 0; } lv = reg.Get(RA); callable = ptrType$7.nil; meta = false; _r = lv.assertFunction(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; fn = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok) { */ case 2: callable = fn; meta = false; $s = 4; continue; /* } else { */ case 3: _r$1 = L.metaCall(lv); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; callable = _tuple$1[0]; meta = _tuple$1[1]; /* } */ case 4: /* */ if (callable === ptrType$7.nil) { $s = 6; continue; } /* */ $s = 7; continue; /* if (callable === ptrType$7.nil) { */ case 6: $r = L.RaiseError("attempt to call a non-function object", new sliceType$6([])); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 7: ls = L; idx = lbase; if (!(ls.uvcache === ptrType$56.nil)) { prev = ptrType$56.nil; uv = ls.uvcache; while (true) { if (!(!(uv === ptrType$56.nil))) { break; } if (uv.index >= idx) { if (!(prev === ptrType$56.nil)) { prev.next = ptrType$56.nil; } else { ls.uvcache = ptrType$56.nil; } uv.Close(); } prev = uv; uv = uv.next; } } /* */ if (callable.IsG) { $s = 9; continue; } /* */ $s = 10; continue; /* if (callable.IsG) { */ case 9: luaframe = cf; $r = L.pushCallFrame(new callFrame.ptr(0, callable, cf, 0, RA, RA + 1 >> 0, cf.ReturnBase, nargs, cf.NRet, 0), lv, meta); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _r$2 = callGFunction(L, true); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if (_r$2) { $s = 13; continue; } /* */ $s = 14; continue; /* if (_r$2) { */ case 13: $s = -1; return 1; /* } */ case 14: if (L.currentFrame === ptrType$10.nil || L.currentFrame.Fn.IsG || luaframe === baseframe) { $s = -1; return 1; } $s = 11; continue; /* } else { */ case 10: base = cf.Base; cf.Fn = callable; cf.Pc = 0; cf.Base = RA; cf.LocalBase = RA + 1 >> 0; cf.NArgs = nargs; cf.TailCall = cf.TailCall + (1) >> 0; lbase$1 = cf.LocalBase; if (meta) { cf.NArgs = cf.NArgs + (1) >> 0; L.reg.Insert(lv, cf.LocalBase); } ls$1 = L; if (cf.Fn.IsG) { ls$1.reg.SetTop(cf.LocalBase + cf.NArgs >> 0); } else { proto = cf.Fn.Proto; nargs$1 = cf.NArgs; np = ((proto.NumParameters >> 0)); i = nargs$1; while (true) { if (!(i < np)) { break; } (x = ls$1.reg.array, x$1 = cf.LocalBase + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); nargs$1 = np; i = i + (1) >> 0; } if ((((proto.IsVarArg & 2) >>> 0)) === 0) { if (nargs$1 < ((proto.NumUsedRegisters >> 0))) { nargs$1 = ((proto.NumUsedRegisters >> 0)); } i$1 = np; while (true) { if (!(i$1 < nargs$1)) { break; } (x$2 = ls$1.reg.array, x$3 = cf.LocalBase + i$1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3] = $pkg.LNil)); i$1 = i$1 + (1) >> 0; } ls$1.reg.top = cf.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; } else { nvarargs = nargs$1 - np >> 0; if (nvarargs < 0) { nvarargs = 0; } ls$1.reg.SetTop((cf.LocalBase + nargs$1 >> 0) + np >> 0); i$2 = 0; while (true) { if (!(i$2 < np)) { break; } (x$6 = ls$1.reg.array, x$7 = (cf.LocalBase + nargs$1 >> 0) + i$2 >> 0, ((x$7 < 0 || x$7 >= x$6.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + x$7] = (x$4 = ls$1.reg.array, x$5 = cf.LocalBase + i$2 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5])))); (x$8 = ls$1.reg.array, x$9 = cf.LocalBase + i$2 >> 0, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9] = $pkg.LNil)); i$2 = i$2 + (1) >> 0; } if ($pkg.CompatVarArg) { ls$1.reg.SetTop(((cf.LocalBase + nargs$1 >> 0) + np >> 0) + 1 >> 0); if (!(((((proto.IsVarArg & 4) >>> 0)) === 0))) { argtb = newLTable(nvarargs, 0); i$3 = 0; while (true) { if (!(i$3 < nvarargs)) { break; } argtb.RawSetInt(i$3 + 1 >> 0, ls$1.reg.Get((cf.LocalBase + np >> 0) + i$3 >> 0)); i$3 = i$3 + (1) >> 0; } argtb.RawSetString("n", new LNumber((nvarargs))); (x$10 = ls$1.reg.array, x$11 = (cf.LocalBase + nargs$1 >> 0) + np >> 0, ((x$11 < 0 || x$11 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + x$11] = argtb)); } else { (x$12 = ls$1.reg.array, x$13 = (cf.LocalBase + nargs$1 >> 0) + np >> 0, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13] = $pkg.LNil)); } } cf.LocalBase = cf.LocalBase + (nargs$1) >> 0; maxreg = cf.LocalBase + ((proto.NumUsedRegisters >> 0)) >> 0; ls$1.reg.SetTop(maxreg); } } rg = L.reg; regv = base; start = RA; limit = -1; n = (reg.Top() - RA >> 0) - 1 >> 0; i$4 = 0; while (true) { if (!(i$4 < n)) { break; } tidx = start + i$4 >> 0; if (tidx >= rg.top || limit > -1 && tidx >= limit || tidx < 0) { (x$14 = rg.array, x$15 = regv + i$4 >> 0, ((x$15 < 0 || x$15 >= x$14.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$14.$array[x$14.$offset + x$15] = $pkg.LNil)); } else { (x$17 = rg.array, x$18 = regv + i$4 >> 0, ((x$18 < 0 || x$18 >= x$17.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$17.$array[x$17.$offset + x$18] = (x$16 = rg.array, ((tidx < 0 || tidx >= x$16.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$16.$array[x$16.$offset + tidx])))); } i$4 = i$4 + (1) >> 0; } rg.top = regv + n >> 0; cf.Base = base; cf.LocalBase = base + (((cf.LocalBase - lbase$1 >> 0) + 1 >> 0)) >> 0; /* } */ case 11: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.L = L; $f.RA = RA; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.argtb = argtb; $f.base = base; $f.baseframe = baseframe; $f.callable = callable; $f.cf = cf; $f.fn = fn; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.i$4 = i$4; $f.idx = idx; $f.inst = inst; $f.lbase = lbase; $f.lbase$1 = lbase$1; $f.limit = limit; $f.ls = ls; $f.ls$1 = ls$1; $f.luaframe = luaframe; $f.lv = lv; $f.maxreg = maxreg; $f.meta = meta; $f.n = n; $f.nargs = nargs; $f.nargs$1 = nargs$1; $f.np = np; $f.nvarargs = nvarargs; $f.ok = ok; $f.prev = prev; $f.proto = proto; $f.reg = reg; $f.regv = regv; $f.rg = rg; $f.start = start; $f.tidx = tidx; $f.uv = uv; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$16 = x$16; $f.x$17 = x$17; $f.x$18 = x$18; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, B, L, RA, b, b$1, baseframe, cf, i, i$1, i$2, i$3, i$4, i$5, idx, inst, islast, lbase, limit, limit$1, ls, n, n$1, n$2, nret, prev, reg, regm, regm$1, regm$2, regm$3, regv, regv$1, rg, rg$1, rg$2, rg$3, rg$4, rg$5, start, start$1, tidx, tidx$1, uv, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; L = $f.L; RA = $f.RA; b = $f.b; b$1 = $f.b$1; baseframe = $f.baseframe; cf = $f.cf; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; i$4 = $f.i$4; i$5 = $f.i$5; idx = $f.idx; inst = $f.inst; islast = $f.islast; lbase = $f.lbase; limit = $f.limit; limit$1 = $f.limit$1; ls = $f.ls; n = $f.n; n$1 = $f.n$1; n$2 = $f.n$2; nret = $f.nret; prev = $f.prev; reg = $f.reg; regm = $f.regm; regm$1 = $f.regm$1; regm$2 = $f.regm$2; regm$3 = $f.regm$3; regv = $f.regv; regv$1 = $f.regv$1; rg = $f.rg; rg$1 = $f.rg$1; rg$2 = $f.rg$2; rg$3 = $f.rg$3; rg$4 = $f.rg$4; rg$5 = $f.rg$5; start = $f.start; start$1 = $f.start$1; tidx = $f.tidx; tidx$1 = $f.tidx$1; uv = $f.uv; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$16 = $f.x$16; x$17 = $f.x$17; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); ls = L; idx = lbase; if (!(ls.uvcache === ptrType$56.nil)) { prev = ptrType$56.nil; uv = ls.uvcache; while (true) { if (!(!(uv === ptrType$56.nil))) { break; } if (uv.index >= idx) { if (!(prev === ptrType$56.nil)) { prev.next = ptrType$56.nil; } else { ls.uvcache = ptrType$56.nil; } uv.Close(); } prev = uv; uv = uv.next; } } nret = B - 1 >> 0; if (B === 0) { nret = reg.Top() - RA >> 0; } n = cf.NRet; if (cf.NRet === -1) { n = nret; } /* */ if (!(L.Parent === ptrType$9.nil) && (L.stack.Sp() === 1)) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!(L.Parent === ptrType$9.nil) && (L.stack.Sp() === 1)) { */ case 1: regv = reg.Top(); start = RA; b = B; if (b === 1) { rg = L.reg; regm = regv; i = 0; while (true) { if (!(i < n)) { break; } (x = rg.array, x$1 = regm + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); i = i + (1) >> 0; } rg.top = regm + n >> 0; } else { rg$1 = L.reg; limit = -1; i$1 = 0; while (true) { if (!(i$1 < n)) { break; } tidx = start + i$1 >> 0; if (tidx >= rg$1.top || limit > -1 && tidx >= limit || tidx < 0) { (x$2 = rg$1.array, x$3 = regv + i$1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3] = $pkg.LNil)); } else { (x$5 = rg$1.array, x$6 = regv + i$1 >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6] = (x$4 = rg$1.array, ((tidx < 0 || tidx >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + tidx])))); } i$1 = i$1 + (1) >> 0; } rg$1.top = regv + n >> 0; if (b > 1 && n > ((b - 1 >> 0))) { rg$2 = L.reg; regm$1 = (regv + b >> 0) - 1 >> 0; n$1 = n - ((b - 1 >> 0)) >> 0; i$2 = 0; while (true) { if (!(i$2 < n$1)) { break; } (x$7 = rg$2.array, x$8 = regm$1 + i$2 >> 0, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8] = $pkg.LNil)); i$2 = i$2 + (1) >> 0; } rg$2.top = regm$1 + n$1 >> 0; } } $r = switchToParentThread(L, n, false, true); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return 1; /* } */ case 2: islast = baseframe === L.stack.Pop() || L.stack.IsEmpty(); regv$1 = cf.ReturnBase; start$1 = RA; b$1 = B; if (b$1 === 1) { rg$3 = L.reg; regm$2 = regv$1; i$3 = 0; while (true) { if (!(i$3 < n)) { break; } (x$9 = rg$3.array, x$10 = regm$2 + i$3 >> 0, ((x$10 < 0 || x$10 >= x$9.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$9.$array[x$9.$offset + x$10] = $pkg.LNil)); i$3 = i$3 + (1) >> 0; } rg$3.top = regm$2 + n >> 0; } else { rg$4 = L.reg; limit$1 = -1; i$4 = 0; while (true) { if (!(i$4 < n)) { break; } tidx$1 = start$1 + i$4 >> 0; if (tidx$1 >= rg$4.top || limit$1 > -1 && tidx$1 >= limit$1 || tidx$1 < 0) { (x$11 = rg$4.array, x$12 = regv$1 + i$4 >> 0, ((x$12 < 0 || x$12 >= x$11.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$11.$array[x$11.$offset + x$12] = $pkg.LNil)); } else { (x$14 = rg$4.array, x$15 = regv$1 + i$4 >> 0, ((x$15 < 0 || x$15 >= x$14.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$14.$array[x$14.$offset + x$15] = (x$13 = rg$4.array, ((tidx$1 < 0 || tidx$1 >= x$13.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$13.$array[x$13.$offset + tidx$1])))); } i$4 = i$4 + (1) >> 0; } rg$4.top = regv$1 + n >> 0; if (b$1 > 1 && n > ((b$1 - 1 >> 0))) { rg$5 = L.reg; regm$3 = (regv$1 + b$1 >> 0) - 1 >> 0; n$2 = n - ((b$1 - 1 >> 0)) >> 0; i$5 = 0; while (true) { if (!(i$5 < n$2)) { break; } (x$16 = rg$5.array, x$17 = regm$3 + i$5 >> 0, ((x$17 < 0 || x$17 >= x$16.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$16.$array[x$16.$offset + x$17] = $pkg.LNil)); i$5 = i$5 + (1) >> 0; } rg$5.top = regm$3 + n$2 >> 0; } } L.currentFrame = L.stack.Last(); if (islast || L.currentFrame === ptrType$10.nil || L.currentFrame.Fn.IsG) { $s = -1; return 1; } $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.B = B; $f.L = L; $f.RA = RA; $f.b = b; $f.b$1 = b$1; $f.baseframe = baseframe; $f.cf = cf; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.i$4 = i$4; $f.i$5 = i$5; $f.idx = idx; $f.inst = inst; $f.islast = islast; $f.lbase = lbase; $f.limit = limit; $f.limit$1 = limit$1; $f.ls = ls; $f.n = n; $f.n$1 = n$1; $f.n$2 = n$2; $f.nret = nret; $f.prev = prev; $f.reg = reg; $f.regm = regm; $f.regm$1 = regm$1; $f.regm$2 = regm$2; $f.regm$3 = regm$3; $f.regv = regv; $f.regv$1 = regv$1; $f.rg = rg; $f.rg$1 = rg$1; $f.rg$2 = rg$2; $f.rg$3 = rg$3; $f.rg$4 = rg$4; $f.rg$5 = rg$5; $f.start = start; $f.start$1 = start$1; $f.tidx = tidx; $f.tidx$1 = tidx$1; $f.uv = uv; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$16 = x$16; $f.x$17 = x$17; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, L, RA, Sbx, _r, _r$1, _r$2, _tuple, _tuple$1, _tuple$2, baseframe, cf, init$4, inst, lbase, limit, ok1, ok2, ok3, reg, step, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; L = $f.L; RA = $f.RA; Sbx = $f.Sbx; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; baseframe = $f.baseframe; cf = $f.cf; init$4 = $f.init$4; inst = $f.inst; lbase = $f.lbase; limit = $f.limit; ok1 = $f.ok1; ok2 = $f.ok2; ok3 = $f.ok3; reg = $f.reg; step = $f.step; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; _r = reg.Get(RA).assertFloat64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; init$4 = _tuple[0]; ok1 = _tuple[1]; /* */ if (ok1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok1) { */ case 2: _r$1 = reg.Get(RA + 1 >> 0).assertFloat64(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; limit = _tuple$1[0]; ok2 = _tuple$1[1]; /* */ if (ok2) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok2) { */ case 6: _r$2 = reg.Get(RA + 2 >> 0).assertFloat64(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$2 = _r$2; step = _tuple$2[0]; ok3 = _tuple$2[1]; /* */ if (ok3) { $s = 10; continue; } /* */ $s = 11; continue; /* if (ok3) { */ case 10: init$4 = init$4 + (step); reg.SetNumber(RA, (init$4)); if ((step > 0 && init$4 <= limit) || (step <= 0 && init$4 >= limit)) { Sbx = ((((inst & 262143) >>> 0) >> 0)) - 131071 >> 0; cf.Pc = cf.Pc + (Sbx) >> 0; reg.SetNumber(RA + 3 >> 0, (init$4)); } else { reg.SetTop(RA + 1 >> 0); } $s = 12; continue; /* } else { */ case 11: $r = L.RaiseError("for statement step must be a number", new sliceType$6([])); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 12: $s = 8; continue; /* } else { */ case 7: $r = L.RaiseError("for statement limit must be a number", new sliceType$6([])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = 4; continue; /* } else { */ case 3: $r = L.RaiseError("for statement init must be a number", new sliceType$6([])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.L = L; $f.RA = RA; $f.Sbx = Sbx; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.baseframe = baseframe; $f.cf = cf; $f.init$4 = init$4; $f.inst = inst; $f.lbase = lbase; $f.limit = limit; $f.ok1 = ok1; $f.ok2 = ok2; $f.ok3 = ok3; $f.reg = reg; $f.step = step; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, L, RA, Sbx, _r, _r$1, _tuple, _tuple$1, baseframe, cf, init$4, inst, lbase, ok1, ok2, reg, step, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; L = $f.L; RA = $f.RA; Sbx = $f.Sbx; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; baseframe = $f.baseframe; cf = $f.cf; init$4 = $f.init$4; inst = $f.inst; lbase = $f.lbase; ok1 = $f.ok1; ok2 = $f.ok2; reg = $f.reg; step = $f.step; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; Sbx = ((((inst & 262143) >>> 0) >> 0)) - 131071 >> 0; _r = reg.Get(RA).assertFloat64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; init$4 = _tuple[0]; ok1 = _tuple[1]; /* */ if (ok1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok1) { */ case 2: _r$1 = reg.Get(RA + 2 >> 0).assertFloat64(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; step = _tuple$1[0]; ok2 = _tuple$1[1]; /* */ if (ok2) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok2) { */ case 6: reg.SetNumber(RA, (init$4 - step)); $s = 8; continue; /* } else { */ case 7: $r = L.RaiseError("for statement step must be a number", new sliceType$6([])); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 8: $s = 4; continue; /* } else { */ case 3: $r = L.RaiseError("for statement init must be a number", new sliceType$6([])); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 4: cf.Pc = cf.Pc + (Sbx) >> 0; $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.L = L; $f.RA = RA; $f.Sbx = Sbx; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.baseframe = baseframe; $f.cf = cf; $f.init$4 = init$4; $f.inst = inst; $f.lbase = lbase; $f.ok1 = ok1; $f.ok2 = ok2; $f.reg = reg; $f.step = step; $f.$s = $s; $f.$r = $r; return $f; }), (function $b(L, inst, baseframe) { var A, C, L, RA, baseframe, cf, inst, lbase, nret, pc, reg, value, x, x$1, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; C = $f.C; L = $f.L; RA = $f.RA; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; nret = $f.nret; pc = $f.pc; reg = $f.reg; value = $f.value; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; C = (((inst >>> 9 >>> 0) >> 0)) & 511; nret = C; reg.SetTop((RA + 3 >> 0) + 2 >> 0); reg.Set((RA + 3 >> 0) + 2 >> 0, reg.Get(RA + 2 >> 0)); reg.Set((RA + 3 >> 0) + 1 >> 0, reg.Get(RA + 1 >> 0)); reg.Set(RA + 3 >> 0, reg.Get(RA)); $r = L.callR(2, nret, RA + 3 >> 0); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } value = reg.Get(RA + 3 >> 0); if (!($interfaceIsEqual(value, $pkg.LNil))) { reg.Set(RA + 2 >> 0, value); pc = (x = cf.Fn.Proto.Code, x$1 = cf.Pc, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])); cf.Pc = cf.Pc + ((((((pc & 262143) >>> 0) >> 0)) - 131071 >> 0)) >> 0; } cf.Pc = cf.Pc + (1) >> 0; $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.A = A; $f.C = C; $f.L = L; $f.RA = RA; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.nret = nret; $f.pc = pc; $f.reg = reg; $f.value = value; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; }), (function(L, inst, baseframe) { var A, B, C, L, RA, baseframe, cf, i, inst, lbase, nelem, offset, reg, table, x, x$1; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; if (C === 0) { C = (((x = cf.Fn.Proto.Code, x$1 = cf.Pc, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >> 0)); cf.Pc = cf.Pc + (1) >> 0; } offset = $imul(((C - 1 >> 0)), $pkg.FieldsPerFlush); table = $assertType(reg.Get(RA), ptrType$1); nelem = B; if (B === 0) { nelem = (reg.Top() - RA >> 0) - 1 >> 0; } i = 1; while (true) { if (!(i <= nelem)) { break; } table.RawSetInt(offset + i >> 0, reg.Get(RA + i >> 0)); i = i + (1) >> 0; } return 0; }), (function(L, inst, baseframe) { var A, L, RA, baseframe, cf, idx, inst, lbase, ls, prev, uv; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; ls = L; idx = RA; if (!(ls.uvcache === ptrType$56.nil)) { prev = ptrType$56.nil; uv = ls.uvcache; while (true) { if (!(!(uv === ptrType$56.nil))) { break; } if (uv.index >= idx) { if (!(prev === ptrType$56.nil)) { prev.next = ptrType$56.nil; } else { ls.uvcache = ptrType$56.nil; } uv.Close(); } prev = uv; uv = uv.next; } } return 0; }), (function(L, inst, baseframe) { var A, B, Bx, L, RA, _3, baseframe, cf, closure, i, inst, lbase, proto, reg, x, x$1, x$2, x$3, x$4, x$5; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; Bx = ((((inst & 262143) >>> 0) >> 0)); proto = (x = cf.Fn.Proto.FunctionPrototypes, ((Bx < 0 || Bx >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + Bx])); closure = newLFunctionL(proto, cf.Fn.Env, ((proto.NumUpvalues >> 0))); reg.Set(RA, closure); i = 0; while (true) { if (!(i < ((proto.NumUpvalues >> 0)))) { break; } inst = (x$1 = cf.Fn.Proto.Code, x$2 = cf.Pc, ((x$2 < 0 || x$2 >= x$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + x$2])); cf.Pc = cf.Pc + (1) >> 0; B = opGetArgB(inst); _3 = opGetOpCode(inst); if (_3 === (0)) { (x$3 = closure.Upvalues, ((i < 0 || i >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + i] = L.findUpvalue(lbase + B >> 0))); } else if (_3 === (5)) { (x$5 = closure.Upvalues, ((i < 0 || i >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + i] = (x$4 = cf.Fn.Upvalues, ((B < 0 || B >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + B])))); } i = i + (1) >> 0; } return 0; }), (function(L, inst, baseframe) { var A, B, L, RA, baseframe, cf, i, inst, lbase, limit, n, nparams, nvarargs, nwant, reg, regv, rg, start, tidx, x, x$1, x$2, x$3, x$4; reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; B = ((((inst & 511) >>> 0) >> 0)); nparams = ((cf.Fn.Proto.NumParameters >> 0)); nvarargs = cf.NArgs - nparams >> 0; if (nvarargs < 0) { nvarargs = 0; } nwant = B - 1 >> 0; if (B === 0) { nwant = nvarargs; } rg = reg; regv = RA; start = (cf.Base + nparams >> 0) + 1 >> 0; limit = cf.LocalBase; n = nwant; i = 0; while (true) { if (!(i < n)) { break; } tidx = start + i >> 0; if (tidx >= rg.top || limit > -1 && tidx >= limit || tidx < 0) { (x = rg.array, x$1 = regv + i >> 0, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = $pkg.LNil)); } else { (x$3 = rg.array, x$4 = regv + i >> 0, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = (x$2 = rg.array, ((tidx < 0 || tidx >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + tidx])))); } i = i + (1) >> 0; } rg.top = regv + n >> 0; return 0; }), (function(L, inst, baseframe) { var L, baseframe, inst; return 0; })])); }; opArith = function(L, inst, baseframe) { var A, B, C, L, RA, _arg, _arg$1, _r, _r$1, _r$2, _tuple, _tuple$1, baseframe, cf, inst, lbase, lhs, ok1, ok2, opcode, reg, rhs, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; A = $f.A; B = $f.B; C = $f.C; L = $f.L; RA = $f.RA; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; baseframe = $f.baseframe; cf = $f.cf; inst = $f.inst; lbase = $f.lbase; lhs = $f.lhs; ok1 = $f.ok1; ok2 = $f.ok2; opcode = $f.opcode; reg = $f.reg; rhs = $f.rhs; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: reg = L.reg; cf = L.currentFrame; lbase = cf.LocalBase; A = (((inst >>> 18 >>> 0) >> 0)) & 255; RA = lbase + A >> 0; opcode = (((inst >>> 26 >>> 0) >> 0)); B = ((((inst & 511) >>> 0) >> 0)); C = (((inst >>> 9 >>> 0) >> 0)) & 511; lhs = L.rkValue(B); rhs = L.rkValue(C); _r = lhs.assertFloat64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; v1 = _tuple[0]; ok1 = _tuple[1]; _r$1 = rhs.assertFloat64(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; v2 = _tuple$1[0]; ok2 = _tuple$1[1]; /* */ if (ok1 && ok2) { $s = 3; continue; } /* */ $s = 4; continue; /* if (ok1 && ok2) { */ case 3: reg.SetNumber(RA, numberArith(L, opcode, (v1), (v2))); $s = 5; continue; /* } else { */ case 4: _arg = RA; _r$2 = objectArith(L, opcode, lhs, rhs); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg$1 = _r$2; $r = reg.Set(_arg, _arg$1); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 5: $s = -1; return 0; /* */ } return; } if ($f === undefined) { $f = { $blk: opArith }; } $f.A = A; $f.B = B; $f.C = C; $f.L = L; $f.RA = RA; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.baseframe = baseframe; $f.cf = cf; $f.inst = inst; $f.lbase = lbase; $f.lhs = lhs; $f.ok1 = ok1; $f.ok2 = ok2; $f.opcode = opcode; $f.reg = reg; $f.rhs = rhs; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }; luaModulo = function(lhs, rhs) { var flhs, frhs, lhs, rhs, v; flhs = (lhs); frhs = (rhs); v = math.Mod(flhs, frhs); if (flhs < 0 || frhs < 0 && !(flhs < 0 && frhs < 0)) { v = v + (frhs); } return (v); }; numberArith = function(L, opcode, lhs, rhs) { var L, _1, flhs, frhs, lhs, opcode, rhs; _1 = opcode; if (_1 === (15)) { return lhs + rhs; } else if (_1 === (16)) { return lhs - rhs; } else if (_1 === (17)) { return lhs * rhs; } else if (_1 === (18)) { return lhs / rhs; } else if (_1 === (19)) { return luaModulo(lhs, rhs); } else if (_1 === (20)) { flhs = (lhs); frhs = (rhs); return (math.Pow(flhs, frhs)); } $panic(new $String("should not reach here")); }; objectArith = function(L, opcode, lhs, rhs) { var L, _1, _arg, _arg$1, _arg$2, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, err, err$1, event, lhs, lnum, ok, ok$1, ok1, ok2, op, opcode, rhs, rnum, str, str$1, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; err = $f.err; err$1 = $f.err$1; event = $f.event; lhs = $f.lhs; lnum = $f.lnum; ok = $f.ok; ok$1 = $f.ok$1; ok1 = $f.ok1; ok2 = $f.ok2; op = $f.op; opcode = $f.opcode; rhs = $f.rhs; rnum = $f.rnum; str = $f.str; str$1 = $f.str$1; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: event = ""; _1 = opcode; if (_1 === (15)) { event = "__add"; } else if (_1 === (16)) { event = "__sub"; } else if (_1 === (17)) { event = "__mul"; } else if (_1 === (18)) { event = "__div"; } else if (_1 === (19)) { event = "__mod"; } else if (_1 === (20)) { event = "__pow"; } _r = L.metaOp2(lhs, rhs, event); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } op = _r; _r$1 = op.Type(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1 === 4) { $s = 2; continue; } /* */ $s = 3; continue; /* if (_r$1 === 4) { */ case 2: L.reg.Push(op); L.reg.Push(lhs); L.reg.Push(rhs); $r = L.Call(2, 1); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return L.reg.Pop(); /* } */ case 3: _tuple = $assertType(lhs, LString, true); str = _tuple[0]; ok = _tuple[1]; /* */ if (ok) { $s = 6; continue; } /* */ $s = 7; continue; /* if (ok) { */ case 6: _r$2 = parseNumber((str)); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _tuple$1 = _r$2; lnum = _tuple$1[0]; err = _tuple$1[1]; if ($interfaceIsEqual(err, $ifaceNil)) { lhs = new LNumber(lnum); } /* } */ case 7: _tuple$2 = $assertType(rhs, LString, true); str$1 = _tuple$2[0]; ok$1 = _tuple$2[1]; /* */ if (ok$1) { $s = 9; continue; } /* */ $s = 10; continue; /* if (ok$1) { */ case 9: _r$3 = parseNumber((str$1)); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple$3 = _r$3; rnum = _tuple$3[0]; err$1 = _tuple$3[1]; if ($interfaceIsEqual(err$1, $ifaceNil)) { rhs = new LNumber(rnum); } /* } */ case 10: _r$4 = lhs.assertFloat64(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$4 = _r$4; v1 = _tuple$4[0]; ok1 = _tuple$4[1]; /* */ if (ok1) { $s = 13; continue; } /* */ $s = 14; continue; /* if (ok1) { */ case 13: _r$5 = rhs.assertFloat64(); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _tuple$5 = _r$5; v2 = _tuple$5[0]; ok2 = _tuple$5[1]; if (ok2) { $s = -1; return new LNumber(numberArith(L, opcode, (v1), (v2))); } /* } */ case 14: _r$6 = strings.TrimLeft(event, "_"); /* */ $s = 16; case 16: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _arg = new $String(_r$6); _r$7 = lhs.Type(); /* */ $s = 17; case 17: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } _r$8 = new LValueType(_r$7).String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _arg$1 = new $String(_r$8); _r$9 = rhs.Type(); /* */ $s = 19; case 19: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _r$10 = new LValueType(_r$9).String(); /* */ $s = 20; case 20: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _arg$2 = new $String(_r$10); _r$11 = fmt.Sprintf("cannot perform %v operation between %v and %v", new sliceType$6([_arg, _arg$1, _arg$2])); /* */ $s = 21; case 21: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } $r = L.RaiseError(_r$11, new sliceType$6([])); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $pkg.LNil; /* */ } return; } if ($f === undefined) { $f = { $blk: objectArith }; } $f.L = L; $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.err = err; $f.err$1 = err$1; $f.event = event; $f.lhs = lhs; $f.lnum = lnum; $f.ok = ok; $f.ok$1 = ok$1; $f.ok1 = ok1; $f.ok2 = ok2; $f.op = op; $f.opcode = opcode; $f.rhs = rhs; $f.rnum = rnum; $f.str = str; $f.str$1 = str$1; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }; stringConcat = function(L, total, last) { var L, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, buf, i, last, lhs, op, rhs, total, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; buf = $f.buf; i = $f.i; last = $f.last; lhs = $f.lhs; op = $f.op; rhs = $f.rhs; total = $f.total; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: rhs = L.reg.Get(last); total = total - (1) >> 0; i = last - 1 >> 0; /* while (true) { */ case 1: /* if (!(total > 0)) { break; } */ if(!(total > 0)) { $s = 2; continue; } lhs = L.reg.Get(i); /* */ if (!(LVCanConvToString(lhs) && LVCanConvToString(rhs))) { $s = 3; continue; } /* */ $s = 4; continue; /* if (!(LVCanConvToString(lhs) && LVCanConvToString(rhs))) { */ case 3: _r = L.metaOp2(lhs, rhs, "__concat"); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } op = _r; _r$1 = op.Type(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (_r$1 === 4) { $s = 7; continue; } /* */ $s = 8; continue; /* if (_r$1 === 4) { */ case 7: L.reg.Push(op); L.reg.Push(lhs); L.reg.Push(rhs); $r = L.Call(2, 1); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } rhs = L.reg.Pop(); total = total - (1) >> 0; i = i - (1) >> 0; $s = 9; continue; /* } else { */ case 8: _r$2 = lhs.Type(); /* */ $s = 12; case 12: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 13; case 13: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = new $String(_r$3); _r$4 = rhs.Type(); /* */ $s = 14; case 14: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new LValueType(_r$4).String(); /* */ $s = 15; case 15: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = new $String(_r$5); $r = L.RaiseError("cannot perform concat operation between %v and %v", new sliceType$6([_arg, _arg$1])); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return $pkg.LNil; /* } */ case 9: $s = 5; continue; /* } else { */ case 4: buf = $makeSlice(sliceType$1, (total + 1 >> 0)); _r$6 = LVAsString(rhs); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } ((total < 0 || total >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + total] = _r$6); /* while (true) { */ case 18: /* if (!(total > 0)) { break; } */ if(!(total > 0)) { $s = 19; continue; } lhs = L.reg.Get(i); if (!LVCanConvToString(lhs)) { /* break; */ $s = 19; continue; } _r$7 = LVAsString(lhs); /* */ $s = 20; case 20: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } (x = total - 1 >> 0, ((x < 0 || x >= buf.$length) ? ($throwRuntimeError("index out of range"), undefined) : buf.$array[buf.$offset + x] = _r$7)); i = i - (1) >> 0; total = total - (1) >> 0; /* } */ $s = 18; continue; case 19: rhs = new LString((strings.Join(buf, ""))); /* } */ case 5: /* } */ $s = 1; continue; case 2: $s = -1; return rhs; /* */ } return; } if ($f === undefined) { $f = { $blk: stringConcat }; } $f.L = L; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.buf = buf; $f.i = i; $f.last = last; $f.lhs = lhs; $f.op = op; $f.rhs = rhs; $f.total = total; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; lessThan = function(L, lhs, rhs) { var L, _1, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, lhs, ok1, ok2, ret, rhs, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; lhs = $f.lhs; ok1 = $f.ok1; ok2 = $f.ok2; ret = $f.ret; rhs = $f.rhs; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lhs.assertFloat64(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _tuple = _r; v1 = _tuple[0]; ok1 = _tuple[1]; /* */ if (ok1) { $s = 2; continue; } /* */ $s = 3; continue; /* if (ok1) { */ case 2: _r$1 = rhs.assertFloat64(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _tuple$1 = _r$1; v2 = _tuple$1[0]; ok2 = _tuple$1[1]; if (ok2) { $s = -1; return v1 < v2; } _r$2 = lhs.Type(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _r$3 = new LValueType(_r$2).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _arg = new $String(_r$3); _r$4 = rhs.Type(); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _r$5 = new LValueType(_r$4).String(); /* */ $s = 8; case 8: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _arg$1 = new $String(_r$5); $r = L.RaiseError("attempt to compare %v with %v", new sliceType$6([_arg, _arg$1])); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } /* } */ case 3: _r$6 = lhs.Type(); /* */ $s = 12; case 12: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } _r$7 = rhs.Type(); /* */ $s = 13; case 13: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } /* */ if (!((_r$6 === _r$7))) { $s = 10; continue; } /* */ $s = 11; continue; /* if (!((_r$6 === _r$7))) { */ case 10: _r$8 = lhs.Type(); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } _r$9 = new LValueType(_r$8).String(); /* */ $s = 15; case 15: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } _arg$2 = new $String(_r$9); _r$10 = rhs.Type(); /* */ $s = 16; case 16: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } _r$11 = new LValueType(_r$10).String(); /* */ $s = 17; case 17: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } _arg$3 = new $String(_r$11); $r = L.RaiseError("attempt to compare %v with %v", new sliceType$6([_arg$2, _arg$3])); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return false; /* } */ case 11: ret = false; _r$12 = lhs.Type(); /* */ $s = 20; case 20: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } _1 = _r$12; /* */ if (_1 === (3)) { $s = 21; continue; } /* */ $s = 22; continue; /* if (_1 === (3)) { */ case 21: ret = strCmp(($assertType(lhs, LString)), ($assertType(rhs, LString))) < 0; $s = 23; continue; /* } else { */ case 22: _r$13 = objectRationalWithError(L, lhs, rhs, "__lt"); /* */ $s = 24; case 24: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } ret = _r$13; /* } */ case 23: case 19: $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: lessThan }; } $f.L = L; $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.lhs = lhs; $f.ok1 = ok1; $f.ok2 = ok2; $f.ret = ret; $f.rhs = rhs; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }; equals = function(L, lhs, rhs, raw) { var L, _1, _2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, _tuple$1, lhs, raw, ret, rhs, v1, v2, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _2 = $f._2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; lhs = $f.lhs; raw = $f.raw; ret = $f.ret; rhs = $f.rhs; v1 = $f.v1; v2 = $f.v2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lhs.Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _r$1 = rhs.Type(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } /* */ if (!((_r === _r$1))) { $s = 1; continue; } /* */ $s = 2; continue; /* if (!((_r === _r$1))) { */ case 1: $s = -1; return false; /* } */ case 2: ret = false; _r$2 = lhs.Type(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _1 = _r$2; /* */ if (_1 === (0)) { $s = 7; continue; } /* */ if (_1 === (2)) { $s = 8; continue; } /* */ if (_1 === (1)) { $s = 9; continue; } /* */ if (_1 === (3)) { $s = 10; continue; } /* */ if ((_1 === (5)) || (_1 === (7))) { $s = 11; continue; } /* */ $s = 12; continue; /* if (_1 === (0)) { */ case 7: ret = true; $s = 13; continue; /* } else if (_1 === (2)) { */ case 8: _r$3 = lhs.assertFloat64(); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; v1 = _tuple[0]; _r$4 = rhs.assertFloat64(); /* */ $s = 15; case 15: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _tuple$1 = _r$4; v2 = _tuple$1[0]; ret = v1 === v2; $s = 13; continue; /* } else if (_1 === (1)) { */ case 9: ret = ($assertType(lhs, LBool)) === ($assertType(rhs, LBool)); $s = 13; continue; /* } else if (_1 === (3)) { */ case 10: ret = ($assertType(lhs, LString)) === ($assertType(rhs, LString)); $s = 13; continue; /* } else if ((_1 === (5)) || (_1 === (7))) { */ case 11: /* */ if ($interfaceIsEqual(lhs, rhs)) { $s = 16; continue; } /* */ if (!raw) { $s = 17; continue; } /* */ $s = 18; continue; /* if ($interfaceIsEqual(lhs, rhs)) { */ case 16: ret = true; $s = 18; continue; /* } else if (!raw) { */ case 17: _r$5 = objectRational(L, lhs, rhs, "__eq"); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } _2 = _r$5; if (_2 === (1)) { ret = true; } else { ret = false; } case 19: /* } */ case 18: $s = 13; continue; /* } else { */ case 12: ret = $interfaceIsEqual(lhs, rhs); /* } */ case 13: case 5: $s = -1; return ret; /* */ } return; } if ($f === undefined) { $f = { $blk: equals }; } $f.L = L; $f._1 = _1; $f._2 = _2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.lhs = lhs; $f.raw = raw; $f.ret = ret; $f.rhs = rhs; $f.v1 = v1; $f.v2 = v2; $f.$s = $s; $f.$r = $r; return $f; }; objectRationalWithError = function(L, lhs, rhs, event) { var L, _1, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, event, lhs, rhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _1 = $f._1; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; event = $f.event; lhs = $f.lhs; rhs = $f.rhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = objectRational(L, lhs, rhs, event); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } _1 = _r; if (_1 === (1)) { $s = -1; return true; } else if (_1 === (0)) { $s = -1; return false; } case 1: _r$1 = lhs.Type(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = new LValueType(_r$1).String(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _arg = new $String(_r$2); _r$3 = rhs.Type(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _r$4 = new LValueType(_r$3).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } _arg$1 = new $String(_r$4); $r = L.RaiseError("attempt to compare %v with %v", new sliceType$6([_arg, _arg$1])); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $s = -1; return false; /* */ } return; } if ($f === undefined) { $f = { $blk: objectRationalWithError }; } $f.L = L; $f._1 = _1; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.event = event; $f.lhs = lhs; $f.rhs = rhs; $f.$s = $s; $f.$r = $r; return $f; }; objectRational = function(L, lhs, rhs, event) { var L, _r, _r$1, _r$2, event, lhs, m1, m2, rhs, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; event = $f.event; lhs = $f.lhs; m1 = $f.m1; m2 = $f.m2; rhs = $f.rhs; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = L.metaOp1(lhs, event); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } m1 = _r; _r$1 = L.metaOp1(rhs, event); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } m2 = _r$1; _r$2 = m1.Type(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } /* */ if ((_r$2 === 4) && $interfaceIsEqual(m1, m2)) { $s = 3; continue; } /* */ $s = 4; continue; /* if ((_r$2 === 4) && $interfaceIsEqual(m1, m2)) { */ case 3: L.reg.Push(m1); L.reg.Push(lhs); L.reg.Push(rhs); $r = L.Call(2, 1); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (LVAsBool(L.reg.Pop())) { $s = -1; return 1; } $s = -1; return 0; /* } */ case 4: $s = -1; return -1; /* */ } return; } if ($f === undefined) { $f = { $blk: objectRational }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.event = event; $f.lhs = lhs; $f.m1 = m1; $f.m2 = m2; $f.rhs = rhs; $f.$s = $s; $f.$r = $r; return $f; }; ptrType$66.methods = [{prop: "LNumber2I", name: "LNumber2I", pkg: "", typ: $funcType([LNumber], [LValue], false)}]; ptrType$51.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$19.methods = [{prop: "Add", name: "Add", pkg: "", typ: $funcType([$Uint32, $Int], [], false)}, {prop: "AddABC", name: "AddABC", pkg: "", typ: $funcType([$Int, $Int, $Int, $Int, $Int], [], false)}, {prop: "AddABx", name: "AddABx", pkg: "", typ: $funcType([$Int, $Int, $Int, $Int], [], false)}, {prop: "AddASbx", name: "AddASbx", pkg: "", typ: $funcType([$Int, $Int, $Int, $Int], [], false)}, {prop: "PropagateKMV", name: "PropagateKMV", pkg: "", typ: $funcType([$Int, ptrType$37, ptrType$37, $Int], [], false)}, {prop: "PropagateMV", name: "PropagateMV", pkg: "", typ: $funcType([$Int, ptrType$37, ptrType$37, $Int], [], false)}, {prop: "AddLoadNil", name: "AddLoadNil", pkg: "", typ: $funcType([$Int, $Int, $Int], [], false)}, {prop: "SetOpCode", name: "SetOpCode", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "SetA", name: "SetA", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "SetB", name: "SetB", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "SetC", name: "SetC", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "SetBx", name: "SetBx", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "SetSbx", name: "SetSbx", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "At", name: "At", pkg: "", typ: $funcType([$Int], [$Uint32], false)}, {prop: "List", name: "List", pkg: "", typ: $funcType([], [sliceType$11], false)}, {prop: "PosList", name: "PosList", pkg: "", typ: $funcType([], [sliceType$12], false)}, {prop: "LastPC", name: "LastPC", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Last", name: "Last", pkg: "", typ: $funcType([], [$Uint32], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([], [], false)}]; ptrType$20.methods = [{prop: "Names", name: "Names", pkg: "", typ: $funcType([], [sliceType$1], false)}, {prop: "List", name: "List", pkg: "", typ: $funcType([], [sliceType$9], false)}, {prop: "LastIndex", name: "LastIndex", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Find", name: "Find", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "RegisterUnique", name: "RegisterUnique", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "Register", name: "Register", pkg: "", typ: $funcType([$String], [$Int], false)}]; ptrType$12.methods = [{prop: "NewLabel", name: "NewLabel", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetLabelPc", name: "SetLabelPc", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "GetLabelPc", name: "GetLabelPc", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "ConstIndex", name: "ConstIndex", pkg: "", typ: $funcType([LValue], [$Int], false)}, {prop: "RegisterLocalVar", name: "RegisterLocalVar", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "FindLocalVarAndBlock", name: "FindLocalVarAndBlock", pkg: "", typ: $funcType([$String], [$Int, ptrType$21], false)}, {prop: "FindLocalVar", name: "FindLocalVar", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "LocalVars", name: "LocalVars", pkg: "", typ: $funcType([], [sliceType$9], false)}, {prop: "EnterBlock", name: "EnterBlock", pkg: "", typ: $funcType([$Int, ast.PositionHolder], [], false)}, {prop: "CloseUpvalues", name: "CloseUpvalues", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "LeaveBlock", name: "LeaveBlock", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "EndScope", name: "EndScope", pkg: "", typ: $funcType([], [], false)}, {prop: "SetRegTop", name: "SetRegTop", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RegTop", name: "RegTop", pkg: "", typ: $funcType([], [$Int], false)}]; LNumber.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([fmt.State, $Int32], [], false)}]; ptrType$18.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "str", name: "str", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int, $Int], [$String], false)}]; ptrType$56.methods = [{prop: "Value", name: "Value", pkg: "", typ: $funcType([], [LValue], false)}, {prop: "SetValue", name: "SetValue", pkg: "", typ: $funcType([LValue], [], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "IsClosed", name: "IsClosed", pkg: "", typ: $funcType([], [$Bool], false)}]; ptrType$57.methods = [{prop: "Type", name: "Type", pkg: "", typ: $funcType([], [lFileType], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "AbandonReadBuffer", name: "AbandonReadBuffer", pkg: "", typ: $funcType([], [$error], false)}]; ptrType$11.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$65.methods = [{prop: "IsEmpty", name: "IsEmpty", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Clear", name: "Clear", pkg: "", typ: $funcType([], [], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([callFrame], [], false)}, {prop: "Remove", name: "Remove", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Sp", name: "Sp", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetSp", name: "SetSp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Last", name: "Last", pkg: "", typ: $funcType([], [ptrType$10], false)}, {prop: "At", name: "At", pkg: "", typ: $funcType([$Int], [ptrType$10], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([], [ptrType$10], false)}]; ptrType$54.methods = [{prop: "SetTop", name: "SetTop", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Top", name: "Top", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([LValue], [], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([], [LValue], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$Int], [LValue], false)}, {prop: "CopyRange", name: "CopyRange", pkg: "", typ: $funcType([$Int, $Int, $Int, $Int], [], false)}, {prop: "FillNil", name: "FillNil", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Insert", name: "Insert", pkg: "", typ: $funcType([LValue, $Int], [], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$Int, LValue], [], false)}, {prop: "SetNumber", name: "SetNumber", pkg: "", typ: $funcType([$Int, LNumber], [], false)}]; lValueArraySorter.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}]; ptrType$74.methods = [{prop: "AppendString", name: "AppendString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "AppendChar", name: "AppendChar", pkg: "", typ: $funcType([$Uint8], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([], [$Uint8, $Bool], false)}]; LValueType.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; ptrType$68.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}]; LBool.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}]; LString.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([fmt.State, $Int32], [], false)}]; ptrType$1.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([LValue], [], false)}, {prop: "Insert", name: "Insert", pkg: "", typ: $funcType([$Int, LValue], [], false)}, {prop: "MaxN", name: "MaxN", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Remove", name: "Remove", pkg: "", typ: $funcType([$Int], [LValue], false)}, {prop: "RawSet", name: "RawSet", pkg: "", typ: $funcType([LValue, LValue], [], false)}, {prop: "RawSetInt", name: "RawSetInt", pkg: "", typ: $funcType([$Int, LValue], [], false)}, {prop: "RawSetString", name: "RawSetString", pkg: "", typ: $funcType([$String, LValue], [], false)}, {prop: "RawSetH", name: "RawSetH", pkg: "", typ: $funcType([LValue, LValue], [], false)}, {prop: "RawGet", name: "RawGet", pkg: "", typ: $funcType([LValue], [LValue], false)}, {prop: "RawGetInt", name: "RawGetInt", pkg: "", typ: $funcType([$Int], [LValue], false)}, {prop: "RawGetH", name: "RawGetH", pkg: "", typ: $funcType([LValue], [LValue], false)}, {prop: "RawGetString", name: "RawGetString", pkg: "", typ: $funcType([$String], [LValue], false)}, {prop: "ForEach", name: "ForEach", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([LValue], [LValue, LValue], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}]; ptrType$7.methods = [{prop: "LocalName", name: "LocalName", pkg: "", typ: $funcType([$Int, $Int], [$String, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}]; ptrType$9.methods = [{prop: "CheckAny", name: "CheckAny", pkg: "", typ: $funcType([$Int], [LValue], false)}, {prop: "CheckInt", name: "CheckInt", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "CheckInt64", name: "CheckInt64", pkg: "", typ: $funcType([$Int], [$Int64], false)}, {prop: "CheckNumber", name: "CheckNumber", pkg: "", typ: $funcType([$Int], [LNumber], false)}, {prop: "CheckString", name: "CheckString", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "CheckBool", name: "CheckBool", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "CheckTable", name: "CheckTable", pkg: "", typ: $funcType([$Int], [ptrType$1], false)}, {prop: "CheckFunction", name: "CheckFunction", pkg: "", typ: $funcType([$Int], [ptrType$7], false)}, {prop: "CheckUserData", name: "CheckUserData", pkg: "", typ: $funcType([$Int], [ptrType$8], false)}, {prop: "CheckThread", name: "CheckThread", pkg: "", typ: $funcType([$Int], [ptrType$9], false)}, {prop: "CheckType", name: "CheckType", pkg: "", typ: $funcType([$Int, LValueType], [], false)}, {prop: "CheckTypes", name: "CheckTypes", pkg: "", typ: $funcType([$Int, sliceType$8], [], true)}, {prop: "CheckOption", name: "CheckOption", pkg: "", typ: $funcType([$Int, sliceType$1], [$Int], false)}, {prop: "OptInt", name: "OptInt", pkg: "", typ: $funcType([$Int, $Int], [$Int], false)}, {prop: "OptInt64", name: "OptInt64", pkg: "", typ: $funcType([$Int, $Int64], [$Int64], false)}, {prop: "OptNumber", name: "OptNumber", pkg: "", typ: $funcType([$Int, LNumber], [LNumber], false)}, {prop: "OptString", name: "OptString", pkg: "", typ: $funcType([$Int, $String], [$String], false)}, {prop: "OptBool", name: "OptBool", pkg: "", typ: $funcType([$Int, $Bool], [$Bool], false)}, {prop: "OptTable", name: "OptTable", pkg: "", typ: $funcType([$Int, ptrType$1], [ptrType$1], false)}, {prop: "OptFunction", name: "OptFunction", pkg: "", typ: $funcType([$Int, ptrType$7], [ptrType$7], false)}, {prop: "OptUserData", name: "OptUserData", pkg: "", typ: $funcType([$Int, ptrType$8], [ptrType$8], false)}, {prop: "ArgError", name: "ArgError", pkg: "", typ: $funcType([$Int, $String], [], false)}, {prop: "TypeError", name: "TypeError", pkg: "", typ: $funcType([$Int, LValueType], [], false)}, {prop: "Where", name: "Where", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "FindTable", name: "FindTable", pkg: "", typ: $funcType([ptrType$1, $String, $Int], [LValue], false)}, {prop: "RegisterModule", name: "RegisterModule", pkg: "", typ: $funcType([$String, mapType$5], [LValue], false)}, {prop: "SetFuncs", name: "SetFuncs", pkg: "", typ: $funcType([ptrType$1, mapType$5, sliceType$7], [ptrType$1], true)}, {prop: "NewTypeMetatable", name: "NewTypeMetatable", pkg: "", typ: $funcType([$String], [ptrType$1], false)}, {prop: "GetMetaField", name: "GetMetaField", pkg: "", typ: $funcType([LValue, $String], [LValue], false)}, {prop: "GetTypeMetatable", name: "GetTypeMetatable", pkg: "", typ: $funcType([$String], [LValue], false)}, {prop: "CallMeta", name: "CallMeta", pkg: "", typ: $funcType([LValue, $String], [LValue], false)}, {prop: "LoadFile", name: "LoadFile", pkg: "", typ: $funcType([$String], [ptrType$7, $error], false)}, {prop: "LoadString", name: "LoadString", pkg: "", typ: $funcType([$String], [ptrType$7, $error], false)}, {prop: "DoFile", name: "DoFile", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "DoString", name: "DoString", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "ToStringMeta", name: "ToStringMeta", pkg: "", typ: $funcType([LValue], [LValue], false)}, {prop: "PreloadModule", name: "PreloadModule", pkg: "", typ: $funcType([$String, LGFunction], [], false)}, {prop: "OpenLibs", name: "OpenLibs", pkg: "", typ: $funcType([], [], false)}, {prop: "printReg", name: "printReg", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [], false)}, {prop: "printCallStack", name: "printCallStack", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [], false)}, {prop: "closeAllUpvalues", name: "closeAllUpvalues", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [], false)}, {prop: "raiseError", name: "raiseError", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int, $String, sliceType$6], [], true)}, {prop: "findLocal", name: "findLocal", pkg: "github.com/J-J-J/goluajit", typ: $funcType([ptrType$10, $Int], [$String], false)}, {prop: "where", name: "where", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int, $Bool], [$String], false)}, {prop: "stackTrace", name: "stackTrace", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int], [$String], false)}, {prop: "formattedFrameFuncName", name: "formattedFrameFuncName", pkg: "github.com/J-J-J/goluajit", typ: $funcType([ptrType$10], [$String], false)}, {prop: "rawFrameFuncName", name: "rawFrameFuncName", pkg: "github.com/J-J-J/goluajit", typ: $funcType([ptrType$10], [$String], false)}, {prop: "frameFuncName", name: "frameFuncName", pkg: "github.com/J-J-J/goluajit", typ: $funcType([ptrType$10], [$String, $Bool], false)}, {prop: "isStarted", name: "isStarted", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Bool], false)}, {prop: "kill", name: "kill", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [], false)}, {prop: "indexToReg", name: "indexToReg", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int], [$Int], false)}, {prop: "currentLocalBase", name: "currentLocalBase", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Int], false)}, {prop: "currentEnv", name: "currentEnv", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$1], false)}, {prop: "rkValue", name: "rkValue", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int], [LValue], false)}, {prop: "rkString", name: "rkString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int], [$String], false)}, {prop: "closeUpvalues", name: "closeUpvalues", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int], [], false)}, {prop: "findUpvalue", name: "findUpvalue", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int], [ptrType$56], false)}, {prop: "metatable", name: "metatable", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, $Bool], [LValue], false)}, {prop: "metaOp1", name: "metaOp1", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, $String], [LValue], false)}, {prop: "metaOp2", name: "metaOp2", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, LValue, $String], [LValue], false)}, {prop: "metaCall", name: "metaCall", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue], [ptrType$7, $Bool], false)}, {prop: "initCallFrame", name: "initCallFrame", pkg: "github.com/J-J-J/goluajit", typ: $funcType([ptrType$10], [], false)}, {prop: "pushCallFrame", name: "pushCallFrame", pkg: "github.com/J-J-J/goluajit", typ: $funcType([callFrame, LValue, $Bool], [], false)}, {prop: "callR", name: "callR", pkg: "github.com/J-J-J/goluajit", typ: $funcType([$Int, $Int, $Int], [], false)}, {prop: "getField", name: "getField", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, LValue], [LValue], false)}, {prop: "getFieldString", name: "getFieldString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, $String], [LValue], false)}, {prop: "setField", name: "setField", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, LValue, LValue], [], false)}, {prop: "setFieldString", name: "setFieldString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([LValue, $String, LValue], [], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "GetTop", name: "GetTop", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetTop", name: "SetTop", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Replace", name: "Replace", pkg: "", typ: $funcType([$Int, LValue], [], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([$Int], [LValue], false)}, {prop: "Push", name: "Push", pkg: "", typ: $funcType([LValue], [], false)}, {prop: "Pop", name: "Pop", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Insert", name: "Insert", pkg: "", typ: $funcType([LValue, $Int], [], false)}, {prop: "Remove", name: "Remove", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "NewTable", name: "NewTable", pkg: "", typ: $funcType([], [ptrType$1], false)}, {prop: "CreateTable", name: "CreateTable", pkg: "", typ: $funcType([$Int, $Int], [ptrType$1], false)}, {prop: "NewThread", name: "NewThread", pkg: "", typ: $funcType([], [ptrType$9, context.CancelFunc], false)}, {prop: "NewFunctionFromProto", name: "NewFunctionFromProto", pkg: "", typ: $funcType([ptrType$18], [ptrType$7], false)}, {prop: "NewUserData", name: "NewUserData", pkg: "", typ: $funcType([], [ptrType$8], false)}, {prop: "NewFunction", name: "NewFunction", pkg: "", typ: $funcType([LGFunction], [ptrType$7], false)}, {prop: "NewClosure", name: "NewClosure", pkg: "", typ: $funcType([LGFunction, sliceType$7], [ptrType$7], true)}, {prop: "ToBool", name: "ToBool", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "ToInt", name: "ToInt", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "ToInt64", name: "ToInt64", pkg: "", typ: $funcType([$Int], [$Int64], false)}, {prop: "ToNumber", name: "ToNumber", pkg: "", typ: $funcType([$Int], [LNumber], false)}, {prop: "ToString", name: "ToString", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "ToTable", name: "ToTable", pkg: "", typ: $funcType([$Int], [ptrType$1], false)}, {prop: "ToFunction", name: "ToFunction", pkg: "", typ: $funcType([$Int], [ptrType$7], false)}, {prop: "ToUserData", name: "ToUserData", pkg: "", typ: $funcType([$Int], [ptrType$8], false)}, {prop: "ToThread", name: "ToThread", pkg: "", typ: $funcType([$Int], [ptrType$9], false)}, {prop: "RaiseError", name: "RaiseError", pkg: "", typ: $funcType([$String, sliceType$6], [], true)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([LValue, $Int], [], false)}, {prop: "GetInfo", name: "GetInfo", pkg: "", typ: $funcType([$String, ptrType$53, LValue], [LValue, $error], false)}, {prop: "GetStack", name: "GetStack", pkg: "", typ: $funcType([$Int], [ptrType$53, $Bool], false)}, {prop: "GetLocal", name: "GetLocal", pkg: "", typ: $funcType([ptrType$53, $Int], [$String, LValue], false)}, {prop: "SetLocal", name: "SetLocal", pkg: "", typ: $funcType([ptrType$53, $Int, LValue], [$String], false)}, {prop: "GetUpvalue", name: "GetUpvalue", pkg: "", typ: $funcType([ptrType$7, $Int], [$String, LValue], false)}, {prop: "SetUpvalue", name: "SetUpvalue", pkg: "", typ: $funcType([ptrType$7, $Int, LValue], [$String], false)}, {prop: "GetFEnv", name: "GetFEnv", pkg: "", typ: $funcType([LValue], [LValue], false)}, {prop: "SetFEnv", name: "SetFEnv", pkg: "", typ: $funcType([LValue, LValue], [], false)}, {prop: "RawGet", name: "RawGet", pkg: "", typ: $funcType([ptrType$1, LValue], [LValue], false)}, {prop: "RawGetInt", name: "RawGetInt", pkg: "", typ: $funcType([ptrType$1, $Int], [LValue], false)}, {prop: "GetField", name: "GetField", pkg: "", typ: $funcType([LValue, $String], [LValue], false)}, {prop: "GetTable", name: "GetTable", pkg: "", typ: $funcType([LValue, LValue], [LValue], false)}, {prop: "RawSet", name: "RawSet", pkg: "", typ: $funcType([ptrType$1, LValue, LValue], [], false)}, {prop: "RawSetInt", name: "RawSetInt", pkg: "", typ: $funcType([ptrType$1, $Int, LValue], [], false)}, {prop: "SetField", name: "SetField", pkg: "", typ: $funcType([LValue, $String, LValue], [], false)}, {prop: "SetTable", name: "SetTable", pkg: "", typ: $funcType([LValue, LValue, LValue], [], false)}, {prop: "ForEach", name: "ForEach", pkg: "", typ: $funcType([ptrType$1, funcType], [], false)}, {prop: "GetGlobal", name: "GetGlobal", pkg: "", typ: $funcType([$String], [LValue], false)}, {prop: "SetGlobal", name: "SetGlobal", pkg: "", typ: $funcType([$String, LValue], [], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([ptrType$1, LValue], [LValue, LValue], false)}, {prop: "ObjLen", name: "ObjLen", pkg: "", typ: $funcType([LValue], [$Int], false)}, {prop: "Concat", name: "Concat", pkg: "", typ: $funcType([sliceType$7], [$String], true)}, {prop: "LessThan", name: "LessThan", pkg: "", typ: $funcType([LValue, LValue], [$Bool], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([LValue, LValue], [$Bool], false)}, {prop: "RawEqual", name: "RawEqual", pkg: "", typ: $funcType([LValue, LValue], [$Bool], false)}, {prop: "Register", name: "Register", pkg: "", typ: $funcType([$String, LGFunction], [], false)}, {prop: "Load", name: "Load", pkg: "", typ: $funcType([io.Reader, $String], [ptrType$7, $error], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "PCall", name: "PCall", pkg: "", typ: $funcType([$Int, $Int, ptrType$7], [$error], false)}, {prop: "GPCall", name: "GPCall", pkg: "", typ: $funcType([LGFunction, LValue], [$error], false)}, {prop: "CallByParam", name: "CallByParam", pkg: "", typ: $funcType([P, sliceType$7], [$error], true)}, {prop: "GetMetatable", name: "GetMetatable", pkg: "", typ: $funcType([LValue], [LValue], false)}, {prop: "SetMetatable", name: "SetMetatable", pkg: "", typ: $funcType([LValue, LValue], [], false)}, {prop: "Status", name: "Status", pkg: "", typ: $funcType([ptrType$9], [$String], false)}, {prop: "Resume", name: "Resume", pkg: "", typ: $funcType([ptrType$9, ptrType$7, sliceType$7], [ResumeState, $error, sliceType$7], true)}, {prop: "Yield", name: "Yield", pkg: "", typ: $funcType([sliceType$7], [$Int], true)}, {prop: "XMoveTo", name: "XMoveTo", pkg: "", typ: $funcType([ptrType$9, $Int], [], false)}, {prop: "SetMx", name: "SetMx", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetContext", name: "SetContext", pkg: "", typ: $funcType([context.Context], [], false)}, {prop: "Context", name: "Context", pkg: "", typ: $funcType([], [context.Context], false)}, {prop: "RemoveContext", name: "RemoveContext", pkg: "", typ: $funcType([], [context.Context], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}]; ptrType$8.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}]; iface.init("github.com/J-J-J/goluajit", [{prop: "itab", name: "itab", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}, {prop: "word", name: "word", embedded: false, exported: false, typ: $UnsafePointer, tag: ""}]); allocator.init("github.com/J-J-J/goluajit", [{prop: "size", name: "size", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "fptrs", name: "fptrs", embedded: false, exported: false, typ: sliceType$5, tag: ""}, {prop: "fheader", name: "fheader", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "scratchValue", name: "scratchValue", embedded: false, exported: false, typ: LValue, tag: ""}, {prop: "scratchValueP", name: "scratchValueP", embedded: false, exported: false, typ: ptrType$4, tag: ""}]); expcontext.init("github.com/J-J-J/goluajit", [{prop: "ctype", name: "ctype", embedded: false, exported: false, typ: expContextType, tag: ""}, {prop: "reg", name: "reg", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "varargopt", name: "varargopt", embedded: false, exported: false, typ: $Int, tag: ""}]); assigncontext.init("github.com/J-J-J/goluajit", [{prop: "ec", name: "ec", embedded: false, exported: false, typ: ptrType$72, tag: ""}, {prop: "keyrk", name: "keyrk", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "valuerk", name: "valuerk", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "keyks", name: "keyks", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "needmove", name: "needmove", embedded: false, exported: false, typ: $Bool, tag: ""}]); lblabels.init("github.com/J-J-J/goluajit", [{prop: "t", name: "t", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "f", name: "f", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "e", name: "e", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "b", name: "b", embedded: false, exported: false, typ: $Bool, tag: ""}]); constLValueExpr.init("", [{prop: "ExprBase", name: "ExprBase", embedded: true, exported: true, typ: ast.ExprBase, tag: ""}, {prop: "Value", name: "Value", embedded: false, exported: true, typ: LValue, tag: ""}]); CompileError.init("github.com/J-J-J/goluajit", [{prop: "context", name: "context", embedded: false, exported: false, typ: ptrType$12, tag: ""}, {prop: "Line", name: "Line", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Message", name: "Message", embedded: false, exported: true, typ: $String, tag: ""}]); codeStore.init("github.com/J-J-J/goluajit", [{prop: "codes", name: "codes", embedded: false, exported: false, typ: sliceType$11, tag: ""}, {prop: "lines", name: "lines", embedded: false, exported: false, typ: sliceType$12, tag: ""}, {prop: "pc", name: "pc", embedded: false, exported: false, typ: $Int, tag: ""}]); varNamePoolValue.init("", [{prop: "Index", name: "Index", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}]); varNamePool.init("github.com/J-J-J/goluajit", [{prop: "names", name: "names", embedded: false, exported: false, typ: sliceType$1, tag: ""}, {prop: "offset", name: "offset", embedded: false, exported: false, typ: $Int, tag: ""}]); codeBlock.init("", [{prop: "LocalVars", name: "LocalVars", embedded: false, exported: true, typ: ptrType$20, tag: ""}, {prop: "BreakLabel", name: "BreakLabel", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Parent", name: "Parent", embedded: false, exported: true, typ: ptrType$21, tag: ""}, {prop: "RefUpvalue", name: "RefUpvalue", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "LineStart", name: "LineStart", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "LastLine", name: "LastLine", embedded: false, exported: true, typ: $Int, tag: ""}]); funcContext.init("github.com/J-J-J/goluajit", [{prop: "Proto", name: "Proto", embedded: false, exported: true, typ: ptrType$18, tag: ""}, {prop: "Code", name: "Code", embedded: false, exported: true, typ: ptrType$19, tag: ""}, {prop: "Parent", name: "Parent", embedded: false, exported: true, typ: ptrType$12, tag: ""}, {prop: "Upvalues", name: "Upvalues", embedded: false, exported: true, typ: ptrType$20, tag: ""}, {prop: "Block", name: "Block", embedded: false, exported: true, typ: ptrType$21, tag: ""}, {prop: "Blocks", name: "Blocks", embedded: false, exported: true, typ: sliceType$10, tag: ""}, {prop: "regTop", name: "regTop", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "labelId", name: "labelId", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "labelPc", name: "labelPc", embedded: false, exported: false, typ: mapType, tag: ""}]); DbgLocalInfo.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "StartPc", name: "StartPc", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "EndPc", name: "EndPc", embedded: false, exported: true, typ: $Int, tag: ""}]); DbgCall.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Pc", name: "Pc", embedded: false, exported: true, typ: $Int, tag: ""}]); FunctionProto.init("github.com/J-J-J/goluajit", [{prop: "SourceName", name: "SourceName", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "LineDefined", name: "LineDefined", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "LastLineDefined", name: "LastLineDefined", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "NumUpvalues", name: "NumUpvalues", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "NumParameters", name: "NumParameters", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "IsVarArg", name: "IsVarArg", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "NumUsedRegisters", name: "NumUsedRegisters", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Code", name: "Code", embedded: false, exported: true, typ: sliceType$11, tag: ""}, {prop: "Constants", name: "Constants", embedded: false, exported: true, typ: sliceType$7, tag: ""}, {prop: "FunctionPrototypes", name: "FunctionPrototypes", embedded: false, exported: true, typ: sliceType$16, tag: ""}, {prop: "DbgSourcePositions", name: "DbgSourcePositions", embedded: false, exported: true, typ: sliceType$12, tag: ""}, {prop: "DbgLocals", name: "DbgLocals", embedded: false, exported: true, typ: sliceType$17, tag: ""}, {prop: "DbgCalls", name: "DbgCalls", embedded: false, exported: true, typ: sliceType$18, tag: ""}, {prop: "DbgUpvalues", name: "DbgUpvalues", embedded: false, exported: true, typ: sliceType$1, tag: ""}, {prop: "stringConstants", name: "stringConstants", embedded: false, exported: false, typ: sliceType$1, tag: ""}]); Upvalue.init("github.com/J-J-J/goluajit", [{prop: "next", name: "next", embedded: false, exported: false, typ: ptrType$56, tag: ""}, {prop: "reg", name: "reg", embedded: false, exported: false, typ: ptrType$54, tag: ""}, {prop: "index", name: "index", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "value", name: "value", embedded: false, exported: false, typ: LValue, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $Bool, tag: ""}]); lFile.init("github.com/J-J-J/goluajit", [{prop: "fp", name: "fp", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "pp", name: "pp", embedded: false, exported: false, typ: ptrType$58, tag: ""}, {prop: "writer", name: "writer", embedded: false, exported: false, typ: io.Writer, tag: ""}, {prop: "reader", name: "reader", embedded: false, exported: false, typ: ptrType$59, tag: ""}, {prop: "stdout", name: "stdout", embedded: false, exported: false, typ: io.ReadCloser, tag: ""}, {prop: "closed", name: "closed", embedded: false, exported: false, typ: $Bool, tag: ""}]); luaLib.init("github.com/J-J-J/goluajit", [{prop: "libName", name: "libName", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "libFunc", name: "libFunc", embedded: false, exported: false, typ: LGFunction, tag: ""}]); opProp.init("", [{prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "IsTest", name: "IsTest", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "SetRegA", name: "SetRegA", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ModeArgB", name: "ModeArgB", embedded: false, exported: true, typ: opArgMode, tag: ""}, {prop: "ModeArgC", name: "ModeArgC", embedded: false, exported: true, typ: opArgMode, tag: ""}, {prop: "Type", name: "Type", embedded: false, exported: true, typ: opType, tag: ""}]); APIError.init("", [{prop: "Type", name: "Type", embedded: false, exported: true, typ: APIErrorType, tag: ""}, {prop: "Object", name: "Object", embedded: false, exported: true, typ: LValue, tag: ""}, {prop: "StackTrace", name: "StackTrace", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Cause", name: "Cause", embedded: false, exported: true, typ: $error, tag: ""}]); P.init("", [{prop: "Fn", name: "Fn", embedded: false, exported: true, typ: LValue, tag: ""}, {prop: "NRet", name: "NRet", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Protect", name: "Protect", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Handler", name: "Handler", embedded: false, exported: true, typ: ptrType$7, tag: ""}]); Options.init("", [{prop: "CallStackSize", name: "CallStackSize", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "RegistrySize", name: "RegistrySize", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "SkipOpenLibs", name: "SkipOpenLibs", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "IncludeGoStackTrace", name: "IncludeGoStackTrace", embedded: false, exported: true, typ: $Bool, tag: ""}]); Debug.init("github.com/J-J-J/goluajit", [{prop: "frame", name: "frame", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "Name", name: "Name", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "What", name: "What", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "Source", name: "Source", embedded: false, exported: true, typ: $String, tag: ""}, {prop: "CurrentLine", name: "CurrentLine", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "NUpvalues", name: "NUpvalues", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "LineDefined", name: "LineDefined", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "LastLineDefined", name: "LastLineDefined", embedded: false, exported: true, typ: $Int, tag: ""}]); callFrame.init("", [{prop: "Idx", name: "Idx", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Fn", name: "Fn", embedded: false, exported: true, typ: ptrType$7, tag: ""}, {prop: "Parent", name: "Parent", embedded: false, exported: true, typ: ptrType$10, tag: ""}, {prop: "Pc", name: "Pc", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Base", name: "Base", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "LocalBase", name: "LocalBase", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "ReturnBase", name: "ReturnBase", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "NArgs", name: "NArgs", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "NRet", name: "NRet", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "TailCall", name: "TailCall", embedded: false, exported: true, typ: $Int, tag: ""}]); callFrameStack.init("github.com/J-J-J/goluajit", [{prop: "array", name: "array", embedded: false, exported: false, typ: sliceType$22, tag: ""}, {prop: "sp", name: "sp", embedded: false, exported: false, typ: $Int, tag: ""}]); registry.init("github.com/J-J-J/goluajit", [{prop: "array", name: "array", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "top", name: "top", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "alloc", name: "alloc", embedded: false, exported: false, typ: ptrType$66, tag: ""}]); replaceInfo.init("", [{prop: "Indicies", name: "Indicies", embedded: false, exported: true, typ: sliceType$12, tag: ""}, {prop: "String", name: "String", embedded: false, exported: true, typ: $String, tag: ""}]); strMatchData.init("github.com/J-J-J/goluajit", [{prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "pos", name: "pos", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "matches", name: "matches", embedded: false, exported: false, typ: sliceType$24, tag: ""}]); lValueArraySorter.init("", [{prop: "L", name: "L", embedded: false, exported: true, typ: ptrType$9, tag: ""}, {prop: "Fn", name: "Fn", embedded: false, exported: true, typ: ptrType$7, tag: ""}, {prop: "Values", name: "Values", embedded: false, exported: true, typ: sliceType$7, tag: ""}]); flagScanner.init("github.com/J-J-J/goluajit", [{prop: "flag", name: "flag", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "start", name: "start", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "end", name: "end", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "buf", name: "buf", embedded: false, exported: false, typ: sliceType$20, tag: ""}, {prop: "str", name: "str", embedded: false, exported: false, typ: $String, tag: ""}, {prop: "Length", name: "Length", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Pos", name: "Pos", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "HasFlag", name: "HasFlag", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "ChangeFlag", name: "ChangeFlag", embedded: false, exported: true, typ: $Bool, tag: ""}]); LValue.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [LValueType], false)}, {prop: "assertFloat64", name: "assertFloat64", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$Float64, $Bool], false)}, {prop: "assertFunction", name: "assertFunction", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [ptrType$7, $Bool], false)}, {prop: "assertString", name: "assertString", pkg: "github.com/J-J-J/goluajit", typ: $funcType([], [$String, $Bool], false)}]); LNilType.init("", []); LTable.init("github.com/J-J-J/goluajit", [{prop: "Metatable", name: "Metatable", embedded: false, exported: true, typ: LValue, tag: ""}, {prop: "array", name: "array", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "dict", name: "dict", embedded: false, exported: false, typ: mapType$1, tag: ""}, {prop: "strdict", name: "strdict", embedded: false, exported: false, typ: mapType$2, tag: ""}, {prop: "keys", name: "keys", embedded: false, exported: false, typ: sliceType$7, tag: ""}, {prop: "k2i", name: "k2i", embedded: false, exported: false, typ: mapType$3, tag: ""}]); LFunction.init("", [{prop: "IsG", name: "IsG", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Env", name: "Env", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Proto", name: "Proto", embedded: false, exported: true, typ: ptrType$18, tag: ""}, {prop: "GFunction", name: "GFunction", embedded: false, exported: true, typ: LGFunction, tag: ""}, {prop: "Upvalues", name: "Upvalues", embedded: false, exported: true, typ: sliceType$19, tag: ""}]); LGFunction.init([ptrType$9], [$Int], false); Global.init("github.com/J-J-J/goluajit", [{prop: "MainThread", name: "MainThread", embedded: false, exported: true, typ: ptrType$9, tag: ""}, {prop: "CurrentThread", name: "CurrentThread", embedded: false, exported: true, typ: ptrType$9, tag: ""}, {prop: "Registry", name: "Registry", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Global", name: "Global", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "builtinMts", name: "builtinMts", embedded: false, exported: false, typ: mapType$4, tag: ""}, {prop: "tempFiles", name: "tempFiles", embedded: false, exported: false, typ: sliceType$21, tag: ""}, {prop: "gccount", name: "gccount", embedded: false, exported: false, typ: $Int32, tag: ""}]); LState.init("github.com/J-J-J/goluajit", [{prop: "G", name: "G", embedded: false, exported: true, typ: ptrType$64, tag: ""}, {prop: "Parent", name: "Parent", embedded: false, exported: true, typ: ptrType$9, tag: ""}, {prop: "Env", name: "Env", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Panic", name: "Panic", embedded: false, exported: true, typ: funcType$1, tag: ""}, {prop: "Dead", name: "Dead", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Options", name: "Options", embedded: false, exported: true, typ: Options, tag: ""}, {prop: "stop", name: "stop", embedded: false, exported: false, typ: $Int32, tag: ""}, {prop: "reg", name: "reg", embedded: false, exported: false, typ: ptrType$54, tag: ""}, {prop: "stack", name: "stack", embedded: false, exported: false, typ: ptrType$65, tag: ""}, {prop: "alloc", name: "alloc", embedded: false, exported: false, typ: ptrType$66, tag: ""}, {prop: "currentFrame", name: "currentFrame", embedded: false, exported: false, typ: ptrType$10, tag: ""}, {prop: "wrapped", name: "wrapped", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "uvcache", name: "uvcache", embedded: false, exported: false, typ: ptrType$56, tag: ""}, {prop: "hasErrorFunc", name: "hasErrorFunc", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "mainLoop", name: "mainLoop", embedded: false, exported: false, typ: funcType$2, tag: ""}, {prop: "ctx", name: "ctx", embedded: false, exported: false, typ: context.Context, tag: ""}]); LUserData.init("", [{prop: "Value", name: "Value", embedded: false, exported: true, typ: $emptyInterface, tag: ""}, {prop: "Env", name: "Env", embedded: false, exported: true, typ: ptrType$1, tag: ""}, {prop: "Metatable", name: "Metatable", embedded: false, exported: true, typ: LValue, tag: ""}]); instFunc.init([ptrType$9, $Uint32, ptrType$10], [$Int], false); $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = bufio.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = context.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = errors.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = fmt.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ast.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = parse.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = pm.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = io.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = ioutil.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = math.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = rand.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = os.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = exec.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = filepath.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = reflect.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = runtime.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = sort.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strconv.$init(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = strings.$init(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = atomic.$init(); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = syscall.$init(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = time.$init(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } preloads = arrayType.zero(); $pkg.LuaLDir = ""; $pkg.LuaPathDefault = ""; $pkg.LuaOS = ""; startedAt = new time.Time.ptr(new $Uint64(0, 0), new $Int64(0, 0), ptrType.nil); jumpTable = arrayType$1.zero(); loopdetection = new LUserData.ptr($ifaceNil, ptrType$1.nil, $ifaceNil); $pkg.CompatVarArg = true; $pkg.FieldsPerFlush = 50; $pkg.RegistrySize = 5120; $pkg.CallStackSize = 256; $pkg.MaxTableGetLoop = 100; $pkg.MaxArrayIndex = 67108864; $pkg.LuaPath = "LUA_PATH"; stdFiles = new sliceType([new structType.ptr("stdout", os.Stdout, true, false), new structType.ptr("stdin", os.Stdin, false, true), new structType.ptr("stderr", os.Stderr, true, false)]); fileSeekOptions = new sliceType$1(["set", "cur", "end"]); filebufOptions = new sliceType$1(["no", "full"]); ioOpenOpions = new sliceType$1(["r", "rb", "w", "wb", "a", "ab", "r+", "rb+", "w+", "wb+", "a+", "ab+"]); ioPopenOptions = new sliceType$1(["r", "w"]); _ecnone0 = new expcontext.ptr(6, 256, 0); _ecnonem1 = new expcontext.ptr(6, 256, -1); _ecnonem2 = new expcontext.ptr(6, 256, -2); ecfuncdef = new expcontext.ptr(5, 256, 0); opProps = new sliceType$2([new opProp.ptr("MOVE", false, true, 2, 0, 0), new opProp.ptr("MOVEN", false, true, 2, 0, 0), new opProp.ptr("LOADK", false, true, 3, 0, 1), new opProp.ptr("LOADBOOL", false, true, 1, 1, 0), new opProp.ptr("LOADNIL", false, true, 2, 0, 0), new opProp.ptr("GETUPVAL", false, true, 1, 0, 0), new opProp.ptr("GETGLOBAL", false, true, 3, 0, 1), new opProp.ptr("GETTABLE", false, true, 2, 3, 0), new opProp.ptr("GETTABLEKS", false, true, 2, 3, 0), new opProp.ptr("SETGLOBAL", false, false, 3, 0, 1), new opProp.ptr("SETUPVAL", false, false, 1, 0, 0), new opProp.ptr("SETTABLE", false, false, 3, 3, 0), new opProp.ptr("SETTABLEKS", false, false, 3, 3, 0), new opProp.ptr("NEWTABLE", false, true, 1, 1, 0), new opProp.ptr("SELF", false, true, 2, 3, 0), new opProp.ptr("ADD", false, true, 3, 3, 0), new opProp.ptr("SUB", false, true, 3, 3, 0), new opProp.ptr("MUL", false, true, 3, 3, 0), new opProp.ptr("DIV", false, true, 3, 3, 0), new opProp.ptr("MOD", false, true, 3, 3, 0), new opProp.ptr("POW", false, true, 3, 3, 0), new opProp.ptr("UNM", false, true, 2, 0, 0), new opProp.ptr("NOT", false, true, 2, 0, 0), new opProp.ptr("LEN", false, true, 2, 0, 0), new opProp.ptr("CONCAT", false, true, 2, 2, 0), new opProp.ptr("JMP", false, false, 2, 0, 2), new opProp.ptr("EQ", true, false, 3, 3, 0), new opProp.ptr("LT", true, false, 3, 3, 0), new opProp.ptr("LE", true, false, 3, 3, 0), new opProp.ptr("TEST", true, true, 2, 1, 0), new opProp.ptr("TESTSET", true, true, 2, 1, 0), new opProp.ptr("CALL", false, true, 1, 1, 0), new opProp.ptr("TAILCALL", false, true, 1, 1, 0), new opProp.ptr("RETURN", false, false, 1, 0, 0), new opProp.ptr("FORLOOP", false, true, 2, 0, 2), new opProp.ptr("FORPREP", false, true, 2, 0, 2), new opProp.ptr("TFORLOOP", true, false, 0, 1, 0), new opProp.ptr("SETLIST", false, false, 1, 1, 0), new opProp.ptr("CLOSE", false, false, 0, 0, 0), new opProp.ptr("CLOSURE", false, true, 1, 0, 1), new opProp.ptr("VARARG", false, true, 1, 0, 0), new opProp.ptr("NOP", false, false, 2, 0, 2)]); cDateFlagToGo = $makeMap($Uint8.keyFor, [{ k: 97, v: "mon" }, { k: 65, v: "Monday" }, { k: 98, v: "Jan" }, { k: 66, v: "January" }, { k: 99, v: "02 Jan 06 15:04 MST" }, { k: 100, v: "02" }, { k: 70, v: "2006-01-02" }, { k: 72, v: "15" }, { k: 73, v: "03" }, { k: 109, v: "01" }, { k: 77, v: "04" }, { k: 112, v: "PM" }, { k: 80, v: "pm" }, { k: 83, v: "05" }, { k: 120, v: "15/04/05" }, { k: 88, v: "15:04:05" }, { k: 121, v: "06" }, { k: 89, v: "2006" }, { k: 122, v: "-0700" }, { k: 90, v: "MST" }]); lValueNames = $toNativeArray($kindString, ["nil", "boolean", "number", "string", "function", "userdata", "thread", "table", "channel"]); $pkg.LNil = (new LNilType.ptr()); debugFuncs = $makeMap($String.keyFor, [{ k: "getfenv", v: debugGetFEnv }, { k: "getinfo", v: debugGetInfo }, { k: "getlocal", v: debugGetLocal }, { k: "getmetatable", v: debugGetMetatable }, { k: "getupvalue", v: debugGetUpvalue }, { k: "setfenv", v: debugSetFEnv }, { k: "setlocal", v: debugSetLocal }, { k: "setmetatable", v: debugSetMetatable }, { k: "setupvalue", v: debugSetUpvalue }, { k: "traceback", v: debugTraceback }]); loLoaders = new sliceType$3([loLoaderPreload, loLoaderLua]); loFuncs = $makeMap($String.keyFor, [{ k: "loadlib", v: loLoadLib }, { k: "seeall", v: loSeeAll }]); mathFuncs = $makeMap($String.keyFor, [{ k: "abs", v: mathAbs }, { k: "acos", v: mathAcos }, { k: "asin", v: mathAsin }, { k: "atan", v: mathAtan }, { k: "atan2", v: mathAtan2 }, { k: "ceil", v: mathCeil }, { k: "cos", v: mathCos }, { k: "cosh", v: mathCosh }, { k: "deg", v: mathDeg }, { k: "exp", v: mathExp }, { k: "floor", v: mathFloor }, { k: "fmod", v: mathFmod }, { k: "frexp", v: mathFrexp }, { k: "ldexp", v: mathLdexp }, { k: "log", v: mathLog }, { k: "log10", v: mathLog10 }, { k: "max", v: mathMax }, { k: "min", v: mathMin }, { k: "mod", v: mathMod }, { k: "modf", v: mathModf }, { k: "pow", v: mathPow }, { k: "rad", v: mathRad }, { k: "random", v: mathRandom }, { k: "randomseed", v: mathRandomseed }, { k: "sin", v: mathSin }, { k: "sinh", v: mathSinh }, { k: "sqrt", v: mathSqrt }, { k: "tan", v: mathTan }, { k: "tanh", v: mathTanh }]); tableFuncs = $makeMap($String.keyFor, [{ k: "getn", v: tableGetN }, { k: "concat", v: tableConcat }, { k: "insert", v: tableInsert }, { k: "maxn", v: tableMaxN }, { k: "remove", v: tableRemove }, { k: "sort", v: tableSort }]); $pkg.LTrue = true; ioFuncs = $makeMap($String.keyFor, [{ k: "close", v: ioClose }, { k: "flush", v: ioFlush }, { k: "lines", v: ioLines }, { k: "input", v: ioInput }, { k: "output", v: ioOutput }, { k: "open", v: ioOpenFile }, { k: "popen", v: ioPopen }, { k: "read", v: ioRead }, { k: "type", v: ioType }, { k: "tmpfile", v: ioTmpFile }, { k: "write", v: ioWrite }]); fileMethods = $makeMap($String.keyFor, [{ k: "__tostring", v: fileToString }, { k: "write", v: fileWrite }, { k: "close", v: fileClose }, { k: "flush", v: fileFlush }, { k: "lines", v: fileLines }, { k: "read", v: fileRead }, { k: "seek", v: fileSeek }, { k: "setvbuf", v: fileSetVBuf }]); $pkg.LFalse = false; baseFuncs = $makeMap($String.keyFor, [{ k: "assert", v: baseAssert }, { k: "collectgarbage", v: baseCollectGarbage }, { k: "dofile", v: baseDoFile }, { k: "error", v: baseError }, { k: "getfenv", v: baseGetFEnv }, { k: "getmetatable", v: baseGetMetatable }, { k: "load", v: baseLoad }, { k: "loadfile", v: baseLoadFile }, { k: "loadstring", v: baseLoadString }, { k: "next", v: baseNext }, { k: "pcall", v: basePCall }, { k: "print", v: basePrint }, { k: "rawequal", v: baseRawEqual }, { k: "rawget", v: baseRawGet }, { k: "rawset", v: baseRawSet }, { k: "select", v: baseSelect }, { k: "_printregs", v: base_PrintRegs }, { k: "setfenv", v: baseSetFEnv }, { k: "setmetatable", v: baseSetMetatable }, { k: "tonumber", v: baseToNumber }, { k: "tostring", v: baseToString }, { k: "type", v: baseType }, { k: "unpack", v: baseUnpack }, { k: "xpcall", v: baseXPCall }, { k: "module", v: loModule }, { k: "require", v: loRequire }, { k: "newproxy", v: baseNewProxy }]); osFuncs = $makeMap($String.keyFor, [{ k: "clock", v: osClock }, { k: "difftime", v: osDiffTime }, { k: "execute", v: osExecute }, { k: "exit", v: osExit }, { k: "date", v: osDate }, { k: "getenv", v: osGetEnv }, { k: "remove", v: osRemove }, { k: "rename", v: osRename }, { k: "setenv", v: osSetEnv }, { k: "setlocale", v: osSetLocale }, { k: "time", v: osTime }, { k: "tmpname", v: osTmpname }]); strFuncs = $makeMap($String.keyFor, [{ k: "byte", v: strByte }, { k: "char", v: strChar }, { k: "dump", v: strDump }, { k: "find", v: strFind }, { k: "format", v: strFormat }, { k: "gsub", v: strGsub }, { k: "len", v: strLen }, { k: "lower", v: strLower }, { k: "match", v: strMatch }, { k: "rep", v: strRep }, { k: "reverse", v: strReverse }, { k: "sub", v: strSub }, { k: "upper", v: strUpper }]); coFuncs = $makeMap($String.keyFor, [{ k: "create", v: coCreate }, { k: "yield", v: coYield }, { k: "resume", v: coResume }, { k: "running", v: coRunning }, { k: "status", v: coStatus }, { k: "wrap", v: coWrap }]); luaLibs = new sliceType$4([new luaLib.ptr("package", OpenPackage), new luaLib.ptr("", OpenBase), new luaLib.ptr("table", OpenTable), new luaLib.ptr("io", OpenIo), new luaLib.ptr("os", OpenOs), new luaLib.ptr("string", OpenString), new luaLib.ptr("math", OpenMath), new luaLib.ptr("debug", OpenDebug), new luaLib.ptr("coroutine", OpenCoroutine)]); init(); init$1(); init$2(); init$3(); /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $packages["github.com/fiatjaf/glua"] = (function() { var $pkg = {}, $init, lua, js, sliceType, funcType, mapType, funcType$1, mapType$1, funcType$2, sliceType$1, ptrType, funcType$3, ptrType$1, main, lvalueFromInterface, lvalueToInterface; lua = $packages["github.com/J-J-J/goluajit"]; js = $packages["github.com/gopherjs/gopherjs/js"]; sliceType = $sliceType(lua.Options); funcType = $funcType([$String], [], false); mapType = $mapType($String, $emptyInterface); funcType$1 = $funcType([mapType, $String], [], false); mapType$1 = $mapType($String, $String); funcType$2 = $funcType([mapType$1, mapType, $String], [], false); sliceType$1 = $sliceType($emptyInterface); ptrType = $ptrType(js.Object); funcType$3 = $funcType([sliceType$1], [ptrType], true); ptrType$1 = $ptrType(lua.LTable); main = function() { var run, withGlobals, withModules; run = (function $b(code) { var L, _r, _r$1, code, err, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _r = $f._r; _r$1 = $f._r$1; code = $f.code; err = $f.err; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); _r = lua.NewState(new sliceType([])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } L = _r; $deferred.push([$methodVal(L, "Close"), []]); _r$1 = L.DoString(code); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f.L = L; $f._r = _r; $f._r$1 = _r$1; $f.code = code; $f.err = err; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }); withGlobals = (function $b(globals, code) { var L, _entry, _i, _keys, _r, _r$1, _ref, code, err, globals, name, value, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _entry = $f._entry; _i = $f._i; _keys = $f._keys; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; code = $f.code; err = $f.err; globals = $f.globals; name = $f.name; value = $f.value; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); _r = lua.NewState(new sliceType([])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } L = _r; $deferred.push([$methodVal(L, "Close"), []]); _ref = globals; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 2: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 3; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 2; continue; } name = _entry.k; value = _entry.v; $r = L.SetGlobal(name, lvalueFromInterface(L, value)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 2; continue; case 3: _r$1 = L.DoString(code); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } err = _r$1; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f.L = L; $f._entry = _entry; $f._i = _i; $f._keys = _keys; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f.code = code; $f.err = err; $f.globals = globals; $f.name = name; $f.value = value; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }); withModules = (function $b(modules, globals, code) { var L, _entry, _entry$1, _i, _i$1, _keys, _keys$1, _r, _r$1, _r$2, _r$3, _r$4, _ref, _ref$1, _tuple, code, code$1, err, err$1, globals, mod, moduleName, modules, name, preload, value, $s, $deferred, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L = $f.L; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _keys$1 = $f._keys$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _ref$1 = $f._ref$1; _tuple = $f._tuple; code = $f.code; code$1 = $f.code$1; err = $f.err; err$1 = $f.err$1; globals = $f.globals; mod = $f.mod; moduleName = $f.moduleName; modules = $f.modules; name = $f.name; preload = $f.preload; value = $f.value; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); _r = lua.NewState(new sliceType([])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } L = _r; $deferred.push([$methodVal(L, "Close"), []]); _r$1 = L.GetField(L.Get(-10001), "package"); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = L.GetField(_r$1, "preload"); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } preload = _r$2; _ref = modules; _i = 0; _keys = $keys(_ref); /* while (true) { */ case 4: /* if (!(_i < _keys.length)) { break; } */ if(!(_i < _keys.length)) { $s = 5; continue; } _entry = _ref[_keys[_i]]; if (_entry === undefined) { _i++; /* continue; */ $s = 4; continue; } moduleName = _entry.k; code$1 = _entry.v; _r$3 = L.LoadString(code$1); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } _tuple = _r$3; mod = _tuple[0]; err = _tuple[1]; if (!($interfaceIsEqual(err, $ifaceNil))) { $panic(err); } $r = L.SetField(preload, moduleName, mod); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i++; /* } */ $s = 4; continue; case 5: _ref$1 = globals; _i$1 = 0; _keys$1 = $keys(_ref$1); /* while (true) { */ case 8: /* if (!(_i$1 < _keys$1.length)) { break; } */ if(!(_i$1 < _keys$1.length)) { $s = 9; continue; } _entry$1 = _ref$1[_keys$1[_i$1]]; if (_entry$1 === undefined) { _i$1++; /* continue; */ $s = 8; continue; } name = _entry$1.k; value = _entry$1.v; $r = L.SetGlobal(name, lvalueFromInterface(L, value)); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } _i$1++; /* } */ $s = 8; continue; case 9: _r$4 = L.DoString(code); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } err$1 = _r$4; if (!($interfaceIsEqual(err$1, $ifaceNil))) { $panic(err$1); } $s = -1; return; /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: $b }; } $f.L = L; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._keys$1 = _keys$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tuple = _tuple; $f.code = code; $f.code$1 = code$1; $f.err = err; $f.err$1 = err$1; $f.globals = globals; $f.mod = mod; $f.moduleName = moduleName; $f.modules = modules; $f.name = name; $f.preload = preload; $f.value = value; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } }); if (!($module === undefined)) { $module.exports.run = $externalize(run, funcType); $module.exports.runWithGlobals = $externalize(withGlobals, funcType$1); $module.exports.runWithModules = $externalize(withModules, funcType$2); } else { $global.glua = $externalize($makeMap($String.keyFor, [{ k: "run", v: new funcType(run) }, { k: "runWithGlobals", v: new funcType$1(withGlobals) }, { k: "runWithModules", v: new funcType$2(withModules) }]), mapType); } }; lvalueFromInterface = function(L, value) { var L, _entry, _i, _i$1, _keys, _ref, _ref$1, _ref$2, fn, i, iv, iv$1, k, table, table$1, val, val$1, val$2, val$3, val$4, val$5, val$6, value; _ref = value; if ($assertType(_ref, $String, true)[1]) { val = _ref.$val; return new lua.LString((val)); } else if ($assertType(_ref, $Float64, true)[1]) { val$1 = _ref.$val; return new lua.LNumber((val$1)); } else if ($assertType(_ref, $Bool, true)[1]) { val$2 = _ref.$val; return new lua.LBool((val$2)); } else if ($assertType(_ref, mapType, true)[1]) { val$3 = _ref.$val; table = L.NewTable(); _ref$1 = val$3; _i = 0; _keys = $keys(_ref$1); while (true) { if (!(_i < _keys.length)) { break; } _entry = _ref$1[_keys[_i]]; if (_entry === undefined) { _i++; continue; } k = _entry.k; iv = _entry.v; table.RawSetString(k, lvalueFromInterface(L, iv)); _i++; } return table; } else if ($assertType(_ref, sliceType$1, true)[1]) { val$4 = _ref.$val; table$1 = L.NewTable(); _ref$2 = val$4; _i$1 = 0; while (true) { if (!(_i$1 < _ref$2.$length)) { break; } i = _i$1; iv$1 = ((_i$1 < 0 || _i$1 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$1]); table$1.RawSetInt(i + 1 >> 0, lvalueFromInterface(L, iv$1)); _i$1++; } return table$1; } else if ($assertType(_ref, funcType$3, true)[1]) { val$5 = _ref.$val; fn = val$5; return L.NewFunction((function $b(L$1) { var L$1, _entry$1, _i$2, _r, _r$1, _ref$3, _tuple, _tuple$1, _tuple$2, a, arg, args, hasmultikey, ismap, ivalues, jsreturn, mret, ok, ret, value$1, values, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; L$1 = $f.L$1; _entry$1 = $f._entry$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _ref$3 = $f._ref$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; a = $f.a; arg = $f.arg; args = $f.args; hasmultikey = $f.hasmultikey; ismap = $f.ismap; ivalues = $f.ivalues; jsreturn = $f.jsreturn; mret = $f.mret; ok = $f.ok; ret = $f.ret; value$1 = $f.value$1; values = $f.values; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: args = sliceType$1.nil; a = 1; /* while (true) { */ case 1: arg = L$1.Get(a); if ($interfaceIsEqual(arg, lua.LNil)) { /* break; */ $s = 2; continue; } _r = lvalueToInterface(arg); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } args = $append(args, _r); a = a + (1) >> 0; /* } */ $s = 1; continue; case 2: _r$1 = fn(args); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } jsreturn = _r$1; if (jsreturn === undefined) { $s = -1; return 0; } ret = $internalize(jsreturn, $emptyInterface); _tuple = $assertType(ret, mapType, true); mret = _tuple[0]; ismap = _tuple[1]; if (ismap) { _tuple$1 = (_entry$1 = mret[$String.keyFor("_glua_multi")], _entry$1 !== undefined ? [_entry$1.v, true] : [$ifaceNil, false]); ivalues = _tuple$1[0]; hasmultikey = _tuple$1[1]; if (hasmultikey) { _tuple$2 = $assertType(ivalues, sliceType$1, true); values = _tuple$2[0]; ok = _tuple$2[1]; if (ok) { _ref$3 = values; _i$2 = 0; while (true) { if (!(_i$2 < _ref$3.$length)) { break; } value$1 = ((_i$2 < 0 || _i$2 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$2]); L$1.Push(lvalueFromInterface(L$1, value$1)); _i$2++; } $s = -1; return values.$length; } } } L$1.Push(lvalueFromInterface(L$1, ret)); $s = -1; return 1; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.L$1 = L$1; $f._entry$1 = _entry$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._ref$3 = _ref$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.a = a; $f.arg = arg; $f.args = args; $f.hasmultikey = hasmultikey; $f.ismap = ismap; $f.ivalues = ivalues; $f.jsreturn = jsreturn; $f.mret = mret; $f.ok = ok; $f.ret = ret; $f.value$1 = value$1; $f.values = values; $f.$s = $s; $f.$r = $r; return $f; })); } else { val$6 = _ref; return lua.LNil; } }; lvalueToInterface = function(lvalue) { var _1, _ref, array, isArray, lvalue, object, size, value, value$1, value$2, value$3, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _1 = $f._1; _ref = $f._ref; array = $f.array; isArray = $f.isArray; lvalue = $f.lvalue; object = $f.object; size = $f.size; value = $f.value; value$1 = $f.value$1; value$2 = $f.value$2; value$3 = $f.value$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: array = [array]; isArray = [isArray]; object = [object]; size = [size]; _ref = lvalue; /* */ if ($assertType(_ref, ptrType$1, true)[1]) { $s = 1; continue; } /* */ if ($assertType(_ref, lua.LNumber, true)[1]) { $s = 2; continue; } /* */ if ($assertType(_ref, lua.LString, true)[1]) { $s = 3; continue; } /* */ $s = 4; continue; /* if ($assertType(_ref, ptrType$1, true)[1]) { */ case 1: value = _ref.$val; size[0] = value.Len(); object[0] = ((size[0] < 0 || size[0] > 2147483647) ? $throwRuntimeError("makemap: size out of range") : {}); array[0] = $makeSlice(sliceType$1, size[0]); isArray[0] = true; if (size[0] === 0) { isArray[0] = false; } $r = value.ForEach((function(array, isArray, object, size) { return function $b(k, lv) { var _key, _r, _r$1, _r$2, _tuple, k, ln, lv, ok, v, x, $s, $r; /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple = $f._tuple; k = $f.k; ln = $f.ln; lv = $f.lv; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: _r = lvalueToInterface(lv); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } v = _r; if (isArray[0]) { _tuple = $assertType(k, lua.LNumber, true); ln = _tuple[0]; ok = _tuple[1]; if (!ok || !(((((ln >> 0))) === (ln)))) { isArray[0] = false; } else if ((ln === 0) || ((ln >> 0)) > size[0]) { isArray[0] = false; } else { (x = ((ln >> 0)) - 1 >> 0, ((x < 0 || x >= array[0].$length) ? ($throwRuntimeError("index out of range"), undefined) : array[0].$array[array[0].$offset + x] = v)); } } _r$1 = lua.LVAsString(k); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } _r$2 = lvalueToInterface(lv); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } _key = _r$1; (object[0] || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: _r$2 }; $s = -1; return; /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple = _tuple; $f.k = k; $f.ln = ln; $f.lv = lv; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; }; })(array, isArray, object, size)); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if (isArray[0]) { $s = -1; return array[0]; } else { $s = -1; return new mapType(object[0]); } $s = 5; continue; /* } else if ($assertType(_ref, lua.LNumber, true)[1]) { */ case 2: value$1 = _ref.$val; $s = -1; return new $Float64((value$1)); /* } else if ($assertType(_ref, lua.LString, true)[1]) { */ case 3: value$2 = _ref.$val; $s = -1; return new $String((value$2)); /* } else { */ case 4: value$3 = _ref; _1 = lvalue; if ($interfaceIsEqual(_1, new lua.LBool((lua.LTrue)))) { $s = -1; return new $Bool(true); } else if ($interfaceIsEqual(_1, new lua.LBool((lua.LFalse)))) { $s = -1; return new $Bool(false); } else if ($interfaceIsEqual(_1, (lua.LNil))) { $s = -1; return $ifaceNil; } /* } */ case 5: $s = -1; return $ifaceNil; /* */ } return; } if ($f === undefined) { $f = { $blk: lvalueToInterface }; } $f._1 = _1; $f._ref = _ref; $f.array = array; $f.isArray = isArray; $f.lvalue = lvalue; $f.object = object; $f.size = size; $f.value = value; $f.value$1 = value$1; $f.value$2 = value$2; $f.value$3 = value$3; $f.$s = $s; $f.$r = $r; return $f; }; $init = function() { $pkg.$init = function() {}; /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: $r = lua.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } if ($pkg === $mainPkg) { main(); $mainFinished = true; } /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; }; $pkg.$init = $init; return $pkg; })(); $synthesizeMethods(); var $mainPkg = $packages["github.com/fiatjaf/glua"]; $packages["runtime"].$init(); $go($mainPkg.$init, []); $flushConsole(); }).call(this); //# sourceMappingURL=glua.js.map ================================================ FILE: main.go ================================================ package main import ( lua "github.com/J-J-J/goluajit" "github.com/gopherjs/gopherjs/js" ) func main() { run := func(code string) { L := lua.NewState() defer L.Close() if err := L.DoString(code); err != nil { panic(err) } } withGlobals := func(globals map[string]interface{}, code string) { L := lua.NewState() defer L.Close() for name, value := range globals { L.SetGlobal(name, lvalueFromInterface(L, value)) } if err := L.DoString(code); err != nil { panic(err) } } withModules := func(modules map[string]string, globals map[string]interface{}, code string) { L := lua.NewState() defer L.Close() preload := L.GetField(L.GetField(L.Get(lua.EnvironIndex), "package"), "preload") for moduleName, code := range modules { mod, err := L.LoadString(code) if err != nil { panic(err) } L.SetField(preload, moduleName, mod) } for name, value := range globals { L.SetGlobal(name, lvalueFromInterface(L, value)) } if err := L.DoString(code); err != nil { panic(err) } } if js.Module != js.Undefined { js.Module.Get("exports").Set("run", run) js.Module.Get("exports").Set("runWithGlobals", withGlobals) js.Module.Get("exports").Set("runWithModules", withModules) } else { js.Global.Set("glua", map[string]interface{}{ "run": run, "runWithGlobals": withGlobals, "runWithModules": withModules, }) } } func lvalueFromInterface(L *lua.LState, value interface{}) lua.LValue { switch val := value.(type) { case string: return lua.LString(val) case float64: return lua.LNumber(val) case bool: return lua.LBool(val) case map[string]interface{}: table := L.NewTable() for k, iv := range val { table.RawSetString(k, lvalueFromInterface(L, iv)) } return table case []interface{}: table := L.NewTable() for i, iv := range val { table.RawSetInt(i+1, lvalueFromInterface(L, iv)) } return table case func(...interface{}) *js.Object: fn := val return L.NewFunction(func(L *lua.LState) int { var args []interface{} for a := 1; ; a++ { arg := L.Get(a) if arg == lua.LNil { break } args = append(args, lvalueToInterface(arg)) } jsreturn := fn(args...) if jsreturn == js.Undefined { return 0 } ret := jsreturn.Interface() if mret, ismap := ret.(map[string]interface{}); ismap { if ivalues, hasmultikey := mret["_glua_multi"]; hasmultikey { if values, ok := ivalues.([]interface{}); ok { // return multiple values to lua for _, value := range values { L.Push(lvalueFromInterface(L, value)) } return len(values) } } } L.Push(lvalueFromInterface(L, ret)) return 1 }) default: return lua.LNil } } func lvalueToInterface(lvalue lua.LValue) interface{} { switch value := lvalue.(type) { case *lua.LTable: size := value.Len() // it will be either an object or an array object := make(map[string]interface{}, size) array := make([]interface{}, size) isArray := true if size == 0 { isArray = false } value.ForEach(func(k lua.LValue, lv lua.LValue) { v := lvalueToInterface(lv) if isArray { ln, ok := k.(lua.LNumber) if !ok || float64(int(ln)) != float64(ln) { // has a non-int key, so not an array isArray = false } else if ln == 0 || int(ln) > size /* because lua arrays are 1-based */ { // int out of the allowed range, so not an array isArray = false } else { // keep storing everything in the array array[int(ln)-1 /* because lua arrays are 1-based */] = v } } // if in the last key we discover this isn't an array we already have all values object[lua.LVAsString(k)] = lvalueToInterface(lv) }) if isArray { return array } else { return object } case lua.LNumber: return float64(value) case lua.LString: return string(value) default: switch lvalue { case lua.LTrue: return true case lua.LFalse: return false case lua.LNil: return nil } } return nil } ================================================ FILE: package.json ================================================ { "name": "glua", "version": "1.0.2", "description": "Full-featured Lua VM for nodejs and the browser. Based on github.com/yuin/gopher-lua.", "main": "dist/glua.js", "repository": { "type": "git", "url": "git+https://github.com/fiatjaf/glua.git" }, "scripts": { "prepublish": "make" }, "keywords": "lua vm compiler gopher-lua gopherjs", "author": "fiatjaf", "license": "MIT", "devDependencies": { "uglify-js": "^2.8.22" } } ================================================ FILE: try.html ================================================ glua playground
open your console for all the action.
back to GitHub


a simple example you can run now (copy and paste in the console):
  
var state = {count: 18}
glua.runWithGlobals({
  increase: function (n) { state.count += n },
  state: state
}, `

print('initial value: ', state.count)
increase(5) -- increasing by 5

`)
console.log('now the value is:', state.count)