@@ -18788,8 +18788,10 @@ ${cb}` : comment;
1878818788 }
1878918789 }
1879018790 if (afterDoc) {
18791- Array.prototype.push.apply(doc.errors, this.errors);
18792- Array.prototype.push.apply(doc.warnings, this.warnings);
18791+ for (let i = 0; i < this.errors.length; ++i)
18792+ doc.errors.push(this.errors[i]);
18793+ for (let i = 0; i < this.warnings.length; ++i)
18794+ doc.warnings.push(this.warnings[i]);
1879318795 } else {
1879418796 doc.errors = this.errors;
1879518797 doc.warnings = this.warnings;
@@ -19488,7 +19490,7 @@ var Lexer = class {
1948819490 const n4 = (yield* __yieldStar(this.pushCount(1))) + (yield* __yieldStar(this.pushSpaces(true)));
1948919491 this.indentNext = this.indentValue + 1;
1949019492 this.indentValue += n4;
19491- return yield* __yieldStar(this.parseBlockStart()) ;
19493+ return "block-start" ;
1949219494 }
1949319495 return "doc";
1949419496 }
@@ -19787,28 +19789,38 @@ var Lexer = class {
1978719789 return 0;
1978819790 }
1978919791 *pushIndicators() {
19790- switch (this.charAt(0)) {
19791- case "!":
19792- return (yield* __yieldStar(this.pushTag())) + (yield* __yieldStar(this.pushSpaces(true))) + (yield* __yieldStar(this.pushIndicators()));
19793- case "&":
19794- return (yield* __yieldStar(this.pushUntil(isNotAnchorChar))) + (yield* __yieldStar(this.pushSpaces(true))) + (yield* __yieldStar(this.pushIndicators()));
19795- case "-":
19796- // this is an error
19797- case "?":
19798- // this is an error outside flow collections
19799- case ":": {
19800- const inFlow = this.flowLevel > 0;
19801- const ch1 = this.charAt(1);
19802- if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
19803- if (!inFlow)
19804- this.indentNext = this.indentValue + 1;
19805- else if (this.flowKey)
19806- this.flowKey = false;
19807- return (yield* __yieldStar(this.pushCount(1))) + (yield* __yieldStar(this.pushSpaces(true))) + (yield* __yieldStar(this.pushIndicators()));
19808- }
19809- }
19792+ let n4 = 0;
19793+ loop: while (true) {
19794+ switch (this.charAt(0)) {
19795+ case "!":
19796+ n4 += yield* __yieldStar(this.pushTag());
19797+ n4 += yield* __yieldStar(this.pushSpaces(true));
19798+ continue loop;
19799+ case "&":
19800+ n4 += yield* __yieldStar(this.pushUntil(isNotAnchorChar));
19801+ n4 += yield* __yieldStar(this.pushSpaces(true));
19802+ continue loop;
19803+ case "-":
19804+ // this is an error
19805+ case "?":
19806+ // this is an error outside flow collections
19807+ case ":": {
19808+ const inFlow = this.flowLevel > 0;
19809+ const ch1 = this.charAt(1);
19810+ if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
19811+ if (!inFlow)
19812+ this.indentNext = this.indentValue + 1;
19813+ else if (this.flowKey)
19814+ this.flowKey = false;
19815+ n4 += yield* __yieldStar(this.pushCount(1));
19816+ n4 += yield* __yieldStar(this.pushSpaces(true));
19817+ continue loop;
19818+ }
19819+ }
19820+ }
19821+ break loop;
1981019822 }
19811- return 0 ;
19823+ return n4 ;
1981219824 }
1981319825 *pushTag() {
1981419826 if (this.charAt(1) === "<") {
@@ -19954,6 +19966,13 @@ function getFirstKeyStartProps(prev) {
1995419966 }
1995519967 return prev.splice(i, prev.length);
1995619968}
19969+ function arrayPushArray(target, source) {
19970+ if (source.length < 1e5)
19971+ Array.prototype.push.apply(target, source);
19972+ else
19973+ for (let i = 0; i < source.length; ++i)
19974+ target.push(source[i]);
19975+ }
1995719976function fixFlowSeqItems(fc) {
1995819977 if (fc.start.type === "flow-seq-start") {
1995919978 for (const it of fc.items) {
@@ -19963,11 +19982,11 @@ function fixFlowSeqItems(fc) {
1996319982 delete it.key;
1996419983 if (isFlowToken(it.value)) {
1996519984 if (it.value.end)
19966- Array.prototype.push.apply (it.value.end, it.sep);
19985+ arrayPushArray (it.value.end, it.sep);
1996719986 else
1996819987 it.value.end = it.sep;
1996919988 } else
19970- Array.prototype.push.apply (it.start, it.sep);
19989+ arrayPushArray (it.start, it.sep);
1997119990 delete it.sep;
1997219991 }
1997319992 }
@@ -20321,7 +20340,7 @@ var Parser = class {
2032120340 const prev = map2.items[map2.items.length - 2];
2032220341 const end = (_a2 = prev == null ? void 0 : prev.value) == null ? void 0 : _a2.end;
2032320342 if (Array.isArray(end)) {
20324- Array.prototype.push.apply (end, it.start);
20343+ arrayPushArray (end, it.start);
2032520344 end.push(this.sourceToken);
2032620345 map2.items.pop();
2032720346 return;
@@ -20510,7 +20529,7 @@ var Parser = class {
2051020529 const prev = seq2.items[seq2.items.length - 2];
2051120530 const end = (_a2 = prev == null ? void 0 : prev.value) == null ? void 0 : _a2.end;
2051220531 if (Array.isArray(end)) {
20513- Array.prototype.push.apply (end, it.start);
20532+ arrayPushArray (end, it.start);
2051420533 end.push(this.sourceToken);
2051520534 seq2.items.pop();
2051620535 return;
0 commit comments