@typescript-deploys/pr-build 5.6.0-pr-59048-32 → 5.6.0-pr-59106-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +696 -538
- package/lib/typescript.js +729 -559
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240702`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1084,7 +1084,7 @@ function findBestPatternMatch(values, getPattern, candidate) {
|
|
|
1084
1084
|
for (let i = 0; i < values.length; i++) {
|
|
1085
1085
|
const v = values[i];
|
|
1086
1086
|
const pattern = getPattern(v);
|
|
1087
|
-
if (pattern.prefix.length > longestMatchPrefixLength
|
|
1087
|
+
if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) {
|
|
1088
1088
|
longestMatchPrefixLength = pattern.prefix.length;
|
|
1089
1089
|
matchedValue = v;
|
|
1090
1090
|
}
|
|
@@ -8035,6 +8035,88 @@ var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
|
|
|
8035
8035
|
[64 /* UnicodeSets */, 99 /* RegularExpressionFlagsUnicodeSets */],
|
|
8036
8036
|
[128 /* Sticky */, 2 /* RegularExpressionFlagsSticky */]
|
|
8037
8037
|
]);
|
|
8038
|
+
var charcodeToTokenInfoCommon = [];
|
|
8039
|
+
var charcodeToTokenInfoUncommon = /* @__PURE__ */ new Map();
|
|
8040
|
+
for (let i = 0; i < 127 /* maxAsciiCharacter */; i++) {
|
|
8041
|
+
charcodeToTokenInfoCommon.push(0);
|
|
8042
|
+
}
|
|
8043
|
+
for (const [key, value] of [
|
|
8044
|
+
// Line Break Whitespace
|
|
8045
|
+
[10 /* lineFeed */, 1024 /* LineBreak */],
|
|
8046
|
+
[13 /* carriageReturn */, 1024 /* LineBreak */],
|
|
8047
|
+
// Single Line Whitespace
|
|
8048
|
+
[9 /* tab */, 512 /* Whitespace */],
|
|
8049
|
+
[11 /* verticalTab */, 512 /* Whitespace */],
|
|
8050
|
+
[12 /* formFeed */, 512 /* Whitespace */],
|
|
8051
|
+
[32 /* space */, 512 /* Whitespace */],
|
|
8052
|
+
[160 /* nonBreakingSpace */, 512 /* Whitespace */],
|
|
8053
|
+
[5760 /* ogham */, 512 /* Whitespace */],
|
|
8054
|
+
[8192 /* enQuad */, 512 /* Whitespace */],
|
|
8055
|
+
[8193 /* emQuad */, 512 /* Whitespace */],
|
|
8056
|
+
[8194 /* enSpace */, 512 /* Whitespace */],
|
|
8057
|
+
[8195 /* emSpace */, 512 /* Whitespace */],
|
|
8058
|
+
[8196 /* threePerEmSpace */, 512 /* Whitespace */],
|
|
8059
|
+
[8197 /* fourPerEmSpace */, 512 /* Whitespace */],
|
|
8060
|
+
[8198 /* sixPerEmSpace */, 512 /* Whitespace */],
|
|
8061
|
+
[8199 /* figureSpace */, 512 /* Whitespace */],
|
|
8062
|
+
[8200 /* punctuationSpace */, 512 /* Whitespace */],
|
|
8063
|
+
[8201 /* thinSpace */, 512 /* Whitespace */],
|
|
8064
|
+
[8202 /* hairSpace */, 512 /* Whitespace */],
|
|
8065
|
+
[8203 /* zeroWidthSpace */, 512 /* Whitespace */],
|
|
8066
|
+
[8239 /* narrowNoBreakSpace */, 512 /* Whitespace */],
|
|
8067
|
+
[8287 /* mathematicalSpace */, 512 /* Whitespace */],
|
|
8068
|
+
[12288 /* ideographicSpace */, 512 /* Whitespace */],
|
|
8069
|
+
[65279 /* byteOrderMark */, 512 /* Whitespace */],
|
|
8070
|
+
// Simple Single-Character Tokens
|
|
8071
|
+
[40 /* openParen */, 256 /* SimpleToken */ | 21 /* OpenParenToken */],
|
|
8072
|
+
[41 /* closeParen */, 256 /* SimpleToken */ | 22 /* CloseParenToken */],
|
|
8073
|
+
[44 /* comma */, 256 /* SimpleToken */ | 28 /* CommaToken */],
|
|
8074
|
+
[58 /* colon */, 256 /* SimpleToken */ | 59 /* ColonToken */],
|
|
8075
|
+
[59 /* semicolon */, 256 /* SimpleToken */ | 27 /* SemicolonToken */],
|
|
8076
|
+
[91 /* openBracket */, 256 /* SimpleToken */ | 23 /* OpenBracketToken */],
|
|
8077
|
+
[93 /* closeBracket */, 256 /* SimpleToken */ | 24 /* CloseBracketToken */],
|
|
8078
|
+
[123 /* openBrace */, 256 /* SimpleToken */ | 19 /* OpenBraceToken */],
|
|
8079
|
+
[125 /* closeBrace */, 256 /* SimpleToken */ | 20 /* CloseBraceToken */],
|
|
8080
|
+
[126 /* tilde */, 256 /* SimpleToken */ | 55 /* TildeToken */],
|
|
8081
|
+
[64 /* at */, 256 /* SimpleToken */ | 60 /* AtToken */],
|
|
8082
|
+
// Digits
|
|
8083
|
+
[48 /* _0 */, 2048 /* Digit */],
|
|
8084
|
+
[49 /* _1 */, 2048 /* Digit */],
|
|
8085
|
+
[50 /* _2 */, 2048 /* Digit */],
|
|
8086
|
+
[51 /* _3 */, 2048 /* Digit */],
|
|
8087
|
+
[52 /* _4 */, 2048 /* Digit */],
|
|
8088
|
+
[53 /* _5 */, 2048 /* Digit */],
|
|
8089
|
+
[54 /* _6 */, 2048 /* Digit */],
|
|
8090
|
+
[55 /* _7 */, 2048 /* Digit */],
|
|
8091
|
+
[56 /* _8 */, 2048 /* Digit */],
|
|
8092
|
+
[57 /* _9 */, 2048 /* Digit */],
|
|
8093
|
+
[33 /* exclamation */, 4096 /* RecognizedMisc */],
|
|
8094
|
+
[34 /* doubleQuote */, 4096 /* RecognizedMisc */],
|
|
8095
|
+
[39 /* singleQuote */, 4096 /* RecognizedMisc */],
|
|
8096
|
+
[96 /* backtick */, 4096 /* RecognizedMisc */],
|
|
8097
|
+
[37 /* percent */, 4096 /* RecognizedMisc */],
|
|
8098
|
+
[38 /* ampersand */, 4096 /* RecognizedMisc */],
|
|
8099
|
+
[42 /* asterisk */, 4096 /* RecognizedMisc */],
|
|
8100
|
+
[43 /* plus */, 4096 /* RecognizedMisc */],
|
|
8101
|
+
[45 /* minus */, 4096 /* RecognizedMisc */],
|
|
8102
|
+
[46 /* dot */, 4096 /* RecognizedMisc */],
|
|
8103
|
+
[47 /* slash */, 4096 /* RecognizedMisc */],
|
|
8104
|
+
[60 /* lessThan */, 4096 /* RecognizedMisc */],
|
|
8105
|
+
[61 /* equals */, 4096 /* RecognizedMisc */],
|
|
8106
|
+
[62 /* greaterThan */, 4096 /* RecognizedMisc */],
|
|
8107
|
+
[63 /* question */, 4096 /* RecognizedMisc */],
|
|
8108
|
+
[94 /* caret */, 4096 /* RecognizedMisc */],
|
|
8109
|
+
[124 /* bar */, 4096 /* RecognizedMisc */],
|
|
8110
|
+
[92 /* backslash */, 4096 /* RecognizedMisc */],
|
|
8111
|
+
[35 /* hash */, 4096 /* RecognizedMisc */],
|
|
8112
|
+
[65533 /* replacementCharacter */, 4096 /* RecognizedMisc */]
|
|
8113
|
+
]) {
|
|
8114
|
+
if (key < charcodeToTokenInfoCommon.length) {
|
|
8115
|
+
charcodeToTokenInfoCommon[key] = value;
|
|
8116
|
+
} else {
|
|
8117
|
+
charcodeToTokenInfoUncommon.set(key, value);
|
|
8118
|
+
}
|
|
8119
|
+
}
|
|
8038
8120
|
var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
8039
8121
|
var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
8040
8122
|
var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2160, 2183, 2185, 2190, 2208, 2249, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3165, 3165, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3293, 3294, 3296, 3297, 3313, 3314, 3332, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5905, 5919, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6988, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12735, 12784, 12799, 13312, 19903, 19968, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42954, 42960, 42961, 42963, 42963, 42965, 42969, 42994, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43881, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 66928, 66938, 66940, 66954, 66956, 66962, 66964, 66965, 66967, 66977, 66979, 66993, 66995, 67001, 67003, 67004, 67072, 67382, 67392, 67413, 67424, 67431, 67456, 67461, 67463, 67504, 67506, 67514, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69248, 69289, 69296, 69297, 69376, 69404, 69415, 69415, 69424, 69445, 69488, 69505, 69552, 69572, 69600, 69622, 69635, 69687, 69745, 69746, 69749, 69749, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69959, 69959, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70207, 70208, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70753, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71488, 71494, 71680, 71723, 71840, 71903, 71935, 71942, 71945, 71945, 71948, 71955, 71957, 71958, 71960, 71983, 71999, 71999, 72001, 72001, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72368, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73474, 73474, 73476, 73488, 73490, 73523, 73648, 73648, 73728, 74649, 74752, 74862, 74880, 75075, 77712, 77808, 77824, 78895, 78913, 78918, 82944, 83526, 92160, 92728, 92736, 92766, 92784, 92862, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101589, 101632, 101640, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 122624, 122654, 122661, 122666, 122928, 122989, 123136, 123180, 123191, 123197, 123214, 123214, 123536, 123565, 123584, 123627, 124112, 124139, 124896, 124902, 124904, 124907, 124909, 124910, 124912, 124926, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173791, 173824, 177977, 177984, 178205, 178208, 183969, 183984, 191456, 191472, 192093, 194560, 195101, 196608, 201546, 201552, 205743];
|
|
@@ -9197,53 +9279,34 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9197
9279
|
return token = 1 /* EndOfFileToken */;
|
|
9198
9280
|
}
|
|
9199
9281
|
const ch = codePointUnchecked(pos);
|
|
9200
|
-
if (
|
|
9201
|
-
if (
|
|
9202
|
-
pos
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9282
|
+
if (ch === 9 /* tab */ || ch === 32 /* space */) {
|
|
9283
|
+
if (skipTrivia2) {
|
|
9284
|
+
pos++;
|
|
9285
|
+
continue;
|
|
9286
|
+
} else {
|
|
9287
|
+
while (pos < end && isWhiteSpaceSingleLine(charCodeUnchecked(pos))) {
|
|
9288
|
+
pos++;
|
|
9207
9289
|
}
|
|
9290
|
+
return token = 5 /* WhitespaceTrivia */;
|
|
9208
9291
|
}
|
|
9209
9292
|
}
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9293
|
+
if (ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */) {
|
|
9294
|
+
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9295
|
+
if (skipTrivia2) {
|
|
9296
|
+
pos++;
|
|
9297
|
+
continue;
|
|
9298
|
+
} else {
|
|
9299
|
+
if (ch === 13 /* carriageReturn */ && pos + 1 < end && charCodeUnchecked(pos + 1) === 10 /* lineFeed */) {
|
|
9300
|
+
pos += 2;
|
|
9217
9301
|
} else {
|
|
9218
|
-
|
|
9219
|
-
pos += 2;
|
|
9220
|
-
} else {
|
|
9221
|
-
pos++;
|
|
9222
|
-
}
|
|
9223
|
-
return token = 4 /* NewLineTrivia */;
|
|
9302
|
+
pos++;
|
|
9224
9303
|
}
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
case 8192 /* enQuad */:
|
|
9232
|
-
case 8193 /* emQuad */:
|
|
9233
|
-
case 8194 /* enSpace */:
|
|
9234
|
-
case 8195 /* emSpace */:
|
|
9235
|
-
case 8196 /* threePerEmSpace */:
|
|
9236
|
-
case 8197 /* fourPerEmSpace */:
|
|
9237
|
-
case 8198 /* sixPerEmSpace */:
|
|
9238
|
-
case 8199 /* figureSpace */:
|
|
9239
|
-
case 8200 /* punctuationSpace */:
|
|
9240
|
-
case 8201 /* thinSpace */:
|
|
9241
|
-
case 8202 /* hairSpace */:
|
|
9242
|
-
case 8203 /* zeroWidthSpace */:
|
|
9243
|
-
case 8239 /* narrowNoBreakSpace */:
|
|
9244
|
-
case 8287 /* mathematicalSpace */:
|
|
9245
|
-
case 12288 /* ideographicSpace */:
|
|
9246
|
-
case 65279 /* byteOrderMark */:
|
|
9304
|
+
return token = 4 /* NewLineTrivia */;
|
|
9305
|
+
}
|
|
9306
|
+
}
|
|
9307
|
+
const tokenInfo = ch < charcodeToTokenInfoCommon.length ? charcodeToTokenInfoCommon[ch] : charcodeToTokenInfoUncommon.get(ch) ?? 0 /* None */;
|
|
9308
|
+
if (tokenInfo !== 0 /* None */) {
|
|
9309
|
+
if (tokenInfo & 512 /* Whitespace */) {
|
|
9247
9310
|
if (skipTrivia2) {
|
|
9248
9311
|
pos++;
|
|
9249
9312
|
continue;
|
|
@@ -9253,397 +9316,374 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9253
9316
|
}
|
|
9254
9317
|
return token = 5 /* WhitespaceTrivia */;
|
|
9255
9318
|
}
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9259
|
-
return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
|
|
9260
|
-
}
|
|
9261
|
-
return pos += 2, token = 36 /* ExclamationEqualsToken */;
|
|
9262
|
-
}
|
|
9263
|
-
pos++;
|
|
9264
|
-
return token = 54 /* ExclamationToken */;
|
|
9265
|
-
case 34 /* doubleQuote */:
|
|
9266
|
-
case 39 /* singleQuote */:
|
|
9267
|
-
tokenValue = scanString();
|
|
9268
|
-
return token = 11 /* StringLiteral */;
|
|
9269
|
-
case 96 /* backtick */:
|
|
9270
|
-
return token = scanTemplateAndSetTokenValue(
|
|
9271
|
-
/*shouldEmitInvalidEscapeError*/
|
|
9272
|
-
false
|
|
9273
|
-
);
|
|
9274
|
-
case 37 /* percent */:
|
|
9275
|
-
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9276
|
-
return pos += 2, token = 70 /* PercentEqualsToken */;
|
|
9277
|
-
}
|
|
9278
|
-
pos++;
|
|
9279
|
-
return token = 45 /* PercentToken */;
|
|
9280
|
-
case 38 /* ampersand */:
|
|
9281
|
-
if (charCodeUnchecked(pos + 1) === 38 /* ampersand */) {
|
|
9282
|
-
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9283
|
-
return pos += 3, token = 77 /* AmpersandAmpersandEqualsToken */;
|
|
9284
|
-
}
|
|
9285
|
-
return pos += 2, token = 56 /* AmpersandAmpersandToken */;
|
|
9286
|
-
}
|
|
9287
|
-
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9288
|
-
return pos += 2, token = 74 /* AmpersandEqualsToken */;
|
|
9289
|
-
}
|
|
9290
|
-
pos++;
|
|
9291
|
-
return token = 51 /* AmpersandToken */;
|
|
9292
|
-
case 40 /* openParen */:
|
|
9293
|
-
pos++;
|
|
9294
|
-
return token = 21 /* OpenParenToken */;
|
|
9295
|
-
case 41 /* closeParen */:
|
|
9319
|
+
}
|
|
9320
|
+
if (tokenInfo & 256 /* SimpleToken */) {
|
|
9296
9321
|
pos++;
|
|
9297
|
-
return token =
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9322
|
+
return token = tokenInfo & 255 /* SimpleTokenMask */;
|
|
9323
|
+
}
|
|
9324
|
+
if (tokenInfo & 2048 /* Digit */) {
|
|
9325
|
+
if (ch === 48 /* _0 */) {
|
|
9326
|
+
if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 88 /* X */ || charCodeUnchecked(pos + 1) === 120 /* x */)) {
|
|
9327
|
+
pos += 2;
|
|
9328
|
+
tokenValue = scanMinimumNumberOfHexDigits(
|
|
9329
|
+
1,
|
|
9330
|
+
/*canHaveSeparators*/
|
|
9331
|
+
true
|
|
9332
|
+
);
|
|
9333
|
+
if (!tokenValue) {
|
|
9334
|
+
error(Diagnostics.Hexadecimal_digit_expected);
|
|
9335
|
+
tokenValue = "0";
|
|
9336
|
+
}
|
|
9337
|
+
tokenValue = "0x" + tokenValue;
|
|
9338
|
+
tokenFlags |= 64 /* HexSpecifier */;
|
|
9339
|
+
return token = checkBigIntSuffix();
|
|
9340
|
+
} else if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 66 /* B */ || charCodeUnchecked(pos + 1) === 98 /* b */)) {
|
|
9341
|
+
pos += 2;
|
|
9342
|
+
tokenValue = scanBinaryOrOctalDigits(
|
|
9343
|
+
/* base */
|
|
9344
|
+
2
|
|
9345
|
+
);
|
|
9346
|
+
if (!tokenValue) {
|
|
9347
|
+
error(Diagnostics.Binary_digit_expected);
|
|
9348
|
+
tokenValue = "0";
|
|
9349
|
+
}
|
|
9350
|
+
tokenValue = "0b" + tokenValue;
|
|
9351
|
+
tokenFlags |= 128 /* BinarySpecifier */;
|
|
9352
|
+
return token = checkBigIntSuffix();
|
|
9353
|
+
} else if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 79 /* O */ || charCodeUnchecked(pos + 1) === 111 /* o */)) {
|
|
9354
|
+
pos += 2;
|
|
9355
|
+
tokenValue = scanBinaryOrOctalDigits(
|
|
9356
|
+
/* base */
|
|
9357
|
+
8
|
|
9358
|
+
);
|
|
9359
|
+
if (!tokenValue) {
|
|
9360
|
+
error(Diagnostics.Octal_digit_expected);
|
|
9361
|
+
tokenValue = "0";
|
|
9362
|
+
}
|
|
9363
|
+
tokenValue = "0o" + tokenValue;
|
|
9364
|
+
tokenFlags |= 256 /* OctalSpecifier */;
|
|
9365
|
+
return token = checkBigIntSuffix();
|
|
9305
9366
|
}
|
|
9306
|
-
return pos += 2, token = 43 /* AsteriskAsteriskToken */;
|
|
9307
|
-
}
|
|
9308
|
-
pos++;
|
|
9309
|
-
if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
|
|
9310
|
-
asteriskSeen = true;
|
|
9311
|
-
continue;
|
|
9312
|
-
}
|
|
9313
|
-
return token = 42 /* AsteriskToken */;
|
|
9314
|
-
case 43 /* plus */:
|
|
9315
|
-
if (charCodeUnchecked(pos + 1) === 43 /* plus */) {
|
|
9316
|
-
return pos += 2, token = 46 /* PlusPlusToken */;
|
|
9317
|
-
}
|
|
9318
|
-
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9319
|
-
return pos += 2, token = 65 /* PlusEqualsToken */;
|
|
9320
|
-
}
|
|
9321
|
-
pos++;
|
|
9322
|
-
return token = 40 /* PlusToken */;
|
|
9323
|
-
case 44 /* comma */:
|
|
9324
|
-
pos++;
|
|
9325
|
-
return token = 28 /* CommaToken */;
|
|
9326
|
-
case 45 /* minus */:
|
|
9327
|
-
if (charCodeUnchecked(pos + 1) === 45 /* minus */) {
|
|
9328
|
-
return pos += 2, token = 47 /* MinusMinusToken */;
|
|
9329
|
-
}
|
|
9330
|
-
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9331
|
-
return pos += 2, token = 66 /* MinusEqualsToken */;
|
|
9332
|
-
}
|
|
9333
|
-
pos++;
|
|
9334
|
-
return token = 41 /* MinusToken */;
|
|
9335
|
-
case 46 /* dot */:
|
|
9336
|
-
if (isDigit(charCodeUnchecked(pos + 1))) {
|
|
9337
|
-
scanNumber();
|
|
9338
|
-
return token = 9 /* NumericLiteral */;
|
|
9339
|
-
}
|
|
9340
|
-
if (charCodeUnchecked(pos + 1) === 46 /* dot */ && charCodeUnchecked(pos + 2) === 46 /* dot */) {
|
|
9341
|
-
return pos += 3, token = 26 /* DotDotDotToken */;
|
|
9342
9367
|
}
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
if (
|
|
9350
|
-
|
|
9368
|
+
return token = scanNumber();
|
|
9369
|
+
}
|
|
9370
|
+
Debug.assert(tokenInfo & 4096 /* RecognizedMisc */);
|
|
9371
|
+
switch (ch) {
|
|
9372
|
+
case 33 /* exclamation */:
|
|
9373
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9374
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9375
|
+
return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
|
|
9351
9376
|
}
|
|
9352
|
-
pos
|
|
9377
|
+
return pos += 2, token = 36 /* ExclamationEqualsToken */;
|
|
9353
9378
|
}
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9379
|
+
pos++;
|
|
9380
|
+
return token = 54 /* ExclamationToken */;
|
|
9381
|
+
case 34 /* doubleQuote */:
|
|
9382
|
+
case 39 /* singleQuote */:
|
|
9383
|
+
tokenValue = scanString();
|
|
9384
|
+
return token = 11 /* StringLiteral */;
|
|
9385
|
+
case 96 /* backtick */:
|
|
9386
|
+
return token = scanTemplateAndSetTokenValue(
|
|
9387
|
+
/*shouldEmitInvalidEscapeError*/
|
|
9388
|
+
false
|
|
9359
9389
|
);
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
return token = 2 /* SingleLineCommentTrivia */;
|
|
9390
|
+
case 37 /* percent */:
|
|
9391
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9392
|
+
return pos += 2, token = 70 /* PercentEqualsToken */;
|
|
9364
9393
|
}
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
while (pos < end) {
|
|
9372
|
-
const ch2 = charCodeUnchecked(pos);
|
|
9373
|
-
if (ch2 === 42 /* asterisk */ && charCodeUnchecked(pos + 1) === 47 /* slash */) {
|
|
9374
|
-
pos += 2;
|
|
9375
|
-
commentClosed = true;
|
|
9376
|
-
break;
|
|
9377
|
-
}
|
|
9378
|
-
pos++;
|
|
9379
|
-
if (isLineBreak(ch2)) {
|
|
9380
|
-
lastLineStart = pos;
|
|
9381
|
-
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9394
|
+
pos++;
|
|
9395
|
+
return token = 45 /* PercentToken */;
|
|
9396
|
+
case 38 /* ampersand */:
|
|
9397
|
+
if (charCodeUnchecked(pos + 1) === 38 /* ampersand */) {
|
|
9398
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9399
|
+
return pos += 3, token = 77 /* AmpersandAmpersandEqualsToken */;
|
|
9382
9400
|
}
|
|
9401
|
+
return pos += 2, token = 56 /* AmpersandAmpersandToken */;
|
|
9383
9402
|
}
|
|
9384
|
-
if (
|
|
9385
|
-
|
|
9403
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9404
|
+
return pos += 2, token = 74 /* AmpersandEqualsToken */;
|
|
9386
9405
|
}
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9406
|
+
pos++;
|
|
9407
|
+
return token = 51 /* AmpersandToken */;
|
|
9408
|
+
case 42 /* asterisk */:
|
|
9409
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9410
|
+
return pos += 2, token = 67 /* AsteriskEqualsToken */;
|
|
9411
|
+
}
|
|
9412
|
+
if (charCodeUnchecked(pos + 1) === 42 /* asterisk */) {
|
|
9413
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9414
|
+
return pos += 3, token = 68 /* AsteriskAsteriskEqualsToken */;
|
|
9415
|
+
}
|
|
9416
|
+
return pos += 2, token = 43 /* AsteriskAsteriskToken */;
|
|
9390
9417
|
}
|
|
9391
|
-
|
|
9418
|
+
pos++;
|
|
9419
|
+
if (skipJsDocLeadingAsterisks && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) {
|
|
9420
|
+
asteriskSeen = true;
|
|
9392
9421
|
continue;
|
|
9393
|
-
}
|
|
9422
|
+
}
|
|
9423
|
+
return token = 42 /* AsteriskToken */;
|
|
9424
|
+
case 43 /* plus */:
|
|
9425
|
+
if (charCodeUnchecked(pos + 1) === 43 /* plus */) {
|
|
9426
|
+
return pos += 2, token = 46 /* PlusPlusToken */;
|
|
9427
|
+
}
|
|
9428
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9429
|
+
return pos += 2, token = 65 /* PlusEqualsToken */;
|
|
9430
|
+
}
|
|
9431
|
+
pos++;
|
|
9432
|
+
return token = 40 /* PlusToken */;
|
|
9433
|
+
case 45 /* minus */:
|
|
9434
|
+
if (charCodeUnchecked(pos + 1) === 45 /* minus */) {
|
|
9435
|
+
return pos += 2, token = 47 /* MinusMinusToken */;
|
|
9436
|
+
}
|
|
9437
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9438
|
+
return pos += 2, token = 66 /* MinusEqualsToken */;
|
|
9439
|
+
}
|
|
9440
|
+
pos++;
|
|
9441
|
+
return token = 41 /* MinusToken */;
|
|
9442
|
+
case 46 /* dot */:
|
|
9443
|
+
if (isDigit(charCodeUnchecked(pos + 1))) {
|
|
9444
|
+
scanNumber();
|
|
9445
|
+
return token = 9 /* NumericLiteral */;
|
|
9446
|
+
}
|
|
9447
|
+
if (charCodeUnchecked(pos + 1) === 46 /* dot */ && charCodeUnchecked(pos + 2) === 46 /* dot */) {
|
|
9448
|
+
return pos += 3, token = 26 /* DotDotDotToken */;
|
|
9449
|
+
}
|
|
9450
|
+
pos++;
|
|
9451
|
+
return token = 25 /* DotToken */;
|
|
9452
|
+
case 47 /* slash */:
|
|
9453
|
+
if (charCodeUnchecked(pos + 1) === 47 /* slash */) {
|
|
9454
|
+
pos += 2;
|
|
9455
|
+
while (pos < end) {
|
|
9456
|
+
if (isLineBreak(charCodeUnchecked(pos))) {
|
|
9457
|
+
break;
|
|
9458
|
+
}
|
|
9459
|
+
pos++;
|
|
9460
|
+
}
|
|
9461
|
+
commentDirectives = appendIfCommentDirective(
|
|
9462
|
+
commentDirectives,
|
|
9463
|
+
text.slice(tokenStart, pos),
|
|
9464
|
+
commentDirectiveRegExSingleLine,
|
|
9465
|
+
tokenStart
|
|
9466
|
+
);
|
|
9467
|
+
if (skipTrivia2) {
|
|
9468
|
+
continue;
|
|
9469
|
+
} else {
|
|
9470
|
+
return token = 2 /* SingleLineCommentTrivia */;
|
|
9471
|
+
}
|
|
9472
|
+
}
|
|
9473
|
+
if (charCodeUnchecked(pos + 1) === 42 /* asterisk */) {
|
|
9474
|
+
pos += 2;
|
|
9475
|
+
const isJSDoc2 = charCodeUnchecked(pos) === 42 /* asterisk */ && charCodeUnchecked(pos + 1) !== 47 /* slash */;
|
|
9476
|
+
let commentClosed = false;
|
|
9477
|
+
let lastLineStart = tokenStart;
|
|
9478
|
+
while (pos < end) {
|
|
9479
|
+
const ch2 = charCodeUnchecked(pos);
|
|
9480
|
+
if (ch2 === 42 /* asterisk */ && charCodeUnchecked(pos + 1) === 47 /* slash */) {
|
|
9481
|
+
pos += 2;
|
|
9482
|
+
commentClosed = true;
|
|
9483
|
+
break;
|
|
9484
|
+
}
|
|
9485
|
+
pos++;
|
|
9486
|
+
if (isLineBreak(ch2)) {
|
|
9487
|
+
lastLineStart = pos;
|
|
9488
|
+
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9489
|
+
}
|
|
9490
|
+
}
|
|
9491
|
+
if (isJSDoc2 && shouldParseJSDoc()) {
|
|
9492
|
+
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
9493
|
+
}
|
|
9494
|
+
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
9394
9495
|
if (!commentClosed) {
|
|
9395
|
-
|
|
9496
|
+
error(Diagnostics.Asterisk_Slash_expected);
|
|
9497
|
+
}
|
|
9498
|
+
if (skipTrivia2) {
|
|
9499
|
+
continue;
|
|
9500
|
+
} else {
|
|
9501
|
+
if (!commentClosed) {
|
|
9502
|
+
tokenFlags |= 4 /* Unterminated */;
|
|
9503
|
+
}
|
|
9504
|
+
return token = 3 /* MultiLineCommentTrivia */;
|
|
9396
9505
|
}
|
|
9397
|
-
return token = 3 /* MultiLineCommentTrivia */;
|
|
9398
9506
|
}
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
return pos += 2, token = 69 /* SlashEqualsToken */;
|
|
9402
|
-
}
|
|
9403
|
-
pos++;
|
|
9404
|
-
return token = 44 /* SlashToken */;
|
|
9405
|
-
case 48 /* _0 */:
|
|
9406
|
-
if (pos + 2 < end && (charCodeUnchecked(pos + 1) === 88 /* X */ || charCodeUnchecked(pos + 1) === 120 /* x */)) {
|
|
9407
|
-
pos += 2;
|
|
9408
|
-
tokenValue = scanMinimumNumberOfHexDigits(
|
|
9409
|
-
1,
|
|
9410
|
-
/*canHaveSeparators*/
|
|
9411
|
-
true
|
|
9412
|
-
);
|
|
9413
|
-
if (!tokenValue) {
|
|
9414
|
-
error(Diagnostics.Hexadecimal_digit_expected);
|
|
9415
|
-
tokenValue = "0";
|
|
9507
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9508
|
+
return pos += 2, token = 69 /* SlashEqualsToken */;
|
|
9416
9509
|
}
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
error(Diagnostics.Binary_digit_expected);
|
|
9428
|
-
tokenValue = "0";
|
|
9510
|
+
pos++;
|
|
9511
|
+
return token = 44 /* SlashToken */;
|
|
9512
|
+
case 60 /* lessThan */:
|
|
9513
|
+
if (isConflictMarkerTrivia(text, pos)) {
|
|
9514
|
+
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9515
|
+
if (skipTrivia2) {
|
|
9516
|
+
continue;
|
|
9517
|
+
} else {
|
|
9518
|
+
return token = 7 /* ConflictMarkerTrivia */;
|
|
9519
|
+
}
|
|
9429
9520
|
}
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
tokenValue = scanBinaryOrOctalDigits(
|
|
9436
|
-
/* base */
|
|
9437
|
-
8
|
|
9438
|
-
);
|
|
9439
|
-
if (!tokenValue) {
|
|
9440
|
-
error(Diagnostics.Octal_digit_expected);
|
|
9441
|
-
tokenValue = "0";
|
|
9521
|
+
if (charCodeUnchecked(pos + 1) === 60 /* lessThan */) {
|
|
9522
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9523
|
+
return pos += 3, token = 71 /* LessThanLessThanEqualsToken */;
|
|
9524
|
+
}
|
|
9525
|
+
return pos += 2, token = 48 /* LessThanLessThanToken */;
|
|
9442
9526
|
}
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
return token = checkBigIntSuffix();
|
|
9446
|
-
}
|
|
9447
|
-
case 49 /* _1 */:
|
|
9448
|
-
case 50 /* _2 */:
|
|
9449
|
-
case 51 /* _3 */:
|
|
9450
|
-
case 52 /* _4 */:
|
|
9451
|
-
case 53 /* _5 */:
|
|
9452
|
-
case 54 /* _6 */:
|
|
9453
|
-
case 55 /* _7 */:
|
|
9454
|
-
case 56 /* _8 */:
|
|
9455
|
-
case 57 /* _9 */:
|
|
9456
|
-
return token = scanNumber();
|
|
9457
|
-
case 58 /* colon */:
|
|
9458
|
-
pos++;
|
|
9459
|
-
return token = 59 /* ColonToken */;
|
|
9460
|
-
case 59 /* semicolon */:
|
|
9461
|
-
pos++;
|
|
9462
|
-
return token = 27 /* SemicolonToken */;
|
|
9463
|
-
case 60 /* lessThan */:
|
|
9464
|
-
if (isConflictMarkerTrivia(text, pos)) {
|
|
9465
|
-
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9466
|
-
if (skipTrivia2) {
|
|
9467
|
-
continue;
|
|
9468
|
-
} else {
|
|
9469
|
-
return token = 7 /* ConflictMarkerTrivia */;
|
|
9527
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9528
|
+
return pos += 2, token = 33 /* LessThanEqualsToken */;
|
|
9470
9529
|
}
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9474
|
-
return pos += 3, token = 71 /* LessThanLessThanEqualsToken */;
|
|
9530
|
+
if (languageVariant === 1 /* JSX */ && charCodeUnchecked(pos + 1) === 47 /* slash */ && charCodeUnchecked(pos + 2) !== 42 /* asterisk */) {
|
|
9531
|
+
return pos += 2, token = 31 /* LessThanSlashToken */;
|
|
9475
9532
|
}
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
case 61 /* equals */:
|
|
9487
|
-
if (isConflictMarkerTrivia(text, pos)) {
|
|
9488
|
-
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9489
|
-
if (skipTrivia2) {
|
|
9490
|
-
continue;
|
|
9491
|
-
} else {
|
|
9492
|
-
return token = 7 /* ConflictMarkerTrivia */;
|
|
9533
|
+
pos++;
|
|
9534
|
+
return token = 30 /* LessThanToken */;
|
|
9535
|
+
case 61 /* equals */:
|
|
9536
|
+
if (isConflictMarkerTrivia(text, pos)) {
|
|
9537
|
+
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9538
|
+
if (skipTrivia2) {
|
|
9539
|
+
continue;
|
|
9540
|
+
} else {
|
|
9541
|
+
return token = 7 /* ConflictMarkerTrivia */;
|
|
9542
|
+
}
|
|
9493
9543
|
}
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9544
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9545
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9546
|
+
return pos += 3, token = 37 /* EqualsEqualsEqualsToken */;
|
|
9547
|
+
}
|
|
9548
|
+
return pos += 2, token = 35 /* EqualsEqualsToken */;
|
|
9498
9549
|
}
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
if (charCodeUnchecked(pos + 1) === 62 /* greaterThan */) {
|
|
9502
|
-
return pos += 2, token = 39 /* EqualsGreaterThanToken */;
|
|
9503
|
-
}
|
|
9504
|
-
pos++;
|
|
9505
|
-
return token = 64 /* EqualsToken */;
|
|
9506
|
-
case 62 /* greaterThan */:
|
|
9507
|
-
if (isConflictMarkerTrivia(text, pos)) {
|
|
9508
|
-
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9509
|
-
if (skipTrivia2) {
|
|
9510
|
-
continue;
|
|
9511
|
-
} else {
|
|
9512
|
-
return token = 7 /* ConflictMarkerTrivia */;
|
|
9550
|
+
if (charCodeUnchecked(pos + 1) === 62 /* greaterThan */) {
|
|
9551
|
+
return pos += 2, token = 39 /* EqualsGreaterThanToken */;
|
|
9513
9552
|
}
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9553
|
+
pos++;
|
|
9554
|
+
return token = 64 /* EqualsToken */;
|
|
9555
|
+
case 62 /* greaterThan */:
|
|
9556
|
+
if (isConflictMarkerTrivia(text, pos)) {
|
|
9557
|
+
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9558
|
+
if (skipTrivia2) {
|
|
9559
|
+
continue;
|
|
9560
|
+
} else {
|
|
9561
|
+
return token = 7 /* ConflictMarkerTrivia */;
|
|
9562
|
+
}
|
|
9524
9563
|
}
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
pos++;
|
|
9531
|
-
return token = 23 /* OpenBracketToken */;
|
|
9532
|
-
case 93 /* closeBracket */:
|
|
9533
|
-
pos++;
|
|
9534
|
-
return token = 24 /* CloseBracketToken */;
|
|
9535
|
-
case 94 /* caret */:
|
|
9536
|
-
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9537
|
-
return pos += 2, token = 79 /* CaretEqualsToken */;
|
|
9538
|
-
}
|
|
9539
|
-
pos++;
|
|
9540
|
-
return token = 53 /* CaretToken */;
|
|
9541
|
-
case 123 /* openBrace */:
|
|
9542
|
-
pos++;
|
|
9543
|
-
return token = 19 /* OpenBraceToken */;
|
|
9544
|
-
case 124 /* bar */:
|
|
9545
|
-
if (isConflictMarkerTrivia(text, pos)) {
|
|
9546
|
-
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9547
|
-
if (skipTrivia2) {
|
|
9548
|
-
continue;
|
|
9549
|
-
} else {
|
|
9550
|
-
return token = 7 /* ConflictMarkerTrivia */;
|
|
9564
|
+
pos++;
|
|
9565
|
+
return token = 32 /* GreaterThanToken */;
|
|
9566
|
+
case 63 /* question */:
|
|
9567
|
+
if (charCodeUnchecked(pos + 1) === 46 /* dot */ && !isDigit(charCodeUnchecked(pos + 2))) {
|
|
9568
|
+
return pos += 2, token = 29 /* QuestionDotToken */;
|
|
9551
9569
|
}
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9570
|
+
if (charCodeUnchecked(pos + 1) === 63 /* question */) {
|
|
9571
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9572
|
+
return pos += 3, token = 78 /* QuestionQuestionEqualsToken */;
|
|
9573
|
+
}
|
|
9574
|
+
return pos += 2, token = 61 /* QuestionQuestionToken */;
|
|
9556
9575
|
}
|
|
9557
|
-
return pos += 2, token = 57 /* BarBarToken */;
|
|
9558
|
-
}
|
|
9559
|
-
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9560
|
-
return pos += 2, token = 75 /* BarEqualsToken */;
|
|
9561
|
-
}
|
|
9562
|
-
pos++;
|
|
9563
|
-
return token = 52 /* BarToken */;
|
|
9564
|
-
case 125 /* closeBrace */:
|
|
9565
|
-
pos++;
|
|
9566
|
-
return token = 20 /* CloseBraceToken */;
|
|
9567
|
-
case 126 /* tilde */:
|
|
9568
|
-
pos++;
|
|
9569
|
-
return token = 55 /* TildeToken */;
|
|
9570
|
-
case 64 /* at */:
|
|
9571
|
-
pos++;
|
|
9572
|
-
return token = 60 /* AtToken */;
|
|
9573
|
-
case 92 /* backslash */:
|
|
9574
|
-
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
9575
|
-
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
9576
|
-
tokenValue = scanExtendedUnicodeEscape(
|
|
9577
|
-
/*shouldEmitInvalidEscapeError*/
|
|
9578
|
-
true
|
|
9579
|
-
) + scanIdentifierParts();
|
|
9580
|
-
return token = getIdentifierToken();
|
|
9581
|
-
}
|
|
9582
|
-
const cookedChar = peekUnicodeEscape();
|
|
9583
|
-
if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
|
|
9584
|
-
pos += 6;
|
|
9585
|
-
tokenFlags |= 1024 /* UnicodeEscape */;
|
|
9586
|
-
tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();
|
|
9587
|
-
return token = getIdentifierToken();
|
|
9588
|
-
}
|
|
9589
|
-
error(Diagnostics.Invalid_character);
|
|
9590
|
-
pos++;
|
|
9591
|
-
return token = 0 /* Unknown */;
|
|
9592
|
-
case 35 /* hash */:
|
|
9593
|
-
if (pos !== 0 && text[pos + 1] === "!") {
|
|
9594
|
-
error(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
|
|
9595
9576
|
pos++;
|
|
9596
|
-
return token =
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9577
|
+
return token = 58 /* QuestionToken */;
|
|
9578
|
+
case 94 /* caret */:
|
|
9579
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9580
|
+
return pos += 2, token = 79 /* CaretEqualsToken */;
|
|
9581
|
+
}
|
|
9600
9582
|
pos++;
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9583
|
+
return token = 53 /* CaretToken */;
|
|
9584
|
+
case 124 /* bar */:
|
|
9585
|
+
if (isConflictMarkerTrivia(text, pos)) {
|
|
9586
|
+
pos = scanConflictMarkerTrivia(text, pos, error);
|
|
9587
|
+
if (skipTrivia2) {
|
|
9588
|
+
continue;
|
|
9589
|
+
} else {
|
|
9590
|
+
return token = 7 /* ConflictMarkerTrivia */;
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
if (charCodeUnchecked(pos + 1) === 124 /* bar */) {
|
|
9594
|
+
if (charCodeUnchecked(pos + 2) === 61 /* equals */) {
|
|
9595
|
+
return pos += 3, token = 76 /* BarBarEqualsToken */;
|
|
9596
|
+
}
|
|
9597
|
+
return pos += 2, token = 57 /* BarBarToken */;
|
|
9598
|
+
}
|
|
9599
|
+
if (charCodeUnchecked(pos + 1) === 61 /* equals */) {
|
|
9600
|
+
return pos += 2, token = 75 /* BarEqualsToken */;
|
|
9601
|
+
}
|
|
9602
|
+
pos++;
|
|
9603
|
+
return token = 52 /* BarToken */;
|
|
9604
|
+
case 92 /* backslash */:
|
|
9605
|
+
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
9606
|
+
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
9607
|
+
tokenValue = scanExtendedUnicodeEscape(
|
|
9604
9608
|
/*shouldEmitInvalidEscapeError*/
|
|
9605
9609
|
true
|
|
9606
9610
|
) + scanIdentifierParts();
|
|
9607
|
-
return token =
|
|
9611
|
+
return token = getIdentifierToken();
|
|
9608
9612
|
}
|
|
9609
|
-
const
|
|
9610
|
-
if (
|
|
9613
|
+
const cookedChar = peekUnicodeEscape();
|
|
9614
|
+
if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) {
|
|
9611
9615
|
pos += 6;
|
|
9612
9616
|
tokenFlags |= 1024 /* UnicodeEscape */;
|
|
9613
|
-
tokenValue =
|
|
9614
|
-
return token =
|
|
9617
|
+
tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts();
|
|
9618
|
+
return token = getIdentifierToken();
|
|
9615
9619
|
}
|
|
9616
|
-
|
|
9617
|
-
}
|
|
9618
|
-
if (isIdentifierStart(charAfterHash, languageVersion)) {
|
|
9620
|
+
error(Diagnostics.Invalid_character);
|
|
9619
9621
|
pos++;
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9622
|
+
return token = 0 /* Unknown */;
|
|
9623
|
+
case 35 /* hash */:
|
|
9624
|
+
const charAfterHash = codePointUnchecked(pos + 1);
|
|
9625
|
+
if (charAfterHash === 33 /* exclamation */) {
|
|
9626
|
+
if (pos === 0) {
|
|
9627
|
+
pos = scanShebangTrivia(text, pos);
|
|
9628
|
+
if (skipTrivia2) {
|
|
9629
|
+
continue;
|
|
9630
|
+
} else {
|
|
9631
|
+
return token = 6 /* ShebangTrivia */;
|
|
9632
|
+
}
|
|
9633
|
+
} else if (pos !== 0) {
|
|
9634
|
+
error(Diagnostics.can_only_be_used_at_the_start_of_a_file, pos, 2);
|
|
9635
|
+
pos++;
|
|
9636
|
+
return token = 0 /* Unknown */;
|
|
9637
|
+
}
|
|
9638
|
+
}
|
|
9639
|
+
if (charAfterHash === 92 /* backslash */) {
|
|
9640
|
+
pos++;
|
|
9641
|
+
const extendedCookedChar2 = peekExtendedUnicodeEscape();
|
|
9642
|
+
if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
|
|
9643
|
+
tokenValue = "#" + scanExtendedUnicodeEscape(
|
|
9644
|
+
/*shouldEmitInvalidEscapeError*/
|
|
9645
|
+
true
|
|
9646
|
+
) + scanIdentifierParts();
|
|
9647
|
+
return token = 81 /* PrivateIdentifier */;
|
|
9648
|
+
}
|
|
9649
|
+
const cookedChar2 = peekUnicodeEscape();
|
|
9650
|
+
if (cookedChar2 >= 0 && isIdentifierStart(cookedChar2, languageVersion)) {
|
|
9651
|
+
pos += 6;
|
|
9652
|
+
tokenFlags |= 1024 /* UnicodeEscape */;
|
|
9653
|
+
tokenValue = "#" + String.fromCharCode(cookedChar2) + scanIdentifierParts();
|
|
9654
|
+
return token = 81 /* PrivateIdentifier */;
|
|
9655
|
+
}
|
|
9656
|
+
pos--;
|
|
9657
|
+
}
|
|
9658
|
+
if (isIdentifierStart(charAfterHash, languageVersion)) {
|
|
9659
|
+
pos++;
|
|
9660
|
+
scanIdentifier(charAfterHash, languageVersion);
|
|
9661
|
+
} else {
|
|
9662
|
+
tokenValue = "#";
|
|
9663
|
+
error(Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
9664
|
+
}
|
|
9665
|
+
return token = 81 /* PrivateIdentifier */;
|
|
9666
|
+
case 65533 /* replacementCharacter */:
|
|
9667
|
+
error(Diagnostics.File_appears_to_be_binary, 0, 0);
|
|
9668
|
+
pos = end;
|
|
9669
|
+
return token = 8 /* NonTextFileMarkerTrivia */;
|
|
9670
|
+
}
|
|
9646
9671
|
}
|
|
9672
|
+
const identifierKind = scanIdentifier(ch, languageVersion);
|
|
9673
|
+
if (identifierKind) {
|
|
9674
|
+
return token = identifierKind;
|
|
9675
|
+
} else if (isWhiteSpaceSingleLine(ch)) {
|
|
9676
|
+
pos += charSize(ch);
|
|
9677
|
+
continue;
|
|
9678
|
+
} else if (isLineBreak(ch)) {
|
|
9679
|
+
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9680
|
+
pos += charSize(ch);
|
|
9681
|
+
continue;
|
|
9682
|
+
}
|
|
9683
|
+
const size = charSize(ch);
|
|
9684
|
+
error(Diagnostics.Invalid_character, pos, size);
|
|
9685
|
+
pos += size;
|
|
9686
|
+
return token = 0 /* Unknown */;
|
|
9647
9687
|
}
|
|
9648
9688
|
}
|
|
9649
9689
|
function shouldParseJSDoc() {
|
|
@@ -16143,11 +16183,11 @@ function getOwnEmitOutputFilePath(fileName, host, extension) {
|
|
|
16143
16183
|
return emitOutputFilePathWithoutExtension + extension;
|
|
16144
16184
|
}
|
|
16145
16185
|
function getDeclarationEmitOutputFilePath(fileName, host) {
|
|
16146
|
-
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host
|
|
16186
|
+
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host);
|
|
16147
16187
|
}
|
|
16148
|
-
function getDeclarationEmitOutputFilePathWorker(fileName, options,
|
|
16188
|
+
function getDeclarationEmitOutputFilePathWorker(fileName, options, host) {
|
|
16149
16189
|
const outputDir = options.declarationDir || options.outDir;
|
|
16150
|
-
const path = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir,
|
|
16190
|
+
const path = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir, host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f) => host.getCanonicalFileName(f)) : fileName;
|
|
16151
16191
|
const declarationExtension = getDeclarationEmitExtensionForPath(path);
|
|
16152
16192
|
return removeFileExtension(path) + declarationExtension;
|
|
16153
16193
|
}
|
|
@@ -18279,40 +18319,8 @@ function tryParsePattern(pattern) {
|
|
|
18279
18319
|
suffix: pattern.substr(indexOfStar + 1)
|
|
18280
18320
|
};
|
|
18281
18321
|
}
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
let result = parsedPatternsCache.get(paths);
|
|
18285
|
-
if (result !== void 0) {
|
|
18286
|
-
return result;
|
|
18287
|
-
}
|
|
18288
|
-
let matchableStringSet;
|
|
18289
|
-
let sortedPatterns;
|
|
18290
|
-
const pathList = getOwnKeys(paths);
|
|
18291
|
-
for (const path of pathList) {
|
|
18292
|
-
const patternOrStr = tryParsePattern(path);
|
|
18293
|
-
if (patternOrStr === void 0) {
|
|
18294
|
-
continue;
|
|
18295
|
-
} else if (typeof patternOrStr === "string") {
|
|
18296
|
-
(matchableStringSet ?? (matchableStringSet = /* @__PURE__ */ new Set())).add(patternOrStr);
|
|
18297
|
-
} else {
|
|
18298
|
-
(sortedPatterns ?? (sortedPatterns = [])).push(patternOrStr);
|
|
18299
|
-
}
|
|
18300
|
-
}
|
|
18301
|
-
sortedPatterns == null ? void 0 : sortedPatterns.sort((a, b) => {
|
|
18302
|
-
const prefixComparison = compareStringsCaseSensitive(a.prefix, b.prefix);
|
|
18303
|
-
if (prefixComparison === 0 && sortByAggregateLength) {
|
|
18304
|
-
return a.suffix.length - b.suffix.length;
|
|
18305
|
-
}
|
|
18306
|
-
return prefixComparison;
|
|
18307
|
-
});
|
|
18308
|
-
parsedPatternsCache.set(
|
|
18309
|
-
paths,
|
|
18310
|
-
result = {
|
|
18311
|
-
matchableStringSet,
|
|
18312
|
-
sortedPatterns
|
|
18313
|
-
}
|
|
18314
|
-
);
|
|
18315
|
-
return result;
|
|
18322
|
+
function tryParsePatterns(paths) {
|
|
18323
|
+
return mapDefined(getOwnKeys(paths), (path) => tryParsePattern(path));
|
|
18316
18324
|
}
|
|
18317
18325
|
function positionIsSynthesized(pos) {
|
|
18318
18326
|
return !(pos >= 0);
|
|
@@ -18338,14 +18346,16 @@ var emptyFileSystemEntries = {
|
|
|
18338
18346
|
directories: emptyArray
|
|
18339
18347
|
};
|
|
18340
18348
|
function matchPatternOrExact(patternOrStrings, candidate) {
|
|
18341
|
-
const
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18349
|
+
const patterns = [];
|
|
18350
|
+
for (const patternOrString of patternOrStrings) {
|
|
18351
|
+
if (patternOrString === candidate) {
|
|
18352
|
+
return candidate;
|
|
18353
|
+
}
|
|
18354
|
+
if (!isString(patternOrString)) {
|
|
18355
|
+
patterns.push(patternOrString);
|
|
18356
|
+
}
|
|
18347
18357
|
}
|
|
18348
|
-
return findBestPatternMatch(
|
|
18358
|
+
return findBestPatternMatch(patterns, (_) => _, candidate);
|
|
18349
18359
|
}
|
|
18350
18360
|
function sliceAfter(arr, value) {
|
|
18351
18361
|
const index = arr.indexOf(value);
|
|
@@ -37968,6 +37978,8 @@ function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, exis
|
|
|
37968
37978
|
validatedFilesSpecBeforeSubstitution,
|
|
37969
37979
|
validatedIncludeSpecsBeforeSubstitution,
|
|
37970
37980
|
validatedExcludeSpecsBeforeSubstitution,
|
|
37981
|
+
pathPatterns: void 0,
|
|
37982
|
+
// Initialized on first use
|
|
37971
37983
|
isDefaultIncludeSpec
|
|
37972
37984
|
};
|
|
37973
37985
|
}
|
|
@@ -39592,7 +39604,8 @@ function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, co
|
|
|
39592
39604
|
}
|
|
39593
39605
|
}
|
|
39594
39606
|
function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {
|
|
39595
|
-
|
|
39607
|
+
var _a;
|
|
39608
|
+
const { baseUrl, paths, configFile } = state.compilerOptions;
|
|
39596
39609
|
if (paths && !pathIsRelative(moduleName)) {
|
|
39597
39610
|
if (state.traceEnabled) {
|
|
39598
39611
|
if (baseUrl) {
|
|
@@ -39601,7 +39614,7 @@ function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state
|
|
|
39601
39614
|
trace(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
|
|
39602
39615
|
}
|
|
39603
39616
|
const baseDirectory = getPathsBasePath(state.compilerOptions, state.host);
|
|
39604
|
-
const pathPatterns = tryParsePatterns(paths);
|
|
39617
|
+
const pathPatterns = (configFile == null ? void 0 : configFile.configFileSpecs) ? (_a = configFile.configFileSpecs).pathPatterns || (_a.pathPatterns = tryParsePatterns(paths)) : void 0;
|
|
39605
39618
|
return tryLoadModuleUsingPaths(
|
|
39606
39619
|
extensions,
|
|
39607
39620
|
moduleName,
|
|
@@ -40279,8 +40292,17 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
40279
40292
|
if (state.traceEnabled) {
|
|
40280
40293
|
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, moduleName);
|
|
40281
40294
|
}
|
|
40282
|
-
const
|
|
40283
|
-
|
|
40295
|
+
const result = tryLoadModuleUsingPaths(
|
|
40296
|
+
extensions,
|
|
40297
|
+
moduleName,
|
|
40298
|
+
candidate,
|
|
40299
|
+
versionPaths.paths,
|
|
40300
|
+
/*pathPatterns*/
|
|
40301
|
+
void 0,
|
|
40302
|
+
loader,
|
|
40303
|
+
onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex,
|
|
40304
|
+
state
|
|
40305
|
+
);
|
|
40284
40306
|
if (result) {
|
|
40285
40307
|
return removeIgnoredPackageId(result.value);
|
|
40286
40308
|
}
|
|
@@ -40872,8 +40894,17 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
40872
40894
|
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, rest);
|
|
40873
40895
|
}
|
|
40874
40896
|
const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host);
|
|
40875
|
-
const
|
|
40876
|
-
|
|
40897
|
+
const fromPaths = tryLoadModuleUsingPaths(
|
|
40898
|
+
extensions,
|
|
40899
|
+
rest,
|
|
40900
|
+
packageDirectory,
|
|
40901
|
+
versionPaths.paths,
|
|
40902
|
+
/*pathPatterns*/
|
|
40903
|
+
void 0,
|
|
40904
|
+
loader,
|
|
40905
|
+
!packageDirectoryExists,
|
|
40906
|
+
state
|
|
40907
|
+
);
|
|
40877
40908
|
if (fromPaths) {
|
|
40878
40909
|
return fromPaths.value;
|
|
40879
40910
|
}
|
|
@@ -40881,6 +40912,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
40881
40912
|
return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
|
|
40882
40913
|
}
|
|
40883
40914
|
function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) {
|
|
40915
|
+
pathPatterns || (pathPatterns = tryParsePatterns(paths));
|
|
40884
40916
|
const matchedPattern = matchPatternOrExact(pathPatterns, moduleName);
|
|
40885
40917
|
if (matchedPattern) {
|
|
40886
40918
|
const matchedStar = isString(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName);
|
|
@@ -59732,6 +59764,12 @@ function createTypeChecker(host) {
|
|
|
59732
59764
|
function eachUnionContains(unionTypes2, type) {
|
|
59733
59765
|
for (const u of unionTypes2) {
|
|
59734
59766
|
if (!containsType(u.types, type)) {
|
|
59767
|
+
if (type === missingType) {
|
|
59768
|
+
return containsType(u.types, undefinedType);
|
|
59769
|
+
}
|
|
59770
|
+
if (type === undefinedType) {
|
|
59771
|
+
return containsType(u.types, missingType);
|
|
59772
|
+
}
|
|
59735
59773
|
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
59736
59774
|
if (!primitive || !containsType(u.types, primitive)) {
|
|
59737
59775
|
return false;
|
|
@@ -59788,6 +59826,13 @@ function createTypeChecker(host) {
|
|
|
59788
59826
|
for (const t of u.types) {
|
|
59789
59827
|
if (insertType(checked, t)) {
|
|
59790
59828
|
if (eachUnionContains(unionTypes2, t)) {
|
|
59829
|
+
if (t === undefinedType && result.length && result[0] === missingType) {
|
|
59830
|
+
continue;
|
|
59831
|
+
}
|
|
59832
|
+
if (t === missingType && result.length && result[0] === undefinedType) {
|
|
59833
|
+
result[0] = missingType;
|
|
59834
|
+
continue;
|
|
59835
|
+
}
|
|
59791
59836
|
insertType(result, t);
|
|
59792
59837
|
}
|
|
59793
59838
|
}
|
|
@@ -110906,17 +110951,16 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110906
110951
|
function getDeclarationDiagnostics(host, resolver, file) {
|
|
110907
110952
|
const compilerOptions = host.getCompilerOptions();
|
|
110908
110953
|
const files = filter(getSourceFilesToEmit(host, file), isSourceFileNotJson);
|
|
110909
|
-
|
|
110954
|
+
return contains(files, file) ? transformNodes(
|
|
110910
110955
|
resolver,
|
|
110911
110956
|
host,
|
|
110912
110957
|
factory,
|
|
110913
110958
|
compilerOptions,
|
|
110914
|
-
|
|
110959
|
+
[file],
|
|
110915
110960
|
[transformDeclarations],
|
|
110916
110961
|
/*allowDtsFiles*/
|
|
110917
110962
|
false
|
|
110918
|
-
);
|
|
110919
|
-
return result.diagnostics;
|
|
110963
|
+
).diagnostics : void 0;
|
|
110920
110964
|
}
|
|
110921
110965
|
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 1 /* AllowUnresolvedNames */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */;
|
|
110922
110966
|
function transformDeclarations(context) {
|
|
@@ -119219,8 +119263,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119219
119263
|
let filesWithReferencesProcessed;
|
|
119220
119264
|
let fileReasonsToChain;
|
|
119221
119265
|
let reasonToRelatedInfo;
|
|
119222
|
-
|
|
119223
|
-
|
|
119266
|
+
let cachedBindAndCheckDiagnosticsForFile;
|
|
119267
|
+
let cachedDeclarationDiagnosticsForFile;
|
|
119224
119268
|
let fileProcessingDiagnostics;
|
|
119225
119269
|
let automaticTypeDirectiveNames;
|
|
119226
119270
|
let automaticTypeDirectiveResolutions;
|
|
@@ -120300,8 +120344,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120300
120344
|
);
|
|
120301
120345
|
}
|
|
120302
120346
|
function getCachedSemanticDiagnostics(sourceFile) {
|
|
120303
|
-
|
|
120304
|
-
return sourceFile ? (_a2 = cachedBindAndCheckDiagnosticsForFile.perFile) == null ? void 0 : _a2.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics;
|
|
120347
|
+
return cachedBindAndCheckDiagnosticsForFile == null ? void 0 : cachedBindAndCheckDiagnosticsForFile.get(sourceFile.path);
|
|
120305
120348
|
}
|
|
120306
120349
|
function getBindAndCheckDiagnostics(sourceFile, cancellationToken) {
|
|
120307
120350
|
return getBindAndCheckDiagnosticsForFile(
|
|
@@ -120323,12 +120366,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120323
120366
|
return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, programDiagnosticsInFile).diagnostics;
|
|
120324
120367
|
}
|
|
120325
120368
|
function getDeclarationDiagnostics2(sourceFile, cancellationToken) {
|
|
120326
|
-
|
|
120327
|
-
if (!sourceFile || options2.outFile) {
|
|
120328
|
-
return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
|
|
120329
|
-
} else {
|
|
120330
|
-
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
|
|
120331
|
-
}
|
|
120369
|
+
return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken);
|
|
120332
120370
|
}
|
|
120333
120371
|
function getSyntacticDiagnosticsForFile(sourceFile) {
|
|
120334
120372
|
if (isSourceFileJS(sourceFile)) {
|
|
@@ -120359,7 +120397,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120359
120397
|
if (nodesToCheck) {
|
|
120360
120398
|
return getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck);
|
|
120361
120399
|
}
|
|
120362
|
-
|
|
120400
|
+
let result = cachedBindAndCheckDiagnosticsForFile == null ? void 0 : cachedBindAndCheckDiagnosticsForFile.get(sourceFile.path);
|
|
120401
|
+
if (!result) {
|
|
120402
|
+
(cachedBindAndCheckDiagnosticsForFile ?? (cachedBindAndCheckDiagnosticsForFile = /* @__PURE__ */ new Map())).set(
|
|
120403
|
+
sourceFile.path,
|
|
120404
|
+
result = getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken)
|
|
120405
|
+
);
|
|
120406
|
+
}
|
|
120407
|
+
return result;
|
|
120363
120408
|
}
|
|
120364
120409
|
function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck) {
|
|
120365
120410
|
return runWithCancellationToken(() => {
|
|
@@ -120647,7 +120692,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120647
120692
|
});
|
|
120648
120693
|
}
|
|
120649
120694
|
function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) {
|
|
120650
|
-
|
|
120695
|
+
let result = cachedDeclarationDiagnosticsForFile == null ? void 0 : cachedDeclarationDiagnosticsForFile.get(sourceFile.path);
|
|
120696
|
+
if (!result) {
|
|
120697
|
+
(cachedDeclarationDiagnosticsForFile ?? (cachedDeclarationDiagnosticsForFile = /* @__PURE__ */ new Map())).set(
|
|
120698
|
+
sourceFile.path,
|
|
120699
|
+
result = getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken)
|
|
120700
|
+
);
|
|
120701
|
+
}
|
|
120702
|
+
return result;
|
|
120651
120703
|
}
|
|
120652
120704
|
function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) {
|
|
120653
120705
|
return runWithCancellationToken(() => {
|
|
@@ -120655,22 +120707,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120655
120707
|
return getDeclarationDiagnostics(getEmitHost(noop), resolver, sourceFile) || emptyArray;
|
|
120656
120708
|
});
|
|
120657
120709
|
}
|
|
120658
|
-
function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) {
|
|
120659
|
-
var _a2;
|
|
120660
|
-
const cachedResult = sourceFile ? (_a2 = cache.perFile) == null ? void 0 : _a2.get(sourceFile.path) : cache.allDiagnostics;
|
|
120661
|
-
if (cachedResult) {
|
|
120662
|
-
return cachedResult;
|
|
120663
|
-
}
|
|
120664
|
-
const result = getDiagnostics(sourceFile, cancellationToken);
|
|
120665
|
-
if (sourceFile) {
|
|
120666
|
-
(cache.perFile || (cache.perFile = /* @__PURE__ */ new Map())).set(sourceFile.path, result);
|
|
120667
|
-
} else {
|
|
120668
|
-
cache.allDiagnostics = result;
|
|
120669
|
-
}
|
|
120670
|
-
return result;
|
|
120671
|
-
}
|
|
120672
120710
|
function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) {
|
|
120673
|
-
return sourceFile.isDeclarationFile ?
|
|
120711
|
+
return sourceFile.isDeclarationFile ? emptyArray : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken);
|
|
120674
120712
|
}
|
|
120675
120713
|
function getOptionsDiagnostics() {
|
|
120676
120714
|
return sortAndDeduplicateDiagnostics(concatenate(
|
|
@@ -121618,7 +121656,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121618
121656
|
if (options.outDir || // there is --outDir specified
|
|
121619
121657
|
options.rootDir || // there is --rootDir specified
|
|
121620
121658
|
options.sourceRoot || // there is --sourceRoot specified
|
|
121621
|
-
options.mapRoot
|
|
121659
|
+
options.mapRoot || // there is --mapRoot specified
|
|
121660
|
+
getEmitDeclarations(options) && options.declarationDir) {
|
|
121622
121661
|
const dir = getCommonSourceDirectory2();
|
|
121623
121662
|
if (options.outDir && dir === "" && files.some((file) => getRootLength(file.fileName) > 1)) {
|
|
121624
121663
|
createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
|
|
@@ -121631,14 +121670,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121631
121670
|
if (!getEmitDeclarations(options)) {
|
|
121632
121671
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "emitDeclarationOnly", "declaration", "composite");
|
|
121633
121672
|
}
|
|
121634
|
-
if (options.noEmit) {
|
|
121635
|
-
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit");
|
|
121636
|
-
}
|
|
121637
|
-
}
|
|
121638
|
-
if (options.noCheck) {
|
|
121639
|
-
if (options.noEmit) {
|
|
121640
|
-
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit");
|
|
121641
|
-
}
|
|
121642
121673
|
}
|
|
121643
121674
|
if (options.emitDecoratorMetadata && !options.experimentalDecorators) {
|
|
121644
121675
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators");
|
|
@@ -122375,7 +122406,6 @@ var emitSkippedWithNoDiagnostics = { diagnostics: emptyArray, sourceMaps: void 0
|
|
|
122375
122406
|
function handleNoEmitOptions(program, sourceFile, writeFile2, cancellationToken) {
|
|
122376
122407
|
const options = program.getCompilerOptions();
|
|
122377
122408
|
if (options.noEmit) {
|
|
122378
|
-
program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
|
122379
122409
|
return sourceFile ? emitSkippedWithNoDiagnostics : program.emitBuildInfo(writeFile2, cancellationToken);
|
|
122380
122410
|
}
|
|
122381
122411
|
if (!options.noEmitOnError) return void 0;
|
|
@@ -122852,9 +122882,9 @@ function getBuilderFileEmit(options) {
|
|
|
122852
122882
|
let result = 1 /* Js */;
|
|
122853
122883
|
if (options.sourceMap) result = result | 2 /* JsMap */;
|
|
122854
122884
|
if (options.inlineSourceMap) result = result | 4 /* JsInlineMap */;
|
|
122855
|
-
if (getEmitDeclarations(options)) result = result |
|
|
122856
|
-
if (options.declarationMap) result = result |
|
|
122857
|
-
if (options.emitDeclarationOnly) result = result &
|
|
122885
|
+
if (getEmitDeclarations(options)) result = result | 24 /* Dts */;
|
|
122886
|
+
if (options.declarationMap) result = result | 32 /* DtsMap */;
|
|
122887
|
+
if (options.emitDeclarationOnly) result = result & 56 /* AllDts */;
|
|
122858
122888
|
return result;
|
|
122859
122889
|
}
|
|
122860
122890
|
function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
|
|
@@ -122865,7 +122895,8 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
|
|
|
122865
122895
|
const diff = oldEmitKind ^ emitKind;
|
|
122866
122896
|
let result = 0 /* None */;
|
|
122867
122897
|
if (diff & 7 /* AllJs */) result = emitKind & 7 /* AllJs */;
|
|
122868
|
-
if (diff &
|
|
122898
|
+
if (diff & 8 /* DtsErrors */) result = result | emitKind & 8 /* DtsErrors */;
|
|
122899
|
+
if (diff & 48 /* AllDtsEmit */) result = result | emitKind & 48 /* AllDtsEmit */;
|
|
122869
122900
|
return result;
|
|
122870
122901
|
}
|
|
122871
122902
|
function hasSameKeys(map1, map2) {
|
|
@@ -123119,25 +123150,34 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
123119
123150
|
if (!state.seenAffectedFiles) state.seenAffectedFiles = /* @__PURE__ */ new Set();
|
|
123120
123151
|
}
|
|
123121
123152
|
}
|
|
123122
|
-
function clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles) {
|
|
123153
|
+
function clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors) {
|
|
123123
123154
|
var _a, _b;
|
|
123124
123155
|
if (!((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.size) && !state.programEmitPending) return;
|
|
123125
|
-
if (!emitOnlyDtsFiles) {
|
|
123156
|
+
if (!emitOnlyDtsFiles && !isForDtsErrors) {
|
|
123126
123157
|
state.affectedFilesPendingEmit = void 0;
|
|
123127
123158
|
state.programEmitPending = void 0;
|
|
123128
123159
|
}
|
|
123129
123160
|
(_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.forEach((emitKind, path) => {
|
|
123130
|
-
const pending = emitKind & 7 /* AllJs
|
|
123161
|
+
const pending = !isForDtsErrors ? emitKind & 7 /* AllJs */ : emitKind & (7 /* AllJs */ | 48 /* AllDtsEmit */);
|
|
123131
123162
|
if (!pending) state.affectedFilesPendingEmit.delete(path);
|
|
123132
123163
|
else state.affectedFilesPendingEmit.set(path, pending);
|
|
123133
123164
|
});
|
|
123134
123165
|
if (state.programEmitPending) {
|
|
123135
|
-
const pending = state.programEmitPending & 7 /* AllJs
|
|
123166
|
+
const pending = !isForDtsErrors ? state.programEmitPending & 7 /* AllJs */ : state.programEmitPending & (7 /* AllJs */ | 48 /* AllDtsEmit */);
|
|
123136
123167
|
if (!pending) state.programEmitPending = void 0;
|
|
123137
123168
|
else state.programEmitPending = pending;
|
|
123138
123169
|
}
|
|
123139
123170
|
}
|
|
123140
|
-
function
|
|
123171
|
+
function getPendingEmitKindWithSeen(optionsOrEmitKind, seenOldOptionsOrEmitKind, emitOnlyDtsFiles, isForDtsErrors) {
|
|
123172
|
+
let pendingKind = getPendingEmitKind(optionsOrEmitKind, seenOldOptionsOrEmitKind);
|
|
123173
|
+
if (emitOnlyDtsFiles) pendingKind = pendingKind & 56 /* AllDts */;
|
|
123174
|
+
if (isForDtsErrors) pendingKind = pendingKind & 8 /* DtsErrors */;
|
|
123175
|
+
return pendingKind;
|
|
123176
|
+
}
|
|
123177
|
+
function getBuilderFileEmitAllDts(isForDtsErrors) {
|
|
123178
|
+
return !isForDtsErrors ? 56 /* AllDts */ : 8 /* DtsErrors */;
|
|
123179
|
+
}
|
|
123180
|
+
function getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles, isForDtsErrors) {
|
|
123141
123181
|
var _a;
|
|
123142
123182
|
if (!((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.size)) return void 0;
|
|
123143
123183
|
return forEachEntry(state.affectedFilesPendingEmit, (emitKind, path) => {
|
|
@@ -123148,12 +123188,16 @@ function getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles) {
|
|
|
123148
123188
|
return void 0;
|
|
123149
123189
|
}
|
|
123150
123190
|
const seenKind = (_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedFile.resolvedPath);
|
|
123151
|
-
|
|
123152
|
-
|
|
123191
|
+
const pendingKind = getPendingEmitKindWithSeen(
|
|
123192
|
+
emitKind,
|
|
123193
|
+
seenKind,
|
|
123194
|
+
emitOnlyDtsFiles,
|
|
123195
|
+
isForDtsErrors
|
|
123196
|
+
);
|
|
123153
123197
|
if (pendingKind) return { affectedFile, emitKind: pendingKind };
|
|
123154
123198
|
});
|
|
123155
123199
|
}
|
|
123156
|
-
function getNextPendingEmitDiagnosticsFile(state) {
|
|
123200
|
+
function getNextPendingEmitDiagnosticsFile(state, isForDtsErrors) {
|
|
123157
123201
|
var _a;
|
|
123158
123202
|
if (!((_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.size)) return void 0;
|
|
123159
123203
|
return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path) => {
|
|
@@ -123164,7 +123208,7 @@ function getNextPendingEmitDiagnosticsFile(state) {
|
|
|
123164
123208
|
return void 0;
|
|
123165
123209
|
}
|
|
123166
123210
|
const seenKind = ((_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedFile.resolvedPath)) || 0 /* None */;
|
|
123167
|
-
if (!(seenKind &
|
|
123211
|
+
if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) return { affectedFile, diagnostics, seenKind };
|
|
123168
123212
|
});
|
|
123169
123213
|
}
|
|
123170
123214
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
@@ -123219,7 +123263,7 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
|
|
|
123219
123263
|
addToAffectedFilesPendingEmit(
|
|
123220
123264
|
state,
|
|
123221
123265
|
path,
|
|
123222
|
-
state.compilerOptions.declarationMap ?
|
|
123266
|
+
state.compilerOptions.declarationMap ? 56 /* AllDts */ : 24 /* Dts */
|
|
123223
123267
|
);
|
|
123224
123268
|
}
|
|
123225
123269
|
}
|
|
@@ -123419,8 +123463,9 @@ function getBuildInfo2(state) {
|
|
|
123419
123463
|
root,
|
|
123420
123464
|
resolvedRoot: toResolvedRoot(),
|
|
123421
123465
|
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123422
|
-
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
123466
|
+
semanticDiagnosticsPerFile: !state.changedFilesSet.size ? toIncrementalBuildInfoDiagnostics() : void 0,
|
|
123423
123467
|
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123468
|
+
changeFileSet: toChangeFileSet(),
|
|
123424
123469
|
outSignature: state.outSignature,
|
|
123425
123470
|
latestChangedDtsFile,
|
|
123426
123471
|
pendingEmit: !state.programEmitPending ? void 0 : (
|
|
@@ -123504,7 +123549,7 @@ function getBuildInfo2(state) {
|
|
|
123504
123549
|
affectedFilesPendingEmit,
|
|
123505
123550
|
pendingEmit === fullEmitForOptions ? fileId : (
|
|
123506
123551
|
// Pending full emit per options
|
|
123507
|
-
pendingEmit ===
|
|
123552
|
+
pendingEmit === 24 /* Dts */ ? [fileId] : (
|
|
123508
123553
|
// Pending on Dts only
|
|
123509
123554
|
[fileId, pendingEmit]
|
|
123510
123555
|
)
|
|
@@ -123524,6 +123569,7 @@ function getBuildInfo2(state) {
|
|
|
123524
123569
|
referencedMap,
|
|
123525
123570
|
semanticDiagnosticsPerFile,
|
|
123526
123571
|
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123572
|
+
changeFileSet: toChangeFileSet(),
|
|
123527
123573
|
affectedFilesPendingEmit,
|
|
123528
123574
|
emitSignatures,
|
|
123529
123575
|
latestChangedDtsFile,
|
|
@@ -123612,7 +123658,7 @@ function getBuildInfo2(state) {
|
|
|
123612
123658
|
state.fileInfos.forEach((_value, key) => {
|
|
123613
123659
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
123614
123660
|
if (!value) {
|
|
123615
|
-
result = append(result, toFileId(key));
|
|
123661
|
+
if (!state.changedFilesSet.has(key)) result = append(result, toFileId(key));
|
|
123616
123662
|
} else if (value.length) {
|
|
123617
123663
|
result = append(result, [
|
|
123618
123664
|
toFileId(key),
|
|
@@ -123679,6 +123725,15 @@ function getBuildInfo2(state) {
|
|
|
123679
123725
|
return result;
|
|
123680
123726
|
}) || array;
|
|
123681
123727
|
}
|
|
123728
|
+
function toChangeFileSet() {
|
|
123729
|
+
let changeFileSet;
|
|
123730
|
+
if (state.changedFilesSet.size) {
|
|
123731
|
+
for (const path of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) {
|
|
123732
|
+
changeFileSet = append(changeFileSet, toFileId(path));
|
|
123733
|
+
}
|
|
123734
|
+
}
|
|
123735
|
+
return changeFileSet;
|
|
123736
|
+
}
|
|
123682
123737
|
}
|
|
123683
123738
|
function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
123684
123739
|
let host;
|
|
@@ -123757,6 +123812,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123757
123812
|
sourceFile
|
|
123758
123813
|
);
|
|
123759
123814
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
123815
|
+
builderProgram.getDeclarationDiagnostics = getDeclarationDiagnostics2;
|
|
123760
123816
|
builderProgram.emit = emit;
|
|
123761
123817
|
builderProgram.releaseProgram = () => releaseCache(state);
|
|
123762
123818
|
if (kind === 0 /* SemanticDiagnosticsBuilderProgram */) {
|
|
@@ -123781,21 +123837,31 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123781
123837
|
}
|
|
123782
123838
|
return emitSkippedWithNoDiagnostics;
|
|
123783
123839
|
}
|
|
123784
|
-
function
|
|
123840
|
+
function emitNextAffectedFileOrDtsErrors(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers, isForDtsErrors) {
|
|
123785
123841
|
var _a, _b, _c, _d;
|
|
123786
123842
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123787
123843
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123788
123844
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
123789
|
-
let emitKind = emitOnlyDtsFiles ? programEmitKind &
|
|
123845
|
+
let emitKind = !isForDtsErrors ? emitOnlyDtsFiles ? programEmitKind & 56 /* AllDts */ : programEmitKind : 8 /* DtsErrors */;
|
|
123790
123846
|
if (!affected) {
|
|
123791
123847
|
if (!state.compilerOptions.outFile) {
|
|
123792
|
-
const pendingAffectedFile = getNextAffectedFilePendingEmit(
|
|
123848
|
+
const pendingAffectedFile = getNextAffectedFilePendingEmit(
|
|
123849
|
+
state,
|
|
123850
|
+
emitOnlyDtsFiles,
|
|
123851
|
+
isForDtsErrors
|
|
123852
|
+
);
|
|
123793
123853
|
if (pendingAffectedFile) {
|
|
123794
123854
|
({ affectedFile: affected, emitKind } = pendingAffectedFile);
|
|
123795
123855
|
} else {
|
|
123796
|
-
const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(
|
|
123856
|
+
const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(
|
|
123857
|
+
state,
|
|
123858
|
+
isForDtsErrors
|
|
123859
|
+
);
|
|
123797
123860
|
if (pendingForDiagnostics) {
|
|
123798
|
-
(state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(
|
|
123861
|
+
(state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(
|
|
123862
|
+
pendingForDiagnostics.affectedFile.resolvedPath,
|
|
123863
|
+
pendingForDiagnostics.seenKind | getBuilderFileEmitAllDts(isForDtsErrors)
|
|
123864
|
+
);
|
|
123799
123865
|
return {
|
|
123800
123866
|
result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics },
|
|
123801
123867
|
affected: pendingForDiagnostics.affectedFile
|
|
@@ -123804,14 +123870,18 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123804
123870
|
}
|
|
123805
123871
|
} else {
|
|
123806
123872
|
if (state.programEmitPending) {
|
|
123807
|
-
emitKind =
|
|
123808
|
-
|
|
123873
|
+
emitKind = getPendingEmitKindWithSeen(
|
|
123874
|
+
state.programEmitPending,
|
|
123875
|
+
state.seenProgramEmit,
|
|
123876
|
+
emitOnlyDtsFiles,
|
|
123877
|
+
isForDtsErrors
|
|
123878
|
+
);
|
|
123809
123879
|
if (emitKind) affected = state.program;
|
|
123810
123880
|
}
|
|
123811
123881
|
if (!affected && ((_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.size)) {
|
|
123812
123882
|
const seenKind = state.seenProgramEmit || 0 /* None */;
|
|
123813
|
-
if (!(seenKind &
|
|
123814
|
-
state.seenProgramEmit =
|
|
123883
|
+
if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) {
|
|
123884
|
+
state.seenProgramEmit = getBuilderFileEmitAllDts(isForDtsErrors) | seenKind;
|
|
123815
123885
|
const diagnostics = [];
|
|
123816
123886
|
state.emitDiagnosticsPerFile.forEach((d) => addRange(diagnostics, d));
|
|
123817
123887
|
return {
|
|
@@ -123822,7 +123892,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123822
123892
|
}
|
|
123823
123893
|
}
|
|
123824
123894
|
if (!affected) {
|
|
123825
|
-
if (!getBuildInfoEmitPending(state)) return void 0;
|
|
123895
|
+
if (isForDtsErrors || !getBuildInfoEmitPending(state)) return void 0;
|
|
123826
123896
|
const affected2 = state.program;
|
|
123827
123897
|
const result2 = affected2.emitBuildInfo(
|
|
123828
123898
|
writeFile2 || maybeBind(host, host.writeFile),
|
|
@@ -123834,8 +123904,8 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123834
123904
|
}
|
|
123835
123905
|
let emitOnly;
|
|
123836
123906
|
if (emitKind & 7 /* AllJs */) emitOnly = 0 /* Js */;
|
|
123837
|
-
if (emitKind &
|
|
123838
|
-
const result = state.program.emit(
|
|
123907
|
+
if (emitKind & 56 /* AllDts */) emitOnly = emitOnly === void 0 ? 1 /* Dts */ : void 0;
|
|
123908
|
+
const result = !isForDtsErrors ? state.program.emit(
|
|
123839
123909
|
affected === state.program ? void 0 : affected,
|
|
123840
123910
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
123841
123911
|
cancellationToken,
|
|
@@ -123845,7 +123915,13 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123845
123915
|
void 0,
|
|
123846
123916
|
/*skipBuildInfo*/
|
|
123847
123917
|
true
|
|
123848
|
-
)
|
|
123918
|
+
) : {
|
|
123919
|
+
emitSkipped: true,
|
|
123920
|
+
diagnostics: state.program.getDeclarationDiagnostics(
|
|
123921
|
+
affected === state.program ? void 0 : affected,
|
|
123922
|
+
cancellationToken
|
|
123923
|
+
)
|
|
123924
|
+
};
|
|
123849
123925
|
if (affected !== state.program) {
|
|
123850
123926
|
const affectedSourceFile = affected;
|
|
123851
123927
|
state.seenAffectedFiles.add(affectedSourceFile.resolvedPath);
|
|
@@ -123862,18 +123938,31 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123862
123938
|
state.changedFilesSet.clear();
|
|
123863
123939
|
state.programEmitPending = state.changedFilesSet.size ? getPendingEmitKind(programEmitKind, emitKind) : state.programEmitPending ? getPendingEmitKind(state.programEmitPending, emitKind) : void 0;
|
|
123864
123940
|
state.seenProgramEmit = emitKind | (state.seenProgramEmit || 0 /* None */);
|
|
123865
|
-
|
|
123866
|
-
result.diagnostics.forEach((d) => {
|
|
123867
|
-
if (!d.file) return;
|
|
123868
|
-
let diagnostics = emitDiagnosticsPerFile == null ? void 0 : emitDiagnosticsPerFile.get(d.file.resolvedPath);
|
|
123869
|
-
if (!diagnostics) (emitDiagnosticsPerFile ?? (emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(d.file.resolvedPath, diagnostics = []);
|
|
123870
|
-
diagnostics.push(d);
|
|
123871
|
-
});
|
|
123872
|
-
if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile;
|
|
123941
|
+
setEmitDiagnosticsPerFile(result.diagnostics);
|
|
123873
123942
|
state.buildInfoEmitPending = true;
|
|
123874
123943
|
}
|
|
123875
123944
|
return { result, affected };
|
|
123876
123945
|
}
|
|
123946
|
+
function setEmitDiagnosticsPerFile(diagnostics) {
|
|
123947
|
+
let emitDiagnosticsPerFile;
|
|
123948
|
+
diagnostics.forEach((d) => {
|
|
123949
|
+
if (!d.file) return;
|
|
123950
|
+
let diagnostics2 = emitDiagnosticsPerFile == null ? void 0 : emitDiagnosticsPerFile.get(d.file.resolvedPath);
|
|
123951
|
+
if (!diagnostics2) (emitDiagnosticsPerFile ?? (emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(d.file.resolvedPath, diagnostics2 = []);
|
|
123952
|
+
diagnostics2.push(d);
|
|
123953
|
+
});
|
|
123954
|
+
if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile;
|
|
123955
|
+
}
|
|
123956
|
+
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123957
|
+
return emitNextAffectedFileOrDtsErrors(
|
|
123958
|
+
writeFile2,
|
|
123959
|
+
cancellationToken,
|
|
123960
|
+
emitOnlyDtsFiles,
|
|
123961
|
+
customTransformers,
|
|
123962
|
+
/*isForDtsErrors*/
|
|
123963
|
+
false
|
|
123964
|
+
);
|
|
123965
|
+
}
|
|
123877
123966
|
function getWriteFileCallback(writeFile2, customTransformers) {
|
|
123878
123967
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123879
123968
|
if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
|
|
@@ -123973,16 +124062,69 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123973
124062
|
sourceMaps
|
|
123974
124063
|
};
|
|
123975
124064
|
} else {
|
|
123976
|
-
clearAffectedFilesPendingEmit(
|
|
124065
|
+
clearAffectedFilesPendingEmit(
|
|
124066
|
+
state,
|
|
124067
|
+
emitOnlyDtsFiles,
|
|
124068
|
+
/*isForDtsErrors*/
|
|
124069
|
+
false
|
|
124070
|
+
);
|
|
123977
124071
|
}
|
|
123978
124072
|
}
|
|
123979
|
-
|
|
124073
|
+
const emitResult = state.program.emit(
|
|
123980
124074
|
targetSourceFile,
|
|
123981
124075
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
123982
124076
|
cancellationToken,
|
|
123983
124077
|
emitOnlyDtsFiles,
|
|
123984
124078
|
customTransformers
|
|
123985
124079
|
);
|
|
124080
|
+
handleNonEmitBuilderWithEmitOrDtsErrors(
|
|
124081
|
+
targetSourceFile,
|
|
124082
|
+
emitOnlyDtsFiles,
|
|
124083
|
+
/*isForDtsErrors*/
|
|
124084
|
+
false,
|
|
124085
|
+
emitResult.diagnostics
|
|
124086
|
+
);
|
|
124087
|
+
return emitResult;
|
|
124088
|
+
}
|
|
124089
|
+
function handleNonEmitBuilderWithEmitOrDtsErrors(targetSourceFile, emitOnlyDtsFiles, isForDtsErrors, diagnostics) {
|
|
124090
|
+
if (!targetSourceFile && kind !== 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
124091
|
+
clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors);
|
|
124092
|
+
setEmitDiagnosticsPerFile(diagnostics);
|
|
124093
|
+
}
|
|
124094
|
+
}
|
|
124095
|
+
function getDeclarationDiagnostics2(sourceFile, cancellationToken) {
|
|
124096
|
+
var _a;
|
|
124097
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
124098
|
+
if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
124099
|
+
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
|
|
124100
|
+
let affectedEmitResult;
|
|
124101
|
+
let diagnostics;
|
|
124102
|
+
while (affectedEmitResult = emitNextAffectedFileOrDtsErrors(
|
|
124103
|
+
/*writeFile*/
|
|
124104
|
+
void 0,
|
|
124105
|
+
cancellationToken,
|
|
124106
|
+
/*emitOnlyDtsFiles*/
|
|
124107
|
+
void 0,
|
|
124108
|
+
/*customTransformers*/
|
|
124109
|
+
void 0,
|
|
124110
|
+
/*isForDtsErrors*/
|
|
124111
|
+
true
|
|
124112
|
+
)) {
|
|
124113
|
+
if (!sourceFile) diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
124114
|
+
}
|
|
124115
|
+
return (!sourceFile ? diagnostics : (_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.get(sourceFile.resolvedPath)) || emptyArray;
|
|
124116
|
+
} else {
|
|
124117
|
+
const result = state.program.getDeclarationDiagnostics(sourceFile, cancellationToken);
|
|
124118
|
+
handleNonEmitBuilderWithEmitOrDtsErrors(
|
|
124119
|
+
sourceFile,
|
|
124120
|
+
/*emitOnlyDtsFiles*/
|
|
124121
|
+
void 0,
|
|
124122
|
+
/*isForDtsErrors*/
|
|
124123
|
+
true,
|
|
124124
|
+
result
|
|
124125
|
+
);
|
|
124126
|
+
return result;
|
|
124127
|
+
}
|
|
123986
124128
|
}
|
|
123987
124129
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
123988
124130
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
@@ -124060,7 +124202,7 @@ function toBuilderStateFileInfoForMultiEmit(fileInfo) {
|
|
|
124060
124202
|
return isString(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
|
|
124061
124203
|
}
|
|
124062
124204
|
function toBuilderFileEmit(value, fullEmitForOptions) {
|
|
124063
|
-
return isNumber(value) ? fullEmitForOptions : value[1] ||
|
|
124205
|
+
return isNumber(value) ? fullEmitForOptions : value[1] || 24 /* Dts */;
|
|
124064
124206
|
}
|
|
124065
124207
|
function toProgramEmitPending(value, options) {
|
|
124066
124208
|
return !value ? getBuilderFileEmit(options || {}) : value;
|
|
@@ -124074,6 +124216,7 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
124074
124216
|
let filePathsSetList;
|
|
124075
124217
|
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
124076
124218
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
124219
|
+
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
124077
124220
|
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
124078
124221
|
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
124079
124222
|
const path = toFilePath(index + 1);
|
|
@@ -124085,6 +124228,7 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
124085
124228
|
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124086
124229
|
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
124087
124230
|
hasReusableDiagnostic: true,
|
|
124231
|
+
changedFilesSet,
|
|
124088
124232
|
latestChangedDtsFile,
|
|
124089
124233
|
outSignature: buildInfo.outSignature,
|
|
124090
124234
|
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options),
|
|
@@ -124121,6 +124265,7 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
124121
124265
|
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124122
124266
|
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
124123
124267
|
hasReusableDiagnostic: true,
|
|
124268
|
+
changedFilesSet,
|
|
124124
124269
|
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
124125
124270
|
latestChangedDtsFile,
|
|
124126
124271
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0,
|
|
@@ -124173,7 +124318,7 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
124173
124318
|
const semanticDiagnostics = new Map(
|
|
124174
124319
|
mapDefinedIterator(
|
|
124175
124320
|
fileInfos.keys(),
|
|
124176
|
-
(key) => [key, emptyArray]
|
|
124321
|
+
(key) => !changedFilesSet.has(key) ? [key, emptyArray] : void 0
|
|
124177
124322
|
)
|
|
124178
124323
|
);
|
|
124179
124324
|
diagnostics == null ? void 0 : diagnostics.forEach((value) => {
|
|
@@ -125742,7 +125887,7 @@ function toFileName(file, fileNameConvertor) {
|
|
|
125742
125887
|
return fileNameConvertor ? fileNameConvertor(fileName) : fileName;
|
|
125743
125888
|
}
|
|
125744
125889
|
function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
125745
|
-
const
|
|
125890
|
+
const options = program.getCompilerOptions();
|
|
125746
125891
|
const allDiagnostics = program.getConfigFileParsingDiagnostics().slice();
|
|
125747
125892
|
const configFileParsingDiagnosticsLength = allDiagnostics.length;
|
|
125748
125893
|
addRange(allDiagnostics, program.getSyntacticDiagnostics(
|
|
@@ -125752,7 +125897,7 @@ function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummar
|
|
|
125752
125897
|
));
|
|
125753
125898
|
if (allDiagnostics.length === configFileParsingDiagnosticsLength) {
|
|
125754
125899
|
addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken));
|
|
125755
|
-
if (!
|
|
125900
|
+
if (!options.listFilesOnly) {
|
|
125756
125901
|
addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken));
|
|
125757
125902
|
if (allDiagnostics.length === configFileParsingDiagnosticsLength) {
|
|
125758
125903
|
addRange(allDiagnostics, program.getSemanticDiagnostics(
|
|
@@ -125761,9 +125906,16 @@ function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummar
|
|
|
125761
125906
|
cancellationToken
|
|
125762
125907
|
));
|
|
125763
125908
|
}
|
|
125909
|
+
if (options.noEmit && getEmitDeclarations(options) && allDiagnostics.length === configFileParsingDiagnosticsLength) {
|
|
125910
|
+
addRange(allDiagnostics, program.getDeclarationDiagnostics(
|
|
125911
|
+
/*sourceFile*/
|
|
125912
|
+
void 0,
|
|
125913
|
+
cancellationToken
|
|
125914
|
+
));
|
|
125915
|
+
}
|
|
125764
125916
|
}
|
|
125765
125917
|
}
|
|
125766
|
-
const emitResult =
|
|
125918
|
+
const emitResult = options.listFilesOnly ? { emitSkipped: true, diagnostics: emptyArray } : program.emit(
|
|
125767
125919
|
/*targetSourceFile*/
|
|
125768
125920
|
void 0,
|
|
125769
125921
|
writeFile2,
|
|
@@ -127582,7 +127734,7 @@ function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime,
|
|
|
127582
127734
|
}
|
|
127583
127735
|
}
|
|
127584
127736
|
function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
127585
|
-
var _a, _b, _c;
|
|
127737
|
+
var _a, _b, _c, _d, _e;
|
|
127586
127738
|
if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
|
|
127587
127739
|
return {
|
|
127588
127740
|
type: 15 /* ContainerOnly */
|
|
@@ -127644,19 +127796,25 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127644
127796
|
};
|
|
127645
127797
|
}
|
|
127646
127798
|
if (incrementalBuildInfo) {
|
|
127647
|
-
if (!project.options.noCheck && (((_a = incrementalBuildInfo.
|
|
127799
|
+
if (!project.options.noCheck && (((_a = incrementalBuildInfo.changeFileSet) == null ? void 0 : _a.length) || ((_b = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _b.length) || getEmitDeclarations(project.options) && ((_c = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _c.length))) {
|
|
127648
127800
|
return {
|
|
127649
127801
|
type: 8 /* OutOfDateBuildInfoWithErrors */,
|
|
127650
127802
|
buildInfoFile: buildInfoPath
|
|
127651
127803
|
};
|
|
127652
127804
|
}
|
|
127653
|
-
if (!project.options.noEmit && (((
|
|
127805
|
+
if (!project.options.noEmit && (((_d = incrementalBuildInfo.changeFileSet) == null ? void 0 : _d.length) || ((_e = incrementalBuildInfo.affectedFilesPendingEmit) == null ? void 0 : _e.length) || incrementalBuildInfo.pendingEmit !== void 0)) {
|
|
127654
127806
|
return {
|
|
127655
127807
|
type: 7 /* OutOfDateBuildInfoWithPendingEmit */,
|
|
127656
127808
|
buildInfoFile: buildInfoPath
|
|
127657
127809
|
};
|
|
127658
127810
|
}
|
|
127659
|
-
if (!project.options.noEmit
|
|
127811
|
+
if ((!project.options.noEmit || project.options.noEmit && getEmitDeclarations(project.options)) && getPendingEmitKindWithSeen(
|
|
127812
|
+
project.options,
|
|
127813
|
+
incrementalBuildInfo.options || {},
|
|
127814
|
+
/*emitOnlyDtsFiles*/
|
|
127815
|
+
void 0,
|
|
127816
|
+
!!project.options.noEmit
|
|
127817
|
+
)) {
|
|
127660
127818
|
return {
|
|
127661
127819
|
type: 9 /* OutOfDateOptions */,
|
|
127662
127820
|
buildInfoFile: buildInfoPath
|