@forsakringskassan/docs-generator 3.6.0 → 3.6.1
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/dist/{create-markdown-renderer-BjMECUwq.mjs → create-markdown-renderer-tzDgWLhP.mjs} +3 -3
- package/dist/{create-markdown-renderer-BjMECUwq.mjs.map → create-markdown-renderer-tzDgWLhP.mjs.map} +1 -1
- package/dist/{format-code.worker-BmU4wqqU.mjs → format-code.worker-0XhhwOvm.mjs} +2 -2
- package/dist/{format-code.worker-BmU4wqqU.mjs.map → format-code.worker-0XhhwOvm.mjs.map} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/markdown.mjs +2 -2
- package/dist/runtime-internal.mjs +42 -22
- package/dist/{vendor-C6ojgz0W.mjs → vendor-D7FIOE5G.mjs} +471 -168
- package/dist/{vendor-C6ojgz0W.mjs.map → vendor-D7FIOE5G.mjs.map} +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ const require = $createRequire(import.meta.url);
|
|
|
4
4
|
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
6
|
import * as path from 'node:path';
|
|
7
|
-
import path__default, { win32, posix, resolve,
|
|
7
|
+
import path__default, { win32, posix, resolve, sep as sep$1, join as join$1 } from 'node:path';
|
|
8
8
|
import * as require$$0$1 from 'fs';
|
|
9
9
|
import require$$0__default, { realpathSync, readlinkSync, readdirSync, readdir as readdir$1, lstatSync, statSync } from 'fs';
|
|
10
10
|
import * as fs$a from 'node:fs';
|
|
@@ -20978,14 +20978,17 @@ function requireCore () {
|
|
|
20978
20978
|
return match && match.index === 0;
|
|
20979
20979
|
}
|
|
20980
20980
|
|
|
20981
|
-
// BACKREF_RE matches an open parenthesis or backreference. To avoid
|
|
20982
|
-
//
|
|
20983
|
-
//
|
|
20984
|
-
|
|
20985
|
-
|
|
20986
|
-
|
|
20987
|
-
|
|
20988
|
-
|
|
20981
|
+
// BACKREF_RE matches an open parenthesis or backreference. To avoid an
|
|
20982
|
+
// incorrect parse, it also matches the constructs where the meaning of
|
|
20983
|
+
// parentheses, escapes, or capture counting changes.
|
|
20984
|
+
const BACKREF_RE = new RegExp(either(
|
|
20985
|
+
/\[(?:[^\\\]]|\\.)*\]/, // a character class, inside which ( and \ lose their meaning
|
|
20986
|
+
/\(\?<(?![=!])[^>]+>/, // a named capture group `(?<name>` (not a lookbehind `(?<=` / `(?<!`)
|
|
20987
|
+
/\(\?'[^']+'/, // a named capture group `(?'name'`
|
|
20988
|
+
/\(\??/, // an opening parenthesis, capturing or non-capturing / lookahead
|
|
20989
|
+
/\\([1-9][0-9]*)/, // a backreference like `\1`
|
|
20990
|
+
/\\./ // any other escape sequence
|
|
20991
|
+
));
|
|
20989
20992
|
|
|
20990
20993
|
// **INTERNAL** Not intended for outside usage
|
|
20991
20994
|
// join logically computes regexps.join(separator), but fixes the
|
|
@@ -21020,7 +21023,7 @@ function requireCore () {
|
|
|
21020
21023
|
out += '\\' + String(Number(match[1]) + offset);
|
|
21021
21024
|
} else {
|
|
21022
21025
|
out += match[0];
|
|
21023
|
-
if (match[0] === '(') {
|
|
21026
|
+
if (match[0] === '(' || /^\(\?[<']/.test(match[0])) {
|
|
21024
21027
|
numCaptures++;
|
|
21025
21028
|
}
|
|
21026
21029
|
}
|
|
@@ -22062,7 +22065,7 @@ function requireCore () {
|
|
|
22062
22065
|
return mode;
|
|
22063
22066
|
}
|
|
22064
22067
|
|
|
22065
|
-
var version = "11.
|
|
22068
|
+
var version = "11.12.0";
|
|
22066
22069
|
|
|
22067
22070
|
class HTMLInjectionError extends Error {
|
|
22068
22071
|
constructor(reason, html) {
|
|
@@ -22584,12 +22587,15 @@ function requireCore () {
|
|
|
22584
22587
|
}
|
|
22585
22588
|
}
|
|
22586
22589
|
|
|
22587
|
-
// edge case for when illegal matches $ (end of line) which is technically
|
|
22590
|
+
// edge case for when illegal matches $ (end of line/text) which is technically
|
|
22588
22591
|
// a 0 width match but not a begin/end match so it's not caught by the
|
|
22589
|
-
// first handler (when ignoreIllegals is true)
|
|
22592
|
+
// first handler (when `ignoreIllegals` is true)
|
|
22590
22593
|
if (match.type === "illegal" && lexeme === "") {
|
|
22591
|
-
|
|
22592
|
-
|
|
22594
|
+
if (match.index === codeToHighlight.length) ; else {
|
|
22595
|
+
// matched literal `\n` (with `$`) so we must manually add the newline
|
|
22596
|
+
// itself to the modeBuffer so it is not lost when we advance the cursor
|
|
22597
|
+
modeBuffer += "\n";
|
|
22598
|
+
}
|
|
22593
22599
|
return 1;
|
|
22594
22600
|
}
|
|
22595
22601
|
|
|
@@ -23279,10 +23285,7 @@ function requireXml () {
|
|
|
23279
23285
|
starts: {
|
|
23280
23286
|
end: /<\/style>/,
|
|
23281
23287
|
returnEnd: true,
|
|
23282
|
-
subLanguage:
|
|
23283
|
-
'css',
|
|
23284
|
-
'xml'
|
|
23285
|
-
]
|
|
23288
|
+
subLanguage: 'css'
|
|
23286
23289
|
}
|
|
23287
23290
|
},
|
|
23288
23291
|
{
|
|
@@ -23295,11 +23298,7 @@ function requireXml () {
|
|
|
23295
23298
|
starts: {
|
|
23296
23299
|
end: /<\/script>/,
|
|
23297
23300
|
returnEnd: true,
|
|
23298
|
-
subLanguage:
|
|
23299
|
-
'javascript',
|
|
23300
|
-
'handlebars',
|
|
23301
|
-
'xml'
|
|
23302
|
-
]
|
|
23301
|
+
subLanguage: 'javascript'
|
|
23303
23302
|
}
|
|
23304
23303
|
},
|
|
23305
23304
|
// we need this for now for jSX
|
|
@@ -23807,11 +23806,53 @@ function requireC () {
|
|
|
23807
23806
|
+ ')';
|
|
23808
23807
|
|
|
23809
23808
|
|
|
23809
|
+
// C11 <stdatomic.h> atomic type names. This is an explicit whitelist so that
|
|
23810
|
+
// C11 atomic *functions* (atomic_init, atomic_store, atomic_load,
|
|
23811
|
+
// atomic_fetch_add, ...) are not mistakenly highlighted as types. See #3837.
|
|
23812
|
+
const ATOMIC_TYPES = regex.concat(/\batomic_/, regex.either(
|
|
23813
|
+
'bool',
|
|
23814
|
+
'char',
|
|
23815
|
+
'schar',
|
|
23816
|
+
'uchar',
|
|
23817
|
+
'short',
|
|
23818
|
+
'ushort',
|
|
23819
|
+
'int',
|
|
23820
|
+
'uint',
|
|
23821
|
+
'long',
|
|
23822
|
+
'ulong',
|
|
23823
|
+
'llong',
|
|
23824
|
+
'ullong',
|
|
23825
|
+
'char16_t',
|
|
23826
|
+
'char32_t',
|
|
23827
|
+
'wchar_t',
|
|
23828
|
+
'int_least8_t',
|
|
23829
|
+
'uint_least8_t',
|
|
23830
|
+
'int_least16_t',
|
|
23831
|
+
'uint_least16_t',
|
|
23832
|
+
'int_least32_t',
|
|
23833
|
+
'uint_least32_t',
|
|
23834
|
+
'int_least64_t',
|
|
23835
|
+
'uint_least64_t',
|
|
23836
|
+
'int_fast8_t',
|
|
23837
|
+
'uint_fast8_t',
|
|
23838
|
+
'int_fast16_t',
|
|
23839
|
+
'uint_fast16_t',
|
|
23840
|
+
'int_fast32_t',
|
|
23841
|
+
'uint_fast32_t',
|
|
23842
|
+
'int_fast64_t',
|
|
23843
|
+
'uint_fast64_t',
|
|
23844
|
+
'intptr_t',
|
|
23845
|
+
'uintptr_t',
|
|
23846
|
+
'size_t',
|
|
23847
|
+
'ptrdiff_t',
|
|
23848
|
+
'intmax_t',
|
|
23849
|
+
'uintmax_t'
|
|
23850
|
+
), /\b/);
|
|
23810
23851
|
const TYPES = {
|
|
23811
23852
|
className: 'type',
|
|
23812
23853
|
variants: [
|
|
23813
23854
|
{ begin: '\\b[a-z\\d_]*_t\\b' },
|
|
23814
|
-
{ match:
|
|
23855
|
+
{ match: ATOMIC_TYPES }
|
|
23815
23856
|
]
|
|
23816
23857
|
|
|
23817
23858
|
};
|
|
@@ -23833,9 +23874,13 @@ function requireC () {
|
|
|
23833
23874
|
end: '\'',
|
|
23834
23875
|
illegal: '.'
|
|
23835
23876
|
},
|
|
23877
|
+
// https://en.cppreference.com/w/cpp/language/string_literal
|
|
23878
|
+
// a d-char-sequence never contains parentheses, backslashes or whitespace;
|
|
23879
|
+
// quotes are excluded as well so the closing delimiter cannot swallow the
|
|
23880
|
+
// quote that actually terminates the literal
|
|
23836
23881
|
hljs.END_SAME_AS_BEGIN({
|
|
23837
|
-
begin: /(?:u8?|U|L)?R"([^()
|
|
23838
|
-
end: /\)([^()
|
|
23882
|
+
begin: /(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,
|
|
23883
|
+
end: /\)([^()\\\s"]{0,16})"/
|
|
23839
23884
|
})
|
|
23840
23885
|
]
|
|
23841
23886
|
};
|
|
@@ -23851,6 +23896,32 @@ function requireC () {
|
|
|
23851
23896
|
relevance: 0
|
|
23852
23897
|
};
|
|
23853
23898
|
|
|
23899
|
+
// `#include` is the only preprocessor directive that takes an angle-bracket
|
|
23900
|
+
// quoted header (`#include <header>`). Scoping that rule to `#include` keeps
|
|
23901
|
+
// the greedy `<...>` match from eating a `>` that belongs to the body of
|
|
23902
|
+
// another directive (e.g. `#define what do { cout << ">"; } while (0)`),
|
|
23903
|
+
// which would otherwise leave an unbalanced `"` and break highlighting for
|
|
23904
|
+
// the rest of the file. See issue #3505.
|
|
23905
|
+
const PREPROCESSOR_INCLUDE = {
|
|
23906
|
+
scope: 'meta',
|
|
23907
|
+
begin: /#\s*include\b/,
|
|
23908
|
+
end: /$/,
|
|
23909
|
+
keywords: { keyword: 'include' },
|
|
23910
|
+
contains: [
|
|
23911
|
+
{
|
|
23912
|
+
// the `\` at the end of a line signaling continuation
|
|
23913
|
+
begin: /\\\n/,
|
|
23914
|
+
},
|
|
23915
|
+
STRINGS,
|
|
23916
|
+
{
|
|
23917
|
+
scope: 'string',
|
|
23918
|
+
begin: /<.*?>/
|
|
23919
|
+
},
|
|
23920
|
+
C_LINE_COMMENT_MODE,
|
|
23921
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
23922
|
+
]
|
|
23923
|
+
};
|
|
23924
|
+
|
|
23854
23925
|
const PREPROCESSOR = {
|
|
23855
23926
|
className: 'meta',
|
|
23856
23927
|
begin: /#\s*[a-z]+\b/,
|
|
@@ -23864,15 +23935,16 @@ function requireC () {
|
|
|
23864
23935
|
relevance: 0
|
|
23865
23936
|
},
|
|
23866
23937
|
hljs.inherit(STRINGS, { className: 'string' }),
|
|
23867
|
-
{
|
|
23868
|
-
className: 'string',
|
|
23869
|
-
begin: /<.*?>/
|
|
23870
|
-
},
|
|
23871
23938
|
C_LINE_COMMENT_MODE,
|
|
23872
23939
|
hljs.C_BLOCK_COMMENT_MODE
|
|
23873
23940
|
]
|
|
23874
23941
|
};
|
|
23875
23942
|
|
|
23943
|
+
const PREPROCESSORS = [
|
|
23944
|
+
PREPROCESSOR_INCLUDE,
|
|
23945
|
+
PREPROCESSOR
|
|
23946
|
+
];
|
|
23947
|
+
|
|
23876
23948
|
const TITLE_MODE = {
|
|
23877
23949
|
className: 'title',
|
|
23878
23950
|
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
|
|
@@ -23880,6 +23952,11 @@ function requireC () {
|
|
|
23880
23952
|
};
|
|
23881
23953
|
|
|
23882
23954
|
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\(';
|
|
23955
|
+
// Bounded on purpose: an unbounded quantifier here consumes an arbitrarily
|
|
23956
|
+
// long run of words, and when no function title follows it the engine retries
|
|
23957
|
+
// the title at every token boundary of that run - quadratic in the size of
|
|
23958
|
+
// the document. See #4362.
|
|
23959
|
+
const MAX_FUNCTION_TYPE_TOKENS = 12;
|
|
23883
23960
|
|
|
23884
23961
|
const C_KEYWORDS = [
|
|
23885
23962
|
"asm",
|
|
@@ -23980,7 +24057,7 @@ function requireC () {
|
|
|
23980
24057
|
};
|
|
23981
24058
|
|
|
23982
24059
|
const EXPRESSION_CONTAINS = [
|
|
23983
|
-
|
|
24060
|
+
...PREPROCESSORS,
|
|
23984
24061
|
TYPES,
|
|
23985
24062
|
C_LINE_COMMENT_MODE,
|
|
23986
24063
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
@@ -24020,7 +24097,7 @@ function requireC () {
|
|
|
24020
24097
|
};
|
|
24021
24098
|
|
|
24022
24099
|
const FUNCTION_DECLARATION = {
|
|
24023
|
-
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
|
|
24100
|
+
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+){1,' + MAX_FUNCTION_TYPE_TOKENS + '}' + FUNCTION_TITLE,
|
|
24024
24101
|
returnBegin: true,
|
|
24025
24102
|
end: /[{;=]/,
|
|
24026
24103
|
excludeEnd: true,
|
|
@@ -24076,7 +24153,7 @@ function requireC () {
|
|
|
24076
24153
|
TYPES,
|
|
24077
24154
|
C_LINE_COMMENT_MODE,
|
|
24078
24155
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
24079
|
-
|
|
24156
|
+
...PREPROCESSORS
|
|
24080
24157
|
]
|
|
24081
24158
|
};
|
|
24082
24159
|
|
|
@@ -24093,7 +24170,7 @@ function requireC () {
|
|
|
24093
24170
|
FUNCTION_DECLARATION,
|
|
24094
24171
|
EXPRESSION_CONTAINS,
|
|
24095
24172
|
[
|
|
24096
|
-
|
|
24173
|
+
...PREPROCESSORS,
|
|
24097
24174
|
{
|
|
24098
24175
|
begin: hljs.IDENT_RE + '::',
|
|
24099
24176
|
keywords: KEYWORDS
|
|
@@ -24170,9 +24247,13 @@ function requireCpp () {
|
|
|
24170
24247
|
end: '\'',
|
|
24171
24248
|
illegal: '.'
|
|
24172
24249
|
},
|
|
24250
|
+
// https://en.cppreference.com/w/cpp/language/string_literal
|
|
24251
|
+
// a d-char-sequence never contains parentheses, backslashes or whitespace;
|
|
24252
|
+
// quotes are excluded as well so the closing delimiter cannot swallow the
|
|
24253
|
+
// quote that actually terminates the literal
|
|
24173
24254
|
hljs.END_SAME_AS_BEGIN({
|
|
24174
|
-
begin: /(?:u8?|U|L)?R"([^()
|
|
24175
|
-
end: /\)([^()
|
|
24255
|
+
begin: /(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,
|
|
24256
|
+
end: /\)([^()\\\s"]{0,16})"/
|
|
24176
24257
|
})
|
|
24177
24258
|
]
|
|
24178
24259
|
};
|
|
@@ -24185,12 +24266,12 @@ function requireCpp () {
|
|
|
24185
24266
|
"[+-]?(?:" // Leading sign.
|
|
24186
24267
|
// Decimal.
|
|
24187
24268
|
+ "(?:"
|
|
24188
|
-
+"[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?"
|
|
24269
|
+
+ "\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?"
|
|
24189
24270
|
+ "|\\.[0-9](?:'?[0-9])*"
|
|
24190
24271
|
+ ")(?:[Ee][+-]?[0-9](?:'?[0-9])*)?"
|
|
24191
|
-
+ "
|
|
24272
|
+
+ "|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*"
|
|
24192
24273
|
// Hexadecimal.
|
|
24193
|
-
+ "
|
|
24274
|
+
+ "|\\b0[Xx](?:"
|
|
24194
24275
|
+"[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?"
|
|
24195
24276
|
+ "|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*"
|
|
24196
24277
|
+ ")[Pp][+-]?[0-9](?:'?[0-9])*"
|
|
@@ -24222,6 +24303,32 @@ function requireCpp () {
|
|
|
24222
24303
|
relevance: 0
|
|
24223
24304
|
};
|
|
24224
24305
|
|
|
24306
|
+
// `#include` is the only preprocessor directive that takes an angle-bracket
|
|
24307
|
+
// quoted header (`#include <header>`). Scoping that rule to `#include` keeps
|
|
24308
|
+
// the greedy `<...>` match from eating a `>` that belongs to the body of
|
|
24309
|
+
// another directive (e.g. `#define what do { cout << ">"; } while (0)`),
|
|
24310
|
+
// which would otherwise leave an unbalanced `"` and break highlighting for
|
|
24311
|
+
// the rest of the file. See issue #3505.
|
|
24312
|
+
const PREPROCESSOR_INCLUDE = {
|
|
24313
|
+
scope: 'meta',
|
|
24314
|
+
begin: /#\s*include\b/,
|
|
24315
|
+
end: /$/,
|
|
24316
|
+
keywords: { keyword: 'include' },
|
|
24317
|
+
contains: [
|
|
24318
|
+
{
|
|
24319
|
+
// the `\` at the end of a line signaling continuation
|
|
24320
|
+
begin: /\\\n/,
|
|
24321
|
+
},
|
|
24322
|
+
STRINGS,
|
|
24323
|
+
{
|
|
24324
|
+
scope: 'string',
|
|
24325
|
+
begin: /<.*?>/
|
|
24326
|
+
},
|
|
24327
|
+
C_LINE_COMMENT_MODE,
|
|
24328
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
24329
|
+
]
|
|
24330
|
+
};
|
|
24331
|
+
|
|
24225
24332
|
const PREPROCESSOR = {
|
|
24226
24333
|
className: 'meta',
|
|
24227
24334
|
begin: /#\s*[a-z]+\b/,
|
|
@@ -24235,15 +24342,16 @@ function requireCpp () {
|
|
|
24235
24342
|
relevance: 0
|
|
24236
24343
|
},
|
|
24237
24344
|
hljs.inherit(STRINGS, { className: 'string' }),
|
|
24238
|
-
{
|
|
24239
|
-
className: 'string',
|
|
24240
|
-
begin: /<.*?>/
|
|
24241
|
-
},
|
|
24242
24345
|
C_LINE_COMMENT_MODE,
|
|
24243
24346
|
hljs.C_BLOCK_COMMENT_MODE
|
|
24244
24347
|
]
|
|
24245
24348
|
};
|
|
24246
24349
|
|
|
24350
|
+
const PREPROCESSORS = [
|
|
24351
|
+
PREPROCESSOR_INCLUDE,
|
|
24352
|
+
PREPROCESSOR
|
|
24353
|
+
];
|
|
24354
|
+
|
|
24247
24355
|
const TITLE_MODE = {
|
|
24248
24356
|
className: 'title',
|
|
24249
24357
|
begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
|
|
@@ -24251,6 +24359,11 @@ function requireCpp () {
|
|
|
24251
24359
|
};
|
|
24252
24360
|
|
|
24253
24361
|
const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\(';
|
|
24362
|
+
// Bounded on purpose: an unbounded quantifier here consumes an arbitrarily
|
|
24363
|
+
// long run of words, and when no function title follows it the engine retries
|
|
24364
|
+
// the title at every token boundary of that run - quadratic in the size of
|
|
24365
|
+
// the document. See #4362.
|
|
24366
|
+
const MAX_FUNCTION_TYPE_TOKENS = 12;
|
|
24254
24367
|
|
|
24255
24368
|
// https://en.cppreference.com/w/cpp/keyword
|
|
24256
24369
|
const RESERVED_KEYWORDS = [
|
|
@@ -24553,18 +24666,14 @@ function requireCpp () {
|
|
|
24553
24666
|
_hint: FUNCTION_HINTS },
|
|
24554
24667
|
begin: regex.concat(
|
|
24555
24668
|
/\b/,
|
|
24556
|
-
|
|
24557
|
-
/(?!if)/,
|
|
24558
|
-
/(?!for)/,
|
|
24559
|
-
/(?!switch)/,
|
|
24560
|
-
/(?!while)/,
|
|
24669
|
+
`(?!${RESERVED_KEYWORDS.join('|')})`,
|
|
24561
24670
|
hljs.IDENT_RE,
|
|
24562
24671
|
regex.lookahead(/(<[^<>]+>|)\s*\(/))
|
|
24563
24672
|
};
|
|
24564
24673
|
|
|
24565
24674
|
const EXPRESSION_CONTAINS = [
|
|
24566
24675
|
FUNCTION_DISPATCH,
|
|
24567
|
-
|
|
24676
|
+
...PREPROCESSORS,
|
|
24568
24677
|
CPP_PRIMITIVE_TYPES,
|
|
24569
24678
|
C_LINE_COMMENT_MODE,
|
|
24570
24679
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
@@ -24605,7 +24714,7 @@ function requireCpp () {
|
|
|
24605
24714
|
|
|
24606
24715
|
const FUNCTION_DECLARATION = {
|
|
24607
24716
|
className: 'function',
|
|
24608
|
-
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
|
|
24717
|
+
begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+){1,' + MAX_FUNCTION_TYPE_TOKENS + '}' + FUNCTION_TITLE,
|
|
24609
24718
|
returnBegin: true,
|
|
24610
24719
|
end: /[{;=]/,
|
|
24611
24720
|
excludeEnd: true,
|
|
@@ -24676,7 +24785,7 @@ function requireCpp () {
|
|
|
24676
24785
|
CPP_PRIMITIVE_TYPES,
|
|
24677
24786
|
C_LINE_COMMENT_MODE,
|
|
24678
24787
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
24679
|
-
|
|
24788
|
+
...PREPROCESSORS
|
|
24680
24789
|
]
|
|
24681
24790
|
};
|
|
24682
24791
|
|
|
@@ -24700,7 +24809,7 @@ function requireCpp () {
|
|
|
24700
24809
|
FUNCTION_DISPATCH,
|
|
24701
24810
|
EXPRESSION_CONTAINS,
|
|
24702
24811
|
[
|
|
24703
|
-
|
|
24812
|
+
...PREPROCESSORS,
|
|
24704
24813
|
{ // containers: ie, `vector <int> rooms (9);`
|
|
24705
24814
|
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)',
|
|
24706
24815
|
end: '>',
|
|
@@ -24903,12 +25012,18 @@ function requireCsharp () {
|
|
|
24903
25012
|
literal: LITERAL_KEYWORDS
|
|
24904
25013
|
};
|
|
24905
25014
|
const TITLE_MODE = hljs.inherit(hljs.TITLE_MODE, { begin: '[a-zA-Z](\\.?\\w)*' });
|
|
25015
|
+
// https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types
|
|
25016
|
+
// https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types
|
|
25017
|
+
// `_` separators sit between digits, and may also follow the `0x`/`0b` prefix
|
|
25018
|
+
const DIGITS = '\\d(_*\\d)*';
|
|
25019
|
+
const INTEGER_SUFFIX = '([uU][lL]?|[lL][uU]?)?';
|
|
25020
|
+
const REAL_SUFFIX = '([fFdDmM]|[uU][lL]?|[lL][uU]?)?';
|
|
24906
25021
|
const NUMBERS = {
|
|
24907
25022
|
className: 'number',
|
|
24908
25023
|
variants: [
|
|
24909
|
-
{ begin: '\\
|
|
24910
|
-
{ begin: '(-?)\\
|
|
24911
|
-
{ begin: '(-?)(\\
|
|
25024
|
+
{ begin: '\\b0[bB]_*[01](_*[01])*' + INTEGER_SUFFIX },
|
|
25025
|
+
{ begin: '(-?)\\b0[xX]_*[a-fA-F0-9](_*[a-fA-F0-9])*' + INTEGER_SUFFIX },
|
|
25026
|
+
{ begin: '(-?)(\\b' + DIGITS + '(\\.(' + DIGITS + ')?)?|\\.' + DIGITS + ')([eE][-+]?' + DIGITS + ')?' + REAL_SUFFIX }
|
|
24912
25027
|
],
|
|
24913
25028
|
relevance: 0
|
|
24914
25029
|
};
|
|
@@ -25172,6 +25287,10 @@ function requireCss () {
|
|
|
25172
25287
|
scope: 'number',
|
|
25173
25288
|
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
|
|
25174
25289
|
},
|
|
25290
|
+
UNICODE_RANGE: {
|
|
25291
|
+
scope: 'number',
|
|
25292
|
+
begin: /\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/
|
|
25293
|
+
},
|
|
25175
25294
|
FUNCTION_DISPATCH: {
|
|
25176
25295
|
className: "built_in",
|
|
25177
25296
|
begin: /[\w-]+(?=\()/
|
|
@@ -25605,6 +25724,11 @@ function requireCss () {
|
|
|
25605
25724
|
'container-type',
|
|
25606
25725
|
'content',
|
|
25607
25726
|
'content-visibility',
|
|
25727
|
+
'corner-bottom-left-shape',
|
|
25728
|
+
'corner-bottom-right-shape',
|
|
25729
|
+
'corner-shape',
|
|
25730
|
+
'corner-top-left-shape',
|
|
25731
|
+
'corner-top-right-shape',
|
|
25608
25732
|
'counter-increment',
|
|
25609
25733
|
'counter-reset',
|
|
25610
25734
|
'counter-set',
|
|
@@ -25940,6 +26064,7 @@ function requireCss () {
|
|
|
25940
26064
|
'transition-timing-function',
|
|
25941
26065
|
'translate',
|
|
25942
26066
|
'unicode-bidi',
|
|
26067
|
+
'unicode-range',
|
|
25943
26068
|
'user-modify',
|
|
25944
26069
|
'user-select',
|
|
25945
26070
|
'vector-effect',
|
|
@@ -26046,9 +26171,10 @@ function requireCss () {
|
|
|
26046
26171
|
modes.HEXCOLOR,
|
|
26047
26172
|
modes.IMPORTANT,
|
|
26048
26173
|
modes.CSS_NUMBER_MODE,
|
|
26174
|
+
modes.UNICODE_RANGE,
|
|
26049
26175
|
...STRINGS,
|
|
26050
26176
|
// needed to highlight these as strings and to avoid issues with
|
|
26051
|
-
// illegal characters that might be inside urls that would
|
|
26177
|
+
// illegal characters that might be inside urls that would trigger the
|
|
26052
26178
|
// languages illegal stack
|
|
26053
26179
|
{
|
|
26054
26180
|
begin: /(url|data-uri)\(/,
|
|
@@ -26135,10 +26261,10 @@ function requireMarkdown () {
|
|
|
26135
26261
|
subLanguage: 'xml',
|
|
26136
26262
|
relevance: 0
|
|
26137
26263
|
};
|
|
26138
|
-
|
|
26139
|
-
|
|
26140
|
-
|
|
26141
|
-
};
|
|
26264
|
+
// https://spec.commonmark.org/0.31.2/#thematic-breaks
|
|
26265
|
+
// three or more `-`, `*` or `_`, all the same character, optionally
|
|
26266
|
+
// separated and followed by spaces or tabs, and nothing else on the line
|
|
26267
|
+
const HORIZONTAL_RULE = { match: /^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/ };
|
|
26142
26268
|
const CODE = {
|
|
26143
26269
|
className: 'code',
|
|
26144
26270
|
variants: [
|
|
@@ -26354,11 +26480,13 @@ function requireMarkdown () {
|
|
|
26354
26480
|
HEADER,
|
|
26355
26481
|
INLINE_HTML,
|
|
26356
26482
|
LIST,
|
|
26483
|
+
// must come before BOLD/ITALIC so that a `***` or `___` thematic break
|
|
26484
|
+
// isn't mistaken for the start of bold text
|
|
26485
|
+
HORIZONTAL_RULE,
|
|
26357
26486
|
BOLD,
|
|
26358
26487
|
ITALIC,
|
|
26359
26488
|
BLOCKQUOTE,
|
|
26360
26489
|
CODE,
|
|
26361
|
-
HORIZONTAL_RULE,
|
|
26362
26490
|
LINK,
|
|
26363
26491
|
LINK_REFERENCE,
|
|
26364
26492
|
ENTITY
|
|
@@ -26395,7 +26523,10 @@ function requireDiff () {
|
|
|
26395
26523
|
className: 'meta',
|
|
26396
26524
|
relevance: 10,
|
|
26397
26525
|
match: regex.either(
|
|
26398
|
-
/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,
|
|
26526
|
+
/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/, // @@ -1,2 +1,2 @@
|
|
26527
|
+
/^@@ +-\d+ +\+\d+,\d+ +@@/, // @@ -1 +1,2 @@
|
|
26528
|
+
/^@@ +-\d+,\d+ +\+\d+ +@@/, // @@ -1,2 +1 @@
|
|
26529
|
+
/^@@ +-\d+ +\+\d+ +@@/, // @@ -1 +1 @@
|
|
26399
26530
|
/^\*\*\* +\d+,\d+ +\*\*\*\*$/,
|
|
26400
26531
|
/^--- +\d+,\d+ +----$/
|
|
26401
26532
|
)
|
|
@@ -26774,8 +26905,9 @@ function requireRuby () {
|
|
|
26774
26905
|
CLASS_REFERENCE,
|
|
26775
26906
|
METHOD_DEFINITION,
|
|
26776
26907
|
{
|
|
26777
|
-
// swallow
|
|
26778
|
-
begin:
|
|
26908
|
+
// swallow the scope resolution operator so `::` is not read as a symbol
|
|
26909
|
+
begin: '::'
|
|
26910
|
+
},
|
|
26779
26911
|
{
|
|
26780
26912
|
className: 'symbol',
|
|
26781
26913
|
begin: hljs.UNDERSCORE_IDENT_RE + '(!|\\?)?:',
|
|
@@ -27026,6 +27158,10 @@ function requireGo () {
|
|
|
27026
27158
|
match: /-?\b0[oO](_?[0-7])*i?/, // leading 0o octal
|
|
27027
27159
|
relevance: 0
|
|
27028
27160
|
},
|
|
27161
|
+
{
|
|
27162
|
+
match: /-?\b0[bB](_?[01])*i?/, // leading 0b binary
|
|
27163
|
+
relevance: 0
|
|
27164
|
+
},
|
|
27029
27165
|
{
|
|
27030
27166
|
match: /-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/, // decimal without a present digit before . (making a digit afterwards required)
|
|
27031
27167
|
relevance: 0
|
|
@@ -27351,9 +27487,27 @@ function requireJava () {
|
|
|
27351
27487
|
/** @type LanguageFn */
|
|
27352
27488
|
function java(hljs) {
|
|
27353
27489
|
const regex = hljs.regex;
|
|
27490
|
+
|
|
27491
|
+
// A Java identifier consisting of letters, digits, underscore or dollar sign, not beginning with a digit
|
|
27354
27492
|
const JAVA_IDENT_RE = '[\u00C0-\u02B8a-zA-Z_$][\u00C0-\u02B8a-zA-Z_$0-9]*';
|
|
27355
|
-
|
|
27356
|
-
|
|
27493
|
+
|
|
27494
|
+
// Optional 1..n pairs of square brackets identifying an array type
|
|
27495
|
+
const ARRAY_BRACKETS_OPTIONAL_RE = '(?:(?:\\s*\\[\\s*])+)?';
|
|
27496
|
+
|
|
27497
|
+
// A simple Java type: a type name, optionally followed by type arguments and/or array brackets
|
|
27498
|
+
// '<@@@>' is replaced with the pattern for optional type arguments by recurRegex below.
|
|
27499
|
+
const SIMPLE_TYPE_RE = JAVA_IDENT_RE + '<@@@>' + ARRAY_BRACKETS_OPTIONAL_RE;
|
|
27500
|
+
|
|
27501
|
+
// A bounded (? extends Number) or unbounded (?) wildcard type
|
|
27502
|
+
const WILDCARD_TYPE_RE = '\\?(?:\\s+(?:extends|super)\\s+' + SIMPLE_TYPE_RE + ')?';
|
|
27503
|
+
|
|
27504
|
+
// A Java type argument, consisting of a wildcard or simple type
|
|
27505
|
+
const TYPE_ARG_RE = '(?:' + WILDCARD_TYPE_RE + '|' + SIMPLE_TYPE_RE + ')';
|
|
27506
|
+
|
|
27507
|
+
// Pattern for optional generic type arguments in angle brackets with up to 2 levels of nested type arguments
|
|
27508
|
+
const TYPE_ARGS_OPTIONAL_RE = recurRegex('(?:\\s*<\\s*' + TYPE_ARG_RE + '(?:\\s*,\\s*' + TYPE_ARG_RE + ')*\\s*>)?',
|
|
27509
|
+
/<@@@>/g, 2);
|
|
27510
|
+
|
|
27357
27511
|
const MAIN_KEYWORDS = [
|
|
27358
27512
|
'synchronized',
|
|
27359
27513
|
'abstract',
|
|
@@ -27507,18 +27661,25 @@ function requireJava () {
|
|
|
27507
27661
|
match: /non-sealed/,
|
|
27508
27662
|
scope: "keyword"
|
|
27509
27663
|
},
|
|
27664
|
+
{
|
|
27665
|
+
// Expression keywords prevent keyword-led expressions from being
|
|
27666
|
+
// recognized as variable or method declarations.
|
|
27667
|
+
beginKeywords: 'new throw return else yield assert',
|
|
27668
|
+
relevance: 0
|
|
27669
|
+
},
|
|
27510
27670
|
{
|
|
27511
27671
|
begin: [
|
|
27512
|
-
regex.concat(/(?!else)/, JAVA_IDENT_RE),
|
|
27513
|
-
/\s+/,
|
|
27514
27672
|
JAVA_IDENT_RE,
|
|
27515
|
-
/\s
|
|
27673
|
+
regex.concat(TYPE_ARGS_OPTIONAL_RE, ARRAY_BRACKETS_OPTIONAL_RE, /\s+/),
|
|
27674
|
+
JAVA_IDENT_RE,
|
|
27675
|
+
ARRAY_BRACKETS_OPTIONAL_RE,
|
|
27676
|
+
/\s*/,
|
|
27516
27677
|
/=(?!=)/
|
|
27517
27678
|
],
|
|
27518
27679
|
className: {
|
|
27519
27680
|
1: "type",
|
|
27520
27681
|
3: "variable",
|
|
27521
|
-
|
|
27682
|
+
6: "operator"
|
|
27522
27683
|
}
|
|
27523
27684
|
},
|
|
27524
27685
|
{
|
|
@@ -27537,19 +27698,17 @@ function requireJava () {
|
|
|
27537
27698
|
hljs.C_BLOCK_COMMENT_MODE
|
|
27538
27699
|
]
|
|
27539
27700
|
},
|
|
27540
|
-
{
|
|
27541
|
-
// Expression keywords prevent 'keyword Name(...)' from being
|
|
27542
|
-
// recognized as a function definition
|
|
27543
|
-
beginKeywords: 'new throw return else',
|
|
27544
|
-
relevance: 0
|
|
27545
|
-
},
|
|
27546
27701
|
{
|
|
27547
27702
|
begin: [
|
|
27548
|
-
|
|
27549
|
-
|
|
27703
|
+
JAVA_IDENT_RE,
|
|
27704
|
+
regex.concat(TYPE_ARGS_OPTIONAL_RE, ARRAY_BRACKETS_OPTIONAL_RE, /\s+/),
|
|
27705
|
+
JAVA_IDENT_RE,
|
|
27550
27706
|
/\s*(?=\()/
|
|
27551
27707
|
],
|
|
27552
|
-
className: {
|
|
27708
|
+
className: {
|
|
27709
|
+
1: "type",
|
|
27710
|
+
3: "title.function"
|
|
27711
|
+
},
|
|
27553
27712
|
keywords: KEYWORDS,
|
|
27554
27713
|
contains: [
|
|
27555
27714
|
{
|
|
@@ -27587,6 +27746,7 @@ function requireJavascript () {
|
|
|
27587
27746
|
if (hasRequiredJavascript) return javascript_1;
|
|
27588
27747
|
hasRequiredJavascript = 1;
|
|
27589
27748
|
const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
|
|
27749
|
+
|
|
27590
27750
|
const KEYWORDS = [
|
|
27591
27751
|
"as", // for exports
|
|
27592
27752
|
"in",
|
|
@@ -27737,6 +27897,7 @@ function requireJavascript () {
|
|
|
27737
27897
|
"localStorage",
|
|
27738
27898
|
"sessionStorage",
|
|
27739
27899
|
"module",
|
|
27900
|
+
"self",
|
|
27740
27901
|
"global" // Node.js
|
|
27741
27902
|
];
|
|
27742
27903
|
|
|
@@ -28134,7 +28295,8 @@ function requireJavascript () {
|
|
|
28134
28295
|
noneOf([
|
|
28135
28296
|
...BUILT_IN_GLOBALS,
|
|
28136
28297
|
"super",
|
|
28137
|
-
"import"
|
|
28298
|
+
"import",
|
|
28299
|
+
"await",
|
|
28138
28300
|
].map(x => `${x}\\s*\\(`)),
|
|
28139
28301
|
IDENT_RE$1, regex.lookahead(/\s*\(/)),
|
|
28140
28302
|
className: "title.function",
|
|
@@ -28203,7 +28365,7 @@ function requireJavascript () {
|
|
|
28203
28365
|
keywords: KEYWORDS$1,
|
|
28204
28366
|
// this will be extended by TypeScript
|
|
28205
28367
|
exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
|
|
28206
|
-
illegal: /#(?![$_A-z])/,
|
|
28368
|
+
illegal: /#(?![$_A-Za-z])/,
|
|
28207
28369
|
contains: [
|
|
28208
28370
|
hljs.SHEBANG({
|
|
28209
28371
|
label: "shebang",
|
|
@@ -28358,24 +28520,32 @@ function requireJavascript () {
|
|
|
28358
28520
|
return javascript_1;
|
|
28359
28521
|
}
|
|
28360
28522
|
|
|
28361
|
-
/*
|
|
28362
|
-
Language: JSON
|
|
28363
|
-
Description: JSON (JavaScript Object Notation) is a lightweight data-interchange format.
|
|
28364
|
-
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
|
|
28365
|
-
Website: http://www.json.org
|
|
28366
|
-
Category: common, protocols, web
|
|
28367
|
-
*/
|
|
28368
|
-
|
|
28369
28523
|
var json_1;
|
|
28370
28524
|
var hasRequiredJson$1;
|
|
28371
28525
|
|
|
28372
28526
|
function requireJson$1 () {
|
|
28373
28527
|
if (hasRequiredJson$1) return json_1;
|
|
28374
28528
|
hasRequiredJson$1 = 1;
|
|
28529
|
+
const EXTENDED_NUMBER_RE = '([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity'; // 0x..., 0..., decimal, float
|
|
28530
|
+
|
|
28531
|
+
const EXTENDED_NUMBER_MODE = {
|
|
28532
|
+
scope: 'number',
|
|
28533
|
+
match: EXTENDED_NUMBER_RE,
|
|
28534
|
+
relevance: 0
|
|
28535
|
+
};
|
|
28536
|
+
|
|
28537
|
+
/*
|
|
28538
|
+
Language: JSON
|
|
28539
|
+
Description: JSON (JavaScript Object Notation) is a lightweight data-interchange format.
|
|
28540
|
+
Websites: http://www.json.org, https://www.json5.org
|
|
28541
|
+
Category: common, protocols, web
|
|
28542
|
+
*/
|
|
28543
|
+
|
|
28544
|
+
|
|
28375
28545
|
function json(hljs) {
|
|
28376
28546
|
const ATTRIBUTE = {
|
|
28377
28547
|
className: 'attr',
|
|
28378
|
-
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
28548
|
+
begin: /(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,
|
|
28379
28549
|
relevance: 1.01
|
|
28380
28550
|
};
|
|
28381
28551
|
const PUNCTUATION = {
|
|
@@ -28400,16 +28570,17 @@ function requireJson$1 () {
|
|
|
28400
28570
|
|
|
28401
28571
|
return {
|
|
28402
28572
|
name: 'JSON',
|
|
28403
|
-
aliases: ['jsonc'],
|
|
28573
|
+
aliases: ['jsonc', 'json5'],
|
|
28404
28574
|
keywords:{
|
|
28405
28575
|
literal: LITERALS,
|
|
28406
28576
|
},
|
|
28407
28577
|
contains: [
|
|
28408
28578
|
ATTRIBUTE,
|
|
28409
28579
|
PUNCTUATION,
|
|
28580
|
+
hljs.APOS_STRING_MODE,
|
|
28410
28581
|
hljs.QUOTE_STRING_MODE,
|
|
28411
28582
|
LITERALS_MODE,
|
|
28412
|
-
|
|
28583
|
+
EXTENDED_NUMBER_MODE,
|
|
28413
28584
|
hljs.C_LINE_COMMENT_MODE,
|
|
28414
28585
|
hljs.C_BLOCK_COMMENT_MODE
|
|
28415
28586
|
],
|
|
@@ -28590,7 +28761,9 @@ function requireKotlin () {
|
|
|
28590
28761
|
name: 'Kotlin',
|
|
28591
28762
|
aliases: [
|
|
28592
28763
|
'kt',
|
|
28593
|
-
'kts'
|
|
28764
|
+
'kts',
|
|
28765
|
+
'ktm',
|
|
28766
|
+
'ktx'
|
|
28594
28767
|
],
|
|
28595
28768
|
keywords: KEYWORDS,
|
|
28596
28769
|
contains: [
|
|
@@ -28733,6 +28906,10 @@ function requireLess () {
|
|
|
28733
28906
|
scope: 'number',
|
|
28734
28907
|
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
|
|
28735
28908
|
},
|
|
28909
|
+
UNICODE_RANGE: {
|
|
28910
|
+
scope: 'number',
|
|
28911
|
+
begin: /\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/
|
|
28912
|
+
},
|
|
28736
28913
|
FUNCTION_DISPATCH: {
|
|
28737
28914
|
className: "built_in",
|
|
28738
28915
|
begin: /[\w-]+(?=\()/
|
|
@@ -29166,6 +29343,11 @@ function requireLess () {
|
|
|
29166
29343
|
'container-type',
|
|
29167
29344
|
'content',
|
|
29168
29345
|
'content-visibility',
|
|
29346
|
+
'corner-bottom-left-shape',
|
|
29347
|
+
'corner-bottom-right-shape',
|
|
29348
|
+
'corner-shape',
|
|
29349
|
+
'corner-top-left-shape',
|
|
29350
|
+
'corner-top-right-shape',
|
|
29169
29351
|
'counter-increment',
|
|
29170
29352
|
'counter-reset',
|
|
29171
29353
|
'counter-set',
|
|
@@ -29501,6 +29683,7 @@ function requireLess () {
|
|
|
29501
29683
|
'transition-timing-function',
|
|
29502
29684
|
'translate',
|
|
29503
29685
|
'unicode-bidi',
|
|
29686
|
+
'unicode-range',
|
|
29504
29687
|
'user-modify',
|
|
29505
29688
|
'user-select',
|
|
29506
29689
|
'vector-effect',
|
|
@@ -29605,6 +29788,7 @@ function requireLess () {
|
|
|
29605
29788
|
excludeEnd: true
|
|
29606
29789
|
}
|
|
29607
29790
|
},
|
|
29791
|
+
modes.UNICODE_RANGE,
|
|
29608
29792
|
modes.HEXCOLOR,
|
|
29609
29793
|
PARENS_MODE,
|
|
29610
29794
|
IDENT_MODE('variable', '@@?' + IDENT_RE, 10),
|
|
@@ -29715,7 +29899,7 @@ function requireLess () {
|
|
|
29715
29899
|
MIXIN_GUARD_MODE,
|
|
29716
29900
|
IDENT_MODE('keyword', 'all\\b'),
|
|
29717
29901
|
IDENT_MODE('variable', '@\\{' + IDENT_RE + '\\}'), // otherwise it’s identified as tag
|
|
29718
|
-
|
|
29902
|
+
|
|
29719
29903
|
{
|
|
29720
29904
|
begin: '\\b(' + TAGS.join('|') + ')\\b',
|
|
29721
29905
|
className: 'selector-tag'
|
|
@@ -29814,7 +29998,7 @@ function requireLua () {
|
|
|
29814
29998
|
keywords: {
|
|
29815
29999
|
$pattern: hljs.UNDERSCORE_IDENT_RE,
|
|
29816
30000
|
literal: "true false nil",
|
|
29817
|
-
keyword: "and break do else elseif end for goto if in local not or repeat return then until while",
|
|
30001
|
+
keyword: "and break do else elseif end for goto if in local global not or repeat return then until while",
|
|
29818
30002
|
built_in:
|
|
29819
30003
|
// Metatags and globals:
|
|
29820
30004
|
'_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len '
|
|
@@ -30743,6 +30927,10 @@ Language: PHP
|
|
|
30743
30927
|
Author: Victor Karamzin <Victor.Karamzin@enterra-inc.com>
|
|
30744
30928
|
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Ivan Sagalaev <maniac@softwaremaniacs.org>
|
|
30745
30929
|
Website: https://www.php.net
|
|
30930
|
+
Description: Use this for plain PHP code, i.e. code that does not include the
|
|
30931
|
+
surrounding `<?php ... ?>` tags. If your snippet mixes PHP with
|
|
30932
|
+
HTML markup and the opening/closing tags, use `php-template`
|
|
30933
|
+
instead.
|
|
30746
30934
|
Category: common
|
|
30747
30935
|
*/
|
|
30748
30936
|
|
|
@@ -31160,6 +31348,8 @@ function requirePhp () {
|
|
|
31160
31348
|
VARIABLE,
|
|
31161
31349
|
LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,
|
|
31162
31350
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
31351
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
31352
|
+
hljs.HASH_COMMENT_MODE,
|
|
31163
31353
|
STRING,
|
|
31164
31354
|
NUMBER,
|
|
31165
31355
|
CONSTRUCTOR_CALL,
|
|
@@ -31184,6 +31374,8 @@ function requirePhp () {
|
|
|
31184
31374
|
NAMED_ARGUMENT,
|
|
31185
31375
|
LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,
|
|
31186
31376
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
31377
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
31378
|
+
hljs.HASH_COMMENT_MODE,
|
|
31187
31379
|
STRING,
|
|
31188
31380
|
NUMBER,
|
|
31189
31381
|
CONSTRUCTOR_CALL,
|
|
@@ -31312,6 +31504,8 @@ function requirePhp () {
|
|
|
31312
31504
|
VARIABLE,
|
|
31313
31505
|
LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,
|
|
31314
31506
|
hljs.C_BLOCK_COMMENT_MODE,
|
|
31507
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
31508
|
+
hljs.HASH_COMMENT_MODE,
|
|
31315
31509
|
STRING,
|
|
31316
31510
|
NUMBER
|
|
31317
31511
|
]
|
|
@@ -31377,6 +31571,9 @@ Language: PHP Template
|
|
|
31377
31571
|
Requires: xml.js, php.js
|
|
31378
31572
|
Author: Josh Goebel <hello@joshgoebel.com>
|
|
31379
31573
|
Website: https://www.php.net
|
|
31574
|
+
Description: Use this for HTML (or other markup) with embedded PHP, i.e. code
|
|
31575
|
+
that includes the `<?php ... ?>` (or `<?= ... ?>`) tags. For
|
|
31576
|
+
plain PHP code without the surrounding tags, use `php` instead.
|
|
31380
31577
|
Category: common
|
|
31381
31578
|
*/
|
|
31382
31579
|
|
|
@@ -31503,6 +31700,7 @@ function requirePython () {
|
|
|
31503
31700
|
'in',
|
|
31504
31701
|
'is',
|
|
31505
31702
|
'lambda',
|
|
31703
|
+
'lazy',
|
|
31506
31704
|
'match',
|
|
31507
31705
|
'nonlocal|10',
|
|
31508
31706
|
'not',
|
|
@@ -31519,7 +31717,9 @@ function requirePython () {
|
|
|
31519
31717
|
const BUILT_INS = [
|
|
31520
31718
|
'__import__',
|
|
31521
31719
|
'abs',
|
|
31720
|
+
'aiter',
|
|
31522
31721
|
'all',
|
|
31722
|
+
'anext',
|
|
31523
31723
|
'any',
|
|
31524
31724
|
'ascii',
|
|
31525
31725
|
'bin',
|
|
@@ -31542,6 +31742,7 @@ function requirePython () {
|
|
|
31542
31742
|
'filter',
|
|
31543
31743
|
'float',
|
|
31544
31744
|
'format',
|
|
31745
|
+
'frozendict',
|
|
31545
31746
|
'frozenset',
|
|
31546
31747
|
'getattr',
|
|
31547
31748
|
'globals',
|
|
@@ -31574,6 +31775,7 @@ function requirePython () {
|
|
|
31574
31775
|
'repr',
|
|
31575
31776
|
'reversed',
|
|
31576
31777
|
'round',
|
|
31778
|
+
'sentinel',
|
|
31577
31779
|
'set',
|
|
31578
31780
|
'setattr',
|
|
31579
31781
|
'slice',
|
|
@@ -31665,7 +31867,7 @@ function requirePython () {
|
|
|
31665
31867
|
relevance: 10
|
|
31666
31868
|
},
|
|
31667
31869
|
{
|
|
31668
|
-
begin: /([
|
|
31870
|
+
begin: /([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,
|
|
31669
31871
|
end: /'''/,
|
|
31670
31872
|
contains: [
|
|
31671
31873
|
hljs.BACKSLASH_ESCAPE,
|
|
@@ -31675,7 +31877,7 @@ function requirePython () {
|
|
|
31675
31877
|
]
|
|
31676
31878
|
},
|
|
31677
31879
|
{
|
|
31678
|
-
begin: /([
|
|
31880
|
+
begin: /([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,
|
|
31679
31881
|
end: /"""/,
|
|
31680
31882
|
contains: [
|
|
31681
31883
|
hljs.BACKSLASH_ESCAPE,
|
|
@@ -31703,7 +31905,7 @@ function requirePython () {
|
|
|
31703
31905
|
end: /"/
|
|
31704
31906
|
},
|
|
31705
31907
|
{
|
|
31706
|
-
begin: /([
|
|
31908
|
+
begin: /([fFtT][rR]|[rR][fFtT]|[fFtT])'/,
|
|
31707
31909
|
end: /'/,
|
|
31708
31910
|
contains: [
|
|
31709
31911
|
hljs.BACKSLASH_ESCAPE,
|
|
@@ -31712,7 +31914,7 @@ function requirePython () {
|
|
|
31712
31914
|
]
|
|
31713
31915
|
},
|
|
31714
31916
|
{
|
|
31715
|
-
begin: /([
|
|
31917
|
+
begin: /([fFtT][rR]|[rR][fFtT]|[fFtT])"/,
|
|
31716
31918
|
end: /"/,
|
|
31717
31919
|
contains: [
|
|
31718
31920
|
hljs.BACKSLASH_ESCAPE,
|
|
@@ -32240,15 +32442,15 @@ function requireRust () {
|
|
|
32240
32442
|
const IDENT_RE = regex.concat(RAW_IDENTIFIER, hljs.IDENT_RE);
|
|
32241
32443
|
// ============================================
|
|
32242
32444
|
const FUNCTION_INVOKE = {
|
|
32243
|
-
|
|
32445
|
+
scope: "title.function.invoke",
|
|
32244
32446
|
relevance: 0,
|
|
32245
32447
|
begin: regex.concat(
|
|
32246
32448
|
/\b/,
|
|
32247
|
-
/(?!let|for|while|if|else|match\b)/,
|
|
32449
|
+
/(?!(?:let|for|while|if|else|match)\b)/,
|
|
32248
32450
|
IDENT_RE,
|
|
32249
32451
|
regex.lookahead(/\s*\(/))
|
|
32250
32452
|
};
|
|
32251
|
-
const NUMBER_SUFFIX = '([ui](8|16|32|64|128|size)|f(32|64))\?';
|
|
32453
|
+
const NUMBER_SUFFIX = '([ui](8|16|32|64|128|size)|f(16|32|64|128))\?';
|
|
32252
32454
|
const KEYWORDS = [
|
|
32253
32455
|
"abstract",
|
|
32254
32456
|
"as",
|
|
@@ -32282,6 +32484,7 @@ function requireRust () {
|
|
|
32282
32484
|
"override",
|
|
32283
32485
|
"priv",
|
|
32284
32486
|
"pub",
|
|
32487
|
+
"raw",
|
|
32285
32488
|
"ref",
|
|
32286
32489
|
"return",
|
|
32287
32490
|
"self",
|
|
@@ -32392,8 +32595,10 @@ function requireRust () {
|
|
|
32392
32595
|
"u64",
|
|
32393
32596
|
"u128",
|
|
32394
32597
|
"usize",
|
|
32598
|
+
"f16",
|
|
32395
32599
|
"f32",
|
|
32396
32600
|
"f64",
|
|
32601
|
+
"f128",
|
|
32397
32602
|
"str",
|
|
32398
32603
|
"char",
|
|
32399
32604
|
"bool",
|
|
@@ -32422,7 +32627,7 @@ function requireRust () {
|
|
|
32422
32627
|
illegal: null
|
|
32423
32628
|
}),
|
|
32424
32629
|
{
|
|
32425
|
-
|
|
32630
|
+
scope: 'symbol',
|
|
32426
32631
|
// negative lookahead to avoid matching `'`
|
|
32427
32632
|
begin: /'[a-zA-Z_][a-zA-Z0-9_]*(?!')/
|
|
32428
32633
|
},
|
|
@@ -32436,14 +32641,14 @@ function requireRust () {
|
|
|
32436
32641
|
contains: [
|
|
32437
32642
|
{
|
|
32438
32643
|
scope: "char.escape",
|
|
32439
|
-
match: /\\('
|
|
32644
|
+
match: /\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/
|
|
32440
32645
|
}
|
|
32441
32646
|
]
|
|
32442
32647
|
}
|
|
32443
32648
|
]
|
|
32444
32649
|
},
|
|
32445
32650
|
{
|
|
32446
|
-
|
|
32651
|
+
scope: 'number',
|
|
32447
32652
|
variants: [
|
|
32448
32653
|
{ begin: '\\b0b([01_]+)' + NUMBER_SUFFIX },
|
|
32449
32654
|
{ begin: '\\b0o([0-7_]+)' + NUMBER_SUFFIX },
|
|
@@ -32453,24 +32658,35 @@ function requireRust () {
|
|
|
32453
32658
|
],
|
|
32454
32659
|
relevance: 0
|
|
32455
32660
|
},
|
|
32661
|
+
{
|
|
32662
|
+
begin: [
|
|
32663
|
+
/\bsafe/,
|
|
32664
|
+
/\s+/,
|
|
32665
|
+
/extern/,
|
|
32666
|
+
],
|
|
32667
|
+
scope: {
|
|
32668
|
+
1: "keyword",
|
|
32669
|
+
3: "keyword",
|
|
32670
|
+
}
|
|
32671
|
+
},
|
|
32456
32672
|
{
|
|
32457
32673
|
begin: [
|
|
32458
32674
|
/fn/,
|
|
32459
32675
|
/\s+/,
|
|
32460
32676
|
UNDERSCORE_IDENT_RE
|
|
32461
32677
|
],
|
|
32462
|
-
|
|
32678
|
+
scope: {
|
|
32463
32679
|
1: "keyword",
|
|
32464
32680
|
3: "title.function"
|
|
32465
32681
|
}
|
|
32466
32682
|
},
|
|
32467
32683
|
{
|
|
32468
|
-
|
|
32684
|
+
scope: 'meta',
|
|
32469
32685
|
begin: '#!?\\[',
|
|
32470
32686
|
end: '\\]',
|
|
32471
32687
|
contains: [
|
|
32472
32688
|
{
|
|
32473
|
-
|
|
32689
|
+
scope: 'string',
|
|
32474
32690
|
begin: /"/,
|
|
32475
32691
|
end: /"/,
|
|
32476
32692
|
contains: [
|
|
@@ -32486,7 +32702,7 @@ function requireRust () {
|
|
|
32486
32702
|
/(?:mut\s+)?/,
|
|
32487
32703
|
UNDERSCORE_IDENT_RE
|
|
32488
32704
|
],
|
|
32489
|
-
|
|
32705
|
+
scope: {
|
|
32490
32706
|
1: "keyword",
|
|
32491
32707
|
3: "keyword",
|
|
32492
32708
|
4: "variable"
|
|
@@ -32501,7 +32717,7 @@ function requireRust () {
|
|
|
32501
32717
|
/\s+/,
|
|
32502
32718
|
/in/
|
|
32503
32719
|
],
|
|
32504
|
-
|
|
32720
|
+
scope: {
|
|
32505
32721
|
1: "keyword",
|
|
32506
32722
|
3: "variable",
|
|
32507
32723
|
5: "keyword"
|
|
@@ -32513,7 +32729,7 @@ function requireRust () {
|
|
|
32513
32729
|
/\s+/,
|
|
32514
32730
|
UNDERSCORE_IDENT_RE
|
|
32515
32731
|
],
|
|
32516
|
-
|
|
32732
|
+
scope: {
|
|
32517
32733
|
1: "keyword",
|
|
32518
32734
|
3: "title.class"
|
|
32519
32735
|
}
|
|
@@ -32524,7 +32740,7 @@ function requireRust () {
|
|
|
32524
32740
|
/\s+/,
|
|
32525
32741
|
UNDERSCORE_IDENT_RE
|
|
32526
32742
|
],
|
|
32527
|
-
|
|
32743
|
+
scope: {
|
|
32528
32744
|
1: "keyword",
|
|
32529
32745
|
3: "title.class"
|
|
32530
32746
|
}
|
|
@@ -32538,7 +32754,7 @@ function requireRust () {
|
|
|
32538
32754
|
}
|
|
32539
32755
|
},
|
|
32540
32756
|
{
|
|
32541
|
-
|
|
32757
|
+
scope: "punctuation",
|
|
32542
32758
|
begin: '->'
|
|
32543
32759
|
},
|
|
32544
32760
|
FUNCTION_INVOKE
|
|
@@ -32567,6 +32783,10 @@ function requireScss () {
|
|
|
32567
32783
|
scope: 'number',
|
|
32568
32784
|
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
|
|
32569
32785
|
},
|
|
32786
|
+
UNICODE_RANGE: {
|
|
32787
|
+
scope: 'number',
|
|
32788
|
+
begin: /\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/
|
|
32789
|
+
},
|
|
32570
32790
|
FUNCTION_DISPATCH: {
|
|
32571
32791
|
className: "built_in",
|
|
32572
32792
|
begin: /[\w-]+(?=\()/
|
|
@@ -33000,6 +33220,11 @@ function requireScss () {
|
|
|
33000
33220
|
'container-type',
|
|
33001
33221
|
'content',
|
|
33002
33222
|
'content-visibility',
|
|
33223
|
+
'corner-bottom-left-shape',
|
|
33224
|
+
'corner-bottom-right-shape',
|
|
33225
|
+
'corner-shape',
|
|
33226
|
+
'corner-top-left-shape',
|
|
33227
|
+
'corner-top-right-shape',
|
|
33003
33228
|
'counter-increment',
|
|
33004
33229
|
'counter-reset',
|
|
33005
33230
|
'counter-set',
|
|
@@ -33335,6 +33560,7 @@ function requireScss () {
|
|
|
33335
33560
|
'transition-timing-function',
|
|
33336
33561
|
'translate',
|
|
33337
33562
|
'unicode-bidi',
|
|
33563
|
+
'unicode-range',
|
|
33338
33564
|
'user-modify',
|
|
33339
33565
|
'user-select',
|
|
33340
33566
|
'vector-effect',
|
|
@@ -33448,6 +33674,7 @@ function requireScss () {
|
|
|
33448
33674
|
VARIABLE,
|
|
33449
33675
|
modes.HEXCOLOR,
|
|
33450
33676
|
modes.CSS_NUMBER_MODE,
|
|
33677
|
+
modes.UNICODE_RANGE,
|
|
33451
33678
|
hljs.QUOTE_STRING_MODE,
|
|
33452
33679
|
hljs.APOS_STRING_MODE,
|
|
33453
33680
|
modes.IMPORTANT,
|
|
@@ -33526,7 +33753,7 @@ function requireShell () {
|
|
|
33526
33753
|
// We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.
|
|
33527
33754
|
// For instance, in the following example, it would match "echo /path/to/home >" as a prompt:
|
|
33528
33755
|
// echo /path/to/home > t.exe
|
|
33529
|
-
begin: /^\s{0,3}[
|
|
33756
|
+
begin: /^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,
|
|
33530
33757
|
starts: {
|
|
33531
33758
|
end: /[^\\](?=\s*$)/,
|
|
33532
33759
|
subLanguage: 'bash'
|
|
@@ -34314,6 +34541,18 @@ function requireSwift () {
|
|
|
34314
34541
|
return joined;
|
|
34315
34542
|
}
|
|
34316
34543
|
|
|
34544
|
+
// BACKREF_RE matches an open parenthesis or backreference. To avoid an
|
|
34545
|
+
// incorrect parse, it also matches the constructs where the meaning of
|
|
34546
|
+
// parentheses, escapes, or capture counting changes.
|
|
34547
|
+
new RegExp(either(
|
|
34548
|
+
/\[(?:[^\\\]]|\\.)*\]/, // a character class, inside which ( and \ lose their meaning
|
|
34549
|
+
/\(\?<(?![=!])[^>]+>/, // a named capture group `(?<name>` (not a lookbehind `(?<=` / `(?<!`)
|
|
34550
|
+
/\(\?'[^']+'/, // a named capture group `(?'name'`
|
|
34551
|
+
/\(\??/, // an opening parenthesis, capturing or non-capturing / lookahead
|
|
34552
|
+
/\\([1-9][0-9]*)/, // a backreference like `\1`
|
|
34553
|
+
/\\./ // any other escape sequence
|
|
34554
|
+
));
|
|
34555
|
+
|
|
34317
34556
|
const keywordWrapper = keyword => concat(
|
|
34318
34557
|
/\b/,
|
|
34319
34558
|
keyword,
|
|
@@ -35453,6 +35692,7 @@ function requireTypescript () {
|
|
|
35453
35692
|
if (hasRequiredTypescript) return typescript_1;
|
|
35454
35693
|
hasRequiredTypescript = 1;
|
|
35455
35694
|
const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
|
|
35695
|
+
|
|
35456
35696
|
const KEYWORDS = [
|
|
35457
35697
|
"as", // for exports
|
|
35458
35698
|
"in",
|
|
@@ -35603,6 +35843,7 @@ function requireTypescript () {
|
|
|
35603
35843
|
"localStorage",
|
|
35604
35844
|
"sessionStorage",
|
|
35605
35845
|
"module",
|
|
35846
|
+
"self",
|
|
35606
35847
|
"global" // Node.js
|
|
35607
35848
|
];
|
|
35608
35849
|
|
|
@@ -36000,7 +36241,8 @@ function requireTypescript () {
|
|
|
36000
36241
|
noneOf([
|
|
36001
36242
|
...BUILT_IN_GLOBALS,
|
|
36002
36243
|
"super",
|
|
36003
|
-
"import"
|
|
36244
|
+
"import",
|
|
36245
|
+
"await",
|
|
36004
36246
|
].map(x => `${x}\\s*\\(`)),
|
|
36005
36247
|
IDENT_RE$1, regex.lookahead(/\s*\(/)),
|
|
36006
36248
|
className: "title.function",
|
|
@@ -36069,7 +36311,7 @@ function requireTypescript () {
|
|
|
36069
36311
|
keywords: KEYWORDS$1,
|
|
36070
36312
|
// this will be extended by TypeScript
|
|
36071
36313
|
exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
|
|
36072
|
-
illegal: /#(?![$_A-z])/,
|
|
36314
|
+
illegal: /#(?![$_A-Za-z])/,
|
|
36073
36315
|
contains: [
|
|
36074
36316
|
hljs.SHEBANG({
|
|
36075
36317
|
label: "shebang",
|
|
@@ -36752,7 +36994,9 @@ const defaultOptions = {
|
|
|
36752
36994
|
lstat: false,
|
|
36753
36995
|
depth: 2147483648,
|
|
36754
36996
|
alwaysStat: false,
|
|
36755
|
-
|
|
36997
|
+
// Throughput is flat from 16 to 65536 (traversal is I/O-bound), but
|
|
36998
|
+
// batches of 1024+ entries survive young-gen GC and bloat RSS ~20-60%.
|
|
36999
|
+
highWaterMark: 256,
|
|
36756
37000
|
};
|
|
36757
37001
|
Object.freeze(defaultOptions);
|
|
36758
37002
|
const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
|
|
@@ -36791,8 +37035,12 @@ const normalizeFilter = (filter) => {
|
|
|
36791
37035
|
}
|
|
36792
37036
|
return emptyFn;
|
|
36793
37037
|
};
|
|
36794
|
-
/** Readable readdir stream, emitting new files as they're being listed. */
|
|
36795
37038
|
class ReaddirpStream extends Readable {
|
|
37039
|
+
/**
|
|
37040
|
+
* Directories discovered but not yet emitted from. Listings are read
|
|
37041
|
+
* lazily (on pop, plus one prefetch) instead of eagerly on discovery:
|
|
37042
|
+
* keeping whole listings for every queued dir balloons RAM on wide trees.
|
|
37043
|
+
*/
|
|
36796
37044
|
parents;
|
|
36797
37045
|
reading;
|
|
36798
37046
|
parent;
|
|
@@ -36807,14 +37055,17 @@ class ReaddirpStream extends Readable {
|
|
|
36807
37055
|
_rdOptions;
|
|
36808
37056
|
_fileFilter;
|
|
36809
37057
|
_directoryFilter;
|
|
37058
|
+
_relStart;
|
|
36810
37059
|
constructor(options = {}) {
|
|
36811
37060
|
super({
|
|
36812
37061
|
objectMode: true,
|
|
36813
37062
|
autoDestroy: true,
|
|
36814
|
-
highWaterMark: options.highWaterMark,
|
|
37063
|
+
highWaterMark: options.highWaterMark ?? defaultOptions.highWaterMark,
|
|
36815
37064
|
});
|
|
36816
37065
|
const opts = { ...defaultOptions, ...options };
|
|
36817
|
-
|
|
37066
|
+
// Use ?? so an explicit `undefined` in user options doesn't shadow defaults.
|
|
37067
|
+
const root = opts.root ?? defaultOptions.root;
|
|
37068
|
+
const type = opts.type ?? defaultOptions.type;
|
|
36818
37069
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
36819
37070
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
36820
37071
|
const statMethod = opts.lstat ? lstat : stat$1;
|
|
@@ -36827,15 +37078,23 @@ class ReaddirpStream extends Readable {
|
|
|
36827
37078
|
}
|
|
36828
37079
|
this._maxDepth =
|
|
36829
37080
|
opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
36830
|
-
this._wantsDir =
|
|
36831
|
-
this._wantsFile =
|
|
37081
|
+
this._wantsDir = DIR_TYPES.has(type);
|
|
37082
|
+
this._wantsFile = FILE_TYPES.has(type);
|
|
36832
37083
|
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
36833
37084
|
this._root = resolve(root);
|
|
37085
|
+
// Every fullPath is `_root + sep + relative path` (see _formatEntry), so
|
|
37086
|
+
// the relative path is a slice starting past the root and its trailing
|
|
37087
|
+
// separator (which resolved paths lack, except fs roots like '/', 'C:\').
|
|
37088
|
+
this._relStart = this._root.endsWith(sep$1) ? this._root.length : this._root.length + 1;
|
|
36834
37089
|
this._isDirent = !opts.alwaysStat;
|
|
36835
37090
|
this._statsProp = this._isDirent ? 'dirent' : 'stats';
|
|
36836
37091
|
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
|
|
36837
|
-
// Launch stream with one parent, the root dir
|
|
36838
|
-
|
|
37092
|
+
// Launch stream with one parent, the root dir, whose readdir starts
|
|
37093
|
+
// right away. Explore the resolved root so all parent paths stay
|
|
37094
|
+
// absolute even if process.cwd() changes mid-iteration.
|
|
37095
|
+
const rootDir = { path: this._root, depth: 1 };
|
|
37096
|
+
rootDir.pending = this._exploreDir(this._root, 1);
|
|
37097
|
+
this.parents = [rootDir];
|
|
36839
37098
|
this.reading = false;
|
|
36840
37099
|
this.parent = undefined;
|
|
36841
37100
|
}
|
|
@@ -36850,16 +37109,25 @@ class ReaddirpStream extends Readable {
|
|
|
36850
37109
|
if (fil && fil.length > 0) {
|
|
36851
37110
|
const { path, depth } = par;
|
|
36852
37111
|
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
|
|
36853
|
-
|
|
37112
|
+
// In dirent mode _formatEntry is synchronous: skip Promise.all and
|
|
37113
|
+
// its per-entry microtask overhead.
|
|
37114
|
+
const awaited = this._isDirent
|
|
37115
|
+
? slice
|
|
37116
|
+
: await Promise.all(slice);
|
|
36854
37117
|
for (const entry of awaited) {
|
|
36855
37118
|
if (!entry)
|
|
36856
37119
|
continue;
|
|
36857
37120
|
if (this.destroyed)
|
|
36858
37121
|
return;
|
|
36859
|
-
|
|
37122
|
+
// Only symlinks require async work; plain files / dirs resolve synchronously.
|
|
37123
|
+
let entryType = this._getEntryType(entry);
|
|
37124
|
+
if (typeof entryType !== 'string')
|
|
37125
|
+
entryType = await entryType;
|
|
36860
37126
|
if (entryType === 'directory' && this._directoryFilter(entry)) {
|
|
36861
37127
|
if (depth <= this._maxDepth) {
|
|
36862
|
-
this.
|
|
37128
|
+
// Lazy: don't readdir until this dir is popped. Keeping whole
|
|
37129
|
+
// listings for every queued dir would balloon RAM on wide trees.
|
|
37130
|
+
this.parents.push({ path: entry.fullPath, depth: depth + 1 });
|
|
36863
37131
|
}
|
|
36864
37132
|
if (this._wantsDir) {
|
|
36865
37133
|
this.push(entry);
|
|
@@ -36881,7 +37149,15 @@ class ReaddirpStream extends Readable {
|
|
|
36881
37149
|
this.push(null);
|
|
36882
37150
|
break;
|
|
36883
37151
|
}
|
|
36884
|
-
|
|
37152
|
+
const dir = parent.pending ?? this._exploreDir(parent.path, parent.depth);
|
|
37153
|
+
// Prefetch the next dir so its readdir overlaps with processing
|
|
37154
|
+
// this one's entries. Only the stack top is prefetched, keeping at
|
|
37155
|
+
// most a handful of listings (~tree depth) in RAM at once.
|
|
37156
|
+
const next = this.parents[this.parents.length - 1];
|
|
37157
|
+
if (next && !next.pending) {
|
|
37158
|
+
next.pending = this._exploreDir(next.path, next.depth);
|
|
37159
|
+
}
|
|
37160
|
+
this.parent = await dir;
|
|
36885
37161
|
if (this.destroyed)
|
|
36886
37162
|
return;
|
|
36887
37163
|
}
|
|
@@ -36894,6 +37170,18 @@ class ReaddirpStream extends Readable {
|
|
|
36894
37170
|
this.reading = false;
|
|
36895
37171
|
}
|
|
36896
37172
|
}
|
|
37173
|
+
// NOTE: native `readdir(path, { recursive: true })` was evaluated as a
|
|
37174
|
+
// replacement for this per-directory traversal and rejected:
|
|
37175
|
+
// - Not faster: node implements it in JS, walking directories sequentially
|
|
37176
|
+
// just like this loop, but with extra path bookkeeping. Benchmarks
|
|
37177
|
+
// (node 24): ~10% slower on wide trees, ~40% slower on small ones,
|
|
37178
|
+
// parity on deep ones.
|
|
37179
|
+
// - Much more RAM: it buffers the entire subtree listing in one array,
|
|
37180
|
+
// instead of one directory at a time, defeating streaming.
|
|
37181
|
+
// - Semantics diverge: it can't limit depth, can't skip directories a
|
|
37182
|
+
// directoryFilter rejects, doesn't follow symlinked dirs, and fails
|
|
37183
|
+
// wholesale (all entries lost) if anything in the subtree is unreadable,
|
|
37184
|
+
// instead of emitting a 'warn' and continuing.
|
|
36897
37185
|
async _exploreDir(path, depth) {
|
|
36898
37186
|
let files;
|
|
36899
37187
|
try {
|
|
@@ -36904,19 +37192,27 @@ class ReaddirpStream extends Readable {
|
|
|
36904
37192
|
}
|
|
36905
37193
|
return { files, depth, path };
|
|
36906
37194
|
}
|
|
36907
|
-
|
|
36908
|
-
|
|
37195
|
+
// Synchronous in dirent mode; returns a promise only when stats are needed.
|
|
37196
|
+
_formatEntry(dirent, path) {
|
|
36909
37197
|
const basename = this._isDirent ? dirent.name : dirent;
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
|
|
36913
|
-
|
|
36914
|
-
|
|
36915
|
-
|
|
37198
|
+
// `path` is always an absolute, normalized parent dir (see _exploreDir
|
|
37199
|
+
// seeding in the constructor), so a plain join is enough — resolve()
|
|
37200
|
+
// would re-read cwd on every entry.
|
|
37201
|
+
const fullPath = join$1(path, basename);
|
|
37202
|
+
// Slice instead of path.relative(): equivalent here (fullPath is always
|
|
37203
|
+
// under _root) and avoids several intermediate allocations per entry.
|
|
37204
|
+
const entry = { path: fullPath.slice(this._relStart), fullPath, basename };
|
|
37205
|
+
if (this._isDirent) {
|
|
37206
|
+
entry.dirent = dirent;
|
|
37207
|
+
return entry;
|
|
37208
|
+
}
|
|
37209
|
+
return this._stat(fullPath).then((stats) => {
|
|
37210
|
+
entry.stats = stats;
|
|
37211
|
+
return entry;
|
|
37212
|
+
}, (err) => {
|
|
36916
37213
|
this._onError(err);
|
|
36917
|
-
return;
|
|
36918
|
-
}
|
|
36919
|
-
return entry;
|
|
37214
|
+
return undefined;
|
|
37215
|
+
});
|
|
36920
37216
|
}
|
|
36921
37217
|
_onError(err) {
|
|
36922
37218
|
if (isNormalFlowError(err) && !this.destroyed) {
|
|
@@ -36926,10 +37222,12 @@ class ReaddirpStream extends Readable {
|
|
|
36926
37222
|
this.destroy(err);
|
|
36927
37223
|
}
|
|
36928
37224
|
}
|
|
36929
|
-
|
|
37225
|
+
// Synchronous for regular files and directories; returns a promise only for
|
|
37226
|
+
// symlinks, which need realpath() to be classified.
|
|
37227
|
+
_getEntryType(entry) {
|
|
36930
37228
|
// entry may be undefined, because a warning or an error were emitted
|
|
36931
37229
|
// and the statsProp is undefined
|
|
36932
|
-
if (!entry
|
|
37230
|
+
if (!entry || !(this._statsProp in entry)) {
|
|
36933
37231
|
return '';
|
|
36934
37232
|
}
|
|
36935
37233
|
const stats = entry[this._statsProp];
|
|
@@ -36937,30 +37235,34 @@ class ReaddirpStream extends Readable {
|
|
|
36937
37235
|
return 'file';
|
|
36938
37236
|
if (stats.isDirectory())
|
|
36939
37237
|
return 'directory';
|
|
36940
|
-
if (stats
|
|
36941
|
-
|
|
36942
|
-
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
36952
|
-
// @ts-ignore
|
|
36953
|
-
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
36954
|
-
return this._onError(recursiveError);
|
|
36955
|
-
}
|
|
36956
|
-
return 'directory';
|
|
36957
|
-
}
|
|
37238
|
+
if (stats.isSymbolicLink())
|
|
37239
|
+
return this._getSymlinkEntryType(entry);
|
|
37240
|
+
return '';
|
|
37241
|
+
}
|
|
37242
|
+
async _getSymlinkEntryType(entry) {
|
|
37243
|
+
const full = entry.fullPath;
|
|
37244
|
+
try {
|
|
37245
|
+
const entryRealPath = await realpath(full);
|
|
37246
|
+
const entryRealPathStats = await lstat(entryRealPath);
|
|
37247
|
+
if (entryRealPathStats.isFile()) {
|
|
37248
|
+
return 'file';
|
|
36958
37249
|
}
|
|
36959
|
-
|
|
36960
|
-
|
|
36961
|
-
|
|
37250
|
+
if (entryRealPathStats.isDirectory()) {
|
|
37251
|
+
const len = entryRealPath.length;
|
|
37252
|
+
if (full.startsWith(entryRealPath) && full[len] === sep$1) {
|
|
37253
|
+
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
37254
|
+
// @ts-ignore
|
|
37255
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
37256
|
+
this._onError(recursiveError);
|
|
37257
|
+
return '';
|
|
37258
|
+
}
|
|
37259
|
+
return 'directory';
|
|
36962
37260
|
}
|
|
36963
37261
|
}
|
|
37262
|
+
catch (error) {
|
|
37263
|
+
this._onError(error);
|
|
37264
|
+
}
|
|
37265
|
+
return '';
|
|
36964
37266
|
}
|
|
36965
37267
|
_includeAsFile(entry) {
|
|
36966
37268
|
const stats = entry && entry[this._statsProp];
|
|
@@ -36978,8 +37280,6 @@ function readdirp(root, options = {}) {
|
|
|
36978
37280
|
let type = options.entryType || options.type;
|
|
36979
37281
|
if (type === 'both')
|
|
36980
37282
|
type = EntryTypes.FILE_DIR_TYPE; // backwards-compatibility
|
|
36981
|
-
if (type)
|
|
36982
|
-
options.type = type;
|
|
36983
37283
|
if (!root) {
|
|
36984
37284
|
throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
|
|
36985
37285
|
}
|
|
@@ -36989,8 +37289,11 @@ function readdirp(root, options = {}) {
|
|
|
36989
37289
|
else if (type && !ALL_TYPES.includes(type)) {
|
|
36990
37290
|
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
|
|
36991
37291
|
}
|
|
36992
|
-
options
|
|
36993
|
-
|
|
37292
|
+
// Copy options instead of mutating the caller's object.
|
|
37293
|
+
const opts = { ...options, root };
|
|
37294
|
+
if (type)
|
|
37295
|
+
opts.type = type;
|
|
37296
|
+
return new ReaddirpStream(opts);
|
|
36994
37297
|
}
|
|
36995
37298
|
|
|
36996
37299
|
const STR_DATA = 'data';
|
|
@@ -68646,4 +68949,4 @@ var yaml = /*#__PURE__*/Object.freeze({
|
|
|
68646
68949
|
});
|
|
68647
68950
|
|
|
68648
68951
|
export { HighlightJS as H, MarkdownItCallable as M, Ze$b as Z, resolveConfig as a, createTwoFilesPatch$1 as b, createSyncFn as c, dedent$1 as d, deflist_plugin as e, format2 as f, strFromU8 as g, closest as h, distance as i, fm$3 as j, isCI as k, cliProgress as l, moduleImporter as m, tinylr as n, createInstance as o, fse as p, inter as q, runAsWorker as r, strToU8 as s, ts$9 as t, watch$1 as w, zlibSync as z };
|
|
68649
|
-
//# sourceMappingURL=vendor-
|
|
68952
|
+
//# sourceMappingURL=vendor-D7FIOE5G.mjs.map
|