UNPKG

net.akehurst.language-agl-processor

Version:
1,154 lines (1,150 loc) 39.1 kB
import { initMetadataForInterface1egvbzx539z91 as initMetadataForInterface, initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion, StringBuildermazzzhj6kkai as StringBuilder, _Char___init__impl__6a9atx2js6krycynjoo as _Char___init__impl__6a9atx, Unit_instance1fbcbse1fwigr as Unit_instance, equals2au1ep9vhcato as equals, hashCodeq5arwsb9dgti as hashCode, VOID3gxj6tk5isa35 as VOID, joinToString1cxrrlmo0chqs as joinToString, THROW_CCE2g6jy02ryeudk as THROW_CCE, KtMap140uvy3s5zad8 as KtMap, initMetadataForClassbxx6q50dy2s7 as initMetadataForClass, initMetadataForObject1cxne3s9w65el as initMetadataForObject, KtList3hktaavzmj137 as KtList, IllegalStateExceptionkoljg5n0nrlr as IllegalStateException, toDoubleOrNullkxwozihadygj as toDoubleOrNull, numberRangeToNumber25vse2rgp6rs8 as numberRangeToNumber, ClosedRangehokgr73im9z3 as ClosedRange, isInterface3d6p8outrmvmk as isInterface, contains2c50nlxg7en7o as contains, convertToInty04h231mmjoh as convertToInt, toString1pkumu07cwy4m as toString, IllegalArgumentException2asla15b5jaob as IllegalArgumentException, getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression, getBooleanHashCode1bbj3u6b3v0a7 as getBooleanHashCode, getStringHashCode26igk1bx568vk as getStringHashCode, StringCompanionObject_instance3alxothmy382k as StringCompanionObject_instance, captureStack1fzi4aczwc4hg as captureStack, charSequenceLength3278n89t01tmv as charSequenceLength, charSequenceSubSequence1iwpdba8s3jc7 as charSequenceSubSequence, coerceAtLeast2bkz8m9ik7hep as coerceAtLeast, coerceAtMost322komnqp70ag as coerceAtMost, charCodeAt1yspne1d8erbm as charCodeAt, Char__toInt_impl_vasixd1agw9q2fuvclj as Char__toInt_impl_vasixd, equals2v6cggk171b6e as equals_0, numberToChar93r9buh19yek as numberToChar, toString3o7ifthqydp6e as toString_0, toByte4i43936u611k as toByte, charSequenceGet1vxk1y5n17t1z as charSequenceGet, toNumber2e2hj9zugjwi2 as toNumber, noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException, Char__minus_impl_a2frrh3548ixwefqxih as Char__minus_impl_a2frrh, fromInt2ii0rejb1w62w as fromInt, multiply2k9eolhnz1bjv as multiply, add2suhfggl4zvkk as add, subtract2orl8z9upxd9l as subtract, numberToLong2pakxeg38estk as numberToLong, negate13xrbakfwasjy as negate, charArray2ujmm1qusno00 as charArray, } from './kotlin-kotlin-stdlib.mjs'; import { serializer1x79l67jvwntn as serializer, InlinePrimitiveDescriptor3i6ccn1a4fw94 as InlinePrimitiveDescriptor, SerializationExceptioneqrdve3ts2n9 as SerializationException, LIST_getInstancey7k5h8d5cvxt as LIST_getInstance, SerialDescriptor2pelqekb5ic3a as SerialDescriptor, } from './kotlinx-serialization-kotlinx-serialization-core.mjs'; //region block: imports var imul = Math.imul; //endregion //region block: pre-declaration class JsonDecoder {} class Companion {} class JsonElement {} class JsonObject extends JsonElement { constructor(content) { super(); this.ep_1 = content; } equals(other) { return equals(this.ep_1, other); } hashCode() { return hashCode(this.ep_1); } toString() { var tmp = this.ep_1.z1(); return joinToString(tmp, ',', '{', '}', VOID, VOID, JsonObject$toString$lambda); } l1() { return this.ep_1.l1(); } fp(key) { return this.ep_1.a3(key); } a3(key) { if (!(!(key == null) ? typeof key === 'string' : false)) return false; return this.fp((!(key == null) ? typeof key === 'string' : false) ? key : THROW_CCE()); } gp(value) { return this.ep_1.b3(value); } b3(value) { if (!(value instanceof JsonElement)) return false; return this.gp(value instanceof JsonElement ? value : THROW_CCE()); } hp(key) { return this.ep_1.c3(key); } c3(key) { if (!(!(key == null) ? typeof key === 'string' : false)) return null; return this.hp((!(key == null) ? typeof key === 'string' : false) ? key : THROW_CCE()); } asJsReadonlyMapView() { return this.ep_1.asJsReadonlyMapView(); } h1() { return this.ep_1.h1(); } d3() { return this.ep_1.d3(); } e3() { return this.ep_1.e3(); } z1() { return this.ep_1.z1(); } } class Companion_0 {} class JsonPrimitive extends JsonElement { toString() { return this.kp(); } } class JsonNull extends JsonPrimitive { constructor() { JsonNull_instance = null; super(); JsonNull_instance = this; this.ip_1 = 'null'; } jp() { return false; } kp() { return this.ip_1; } } class Companion_1 {} class Companion_2 {} class JsonArray extends JsonElement { constructor(content) { super(); this.lp_1 = content; } equals(other) { return equals(this.lp_1, other); } hashCode() { return hashCode(this.lp_1); } toString() { return joinToString(this.lp_1, ',', '[', ']'); } l1() { return this.lp_1.l1(); } mp(element) { return this.lp_1.p1(element); } p1(element) { if (!(element instanceof JsonElement)) return false; return this.mp(element instanceof JsonElement ? element : THROW_CCE()); } g1() { return this.lp_1.g1(); } np(elements) { return this.lp_1.w2(elements); } w2(elements) { return this.np(elements); } i1(index) { return this.lp_1.i1(index); } op(element) { return this.lp_1.t1(element); } t1(element) { if (!(element instanceof JsonElement)) return -1; return this.op(element instanceof JsonElement ? element : THROW_CCE()); } pp(element) { return this.lp_1.x2(element); } x2(element) { if (!(element instanceof JsonElement)) return -1; return this.pp(element instanceof JsonElement ? element : THROW_CCE()); } y2() { return this.lp_1.y2(); } q1(index) { return this.lp_1.q1(index); } z2(fromIndex, toIndex) { return this.lp_1.z2(fromIndex, toIndex); } asJsReadonlyArrayView() { return this.lp_1.asJsReadonlyArrayView(); } h1() { return this.lp_1.h1(); } } class JsonLiteral extends JsonPrimitive { constructor(body, isString, coerceToInlineType) { coerceToInlineType = coerceToInlineType === VOID ? null : coerceToInlineType; super(); this.qp_1 = isString; this.rp_1 = coerceToInlineType; this.sp_1 = toString(body); if (!(this.rp_1 == null)) { // Inline function 'kotlin.require' call // Inline function 'kotlin.require' call if (!this.rp_1.vm()) { var message = 'Failed requirement.'; throw IllegalArgumentException.f1(toString(message)); } } } jp() { return this.qp_1; } kp() { return this.sp_1; } toString() { var tmp; if (this.qp_1) { // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder.s(); printQuoted(this_0, this.sp_1); tmp = this_0.toString(); } else { tmp = this.sp_1; } return tmp; } equals(other) { if (this === other) return true; if (other == null || !getKClassFromExpression(this).equals(getKClassFromExpression(other))) return false; if (!(other instanceof JsonLiteral)) THROW_CCE(); if (!(this.qp_1 === other.qp_1)) return false; if (!(this.sp_1 === other.sp_1)) return false; return true; } hashCode() { var result = getBooleanHashCode(this.qp_1); result = imul(31, result) + getStringHashCode(this.sp_1) | 0; return result; } } class JsonEncoder {} class JsonException extends SerializationException { static lq(message) { var $this = this.sm(message); captureStack($this, $this.kq_1); return $this; } } class JsonDecodingException extends JsonException { static fq(message) { var $this = this.lq(message); captureStack($this, $this.eq_1); return $this; } } class Tombstone {} class JsonPath { constructor() { var tmp = this; // Inline function 'kotlin.arrayOfNulls' call tmp.mq_1 = Array(8); var tmp_0 = this; var tmp_1 = 0; var tmp_2 = new Int32Array(8); while (tmp_1 < 8) { tmp_2[tmp_1] = -1; tmp_1 = tmp_1 + 1 | 0; } tmp_0.nq_1 = tmp_2; this.oq_1 = -1; } pq() { // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder.s(); this_0.ya('$'); // Inline function 'kotlin.repeat' call var times = this.oq_1 + 1 | 0; var inductionVariable = 0; if (inductionVariable < times) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var element = this.mq_1[index]; if (!(element == null) ? isInterface(element, SerialDescriptor) : false) { if (equals(element.um(), LIST_getInstance())) { if (!(this.nq_1[index] === -1)) { this_0.ya('['); this_0.te(this.nq_1[index]); this_0.ya(']'); } } else { var idx = this.nq_1[index]; if (idx >= 0) { this_0.ya('.'); this_0.ya(element.xm(idx)); } } } else { if (!(element === Tombstone_instance)) { this_0.ya('['); this_0.ya("'"); this_0.xa(element); this_0.ya("'"); this_0.ya(']'); } } } while (inductionVariable < times); return this_0.toString(); } toString() { return this.pq(); } } class AbstractJsonLexer { constructor() { this.tp_1 = 0; this.up_1 = new JsonPath(); this.vp_1 = null; this.wp_1 = StringBuilder.s(); } uq() { } xq(startPos, endPos) { // Inline function 'kotlin.text.substring' call var this_0 = this.tq(); return toString(charSequenceSubSequence(this_0, startPos, endPos)); } consumeString2(source, startPosition, current) { var currentPosition = current; var lastPosition = startPosition; var char = charSequenceGet(source, currentPosition); var usedAppend = false; while (!(char === _Char___init__impl__6a9atx(34))) { if (char === _Char___init__impl__6a9atx(92)) { usedAppend = true; currentPosition = this.rq(appendEscape(this, lastPosition, currentPosition)); if (currentPosition === -1) { this.sq('Unexpected EOF', currentPosition); } lastPosition = currentPosition; } else { currentPosition = currentPosition + 1 | 0; if (currentPosition >= charSequenceLength(source)) { usedAppend = true; this.qq(lastPosition, currentPosition); currentPosition = this.rq(currentPosition); if (currentPosition === -1) { this.sq('Unexpected EOF', currentPosition); } lastPosition = currentPosition; } } char = charSequenceGet(source, currentPosition); } var tmp; if (!usedAppend) { tmp = this.xq(lastPosition, currentPosition); } else { tmp = decodedString(this, lastPosition, currentPosition); } var string = tmp; this.tp_1 = currentPosition + 1 | 0; return string; } qq(fromIndex, toIndex) { this.wp_1.re(this.tq(), fromIndex, toIndex); } toString() { return "JsonReader(source='" + toString(this.tq()) + "', currentPosition=" + this.tp_1 + ')'; } yq(message, position, hint) { var tmp; // Inline function 'kotlin.text.isEmpty' call if (charSequenceLength(hint) === 0) { tmp = ''; } else { tmp = '\n' + hint; } var hintMessage = tmp; throw JsonDecodingException_0(position, message + ' at path: ' + this.up_1.pq() + hintMessage, this.tq()); } sq(message, position, hint, $super) { position = position === VOID ? this.tp_1 : position; hint = hint === VOID ? '' : hint; return $super === VOID ? this.yq(message, position, hint) : $super.yq.call(this, message, position, hint); } zq() { var current = this.wq(); current = this.rq(current); if (current >= charSequenceLength(this.tq()) || current === -1) { this.sq('EOF'); } var tmp; if (charSequenceGet(this.tq(), current) === _Char___init__impl__6a9atx(34)) { current = current + 1 | 0; if (current === charSequenceLength(this.tq())) { this.sq('EOF'); } tmp = true; } else { tmp = false; } var hasQuotation = tmp; var accumulator = 0n; var exponentAccumulator = 0n; var isNegative = false; var isExponentPositive = false; var hasExponent = false; var start = current; $l$loop_4: while (!(current === charSequenceLength(this.tq()))) { var ch = charSequenceGet(this.tq(), current); if ((ch === _Char___init__impl__6a9atx(101) || ch === _Char___init__impl__6a9atx(69)) && !hasExponent) { if (current === start) { this.sq('Unexpected symbol ' + toString_0(ch) + ' in numeric literal'); } isExponentPositive = true; hasExponent = true; current = current + 1 | 0; continue $l$loop_4; } if (ch === _Char___init__impl__6a9atx(45) && hasExponent) { if (current === start) { this.sq("Unexpected symbol '-' in numeric literal"); } isExponentPositive = false; current = current + 1 | 0; continue $l$loop_4; } if (ch === _Char___init__impl__6a9atx(43) && hasExponent) { if (current === start) { this.sq("Unexpected symbol '+' in numeric literal"); } isExponentPositive = true; current = current + 1 | 0; continue $l$loop_4; } if (ch === _Char___init__impl__6a9atx(45)) { if (!(current === start)) { this.sq("Unexpected symbol '-' in numeric literal"); } isNegative = true; current = current + 1 | 0; continue $l$loop_4; } var token = charToTokenClass(ch); if (!(token === 0)) break $l$loop_4; current = current + 1 | 0; var digit = Char__minus_impl_a2frrh(ch, _Char___init__impl__6a9atx(48)); if (!(0 <= digit ? digit <= 9 : false)) { this.sq("Unexpected symbol '" + toString_0(ch) + "' in numeric literal"); } if (hasExponent) { // Inline function 'kotlin.Long.times' call var this_0 = exponentAccumulator; // Inline function 'kotlin.Long.plus' call var this_1 = multiply(this_0, fromInt(10)); exponentAccumulator = add(this_1, fromInt(digit)); continue $l$loop_4; } // Inline function 'kotlin.Long.times' call var this_2 = accumulator; // Inline function 'kotlin.Long.minus' call var this_3 = multiply(this_2, fromInt(10)); accumulator = subtract(this_3, fromInt(digit)); if (accumulator > 0n) { this.sq('Numeric value overflow'); } } var hasChars = !(current === start); if (start === current || (isNegative && start === (current - 1 | 0))) { this.sq('Expected numeric literal'); } if (hasQuotation) { if (!hasChars) { this.sq('EOF'); } if (!(charSequenceGet(this.tq(), current) === _Char___init__impl__6a9atx(34))) { this.sq('Expected closing quotation mark'); } current = current + 1 | 0; } this.tp_1 = current; if (hasExponent) { var doubleAccumulator = toNumber(accumulator) * consumeNumericLiteral$calculateExponent(exponentAccumulator, isExponentPositive); if (doubleAccumulator > toNumber(9223372036854775807n) || doubleAccumulator < toNumber(-9223372036854775808n)) { this.sq('Numeric value overflow'); } // Inline function 'kotlin.math.floor' call if (!(Math.floor(doubleAccumulator) === doubleAccumulator)) { this.sq("Can't convert " + doubleAccumulator + ' to Long'); } accumulator = numberToLong(doubleAccumulator); } var tmp_0; if (isNegative) { tmp_0 = accumulator; } else if (!(accumulator === -9223372036854775808n)) { tmp_0 = negate(accumulator); } else { this.sq('Numeric value overflow'); } return tmp_0; } xp() { var result = this.zq(); var next = this.vq(); if (!(next === 10)) { // Inline function 'kotlinx.serialization.json.internal.AbstractJsonLexer.fail' call var expected = tokenDescription(10); var position = true ? this.tp_1 - 1 | 0 : this.tp_1; var s = this.tp_1 === charSequenceLength(this.tq()) || position < 0 ? 'EOF' : toString_0(charSequenceGet(this.tq(), position)); var tmp$ret$0 = "Expected input to contain a single valid number, but got '" + s + "' after it"; this.sq(tmp$ret$0, position); } return result; } } class CharMappings { constructor() { CharMappings_instance = this; this.ar_1 = charArray(117); this.br_1 = new Int8Array(126); initEscape(this); initCharToToken(this); } } class StringJsonLexer extends AbstractJsonLexer { constructor(source) { super(); this.gr_1 = source; } tq() { return this.gr_1; } rq(position) { return position < this.tq().length ? position : -1; } vq() { var source = this.tq(); var cpos = this.tp_1; $l$loop: while (!(cpos === -1) && cpos < source.length) { var _unary__edvuaz = cpos; cpos = _unary__edvuaz + 1 | 0; var c = charCodeAt(source, _unary__edvuaz); // Inline function 'kotlinx.serialization.json.internal.AbstractJsonLexer.isWs' call if (c === _Char___init__impl__6a9atx(32) || c === _Char___init__impl__6a9atx(10) || c === _Char___init__impl__6a9atx(13) || c === _Char___init__impl__6a9atx(9)) continue $l$loop; this.tp_1 = cpos; return charToTokenClass(c); } this.tp_1 = source.length; return 10; } wq() { var current = this.tp_1; if (current === -1) return current; var source = this.tq(); $l$loop: while (current < source.length) { var c = charCodeAt(source, current); // Inline function 'kotlinx.serialization.json.internal.AbstractJsonLexer.isWs' call if (c === _Char___init__impl__6a9atx(32) || c === _Char___init__impl__6a9atx(10) || c === _Char___init__impl__6a9atx(13) || c === _Char___init__impl__6a9atx(9)) { current = current + 1 | 0; } else { break $l$loop; } } this.tp_1 = current; return current; } } //endregion var jsonUnquotedLiteralDescriptor; var Companion_instance; function Companion_getInstance() { return Companion_instance; } function JsonObject$toString$lambda(_destruct__k2r9zo) { // Inline function 'kotlin.collections.component1' call var k = _destruct__k2r9zo.a2(); // Inline function 'kotlin.collections.component2' call var v = _destruct__k2r9zo.b2(); // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder.s(); printQuoted(this_0, k); this_0.za(_Char___init__impl__6a9atx(58)); this_0.xa(v); return this_0.toString(); } var Companion_instance_0; function Companion_getInstance_0() { return Companion_instance_0; } var JsonNull_instance; function JsonNull_getInstance() { if (JsonNull_instance === VOID) new JsonNull(); return JsonNull_instance; } var Companion_instance_1; function Companion_getInstance_1() { return Companion_instance_1; } function JsonPrimitive_0(value) { _init_properties_JsonElement_kt__7cbdc2(); if (value == null) return JsonNull_getInstance(); return new JsonLiteral(value, true); } function JsonPrimitive_1(value) { _init_properties_JsonElement_kt__7cbdc2(); if (value == null) return JsonNull_getInstance(); return new JsonLiteral(value, false); } function JsonPrimitive_2(value) { _init_properties_JsonElement_kt__7cbdc2(); if (value == null) return JsonNull_getInstance(); return new JsonLiteral(value, false); } var Companion_instance_2; function Companion_getInstance_2() { return Companion_instance_2; } function get_jsonPrimitive(_this__u8e3s4) { _init_properties_JsonElement_kt__7cbdc2(); var tmp0_elvis_lhs = _this__u8e3s4 instanceof JsonPrimitive ? _this__u8e3s4 : null; var tmp; if (tmp0_elvis_lhs == null) { error(_this__u8e3s4, 'JsonPrimitive'); } else { tmp = tmp0_elvis_lhs; } return tmp; } function get_boolean(_this__u8e3s4) { _init_properties_JsonElement_kt__7cbdc2(); var tmp0_elvis_lhs = toBooleanStrictOrNull(_this__u8e3s4.kp()); var tmp; if (tmp0_elvis_lhs == null) { throw IllegalStateException.t4(_this__u8e3s4.toString() + ' does not represent a Boolean'); } else { tmp = tmp0_elvis_lhs; } return tmp; } function get_doubleOrNull(_this__u8e3s4) { _init_properties_JsonElement_kt__7cbdc2(); return toDoubleOrNull(_this__u8e3s4.kp()); } function get_longOrNull(_this__u8e3s4) { _init_properties_JsonElement_kt__7cbdc2(); // Inline function 'kotlinx.serialization.json.exceptionToNull' call var tmp; try { tmp = parseLongImpl(_this__u8e3s4); } catch ($p) { var tmp_0; if ($p instanceof JsonDecodingException) { var e = $p; tmp_0 = null; } else { throw $p; } tmp = tmp_0; } return tmp; } function get_intOrNull(_this__u8e3s4) { _init_properties_JsonElement_kt__7cbdc2(); // Inline function 'kotlinx.serialization.json.exceptionToNull' call var tmp; try { tmp = parseLongImpl(_this__u8e3s4); } catch ($p) { var tmp_0; if ($p instanceof JsonDecodingException) { var e = $p; tmp_0 = null; } else { throw $p; } tmp = tmp_0; } var tmp0_elvis_lhs = tmp; var tmp_1; if (tmp0_elvis_lhs == null) { return null; } else { tmp_1 = tmp0_elvis_lhs; } var result = tmp_1; // Inline function 'kotlin.ranges.contains' call var this_0 = numberRangeToNumber(-2147483648, 2147483647); if (!contains(isInterface(this_0, ClosedRange) ? this_0 : THROW_CCE(), result)) return null; return convertToInt(result); } function error(_this__u8e3s4, element) { _init_properties_JsonElement_kt__7cbdc2(); throw IllegalArgumentException.f1('Element ' + toString(getKClassFromExpression(_this__u8e3s4)) + ' is not a ' + element); } function parseLongImpl(_this__u8e3s4) { _init_properties_JsonElement_kt__7cbdc2(); return (new StringJsonLexer(_this__u8e3s4.kp())).xp(); } var properties_initialized_JsonElement_kt_abxy8s; function _init_properties_JsonElement_kt__7cbdc2() { if (!properties_initialized_JsonElement_kt_abxy8s) { properties_initialized_JsonElement_kt_abxy8s = true; jsonUnquotedLiteralDescriptor = InlinePrimitiveDescriptor('kotlinx.serialization.json.JsonUnquotedLiteral', serializer(StringCompanionObject_instance)); } } function JsonDecodingException_0(offset, message, input) { return JsonDecodingException_1(offset, message + '\nJSON input: ' + toString(minify(input, offset))); } function JsonDecodingException_1(offset, message) { return JsonDecodingException.fq(offset >= 0 ? 'Unexpected JSON token at offset ' + offset + ': ' + message : message); } function minify(_this__u8e3s4, offset) { offset = offset === VOID ? -1 : offset; if (charSequenceLength(_this__u8e3s4) < 200) return _this__u8e3s4; if (offset === -1) { var start = charSequenceLength(_this__u8e3s4) - 60 | 0; if (start <= 0) return _this__u8e3s4; // Inline function 'kotlin.text.substring' call var endIndex = charSequenceLength(_this__u8e3s4); return '.....' + toString(charSequenceSubSequence(_this__u8e3s4, start, endIndex)); } var start_0 = offset - 30 | 0; var end = offset + 30 | 0; var prefix = start_0 <= 0 ? '' : '.....'; var suffix = end >= charSequenceLength(_this__u8e3s4) ? '' : '.....'; var tmp2 = coerceAtLeast(start_0, 0); // Inline function 'kotlin.text.substring' call var endIndex_0 = coerceAtMost(end, charSequenceLength(_this__u8e3s4)); return prefix + toString(charSequenceSubSequence(_this__u8e3s4, tmp2, endIndex_0)) + suffix; } var Tombstone_instance; function Tombstone_getInstance() { return Tombstone_instance; } function get_ESCAPE_STRINGS() { _init_properties_StringOps_kt__fcy1db(); return ESCAPE_STRINGS; } var ESCAPE_STRINGS; var ESCAPE_MARKERS; function printQuoted(_this__u8e3s4, value) { _init_properties_StringOps_kt__fcy1db(); _this__u8e3s4.za(_Char___init__impl__6a9atx(34)); var lastPos = 0; var inductionVariable = 0; var last = charSequenceLength(value) - 1 | 0; if (inductionVariable <= last) do { var i = inductionVariable; inductionVariable = inductionVariable + 1 | 0; // Inline function 'kotlin.code' call var this_0 = charCodeAt(value, i); var c = Char__toInt_impl_vasixd(this_0); if (c < get_ESCAPE_STRINGS().length && !(get_ESCAPE_STRINGS()[c] == null)) { _this__u8e3s4.re(value, lastPos, i); _this__u8e3s4.ya(get_ESCAPE_STRINGS()[c]); lastPos = i + 1 | 0; } } while (inductionVariable <= last); if (!(lastPos === 0)) _this__u8e3s4.re(value, lastPos, value.length); else _this__u8e3s4.ya(value); _this__u8e3s4.za(_Char___init__impl__6a9atx(34)); } function toBooleanStrictOrNull(_this__u8e3s4) { _init_properties_StringOps_kt__fcy1db(); return equals_0(_this__u8e3s4, 'true', true) ? true : equals_0(_this__u8e3s4, 'false', true) ? false : null; } function toHexChar(i) { _init_properties_StringOps_kt__fcy1db(); var d = i & 15; var tmp; if (d < 10) { // Inline function 'kotlin.code' call var this_0 = _Char___init__impl__6a9atx(48); var tmp$ret$0 = Char__toInt_impl_vasixd(this_0); tmp = numberToChar(d + tmp$ret$0 | 0); } else { var tmp_0 = d - 10 | 0; // Inline function 'kotlin.code' call var this_1 = _Char___init__impl__6a9atx(97); var tmp$ret$1 = Char__toInt_impl_vasixd(this_1); tmp = numberToChar(tmp_0 + tmp$ret$1 | 0); } return tmp; } var properties_initialized_StringOps_kt_wzaea7; function _init_properties_StringOps_kt__fcy1db() { if (!properties_initialized_StringOps_kt_wzaea7) { properties_initialized_StringOps_kt_wzaea7 = true; // Inline function 'kotlin.arrayOfNulls' call // Inline function 'kotlin.apply' call var this_0 = Array(93); var inductionVariable = 0; if (inductionVariable <= 31) do { var c = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var c1 = toHexChar(c >> 12); var c2 = toHexChar(c >> 8); var c3 = toHexChar(c >> 4); var c4 = toHexChar(c); this_0[c] = '\\u' + toString_0(c1) + toString_0(c2) + toString_0(c3) + toString_0(c4); } while (inductionVariable <= 31); // Inline function 'kotlin.code' call var this_1 = _Char___init__impl__6a9atx(34); this_0[Char__toInt_impl_vasixd(this_1)] = '\\"'; // Inline function 'kotlin.code' call var this_2 = _Char___init__impl__6a9atx(92); this_0[Char__toInt_impl_vasixd(this_2)] = '\\\\'; // Inline function 'kotlin.code' call var this_3 = _Char___init__impl__6a9atx(9); this_0[Char__toInt_impl_vasixd(this_3)] = '\\t'; // Inline function 'kotlin.code' call var this_4 = _Char___init__impl__6a9atx(8); this_0[Char__toInt_impl_vasixd(this_4)] = '\\b'; // Inline function 'kotlin.code' call var this_5 = _Char___init__impl__6a9atx(10); this_0[Char__toInt_impl_vasixd(this_5)] = '\\n'; // Inline function 'kotlin.code' call var this_6 = _Char___init__impl__6a9atx(13); this_0[Char__toInt_impl_vasixd(this_6)] = '\\r'; this_0[12] = '\\f'; ESCAPE_STRINGS = this_0; // Inline function 'kotlin.apply' call var this_7 = new Int8Array(93); var inductionVariable_0 = 0; if (inductionVariable_0 <= 31) do { var c_0 = inductionVariable_0; inductionVariable_0 = inductionVariable_0 + 1 | 0; this_7[c_0] = 1; } while (inductionVariable_0 <= 31); // Inline function 'kotlin.code' call var this_8 = _Char___init__impl__6a9atx(34); var tmp = Char__toInt_impl_vasixd(this_8); // Inline function 'kotlin.code' call var this_9 = _Char___init__impl__6a9atx(34); var tmp$ret$1 = Char__toInt_impl_vasixd(this_9); this_7[tmp] = toByte(tmp$ret$1); // Inline function 'kotlin.code' call var this_10 = _Char___init__impl__6a9atx(92); var tmp_0 = Char__toInt_impl_vasixd(this_10); // Inline function 'kotlin.code' call var this_11 = _Char___init__impl__6a9atx(92); var tmp$ret$3 = Char__toInt_impl_vasixd(this_11); this_7[tmp_0] = toByte(tmp$ret$3); // Inline function 'kotlin.code' call var this_12 = _Char___init__impl__6a9atx(9); var tmp_1 = Char__toInt_impl_vasixd(this_12); // Inline function 'kotlin.code' call var this_13 = _Char___init__impl__6a9atx(116); var tmp$ret$5 = Char__toInt_impl_vasixd(this_13); this_7[tmp_1] = toByte(tmp$ret$5); // Inline function 'kotlin.code' call var this_14 = _Char___init__impl__6a9atx(8); var tmp_2 = Char__toInt_impl_vasixd(this_14); // Inline function 'kotlin.code' call var this_15 = _Char___init__impl__6a9atx(98); var tmp$ret$7 = Char__toInt_impl_vasixd(this_15); this_7[tmp_2] = toByte(tmp$ret$7); // Inline function 'kotlin.code' call var this_16 = _Char___init__impl__6a9atx(10); var tmp_3 = Char__toInt_impl_vasixd(this_16); // Inline function 'kotlin.code' call var this_17 = _Char___init__impl__6a9atx(110); var tmp$ret$9 = Char__toInt_impl_vasixd(this_17); this_7[tmp_3] = toByte(tmp$ret$9); // Inline function 'kotlin.code' call var this_18 = _Char___init__impl__6a9atx(13); var tmp_4 = Char__toInt_impl_vasixd(this_18); // Inline function 'kotlin.code' call var this_19 = _Char___init__impl__6a9atx(114); var tmp$ret$11 = Char__toInt_impl_vasixd(this_19); this_7[tmp_4] = toByte(tmp$ret$11); // Inline function 'kotlin.code' call var this_20 = _Char___init__impl__6a9atx(102); var tmp$ret$12 = Char__toInt_impl_vasixd(this_20); this_7[12] = toByte(tmp$ret$12); ESCAPE_MARKERS = this_7; } } function appendEscape($this, lastPosition, current) { $this.qq(lastPosition, current); return appendEsc($this, current + 1 | 0); } function decodedString($this, lastPosition, currentPosition) { $this.qq(lastPosition, currentPosition); var result = $this.wp_1.toString(); $this.wp_1.ue(0); return result; } function appendEsc($this, startPosition) { var currentPosition = startPosition; currentPosition = $this.rq(currentPosition); if (currentPosition === -1) { $this.sq('Expected escape sequence to continue, got EOF'); } var tmp = $this.tq(); var _unary__edvuaz = currentPosition; currentPosition = _unary__edvuaz + 1 | 0; var currentChar = charSequenceGet(tmp, _unary__edvuaz); if (currentChar === _Char___init__impl__6a9atx(117)) { return appendHex($this, $this.tq(), currentPosition); } // Inline function 'kotlin.code' call var tmp$ret$0 = Char__toInt_impl_vasixd(currentChar); var c = escapeToChar(tmp$ret$0); if (c === _Char___init__impl__6a9atx(0)) { $this.sq("Invalid escaped char '" + toString_0(currentChar) + "'"); } $this.wp_1.za(c); return currentPosition; } function appendHex($this, source, startPos) { if ((startPos + 4 | 0) >= charSequenceLength(source)) { $this.tp_1 = startPos; $this.uq(); if (($this.tp_1 + 4 | 0) >= charSequenceLength(source)) { $this.sq('Unexpected EOF during unicode escape'); } return appendHex($this, source, $this.tp_1); } $this.wp_1.za(numberToChar((((fromHexChar($this, source, startPos) << 12) + (fromHexChar($this, source, startPos + 1 | 0) << 8) | 0) + (fromHexChar($this, source, startPos + 2 | 0) << 4) | 0) + fromHexChar($this, source, startPos + 3 | 0) | 0)); return startPos + 4 | 0; } function fromHexChar($this, source, currentPosition) { var character = charSequenceGet(source, currentPosition); var tmp; if (_Char___init__impl__6a9atx(48) <= character ? character <= _Char___init__impl__6a9atx(57) : false) { // Inline function 'kotlin.code' call var tmp_0 = Char__toInt_impl_vasixd(character); // Inline function 'kotlin.code' call var this_0 = _Char___init__impl__6a9atx(48); tmp = tmp_0 - Char__toInt_impl_vasixd(this_0) | 0; } else if (_Char___init__impl__6a9atx(97) <= character ? character <= _Char___init__impl__6a9atx(102) : false) { // Inline function 'kotlin.code' call var tmp_1 = Char__toInt_impl_vasixd(character); // Inline function 'kotlin.code' call var this_1 = _Char___init__impl__6a9atx(97); tmp = (tmp_1 - Char__toInt_impl_vasixd(this_1) | 0) + 10 | 0; } else if (_Char___init__impl__6a9atx(65) <= character ? character <= _Char___init__impl__6a9atx(70) : false) { // Inline function 'kotlin.code' call var tmp_2 = Char__toInt_impl_vasixd(character); // Inline function 'kotlin.code' call var this_2 = _Char___init__impl__6a9atx(65); tmp = (tmp_2 - Char__toInt_impl_vasixd(this_2) | 0) + 10 | 0; } else { $this.sq("Invalid toHexChar char '" + toString_0(character) + "' in unicode escape"); } return tmp; } function consumeNumericLiteral$calculateExponent(exponentAccumulator, isExponentPositive) { var tmp; switch (isExponentPositive) { case false: // Inline function 'kotlin.math.pow' call var x = -toNumber(exponentAccumulator); tmp = Math.pow(10.0, x); break; case true: // Inline function 'kotlin.math.pow' call var x_0 = toNumber(exponentAccumulator); tmp = Math.pow(10.0, x_0); break; default: noWhenBranchMatchedException(); break; } return tmp; } function charToTokenClass(c) { var tmp; // Inline function 'kotlin.code' call if (Char__toInt_impl_vasixd(c) < 126) { var tmp_0 = CharMappings_getInstance().br_1; // Inline function 'kotlin.code' call tmp = tmp_0[Char__toInt_impl_vasixd(c)]; } else { tmp = 0; } return tmp; } function tokenDescription(token) { return token === 1 ? "quotation mark '\"'" : token === 2 ? "string escape sequence '\\'" : token === 4 ? "comma ','" : token === 5 ? "colon ':'" : token === 6 ? "start of the object '{'" : token === 7 ? "end of the object '}'" : token === 8 ? "start of the array '['" : token === 9 ? "end of the array ']'" : token === 10 ? 'end of the input' : token === 127 ? 'invalid token' : 'valid token'; } function escapeToChar(c) { return c < 117 ? CharMappings_getInstance().ar_1[c] : _Char___init__impl__6a9atx(0); } function initEscape($this) { var inductionVariable = 0; if (inductionVariable <= 31) do { var i = inductionVariable; inductionVariable = inductionVariable + 1 | 0; initC2ESC($this, i, _Char___init__impl__6a9atx(117)); } while (inductionVariable <= 31); initC2ESC($this, 8, _Char___init__impl__6a9atx(98)); initC2ESC($this, 9, _Char___init__impl__6a9atx(116)); initC2ESC($this, 10, _Char___init__impl__6a9atx(110)); initC2ESC($this, 12, _Char___init__impl__6a9atx(102)); initC2ESC($this, 13, _Char___init__impl__6a9atx(114)); initC2ESC_0($this, _Char___init__impl__6a9atx(47), _Char___init__impl__6a9atx(47)); initC2ESC_0($this, _Char___init__impl__6a9atx(34), _Char___init__impl__6a9atx(34)); initC2ESC_0($this, _Char___init__impl__6a9atx(92), _Char___init__impl__6a9atx(92)); } function initCharToToken($this) { var inductionVariable = 0; if (inductionVariable <= 32) do { var i = inductionVariable; inductionVariable = inductionVariable + 1 | 0; initC2TC($this, i, 127); } while (inductionVariable <= 32); initC2TC($this, 9, 3); initC2TC($this, 10, 3); initC2TC($this, 13, 3); initC2TC($this, 32, 3); initC2TC_0($this, _Char___init__impl__6a9atx(44), 4); initC2TC_0($this, _Char___init__impl__6a9atx(58), 5); initC2TC_0($this, _Char___init__impl__6a9atx(123), 6); initC2TC_0($this, _Char___init__impl__6a9atx(125), 7); initC2TC_0($this, _Char___init__impl__6a9atx(91), 8); initC2TC_0($this, _Char___init__impl__6a9atx(93), 9); initC2TC_0($this, _Char___init__impl__6a9atx(34), 1); initC2TC_0($this, _Char___init__impl__6a9atx(92), 2); } function initC2ESC($this, c, esc) { if (!(esc === _Char___init__impl__6a9atx(117))) { // Inline function 'kotlin.code' call var tmp$ret$0 = Char__toInt_impl_vasixd(esc); $this.ar_1[tmp$ret$0] = numberToChar(c); } } function initC2ESC_0($this, c, esc) { // Inline function 'kotlin.code' call var tmp$ret$0 = Char__toInt_impl_vasixd(c); return initC2ESC($this, tmp$ret$0, esc); } function initC2TC($this, c, cl) { $this.br_1[c] = cl; } function initC2TC_0($this, c, cl) { // Inline function 'kotlin.code' call var tmp$ret$0 = Char__toInt_impl_vasixd(c); return initC2TC($this, tmp$ret$0, cl); } var CharMappings_instance; function CharMappings_getInstance() { if (CharMappings_instance === VOID) new CharMappings(); return CharMappings_instance; } //region block: post-declaration initMetadataForInterface(JsonDecoder, 'JsonDecoder'); initMetadataForCompanion(Companion); initMetadataForClass(JsonElement, 'JsonElement'); initMetadataForClass(JsonObject, 'JsonObject', VOID, VOID, [JsonElement, KtMap]); initMetadataForCompanion(Companion_0); initMetadataForClass(JsonPrimitive, 'JsonPrimitive'); initMetadataForObject(JsonNull, 'JsonNull'); initMetadataForCompanion(Companion_1); initMetadataForCompanion(Companion_2); initMetadataForClass(JsonArray, 'JsonArray', VOID, VOID, [JsonElement, KtList]); initMetadataForClass(JsonLiteral, 'JsonLiteral'); initMetadataForInterface(JsonEncoder, 'JsonEncoder'); initMetadataForClass(JsonException, 'JsonException'); initMetadataForClass(JsonDecodingException, 'JsonDecodingException'); initMetadataForObject(Tombstone, 'Tombstone'); initMetadataForClass(JsonPath, 'JsonPath', JsonPath); initMetadataForClass(AbstractJsonLexer, 'AbstractJsonLexer'); initMetadataForObject(CharMappings, 'CharMappings'); initMetadataForClass(StringJsonLexer, 'StringJsonLexer'); //endregion //region block: init Companion_instance = new Companion(); Companion_instance_0 = new Companion_0(); Companion_instance_1 = new Companion_1(); Companion_instance_2 = new Companion_2(); Tombstone_instance = new Tombstone(); //endregion //region block: exports export { JsonNull_getInstance as JsonNull_getInstance2gh8fwl8w0wl7, JsonArray as JsonArray2urf8ey7u44sd, JsonDecoder as JsonDecoder1rijst5ne6qla, JsonEncoder as JsonEncoder1qlse6simkfi1, JsonNull as JsonNull2liwjj96vm0w2, JsonObject as JsonObjectee06ihoeeiqj, JsonPrimitive_0 as JsonPrimitiveolttw629wj53, JsonPrimitive_2 as JsonPrimitive2fp8648nd60dn, JsonPrimitive_1 as JsonPrimitive1xkjzc5d7ihuv, JsonPrimitive as JsonPrimitive3ttzjh2ft5dnx, get_boolean as get_boolean37ml8jnzy6rg3, get_doubleOrNull as get_doubleOrNull2fo14gjg922um, get_intOrNull as get_intOrNulld29i64b3udf, get_jsonPrimitive as get_jsonPrimitivez17tyd5rw1ql, get_longOrNull as get_longOrNull1kg1ha9scz5pa, }; //endregion //# sourceMappingURL=kotlinx-serialization-kotlinx-serialization-json.mjs.map