capnp-js-plugin
Version:
Capnproto implementation for Javascript
14 lines • 34.5 kB
JavaScript
var dust = require("capnp-js-plugin-dust");(function(){dust.register("rScope",body_0);function body_0(chk,ctx){return chk.w("define(['./rTypes'").x(ctx.getPath(true, ["imports"]),ctx,{"block":body_1},{}).w("], function (types ").x(ctx.getPath(true, ["imports"]),ctx,{"block":body_2},{}).w(") {").s(ctx.getPath(true, ["imports"]),ctx,{"block":body_5},{}).w("return types;});");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w(",").h("imports",ctx,{},{"file":"rTypes"});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w(",").s(ctx.getPath(true, ["imports"]),ctx,{"block":body_3},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("file").f(ctx.get(["$idx"], false),ctx,"h").h("sep",ctx,{"block":body_4},{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w(",");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.s(ctx.getPath(true, ["typeIds"]),ctx,{"block":body_6},{"fileId":ctx.get(["$idx"], false)});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("types[\"").f(ctx.getPath(true, []),ctx,"h").w("\"] = file").f(ctx.get(["fileId"], false),ctx,"h").w("[\"").f(ctx.getPath(true, []),ctx,"h").w("\"];");}body_6.__dustBody=!0;return body_0;})();
(function(){dust.register("rTypes",body_0);function body_0(chk,ctx){return chk.w("define(['capnp-js/reader/index'], function (reader) {var types = {};").s(ctx.getPath(true, ["nodes"]),ctx,{"block":body_1},{}).w("return types;});");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.p("rTypes/node",ctx,{});}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("readers",body_0);function body_0(chk,ctx){return chk.w("define(['capnp-js/builder/Allocator', 'capnp-js/reader/index', './rScope' ").x(ctx.getPath(true, ["imports"]),ctx,{"block":body_1},{}).w("], function (Allocator, reader, scope) {var readers = {};var allocator = new Allocator();").s(ctx.getPath(true, ["nodes"]),ctx,{"block":body_2},{}).w("return readers;});");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w(",").h("imports",ctx,{},{"file":"readers"});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.p("readers/node",ctx,{}).w("(scope, readers, allocator);");}body_2.__dustBody=!0;return body_0;})();
(function(){dust.register("rTypes/node",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"block":body_1},{"key":ctx.getPath(true, ["meta"]),"value":"struct"}).h("eq",ctx,{"block":body_6},{"key":ctx.getPath(true, ["meta"]),"value":"enum"});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.x(ctx.getPath(true, ["parameters"]),ctx,{"else":body_2,"block":body_3},{}).s(ctx.getPath(true, ["nodes"]),ctx,{"block":body_5},{});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("types['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'] = reader.structure(").f(ctx.getPath(true, ["preferredListEncoding"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["dataWordCount"]),"method":"multiply","operand":8}).w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["pointerCount"]),"method":"multiply","operand":8}).w(",'").f(ctx.getPath(true, ["id"]),ctx,"h").w("');");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("types['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'] = reader.generic(").f(ctx.getPath(true, ["preferredListEncoding"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["dataWordCount"]),"method":"multiply","operand":8}).w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["pointerCount"]),"method":"multiply","operand":8}).w(",'").f(ctx.getPath(true, ["id"]),ctx,"h").w("',").h("size",ctx,{},{"key":ctx.getPath(true, ["parameters"])}).w(")").x(ctx.getPath(true, ["hash"]),ctx,{"block":body_4},{}).w(";");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w(".fixScope(null)");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.p("rTypes/node",ctx,{});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("types['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'] = {").s(ctx.getPath(true, ["enumerants"]),ctx,{"block":body_7},{}).w("};");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" : ").f(ctx.get(["$idx"], false),ctx,"h").h("sep",ctx,{"block":body_8},{});}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w(", ");}body_8.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/constant",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope, allocator) {").h("provide",ctx,{"target":body_1,"blob":body_3,"block":body_5},{}).w("})");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.h("verbatim",ctx,{"block":body_2},{});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("parentScope.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =parentScope.prototype.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.h("verbatim",ctx,{"block":body_4},{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("reader.").f(ctx.getPath(true, ["type"]),ctx,"h").w("._deref(arena,arena._root(),0)");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.s(ctx.getPath(true, ["datum"]),ctx,{"block":body_6},{});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.x(ctx.getPath(true, ["meta"]),ctx,{"else":body_7,"block":body_22},{});}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.h("eq",ctx,{"block":body_8},{"key":ctx.getPath(true, ["type"]),"value":"Text"}).h("eq",ctx,{"block":body_9},{"key":ctx.getPath(true, ["type"]),"value":"Data"}).h("eq",ctx,{"block":body_10},{"key":ctx.getPath(true, ["type"]),"value":"Void"}).h("eq",ctx,{"block":body_11},{"key":ctx.getPath(true, ["type"]),"value":"Bool"}).h("eq",ctx,{"block":body_12},{"key":ctx.getPath(true, ["type"]),"value":"Int8"}).h("eq",ctx,{"block":body_13},{"key":ctx.getPath(true, ["type"]),"value":"Int16"}).h("eq",ctx,{"block":body_14},{"key":ctx.getPath(true, ["type"]),"value":"Int32"}).h("eq",ctx,{"block":body_15},{"key":ctx.getPath(true, ["type"]),"value":"Int64"}).h("eq",ctx,{"block":body_16},{"key":ctx.getPath(true, ["type"]),"value":"UInt8"}).h("eq",ctx,{"block":body_17},{"key":ctx.getPath(true, ["type"]),"value":"UInt16"}).h("eq",ctx,{"block":body_18},{"key":ctx.getPath(true, ["type"]),"value":"UInt32"}).h("eq",ctx,{"block":body_19},{"key":ctx.getPath(true, ["type"]),"value":"UInt64"}).h("eq",ctx,{"block":body_20},{"key":ctx.getPath(true, ["type"]),"value":"Float32"}).h("eq",ctx,{"block":body_21},{"key":ctx.getPath(true, ["type"]),"value":"Float64"});}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("var arena = ").p("readers/listArena",ctx,{}).w(";").f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.get(["blob"], false),ctx,"h",["s"]).w(";");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("var arena = ").p("readers/listArena",ctx,{}).w(";").f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.get(["blob"], false),ctx,"h",["s"]).w(";");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = null;");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h",["js"]).w(";");}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h",["js"]).w(";");}body_19.__dustBody=!0;function body_20(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_20.__dustBody=!0;function body_21(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_21.__dustBody=!0;function body_22(chk,ctx){return chk.h("eq",ctx,{"block":body_23},{"key":ctx.getPath(true, ["meta"]),"value":"enum"}).h("eq",ctx,{"block":body_24},{"key":ctx.getPath(true, ["meta"]),"value":"struct"}).h("eq",ctx,{"block":body_25},{"key":ctx.getPath(true, ["meta"]),"value":"list"});}body_22.__dustBody=!0;function body_23(chk,ctx){return chk.f(ctx.get(["target"], false),ctx,"h").w(" = ").f(ctx.getPath(true, ["value"]),ctx,"h").w(";");}body_23.__dustBody=!0;function body_24(chk,ctx){return chk.w("var arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["value"]),ctx,"h").w("\").asReader();").f(ctx.get(["target"], false),ctx,"h").w(" = ").p("generic/scope",ctx,{"source":"reader","index":"types","current":"parentScope"}).w("._deref(arena,arena._root(),0);");}body_24.__dustBody=!0;function body_25(chk,ctx){return chk.w("var arena = ").p("readers/listArena",ctx,{}).w(";").f(ctx.get(["target"], false),ctx,"h").w(" = ").p("readers/list",ctx,{}).w("._deref(arena,arena._root(),0);");}body_25.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/dataField",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["current"], false),ctx,"h").w(".prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("throwOnInactive",ctx,{"error":"Attempted to access an inactive union member"}).w("var position = this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":ctx.get(["byteCount"], false)}).w(";if (position < this._pointersSection) {return ").f(ctx.get(["decoder"], false),ctx,"h").w(".").f(ctx.get(["method"], false),ctx,"h").w("(").f(ctx.get(["default"], false),ctx,"h",["js"]).w(", this._segment, position);} else {return ").f(ctx.get(["default"], false),ctx,"h",["js"]).w(";}};");}body_0.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/fields",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope, allocator) {").x(ctx.getPath(true, ["discriminantCount"]),ctx,{"block":body_1},{}).w("var defaults = parentScope.prototype._pointerDefaults;").s(ctx.getPath(true, ["fields"]),ctx,{"block":body_3},{}).x(ctx.getPath(true, ["fields"]),ctx,{"block":body_35},{}).w("})");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.h("gt",ctx,{"block":body_2},{"key":ctx.getPath(true, ["discriminantCount"]),"value":0});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("parentScope.prototype.which = function () {var position = this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["discriminantOffset"]),"method":"multiply","operand":"2"}).w(";if (position < this._pointersSection) {return reader.primitives.uint16(this._segment, position);} else {return 0;}};");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("/* ").f(ctx.getPath(true, ["name"]),ctx,"h").w(" */").h("ne",ctx,{"block":body_4},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535}).x(ctx.getPath(true, ["meta"]),ctx,{"else":body_5,"block":body_26},{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("parentScope.prototype.").h("fieldIser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {return this.which() === ").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(";};parentScope.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =parentScope.prototype.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(";");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.h("eq",ctx,{"block":body_6},{"key":ctx.getPath(true, ["type"]),"value":"group"}).h("eq",ctx,{"block":body_7},{"key":ctx.getPath(true, ["type"]),"value":"AnyPointer"}).h("member",ctx,{"block":body_10},{"key":ctx.getPath(true, ["type"]),"value":"Text,Data"}).h("eq",ctx,{"block":body_13},{"key":ctx.getPath(true, ["type"]),"value":"Void"}).h("eq",ctx,{"block":body_14},{"key":ctx.getPath(true, ["type"]),"value":"Bool"}).s(ctx.getPath(true, []),ctx,{"block":body_15},{"current":"parentScope","decoder":"reader.fields"});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("var G").f(ctx.get(["$idx"], false),ctx,"h").w(" = reader.group(parentScope);parentScope.").f(ctx.getPath(true, ["name"]),ctx,"h").w(" = G").f(ctx.get(["$idx"], false),ctx,"h").w(";G").f(ctx.get(["$idx"], false),ctx,"h").w(".prototype._pointerDefaults = defaults;").p("readers/fields",ctx,{}).w("(types, G").f(ctx.get(["$idx"], false),ctx,"h").w(", allocator);parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("throwOnInactive",ctx,{"error":"Attempted to access an inactive union member"}).w("return new G").f(ctx.get(["$idx"], false),ctx,"h").w("(this);};");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("var f").f(ctx.get(["$idx"], false),ctx,"h").w(" = reader.AnyPointer._FIELD;").h("eq",ctx,{"else":body_8,"block":body_9},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535});}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionGet(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(",").f(ctx.getPath(true, ["offset"]),ctx,"h").w(");parentScope.prototype.").h("fieldHaser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionHas(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".get(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(",").f(ctx.getPath(true, ["offset"]),ctx,"h").w(");parentScope.prototype.").h("fieldHaser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".has(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("var f").f(ctx.get(["$idx"], false),ctx,"h").w(" = reader.").f(ctx.getPath(true, ["type"]),ctx,"h").w("._FIELD;").h("eq",ctx,{"else":body_11,"block":body_12},{"key":ctx.get(["discriminantValue"], false),"value":65535});}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionGet(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(",").f(ctx.getPath(true, ["offset"]),ctx,"h").w(");parentScope.prototype.").h("fieldHaser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionHas(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".get(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(",").f(ctx.getPath(true, ["offset"]),ctx,"h").w(");parentScope.prototype.").h("fieldHaser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".has(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("throwOnInactive",ctx,{"error":"Attempted to access an inactive union member"}).w("return null;};");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("throwOnInactive",ctx,{"error":"Attempted to access an inactive union member"}).w("var position = this._dataSection + ").h("boolOffset",ctx,{},{"offset":ctx.getPath(true, ["offset"])}).w(";if (position < this._pointersSection) {return reader.fields.bool(").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w(",this._segment,position,").h("boolMask",ctx,{},{"offset":ctx.getPath(true, ["offset"])}).w(");} else {return !!").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w(";}};");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.h("eq",ctx,{"block":body_16},{"key":ctx.getPath(true, ["type"]),"value":"Int8"}).h("eq",ctx,{"block":body_17},{"key":ctx.getPath(true, ["type"]),"value":"Int16"}).h("eq",ctx,{"block":body_18},{"key":ctx.getPath(true, ["type"]),"value":"Int32"}).h("eq",ctx,{"block":body_19},{"key":ctx.getPath(true, ["type"]),"value":"Int64"}).h("eq",ctx,{"block":body_20},{"key":ctx.getPath(true, ["type"]),"value":"UInt8"}).h("eq",ctx,{"block":body_21},{"key":ctx.getPath(true, ["type"]),"value":"UInt16"}).h("eq",ctx,{"block":body_22},{"key":ctx.getPath(true, ["type"]),"value":"UInt32"}).h("eq",ctx,{"block":body_23},{"key":ctx.getPath(true, ["type"]),"value":"UInt64"}).h("eq",ctx,{"block":body_24},{"key":ctx.getPath(true, ["type"]),"value":"Float32"}).h("eq",ctx,{"block":body_25},{"key":ctx.getPath(true, ["type"]),"value":"Float64"});}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int8","byteCount":"1"});}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int16","byteCount":"2"});}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int32","byteCount":"4"});}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int64","byteCount":"8"});}body_19.__dustBody=!0;function body_20(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint8","byteCount":"1"});}body_20.__dustBody=!0;function body_21(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint16","byteCount":"2"});}body_21.__dustBody=!0;function body_22(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint32","byteCount":"4"});}body_22.__dustBody=!0;function body_23(chk,ctx){return chk.p("readers/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint64","byteCount":"8"});}body_23.__dustBody=!0;function body_24(chk,ctx){return chk.p("readers/floatField",ctx,{"method":"float32","byteCount":"4"});}body_24.__dustBody=!0;function body_25(chk,ctx){return chk.p("readers/floatField",ctx,{"method":"float64","byteCount":"8"});}body_25.__dustBody=!0;function body_26(chk,ctx){return chk.h("eq",ctx,{"else":body_27,"block":body_34},{"key":ctx.getPath(true, ["meta"]),"value":"enum"});}body_26.__dustBody=!0;function body_27(chk,ctx){return chk.h("eq",ctx,{"block":body_28},{"key":ctx.getPath(true, ["meta"]),"value":"parameter"}).h("eq",ctx,{"block":body_30},{"key":ctx.getPath(true, ["meta"]),"value":"struct"}).h("eq",ctx,{"block":body_31},{"key":ctx.getPath(true, ["meta"]),"value":"list"}).h("eq",ctx,{"else":body_32,"block":body_33},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535});}body_27.__dustBody=!0;function body_28(chk,ctx){return chk.w("var f").f(ctx.get(["$idx"], false),ctx,"h").w(" = parentScope").h("repeat",ctx,{"block":body_29},{"times":ctx.getPath(true, ["type","scopeDistance"])}).w("._PARAMS[").f(ctx.getPath(true, ["type","position"]),ctx,"h").w("]._FIELD;");}body_28.__dustBody=!0;function body_29(chk,ctx){return chk.w("._PARENT");}body_29.__dustBody=!0;function body_30(chk,ctx){return chk.w("var f").f(ctx.get(["$idx"], false),ctx,"h").w(" = ").p("generic/scope",ctx,{"source":"reader","index":"types","current":"parentScope"}).w("._FIELD;");}body_30.__dustBody=!0;function body_31(chk,ctx){return chk.w("var f").f(ctx.get(["$idx"], false),ctx,"h").w(" = ").p("readers/list",ctx,{"index":"types","current":"parentScope"}).w("._FIELD;");}body_31.__dustBody=!0;function body_32(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionGet(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(",").f(ctx.getPath(true, ["offset"]),ctx,"h").w(");parentScope.prototype.").h("fieldHaser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionHas(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_32.__dustBody=!0;function body_33(chk,ctx){return chk.w("parentScope.prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".get(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(",").f(ctx.getPath(true, ["offset"]),ctx,"h").w(");parentScope.prototype.").h("fieldHaser",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".has(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_33.__dustBody=!0;function body_34(chk,ctx){return chk.p("readers/dataField",ctx,{"current":"parentScope","default":ctx.getPath(true, ["defaultValue"]),"decoder":"reader.fields","method":"uint16","byteCount":"2"});}body_34.__dustBody=!0;function body_35(chk,ctx){return chk.h("provide",ctx,{"pointers":body_36,"block":body_37},{}).w("parentScope.prototype._floatDefaults = {").h("provide",ctx,{"floats":body_54,"block":body_55},{}).w("};");}body_35.__dustBody=!0;function body_36(chk,ctx){return chk.h("pointerFields",ctx,{},{"fields":ctx.getPath(true, ["fields"])});}body_36.__dustBody=!0;function body_37(chk,ctx){return chk.s(ctx.getPath(true, ["pointers"]),ctx,{"block":body_38},{});}body_37.__dustBody=!0;function body_38(chk,ctx){return chk.w("defaults[").f(ctx.getPath(true, ["offset"]),ctx,"h").w("] = (function () {").x(ctx.getPath(true, ["meta"]),ctx,{"else":body_39,"block":body_47},{}).w("return Reader._deref(arena, arena._root(), 0);})();");}body_38.__dustBody=!0;function body_39(chk,ctx){return chk.h("eq",ctx,{"block":body_40},{"key":ctx.getPath(true, ["type"]),"value":"AnyPointer"}).h("eq",ctx,{"block":body_41},{"key":ctx.getPath(true, ["type"]),"value":"Text"}).h("eq",ctx,{"block":body_44},{"key":ctx.getPath(true, ["type"]),"value":"Data"});}body_39.__dustBody=!0;function body_40(chk,ctx){return chk.w("var Reader = reader.AnyPointer;var arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader();");}body_40.__dustBody=!0;function body_41(chk,ctx){return chk.w("var Reader = reader.Text;").h("eq",ctx,{"else":body_42,"block":body_43},{"key":ctx.getPath(true, ["defaultValue"]),"value":"AAAAAAAAAAA="});}body_41.__dustBody=!0;function body_42(chk,ctx){return chk.w("var arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader();");}body_42.__dustBody=!0;function body_43(chk,ctx){return chk.w("var arena = allocator._fromBase64(\"AQAAAAoAAAAAAAAAAAAAAA==\").asReader();");}body_43.__dustBody=!0;function body_44(chk,ctx){return chk.w("var Reader = reader.Data;").h("eq",ctx,{"else":body_45,"block":body_46},{"key":ctx.getPath(true, ["defaultValue"]),"value":"AAAAAAAAAAA="});}body_44.__dustBody=!0;function body_45(chk,ctx){return chk.w("var arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader();");}body_45.__dustBody=!0;function body_46(chk,ctx){return chk.w("var arena = allocator._fromBase64(\"AQAAAAIAAAA=\").asReader();");}body_46.__dustBody=!0;function body_47(chk,ctx){return chk.h("eq",ctx,{"block":body_48},{"key":ctx.getPath(true, ["meta"]),"value":"struct"}).h("eq",ctx,{"block":body_49},{"key":ctx.getPath(true, ["meta"]),"value":"list"}).h("eq",ctx,{"block":body_50},{"key":ctx.getPath(true, ["meta"]),"value":"parameter"});}body_47.__dustBody=!0;function body_48(chk,ctx){return chk.w("var Reader = ").p("generic/scope",ctx,{"source":"reader","index":"types","current":"parentScope"}).w(";var arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader();");}body_48.__dustBody=!0;function body_49(chk,ctx){return chk.w("var Reader = ").p("readers/list",ctx,{"index":"types","current":"parentScope"}).w(";var arena = ").p("readers/listDefaultArena",ctx,{}).w(";");}body_49.__dustBody=!0;function body_50(chk,ctx){return chk.w("var Reader = parentScope").h("repeat",ctx,{"block":body_51},{"times":ctx.getPath(true, ["type","scopeDistance"])}).w("._PARAMS[").f(ctx.getPath(true, ["type","position"]),ctx,"h").w("];").h("eq",ctx,{"else":body_52,"block":body_53},{"key":ctx.getPath(true, ["defaultValue"]),"value":"AAAAAAAAAAA="});}body_50.__dustBody=!0;function body_51(chk,ctx){return chk.w("._PARENT");}body_51.__dustBody=!0;function body_52(chk,ctx){return chk.w("var arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader();");}body_52.__dustBody=!0;function body_53(chk,ctx){return chk.w("var arena;if (Reader._CT && Reader._CT.meta === 1) {arena = allocator._fromBase64(Reader._B64_NULL).asReader();} else {arena = allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader();}");}body_53.__dustBody=!0;function body_54(chk,ctx){return chk.h("floatFields",ctx,{},{"fields":ctx.getPath(true, ["fields"])});}body_54.__dustBody=!0;function body_55(chk,ctx){return chk.s(ctx.getPath(true, ["floats"]),ctx,{"block":body_56},{});}body_55.__dustBody=!0;function body_56(chk,ctx){return chk.f(ctx.getPath(true, ["name"]),ctx,"h").w(" :").h("eq",ctx,{"block":body_57},{"key":ctx.getPath(true, ["type"]),"value":"Float32"}).h("eq",ctx,{"block":body_58},{"key":ctx.getPath(true, ["type"]),"value":"Float64"}).h("sep",ctx,{"block":body_59},{});}body_56.__dustBody=!0;function body_57(chk,ctx){return chk.w("allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultBytes"]),ctx,"h").w("\").getSegment(0)");}body_57.__dustBody=!0;function body_58(chk,ctx){return chk.w("allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultBytes"]),ctx,"h").w("\").getSegment(0)");}body_58.__dustBody=!0;function body_59(chk,ctx){return chk.w(",");}body_59.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/floatField",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["current"], false),ctx,"h").w(".prototype.").h("fieldGetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("throwOnInactive",ctx,{"error":"Attempted to access an inactive union member"}).w("var position = this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":ctx.get(["byteCount"], false)}).w(";if (position < this._pointersSection) {return ").f(ctx.get(["decoder"], false),ctx,"h").w(".").f(ctx.get(["method"], false),ctx,"h").w("(this._floatDefaults.").f(ctx.getPath(true, ["name"]),ctx,"h").w(",this._segment,position);} else {return ").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w(";}};");}body_0.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/generic",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope, allocator) {").x(ctx.getPath(true, ["hash"]),ctx,{"else":body_1,"block":body_2},{}).w("Generic._populate = function (Structure) {").s(ctx.getPath(true, ["nodes"]),ctx,{"block":body_3},{}).w("Structure.prototype._pointerDefaults = [];").p("readers/fields",ctx,{}).w("(types, Structure, allocator);};Generic.bindParams = function (").s(ctx.getPath(true, ["parameters"]),ctx,{"block":body_4},{}).w(") {return Generic._bindParams(parentScope,[").s(ctx.getPath(true, ["parameters"]),ctx,{"block":body_6},{}).w("]);};parentScope.").f(ctx.getPath(true, ["name"]),ctx,"h").w(" = Generic;})");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("var Generic = types[\"").f(ctx.getPath(true, ["id"]),ctx,"h").w("\"].bindScope(parentScope);");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("var Generic = types[\"").f(ctx.getPath(true, ["id"]),ctx,"h").w("\"];");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.p("readers/node",ctx,{}).w("(types, Structure, allocator);");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.f(ctx.getPath(true, []),ctx,"h").h("sep",ctx,{"block":body_5},{});}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w(", ");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.f(ctx.getPath(true, []),ctx,"h").h("sep",ctx,{"block":body_7},{});}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w(", ");}body_7.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/list",body_0);function body_0(chk,ctx){return chk.x(ctx.getPath(true, ["type","meta"]),ctx,{"else":body_1,"block":body_2},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("reader.lists.").f(ctx.getPath(true, ["type"]),ctx,"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.s(ctx.getPath(true, ["type"]),ctx,{"block":body_3},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.h("eq",ctx,{"block":body_4},{"key":ctx.getPath(true, ["meta"]),"value":"list"}).h("eq",ctx,{"block":body_5},{"key":ctx.getPath(true, ["meta"]),"value":"struct"}).h("eq",ctx,{"block":body_6},{"key":ctx.getPath(true, ["meta"]),"value":"enum"});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("reader.lists.list(").p("readers/list",ctx,{}).w(")");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("reader.lists.struct(").p("generic/scope",ctx,{"source":"reader"}).w(")");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("reader.lists.UInt16");}body_6.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/listArena",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"else":body_1,"block":body_2},{"key":ctx.getPath(true, ["value"]),"value":"AAAAAAAAAAA="});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("allocator._fromBase64(\"").f(ctx.getPath(true, ["value"]),ctx,"h").w("\").asReader()");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.h("provide",ctx,{"encoding":body_3,"block":body_4},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.h("nullListPointer",ctx,{},{"type":ctx.getPath(true, ["type"])});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("allocator._fromBase64(\"").f(ctx.getPath(true, ["encoding"]),ctx,"h").w("\").asReader()");}body_4.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/listDefaultArena",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"else":body_1,"block":body_2},{"key":ctx.getPath(true, ["defaultValue"]),"value":"AAAAAAAAAAA="});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("allocator._fromBase64(\"").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w("\").asReader()");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.h("provide",ctx,{"encoding":body_3,"block":body_4},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.h("nullListPointer",ctx,{},{"type":ctx.getPath(true, ["type"])});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("allocator._fromBase64(\"").f(ctx.getPath(true, ["encoding"]),ctx,"h").w("\").asReader()");}body_4.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/node",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"block":body_1},{"key":ctx.getPath(true, ["meta"]),"value":"struct"}).h("eq",ctx,{"block":body_4},{"key":ctx.getPath(true, ["meta"]),"value":"enum"}).h("eq",ctx,{"block":body_5},{"key":ctx.getPath(true, ["meta"]),"value":"const"});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.x(ctx.getPath(true, ["parameters"]),ctx,{"else":body_2,"block":body_3},{});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.p("readers/structure",ctx,{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.p("readers/generic",ctx,{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("(function (types, parentScope, allocator) {parentScope.").f(ctx.getPath(true, ["name"]),ctx,"h").w(" = types[\"").f(ctx.getPath(true, ["id"]),ctx,"h").w("\"];})");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.p("readers/constant",ctx,{});}body_5.__dustBody=!0;return body_0;})();
(function(){dust.register("readers/structure",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope, allocator) {var Structure = types[\"").f(ctx.getPath(true, ["id"]),ctx,"h").w("\"];Structure._PARENT = parentScope;").s(ctx.getPath(true, ["nodes"]),ctx,{"block":body_1},{}).w("Structure.prototype._pointerDefaults = [];").p("readers/fields",ctx,{}).w("(types, Structure, allocator);parentScope.").f(ctx.getPath(true, ["name"]),ctx,"h").w(" = Structure;})");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.p("readers/node",ctx,{}).w("(types, Structure, allocator);");}body_1.__dustBody=!0;return body_0;})();