capnp-js-plugin
Version:
Capnproto implementation for Javascript
17 lines • 36 kB
JavaScript
var dust = require("capnp-js-plugin-dust");(function(){dust.register("bScope",body_0);function body_0(chk,ctx){return chk.w("define(['./bTypes'").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":"bTypes"});}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("bTypes",body_0);function body_0(chk,ctx){return chk.w("define(['capnp-js/builder/index', './rTypes'], function (builder, rTypes) {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("bTypes/node",ctx,{});}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("builders",body_0);function body_0(chk,ctx){return chk.w("define(['capnp-js/builder/index', 'capnp-js/reader/index', './bScope', './readers'").x(ctx.getPath(true, ["imports"]),ctx,{"block":body_1},{}).w("], function (builder, reader, scope, readers").x(ctx.getPath(true, ["imports"]),ctx,{"block":body_2},{}).w(") {var builders = { _READER : readers };").s(ctx.getPath(true, ["nodes"]),ctx,{"block":body_5},{}).w("return builders;});");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w(",").h("imports",ctx,{},{"file":"builders"});}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.p("builders/node",ctx,{}).w("(scope, builders);");}body_5.__dustBody=!0;return body_0;})();
(function(){dust.register("bTypes/node",body_0);function body_0(chk,ctx){return chk.h("eq",ctx,{"block":body_1},{"key":ctx.getPath(true, ["meta"]),"value":"struct"});}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_6},{});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("types['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'] = builder.structure(rTypes['").f(ctx.getPath(true, ["id"]),ctx,"h").w("']);");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.x(ctx.getPath(true, ["hash"]),ctx,{"else":body_4,"block":body_5},{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("types['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'] = builder.generic(rTypes['").f(ctx.getPath(true, ["id"]),ctx,"h").w("']);");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("types['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'] = builder.generic(rTypes['").f(ctx.getPath(true, ["id"]),ctx,"h").w("']._GENERIC).fixScope(rTypes['").f(ctx.getPath(true, ["id"]),ctx,"h").w("'], null);");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.p("bTypes/node",ctx,{});}body_6.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/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(";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);};").f(ctx.get(["current"], false),ctx,"h").w(".prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function (value) {").p("builders/setDiscriminant",ctx,{}).f(ctx.get(["encoder"], false),ctx,"h").w(".").f(ctx.get(["method"], false),ctx,"h").w("(value,").f(ctx.get(["default"], false),ctx,"h",["js"]).w(",this._segment,this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":ctx.get(["byteCount"], false)}).w(");};");}body_0.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/fields",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope) {parentScope.prototype._pointerDefaults = parentScope._READER.prototype._pointerDefaults;parentScope.prototype._floatDefaults = parentScope._READER.prototype._floatDefaults;").x(ctx.getPath(true, ["discriminantCount"]),ctx,{"block":body_1},{}).s(ctx.getPath(true, ["fields"]),ctx,{"block":body_3},{}).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 () {return reader.primitives.uint16(this._segment,this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["discriminantOffset"]),"method":"multiply","operand":"2"}).w(");};parentScope.prototype._setWhich = function (discr) {").p("builders/zeroUnion",ctx,{"zero":"builder.zero"}).w("var position = this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["discriminantOffset"]),"method":"multiply","operand":"2"}).w(";builder.primitives.uint16(discr, this._segment, position);};");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.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","encoder":"builder.fields"});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("var G").f(ctx.get(["$idx"], false),ctx,"h").w(" = builder.group(parentScope._READER.").f(ctx.getPath(true, ["name"]),ctx,"h").w(");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 = parentScope.prototype._pointerDefaults;").p("builders/fields",ctx,{}).w("(types, G").f(ctx.get(["$idx"], false),ctx,"h").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 new G").f(ctx.get(["$idx"], false),ctx,"h").w("(this);};parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("builders/setDiscriminant",ctx,{}).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(" = builder.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(");parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionInit(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionSet(").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(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".set(").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(" = builder.").f(ctx.getPath(true, ["type"]),ctx,"h").w("._FIELD;").h("eq",ctx,{"else":body_11,"block":body_12},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535});}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("parentScope.prototype.").h("fieldAdopter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionAdopt(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).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(");parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionInit(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionDisown(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldReaderDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionDisownReader(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionSet(").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("fieldAdopter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".adopt(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).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(");parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".init(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".disown(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldReaderDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".disownReader(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".set(").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;};parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function () {").p("builders/setDiscriminant",ctx,{}).w("};");}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("return reader.fields.bool(").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w(",this._segment,this._dataSection + ").h("boolOffset",ctx,{},{"offset":ctx.getPath(true, ["offset"])}).w(",").h("boolMask",ctx,{},{"offset":ctx.getPath(true, ["offset"])}).w(");};parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function (value) {").p("builders/setDiscriminant",ctx,{}).w("builder.fields.bool(value,").f(ctx.getPath(true, ["defaultValue"]),ctx,"h").w(",this._segment,this._dataSection + ").h("boolOffset",ctx,{},{"offset":ctx.getPath(true, ["offset"])}).w(",").h("boolMask",ctx,{},{"offset":ctx.getPath(true, ["offset"])}).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("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int8","byteCount":"1"});}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int16","byteCount":"2"});}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int32","byteCount":"4"});}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"int64","byteCount":"8"});}body_19.__dustBody=!0;function body_20(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint8","byteCount":"1"});}body_20.__dustBody=!0;function body_21(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint16","byteCount":"2"});}body_21.__dustBody=!0;function body_22(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint32","byteCount":"4"});}body_22.__dustBody=!0;function body_23(chk,ctx){return chk.p("builders/dataField",ctx,{"default":ctx.getPath(true, ["defaultValue"]),"method":"uint64","byteCount":"8"});}body_23.__dustBody=!0;function body_24(chk,ctx){return chk.p("builders/floatField",ctx,{"method":"float32","byteCount":"4"});}body_24.__dustBody=!0;function body_25(chk,ctx){return chk.p("builders/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_38},{"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,{"block":body_32},{"key":ctx.getPath(true, ["meta"]),"value":"parameter"}).h("eq",ctx,{"else":body_35,"block":body_36},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535}).h("eq",ctx,{"block":body_37},{"key":ctx.getPath(true, ["meta"]),"value":"parameter"});}body_27.__dustBody=!0;function body_28(chk,ctx){return chk.w("var gf").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("];var f").f(ctx.get(["$idx"], false),ctx,"h").w(" = gf").f(ctx.get(["$idx"], false),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":"builder","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("builders/list",ctx,{"index":"types","current":"parentScope"}).w("._FIELD;");}body_31.__dustBody=!0;function body_32(chk,ctx){return chk.w("if (gf").f(ctx.get(["$idx"], false),ctx,"h").w("._TYPE === builder.AnyPointer._TYPE) {").h("eq",ctx,{"else":body_33,"block":body_34},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535}).w("} else {");}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(".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(");parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionInit(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionSet(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_33.__dustBody=!0;function body_34(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(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".set(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_34.__dustBody=!0;function body_35(chk,ctx){return chk.w("parentScope.prototype.").h("fieldAdopter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionAdopt(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).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(");parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionInit(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionDisown(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldReaderDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionDisownReader(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".unionSet(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(",").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_35.__dustBody=!0;function body_36(chk,ctx){return chk.w("parentScope.prototype.").h("fieldAdopter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".adopt(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).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(");parentScope.prototype.").h("fieldIniter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".init(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".disown(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldReaderDisowner",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".disownReader(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");parentScope.prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =f").f(ctx.get(["$idx"], false),ctx,"h").w(".set(").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":"8"}).w(");");}body_36.__dustBody=!0;function body_37(chk,ctx){return chk.w("}");}body_37.__dustBody=!0;function body_38(chk,ctx){return chk.p("builders/dataField",ctx,{"current":"parentScope","default":ctx.getPath(true, ["defaultValue"]),"decoder":"reader.fields","encoder":"builder.fields","method":"uint16","byteCount":"2"});}body_38.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/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(";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);};").f(ctx.get(["current"], false),ctx,"h").w(".prototype.").h("fieldSetter",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" = function (value) {").p("builders/setDiscriminant",ctx,{}).w("var position = this._dataSection +").h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":ctx.get(["byteCount"], false)}).w(";").f(ctx.get(["encoder"], false),ctx,"h").w(".").f(ctx.get(["method"], false),ctx,"h").w("(value,this._floatDefaults.").f(ctx.getPath(true, ["name"]),ctx,"h").w(",this._segment,position);};");}body_0.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/generic",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope) {").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 = Structure._READER.prototype._pointerDefaults;").p("builders/fields",ctx,{}).w("(types, Structure);};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("builders/node",ctx,{}).w("(types, Structure);");}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("builders/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("builder.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("builder.lists.list(").p("builders/list",ctx,{}).w(")");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("builder.lists.struct(").p("generic/scope",ctx,{"source":"builder"}).w(")");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("builder.lists.UInt16");}body_6.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/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("builders/structure",ctx,{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.p("builders/generic",ctx,{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("(function (types, parentScope) {parentScope.").f(ctx.getPath(true, ["name"]),ctx,"h").w(" = parentScope._READER.").f(ctx.getPath(true, ["name"]),ctx,"h").w(";})");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("(function (types, parentScope) {parentScope.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =parentScope.prototype.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(" =parentScope._READER.").h("constant",ctx,{},{"name":ctx.getPath(true, ["name"])}).w(";})");}body_5.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/setDiscriminant",body_0);function body_0(chk,ctx){return chk.h("ne",ctx,{"block":body_1},{"key":ctx.getPath(true, ["discriminantValue"]),"value":65535});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("this._setWhich(").f(ctx.getPath(true, ["discriminantValue"]),ctx,"h").w(");");}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/structure",body_0);function body_0(chk,ctx){return chk.w("(function (types, parentScope) {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 = Structure._READER.prototype._pointerDefaults;").p("builders/fields",ctx,{}).w("(types, Structure);parentScope.").f(ctx.getPath(true, ["name"]),ctx,"h").w(" = Structure;})");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.p("builders/node",ctx,{}).w("(types, Structure);");}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/zeroUnion",body_0);function body_0(chk,ctx){return chk.h("partial",ctx,{"bits":body_1,"block":body_2},{}).h("partial",ctx,{"bytes":body_3,"block":body_4},{}).h("partial",ctx,{"pointers":body_5,"block":body_6},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.h("unionBits",ctx,{},{"fields":ctx.getPath(true, ["fields"])});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("builders/union/bit");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.h("unionBytes",ctx,{},{"fields":ctx.getPath(true, ["fields"])});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("builders/union/nonbit");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.h("unionPointers",ctx,{},{"fields":ctx.getPath(true, ["fields"])});}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("builders/union/pointer");}body_6.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/union/bit",body_0);function body_0(chk,ctx){return chk.s(ctx.get(["bits"], false),ctx,{"block":body_1},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("this._maskData(").f(ctx.get(["position"], false),ctx,"h").w(", ").f(ctx.get(["mask"], false),ctx,"h").w(");");}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/union/nonbit",body_0);function body_0(chk,ctx){return chk.s(ctx.get(["bytes"], false),ctx,{"block":body_1},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("this._zeroData(").f(ctx.get(["position"], false),ctx,"h").w(", ").f(ctx.get(["length"], false),ctx,"h").w(");");}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/union/pointer",body_0);function body_0(chk,ctx){return chk.s(ctx.get(["pointers"], false),ctx,{"block":body_1},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.f(ctx.get(["zero"], false),ctx,"h").w(".pointer(this._arena,{segment : this._segment,position : this._pointersSection + ").f(ctx.getPath(true, []),ctx,"h").w("});");}body_1.__dustBody=!0;return body_0;})();
(function(){dust.register("builders/union/range",body_0);function body_0(chk,ctx){return chk.h("math",ctx,{},{"key":ctx.getPath(true, ["offset"]),"method":"multiply","operand":ctx.get(["byteCount"], false)}).w(":").f(ctx.get(["byteCount"], false),ctx,"h");}body_0.__dustBody=!0;return body_0;})();