@parcel/codeframe 2.8.2 → 2.8.4-nightly.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/codeframe.js +13 -39
- package/lib/codeframe.js.map +1 -1
- package/package.json +3 -4
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
|
@@ -35740,9 +35740,9 @@ $5f04f11630a6945d$exports = ({ onlyFirst: onlyFirst = false } = {})=>{
|
|
35740
35740
|
$5e2cf9f740fe0527$exports = (string)=>typeof string === "string" ? string.replace($5f04f11630a6945d$exports(), "") : string;
|
35741
35741
|
|
35742
35742
|
|
35743
|
-
var $
|
35743
|
+
var $55a95b67e18839c0$exports = {};
|
35744
35744
|
/* eslint-disable yoda */ "use strict";
|
35745
|
-
const $
|
35745
|
+
const $55a95b67e18839c0$var$isFullwidthCodePoint = (codePoint)=>{
|
35746
35746
|
if (Number.isNaN(codePoint)) return false;
|
35747
35747
|
// Code points are derived from:
|
35748
35748
|
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
@@ -35764,8 +35764,8 @@ const $e19c725c5553b196$var$isFullwidthCodePoint = (codePoint)=>{
|
|
35764
35764
|
0x20000 <= codePoint && codePoint <= 0x3FFFD)) return true;
|
35765
35765
|
return false;
|
35766
35766
|
};
|
35767
|
-
$
|
35768
|
-
$
|
35767
|
+
$55a95b67e18839c0$exports = $55a95b67e18839c0$var$isFullwidthCodePoint;
|
35768
|
+
$55a95b67e18839c0$exports.default = $55a95b67e18839c0$var$isFullwidthCodePoint;
|
35769
35769
|
|
35770
35770
|
|
35771
35771
|
var $aaafc2d9fc2c7f45$exports = {};
|
@@ -35777,9 +35777,10 @@ $aaafc2d9fc2c7f45$exports = function() {
|
|
35777
35777
|
|
35778
35778
|
|
35779
35779
|
const $ae1b0396e51a6d8c$var$stringWidth = (string)=>{
|
35780
|
-
string = string.replace($aaafc2d9fc2c7f45$exports(), " ");
|
35781
35780
|
if (typeof string !== "string" || string.length === 0) return 0;
|
35782
35781
|
string = $5e2cf9f740fe0527$exports(string);
|
35782
|
+
if (string.length === 0) return 0;
|
35783
|
+
string = string.replace($aaafc2d9fc2c7f45$exports(), " ");
|
35783
35784
|
let width = 0;
|
35784
35785
|
for(let i = 0; i < string.length; i++){
|
35785
35786
|
const code = string.codePointAt(i);
|
@@ -35789,7 +35790,7 @@ const $ae1b0396e51a6d8c$var$stringWidth = (string)=>{
|
|
35789
35790
|
if (code >= 0x300 && code <= 0x36F) continue;
|
35790
35791
|
// Surrogates
|
35791
35792
|
if (code > 0xFFFF) i++;
|
35792
|
-
width += $
|
35793
|
+
width += $55a95b67e18839c0$exports(code) ? 2 : 1;
|
35793
35794
|
}
|
35794
35795
|
return width;
|
35795
35796
|
};
|
@@ -35800,33 +35801,6 @@ $ae1b0396e51a6d8c$exports.default = $ae1b0396e51a6d8c$var$stringWidth;
|
|
35800
35801
|
|
35801
35802
|
var $0ae586f9cf7cb410$exports = {};
|
35802
35803
|
"use strict";
|
35803
|
-
var $0926ce0154f25409$exports = {};
|
35804
|
-
/* eslint-disable yoda */ "use strict";
|
35805
|
-
const $0926ce0154f25409$var$isFullwidthCodePoint = (codePoint)=>{
|
35806
|
-
if (Number.isNaN(codePoint)) return false;
|
35807
|
-
// Code points are derived from:
|
35808
|
-
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
|
35809
|
-
if (codePoint >= 0x1100 && (codePoint <= 0x115F || // Hangul Jamo
|
35810
|
-
codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
|
35811
|
-
codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
|
35812
|
-
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
35813
|
-
0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
35814
|
-
0x3250 <= codePoint && codePoint <= 0x4DBF || // CJK Unified Ideographs .. Yi Radicals
|
35815
|
-
0x4E00 <= codePoint && codePoint <= 0xA4C6 || // Hangul Jamo Extended-A
|
35816
|
-
0xA960 <= codePoint && codePoint <= 0xA97C || // Hangul Syllables
|
35817
|
-
0xAC00 <= codePoint && codePoint <= 0xD7A3 || // CJK Compatibility Ideographs
|
35818
|
-
0xF900 <= codePoint && codePoint <= 0xFAFF || // Vertical Forms
|
35819
|
-
0xFE10 <= codePoint && codePoint <= 0xFE19 || // CJK Compatibility Forms .. Small Form Variants
|
35820
|
-
0xFE30 <= codePoint && codePoint <= 0xFE6B || // Halfwidth and Fullwidth Forms
|
35821
|
-
0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || // Kana Supplement
|
35822
|
-
0x1B000 <= codePoint && codePoint <= 0x1B001 || // Enclosed Ideographic Supplement
|
35823
|
-
0x1F200 <= codePoint && codePoint <= 0x1F251 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
35824
|
-
0x20000 <= codePoint && codePoint <= 0x3FFFD)) return true;
|
35825
|
-
return false;
|
35826
|
-
};
|
35827
|
-
$0926ce0154f25409$exports = $0926ce0154f25409$var$isFullwidthCodePoint;
|
35828
|
-
$0926ce0154f25409$exports.default = $0926ce0154f25409$var$isFullwidthCodePoint;
|
35829
|
-
|
35830
35804
|
|
35831
35805
|
var $84440f8e6725c936$exports = {};
|
35832
35806
|
"use strict";
|
@@ -35901,7 +35875,7 @@ $0ae586f9cf7cb410$exports = (string, begin, end)=>{
|
|
35901
35875
|
if (!isInsideEscape && !leftEscape) visible++;
|
35902
35876
|
if (!$84440f8e6725c936$exports({
|
35903
35877
|
exact: true
|
35904
|
-
}).test(character) && $
|
35878
|
+
}).test(character) && $55a95b67e18839c0$exports(character.codePointAt())) {
|
35905
35879
|
visible++;
|
35906
35880
|
if (typeof end !== "number") stringEnd++;
|
35907
35881
|
}
|