@parcel/codeframe 2.8.1 → 2.8.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/codeframe.js +7 -7
- package/lib/codeframe.js.map +1 -1
- package/package.json +2 -2
package/lib/codeframe.js
CHANGED
@@ -34555,9 +34555,9 @@ const $03b62e45aee69014$var$NO_MATCH = Symbol("nomatch");
|
|
34555
34555
|
if (match.type === "begin") return doBeginMatch(match);
|
34556
34556
|
else if (match.type === "illegal" && !ignoreIllegals) {
|
34557
34557
|
// illegal match, we do not continue processing
|
34558
|
-
/** @type {AnnotatedError} */ const
|
34559
|
-
|
34560
|
-
throw
|
34558
|
+
/** @type {AnnotatedError} */ const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || "<unnamed>") + '"');
|
34559
|
+
err.mode = top;
|
34560
|
+
throw err;
|
34561
34561
|
} else if (match.type === "end") {
|
34562
34562
|
const processed = doEndMatch(match);
|
34563
34563
|
if (processed !== $03b62e45aee69014$var$NO_MATCH) return processed;
|
@@ -34572,8 +34572,8 @@ const $03b62e45aee69014$var$NO_MATCH = Symbol("nomatch");
|
|
34572
34572
|
// parsing) still 3x behind our index then something is very wrong
|
34573
34573
|
// so we bail
|
34574
34574
|
if (iterations > 100000 && iterations > match.index * 3) {
|
34575
|
-
const
|
34576
|
-
throw
|
34575
|
+
const err = new Error("potential infinite loop, way more iterations than matches");
|
34576
|
+
throw err;
|
34577
34577
|
}
|
34578
34578
|
/*
|
34579
34579
|
Why might be find ourselves here? Only one occasion now. An end match that was
|
@@ -35928,12 +35928,12 @@ const $796233c1fee0ccb8$var$highlightSyntax = (txt, lang)=>{
|
|
35928
35928
|
};
|
35929
35929
|
function $796233c1fee0ccb8$export$2e2bcd8739ae039(code, highlights, inputOpts = {}) {
|
35930
35930
|
if (highlights.length < 1) return "";
|
35931
|
-
var
|
35931
|
+
var _inputOpts_maxLines;
|
35932
35932
|
let opts = {
|
35933
35933
|
useColor: !!inputOpts.useColor,
|
35934
35934
|
syntaxHighlighting: !!inputOpts.syntaxHighlighting,
|
35935
35935
|
language: inputOpts.language,
|
35936
|
-
maxLines: (
|
35936
|
+
maxLines: (_inputOpts_maxLines = inputOpts.maxLines) !== null && _inputOpts_maxLines !== void 0 ? _inputOpts_maxLines : 12,
|
35937
35937
|
terminalWidth: inputOpts.terminalWidth || $796233c1fee0ccb8$var$DEFAULT_TERMINAL_WIDTH,
|
35938
35938
|
padding: inputOpts.padding || {
|
35939
35939
|
before: 1,
|