@bluepic/embed 0.4.0-next.98 → 0.4.0-next.99
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/bluepic-embed.iife.js +56 -56
- package/dist/bluepic-embed.umd.js +56 -56
- package/dist/c-B4BAHWS4.cjs +1 -0
- package/dist/{c-Bz1-FJiA.js → c-C0DTNf68.js} +122 -63
- package/dist/cpp-BfO2fOQK.cjs +1 -0
- package/dist/{cpp-CH0U-pDu.js → cpp-DxGBPWa5.js} +60 -39
- package/dist/{css-DXX4BvrO.js → css-Cx1gP-zj.js} +13 -8
- package/dist/css-DTF39MN3.cjs +1 -0
- package/dist/{go-BpetKc7b.cjs → go-By8nj0Vi.cjs} +1 -1
- package/dist/{go-CkZ9_bn0.js → go-C8VcBUsu.js} +7 -2
- package/dist/{java-BicX26Pg.js → java-BoRJOXvw.js} +48 -39
- package/dist/java-DFXAwvvK.cjs +1 -0
- package/dist/javascript-C2jY0XE6.cjs +1 -0
- package/dist/{javascript-BAHKs5qZ.js → javascript-CgRUYx2b.js} +1 -0
- package/dist/main.cjs +59 -59
- package/dist/main.mjs +13096 -13097
- package/dist/markdown-BmL9j9cU.cjs +1 -0
- package/dist/{markdown-ga2-2-T7.js → markdown-D19noYwn.js} +9 -10
- package/dist/{python-CymlFLB0.js → python-BBUuE3AY.js} +20 -15
- package/dist/python-Clt6L10q.cjs +1 -0
- package/dist/{rust-BocnJ3Ns.js → rust-DY-oA2gr.js} +40 -26
- package/dist/rust-_vvcEGSJ.cjs +1 -0
- package/dist/{scss-DybQU0yX.js → scss-BWo_aR1L.js} +6 -1
- package/dist/scss-ex7iHSUb.cjs +1 -0
- package/dist/{typescript-BRD67TAB.js → typescript-BHqLHF13.js} +1 -0
- package/dist/typescript-DYRnLHqF.cjs +1 -0
- package/dist/util/analytics.d.ts +16 -0
- package/dist/util/gallery.d.ts +0 -2
- package/dist/{xml-B7THKYqr.js → xml-Bse49fPV.js} +9 -16
- package/dist/{xml-CII3FKiI.cjs → xml-CVmug_x4.cjs} +1 -1
- package/package.json +1 -1
- package/dist/c-C_Sx7N-F.cjs +0 -1
- package/dist/cpp-CEORmSCT.cjs +0 -1
- package/dist/css-l--Pv1Vb.cjs +0 -1
- package/dist/java-BIk0G-rH.cjs +0 -1
- package/dist/javascript-NPBda6fN.cjs +0 -1
- package/dist/markdown-BbPYOuo6.cjs +0 -1
- package/dist/python-B6_9AjJr.cjs +0 -1
- package/dist/rust-DKnYCg2f.cjs +0 -1
- package/dist/scss-C_iicH8I.cjs +0 -1
- package/dist/typescript-ro3bsRwC.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function N(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),l="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",E="("+l+"|"+n.optional(r)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f=n.concat(/\batomic_/,n.either("bool","char","schar","uchar","short","ushort","int","uint","long","ulong","llong","ullong","char16_t","char32_t","wchar_t","int_least8_t","uint_least8_t","int_least16_t","uint_least16_t","int_least32_t","uint_least32_t","int_least64_t","uint_least64_t","int_fast8_t","uint_fast8_t","int_fast16_t","uint_fast16_t","int_fast32_t","uint_fast32_t","int_fast64_t","uint_fast64_t","intptr_t","uintptr_t","size_t","ptrdiff_t","intmax_t","uintmax_t"),/\b/),i={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:f}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},o={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},m={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},s,{scope:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(s,{className:"string"}),a,t.C_BLOCK_COMMENT_MODE]},c=[m,u],g={className:"title",begin:n.optional(r)+t.IDENT_RE,relevance:0},d=n.optional(r)+t.IDENT_RE+"\\s*\\(",p=12,e={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},_=[...c,i,a,t.C_BLOCK_COMMENT_MODE,o,s],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:e,contains:_.concat([{begin:/\(/,end:/\)/,keywords:e,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+E+"[\\*&\\s]+){1,"+p+"}"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:e,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:l,keywords:e,relevance:0},{begin:d,returnBegin:!0,contains:[t.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:e,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,s,o,i,{begin:/\(/,end:/\)/,keywords:e,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,s,o,i]}]},i,a,t.C_BLOCK_COMMENT_MODE,...c]};return{name:"C",aliases:["h"],keywords:e,disableAutodetect:!0,illegal:"</",contains:[].concat(b,C,_,[...c,{begin:t.IDENT_RE+"::",keywords:e},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:u,strings:s,keywords:e}}}exports.default=N;
|
|
@@ -1,30 +1,72 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
1
|
+
function S(t) {
|
|
2
|
+
const n = t.regex, a = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), l = "decltype\\(auto\\)", r = "[a-zA-Z_]\\w*::", E = "(" + l + "|" + n.optional(r) + "[a-zA-Z_]\\w*" + n.optional("<[^<>]+>") + ")", f = n.concat(/\batomic_/, n.either(
|
|
3
|
+
"bool",
|
|
4
|
+
"char",
|
|
5
|
+
"schar",
|
|
6
|
+
"uchar",
|
|
7
|
+
"short",
|
|
8
|
+
"ushort",
|
|
9
|
+
"int",
|
|
10
|
+
"uint",
|
|
11
|
+
"long",
|
|
12
|
+
"ulong",
|
|
13
|
+
"llong",
|
|
14
|
+
"ullong",
|
|
15
|
+
"char16_t",
|
|
16
|
+
"char32_t",
|
|
17
|
+
"wchar_t",
|
|
18
|
+
"int_least8_t",
|
|
19
|
+
"uint_least8_t",
|
|
20
|
+
"int_least16_t",
|
|
21
|
+
"uint_least16_t",
|
|
22
|
+
"int_least32_t",
|
|
23
|
+
"uint_least32_t",
|
|
24
|
+
"int_least64_t",
|
|
25
|
+
"uint_least64_t",
|
|
26
|
+
"int_fast8_t",
|
|
27
|
+
"uint_fast8_t",
|
|
28
|
+
"int_fast16_t",
|
|
29
|
+
"uint_fast16_t",
|
|
30
|
+
"int_fast32_t",
|
|
31
|
+
"uint_fast32_t",
|
|
32
|
+
"int_fast64_t",
|
|
33
|
+
"uint_fast64_t",
|
|
34
|
+
"intptr_t",
|
|
35
|
+
"uintptr_t",
|
|
36
|
+
"size_t",
|
|
37
|
+
"ptrdiff_t",
|
|
38
|
+
"intmax_t",
|
|
39
|
+
"uintmax_t"
|
|
40
|
+
), /\b/), i = {
|
|
3
41
|
className: "type",
|
|
4
42
|
variants: [
|
|
5
43
|
{ begin: "\\b[a-z\\d_]*_t\\b" },
|
|
6
|
-
{ match:
|
|
44
|
+
{ match: f }
|
|
7
45
|
]
|
|
8
|
-
},
|
|
46
|
+
}, s = {
|
|
9
47
|
className: "string",
|
|
10
48
|
variants: [
|
|
11
49
|
{
|
|
12
50
|
begin: '(u8?|U|L)?"',
|
|
13
51
|
end: '"',
|
|
14
52
|
illegal: "\\n",
|
|
15
|
-
contains: [
|
|
53
|
+
contains: [t.BACKSLASH_ESCAPE]
|
|
16
54
|
},
|
|
17
55
|
{
|
|
18
56
|
begin: "(u8?|U|L)?'(" + "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)" + "|.)",
|
|
19
57
|
end: "'",
|
|
20
58
|
illegal: "."
|
|
21
59
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
60
|
+
// https://en.cppreference.com/w/cpp/language/string_literal
|
|
61
|
+
// a d-char-sequence never contains parentheses, backslashes or whitespace;
|
|
62
|
+
// quotes are excluded as well so the closing delimiter cannot swallow the
|
|
63
|
+
// quote that actually terminates the literal
|
|
64
|
+
t.END_SAME_AS_BEGIN({
|
|
65
|
+
begin: /(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,
|
|
66
|
+
end: /\)([^()\\\s"]{0,16})"/
|
|
25
67
|
})
|
|
26
68
|
]
|
|
27
|
-
},
|
|
69
|
+
}, o = {
|
|
28
70
|
className: "number",
|
|
29
71
|
variants: [
|
|
30
72
|
{ match: /\b(0b[01']+)/ },
|
|
@@ -33,7 +75,25 @@ function C(e) {
|
|
|
33
75
|
{ match: /(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/ }
|
|
34
76
|
],
|
|
35
77
|
relevance: 0
|
|
36
|
-
},
|
|
78
|
+
}, m = {
|
|
79
|
+
scope: "meta",
|
|
80
|
+
begin: /#\s*include\b/,
|
|
81
|
+
end: /$/,
|
|
82
|
+
keywords: { keyword: "include" },
|
|
83
|
+
contains: [
|
|
84
|
+
{
|
|
85
|
+
// the `\` at the end of a line signaling continuation
|
|
86
|
+
begin: /\\\n/
|
|
87
|
+
},
|
|
88
|
+
s,
|
|
89
|
+
{
|
|
90
|
+
scope: "string",
|
|
91
|
+
begin: /<.*?>/
|
|
92
|
+
},
|
|
93
|
+
a,
|
|
94
|
+
t.C_BLOCK_COMMENT_MODE
|
|
95
|
+
]
|
|
96
|
+
}, u = {
|
|
37
97
|
className: "meta",
|
|
38
98
|
begin: /#\s*[a-z]+\b/,
|
|
39
99
|
end: /$/,
|
|
@@ -43,19 +103,18 @@ function C(e) {
|
|
|
43
103
|
begin: /\\\n/,
|
|
44
104
|
relevance: 0
|
|
45
105
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
begin: /<.*?>/
|
|
50
|
-
},
|
|
51
|
-
n,
|
|
52
|
-
e.C_BLOCK_COMMENT_MODE
|
|
106
|
+
t.inherit(s, { className: "string" }),
|
|
107
|
+
a,
|
|
108
|
+
t.C_BLOCK_COMMENT_MODE
|
|
53
109
|
]
|
|
54
|
-
},
|
|
110
|
+
}, c = [
|
|
111
|
+
m,
|
|
112
|
+
u
|
|
113
|
+
], p = {
|
|
55
114
|
className: "title",
|
|
56
|
-
begin:
|
|
115
|
+
begin: n.optional(r) + t.IDENT_RE,
|
|
57
116
|
relevance: 0
|
|
58
|
-
}, d =
|
|
117
|
+
}, d = n.optional(r) + t.IDENT_RE + "\\s*\\(", g = 12, e = {
|
|
59
118
|
keyword: [
|
|
60
119
|
"asm",
|
|
61
120
|
"auto",
|
|
@@ -139,14 +198,14 @@ function C(e) {
|
|
|
139
198
|
literal: "true false NULL",
|
|
140
199
|
// TODO: apply hinting work similar to what was done in cpp.js
|
|
141
200
|
built_in: "std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"
|
|
142
|
-
},
|
|
201
|
+
}, _ = [
|
|
202
|
+
...c,
|
|
143
203
|
i,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
], m = {
|
|
204
|
+
a,
|
|
205
|
+
t.C_BLOCK_COMMENT_MODE,
|
|
206
|
+
o,
|
|
207
|
+
s
|
|
208
|
+
], C = {
|
|
150
209
|
// This mode covers expression context where we can't expect a function
|
|
151
210
|
// definition and shouldn't highlight anything that looks like one:
|
|
152
211
|
// `return some()`, `else if()`, `(x*sum(1, 2))`
|
|
@@ -164,35 +223,35 @@ function C(e) {
|
|
|
164
223
|
end: /;/
|
|
165
224
|
}
|
|
166
225
|
],
|
|
167
|
-
keywords:
|
|
168
|
-
contains:
|
|
226
|
+
keywords: e,
|
|
227
|
+
contains: _.concat([
|
|
169
228
|
{
|
|
170
229
|
begin: /\(/,
|
|
171
230
|
end: /\)/,
|
|
172
|
-
keywords:
|
|
173
|
-
contains:
|
|
231
|
+
keywords: e,
|
|
232
|
+
contains: _.concat(["self"]),
|
|
174
233
|
relevance: 0
|
|
175
234
|
}
|
|
176
235
|
]),
|
|
177
236
|
relevance: 0
|
|
178
|
-
},
|
|
179
|
-
begin: "(" +
|
|
237
|
+
}, b = {
|
|
238
|
+
begin: "(" + E + "[\\*&\\s]+){1," + g + "}" + d,
|
|
180
239
|
returnBegin: !0,
|
|
181
240
|
end: /[{;=]/,
|
|
182
241
|
excludeEnd: !0,
|
|
183
|
-
keywords:
|
|
242
|
+
keywords: e,
|
|
184
243
|
illegal: /[^\w\s\*&:<>.]/,
|
|
185
244
|
contains: [
|
|
186
245
|
{
|
|
187
246
|
// to prevent it from being confused as the function title
|
|
188
|
-
begin:
|
|
189
|
-
keywords:
|
|
247
|
+
begin: l,
|
|
248
|
+
keywords: e,
|
|
190
249
|
relevance: 0
|
|
191
250
|
},
|
|
192
251
|
{
|
|
193
252
|
begin: d,
|
|
194
253
|
returnBegin: !0,
|
|
195
|
-
contains: [
|
|
254
|
+
contains: [t.inherit(p, { className: "title.function" })],
|
|
196
255
|
relevance: 0
|
|
197
256
|
},
|
|
198
257
|
// allow for multiple declarations, e.g.:
|
|
@@ -205,54 +264,54 @@ function C(e) {
|
|
|
205
264
|
className: "params",
|
|
206
265
|
begin: /\(/,
|
|
207
266
|
end: /\)/,
|
|
208
|
-
keywords:
|
|
267
|
+
keywords: e,
|
|
209
268
|
relevance: 0,
|
|
210
269
|
contains: [
|
|
211
|
-
n,
|
|
212
|
-
e.C_BLOCK_COMMENT_MODE,
|
|
213
270
|
a,
|
|
214
|
-
|
|
215
|
-
|
|
271
|
+
t.C_BLOCK_COMMENT_MODE,
|
|
272
|
+
s,
|
|
273
|
+
o,
|
|
274
|
+
i,
|
|
216
275
|
// Count matching parentheses.
|
|
217
276
|
{
|
|
218
277
|
begin: /\(/,
|
|
219
278
|
end: /\)/,
|
|
220
|
-
keywords:
|
|
279
|
+
keywords: e,
|
|
221
280
|
relevance: 0,
|
|
222
281
|
contains: [
|
|
223
282
|
"self",
|
|
224
|
-
n,
|
|
225
|
-
e.C_BLOCK_COMMENT_MODE,
|
|
226
283
|
a,
|
|
227
|
-
|
|
228
|
-
|
|
284
|
+
t.C_BLOCK_COMMENT_MODE,
|
|
285
|
+
s,
|
|
286
|
+
o,
|
|
287
|
+
i
|
|
229
288
|
]
|
|
230
289
|
}
|
|
231
290
|
]
|
|
232
291
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
292
|
+
i,
|
|
293
|
+
a,
|
|
294
|
+
t.C_BLOCK_COMMENT_MODE,
|
|
295
|
+
...c
|
|
237
296
|
]
|
|
238
297
|
};
|
|
239
298
|
return {
|
|
240
299
|
name: "C",
|
|
241
300
|
aliases: ["h"],
|
|
242
|
-
keywords:
|
|
301
|
+
keywords: e,
|
|
243
302
|
// Until differentiations are added between `c` and `cpp`, `c` will
|
|
244
303
|
// not be auto-detected to avoid auto-detect conflicts between C and C++
|
|
245
304
|
disableAutodetect: !0,
|
|
246
305
|
illegal: "</",
|
|
247
306
|
contains: [].concat(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
307
|
+
C,
|
|
308
|
+
b,
|
|
309
|
+
_,
|
|
251
310
|
[
|
|
252
|
-
|
|
311
|
+
...c,
|
|
253
312
|
{
|
|
254
|
-
begin:
|
|
255
|
-
keywords:
|
|
313
|
+
begin: t.IDENT_RE + "::",
|
|
314
|
+
keywords: e
|
|
256
315
|
},
|
|
257
316
|
{
|
|
258
317
|
className: "class",
|
|
@@ -260,18 +319,18 @@ function C(e) {
|
|
|
260
319
|
end: /[{;:<>=]/,
|
|
261
320
|
contains: [
|
|
262
321
|
{ beginKeywords: "final class struct" },
|
|
263
|
-
|
|
322
|
+
t.TITLE_MODE
|
|
264
323
|
]
|
|
265
324
|
}
|
|
266
325
|
]
|
|
267
326
|
),
|
|
268
327
|
exports: {
|
|
269
|
-
preprocessor:
|
|
270
|
-
strings:
|
|
271
|
-
keywords:
|
|
328
|
+
preprocessor: u,
|
|
329
|
+
strings: s,
|
|
330
|
+
keywords: e
|
|
272
331
|
}
|
|
273
332
|
};
|
|
274
333
|
}
|
|
275
334
|
export {
|
|
276
|
-
|
|
335
|
+
S as default
|
|
277
336
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function w(e){const n=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),_="decltype\\(auto\\)",c="[a-zA-Z_]\\w*::",m="(?!struct)("+_+"|"+n.optional(c)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},r={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},i={className:"number",variants:[{begin:"[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},E={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},r,{scope:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(r,{className:"string"}),a,e.C_BLOCK_COMMENT_MODE]},o=[E,f],g={className:"title",begin:n.optional(c)+e.IDENT_RE,relevance:0},u=n.optional(c)+e.IDENT_RE+"\\s*\\(",b=12,d=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],T=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],C=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],t={type:N,keyword:d,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:T},p={className:"function.dispatch",relevance:0,keywords:{_hint:C},begin:n.concat(/\b/,`(?!${d.join("|")})`,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},l=[p,...o,s,a,e.C_BLOCK_COMMENT_MODE,i,r],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:t,contains:l.concat([{begin:/\(/,end:/\)/,keywords:t,contains:l.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+m+"[\\*&\\s]+){1,"+b+"}"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:t,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:_,keywords:t,relevance:0},{begin:u,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[r,i]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:t,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,r,i,s,{begin:/\(/,end:/\)/,keywords:t,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,r,i,s]}]},s,a,e.C_BLOCK_COMMENT_MODE,...o]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:t,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(y,O,p,l,[...o,{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*<(?!<)",end:">",keywords:t,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:t},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}exports.default=w;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function
|
|
2
|
-
const n = e.regex, a = e.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), _ = "decltype\\(auto\\)", c = "[a-zA-Z_]\\w*::", m = "(?!struct)(" + _ + "|" + n.optional(c) + "[a-zA-Z_]\\w*" + n.optional("<[^<>]+>") + ")",
|
|
1
|
+
function S(e) {
|
|
2
|
+
const n = e.regex, a = e.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), _ = "decltype\\(auto\\)", c = "[a-zA-Z_]\\w*::", m = "(?!struct)(" + _ + "|" + n.optional(c) + "[a-zA-Z_]\\w*" + n.optional("<[^<>]+>") + ")", s = {
|
|
3
3
|
className: "type",
|
|
4
4
|
begin: "\\b[a-z\\d_]*_t\\b"
|
|
5
|
-
},
|
|
5
|
+
}, r = {
|
|
6
6
|
className: "string",
|
|
7
7
|
variants: [
|
|
8
8
|
{
|
|
@@ -16,9 +16,13 @@ function h(e) {
|
|
|
16
16
|
end: "'",
|
|
17
17
|
illegal: "."
|
|
18
18
|
},
|
|
19
|
+
// https://en.cppreference.com/w/cpp/language/string_literal
|
|
20
|
+
// a d-char-sequence never contains parentheses, backslashes or whitespace;
|
|
21
|
+
// quotes are excluded as well so the closing delimiter cannot swallow the
|
|
22
|
+
// quote that actually terminates the literal
|
|
19
23
|
e.END_SAME_AS_BEGIN({
|
|
20
|
-
begin: /(?:u8?|U|L)?R"([^()
|
|
21
|
-
end: /\)([^()
|
|
24
|
+
begin: /(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,
|
|
25
|
+
end: /\)([^()\\\s"]{0,16})"/
|
|
22
26
|
})
|
|
23
27
|
]
|
|
24
28
|
}, i = {
|
|
@@ -26,7 +30,7 @@ function h(e) {
|
|
|
26
30
|
variants: [
|
|
27
31
|
// Floating-point literal.
|
|
28
32
|
{
|
|
29
|
-
begin: "[+-]?(?:(
|
|
33
|
+
begin: "[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"
|
|
30
34
|
},
|
|
31
35
|
// Integer literal.
|
|
32
36
|
{
|
|
@@ -36,7 +40,25 @@ function h(e) {
|
|
|
36
40
|
}
|
|
37
41
|
],
|
|
38
42
|
relevance: 0
|
|
39
|
-
},
|
|
43
|
+
}, E = {
|
|
44
|
+
scope: "meta",
|
|
45
|
+
begin: /#\s*include\b/,
|
|
46
|
+
end: /$/,
|
|
47
|
+
keywords: { keyword: "include" },
|
|
48
|
+
contains: [
|
|
49
|
+
{
|
|
50
|
+
// the `\` at the end of a line signaling continuation
|
|
51
|
+
begin: /\\\n/
|
|
52
|
+
},
|
|
53
|
+
r,
|
|
54
|
+
{
|
|
55
|
+
scope: "string",
|
|
56
|
+
begin: /<.*?>/
|
|
57
|
+
},
|
|
58
|
+
a,
|
|
59
|
+
e.C_BLOCK_COMMENT_MODE
|
|
60
|
+
]
|
|
61
|
+
}, f = {
|
|
40
62
|
className: "meta",
|
|
41
63
|
begin: /#\s*[a-z]+\b/,
|
|
42
64
|
end: /$/,
|
|
@@ -46,19 +68,18 @@ function h(e) {
|
|
|
46
68
|
begin: /\\\n/,
|
|
47
69
|
relevance: 0
|
|
48
70
|
},
|
|
49
|
-
e.inherit(
|
|
50
|
-
{
|
|
51
|
-
className: "string",
|
|
52
|
-
begin: /<.*?>/
|
|
53
|
-
},
|
|
71
|
+
e.inherit(r, { className: "string" }),
|
|
54
72
|
a,
|
|
55
73
|
e.C_BLOCK_COMMENT_MODE
|
|
56
74
|
]
|
|
57
|
-
},
|
|
75
|
+
}, o = [
|
|
76
|
+
E,
|
|
77
|
+
f
|
|
78
|
+
], g = {
|
|
58
79
|
className: "title",
|
|
59
80
|
begin: n.optional(c) + e.IDENT_RE,
|
|
60
81
|
relevance: 0
|
|
61
|
-
}, u = n.optional(c) + e.IDENT_RE + "\\s*\\(", d = [
|
|
82
|
+
}, u = n.optional(c) + e.IDENT_RE + "\\s*\\(", b = 12, d = [
|
|
62
83
|
"alignas",
|
|
63
84
|
"alignof",
|
|
64
85
|
"and",
|
|
@@ -146,7 +167,7 @@ function h(e) {
|
|
|
146
167
|
"while",
|
|
147
168
|
"xor",
|
|
148
169
|
"xor_eq"
|
|
149
|
-
],
|
|
170
|
+
], N = [
|
|
150
171
|
"bool",
|
|
151
172
|
"char",
|
|
152
173
|
"char16_t",
|
|
@@ -163,7 +184,7 @@ function h(e) {
|
|
|
163
184
|
"signed",
|
|
164
185
|
"const",
|
|
165
186
|
"static"
|
|
166
|
-
],
|
|
187
|
+
], T = [
|
|
167
188
|
"any",
|
|
168
189
|
"auto_ptr",
|
|
169
190
|
"barrier",
|
|
@@ -221,7 +242,7 @@ function h(e) {
|
|
|
221
242
|
"weak_ptr",
|
|
222
243
|
"wstring",
|
|
223
244
|
"wstring_view"
|
|
224
|
-
],
|
|
245
|
+
], C = [
|
|
225
246
|
"abort",
|
|
226
247
|
"abs",
|
|
227
248
|
"acos",
|
|
@@ -323,7 +344,7 @@ function h(e) {
|
|
|
323
344
|
"vprintf",
|
|
324
345
|
"vsprintf"
|
|
325
346
|
], t = {
|
|
326
|
-
type:
|
|
347
|
+
type: N,
|
|
327
348
|
keyword: d,
|
|
328
349
|
literal: [
|
|
329
350
|
"NULL",
|
|
@@ -333,13 +354,13 @@ function h(e) {
|
|
|
333
354
|
"true"
|
|
334
355
|
],
|
|
335
356
|
built_in: ["_Pragma"],
|
|
336
|
-
_type_hints:
|
|
357
|
+
_type_hints: T
|
|
337
358
|
}, p = {
|
|
338
359
|
className: "function.dispatch",
|
|
339
360
|
relevance: 0,
|
|
340
361
|
keywords: {
|
|
341
362
|
// Only for relevance, not highlighting.
|
|
342
|
-
_hint:
|
|
363
|
+
_hint: C
|
|
343
364
|
},
|
|
344
365
|
begin: n.concat(
|
|
345
366
|
/\b/,
|
|
@@ -349,13 +370,13 @@ function h(e) {
|
|
|
349
370
|
)
|
|
350
371
|
}, l = [
|
|
351
372
|
p,
|
|
352
|
-
o,
|
|
353
|
-
|
|
373
|
+
...o,
|
|
374
|
+
s,
|
|
354
375
|
a,
|
|
355
376
|
e.C_BLOCK_COMMENT_MODE,
|
|
356
377
|
i,
|
|
357
|
-
|
|
358
|
-
],
|
|
378
|
+
r
|
|
379
|
+
], y = {
|
|
359
380
|
// This mode covers expression context where we can't expect a function
|
|
360
381
|
// definition and shouldn't highlight anything that looks like one:
|
|
361
382
|
// `return some()`, `else if()`, `(x*sum(1, 2))`
|
|
@@ -384,9 +405,9 @@ function h(e) {
|
|
|
384
405
|
}
|
|
385
406
|
]),
|
|
386
407
|
relevance: 0
|
|
387
|
-
},
|
|
408
|
+
}, O = {
|
|
388
409
|
className: "function",
|
|
389
|
-
begin: "(" + m + "[\\*&\\s]+)+" + u,
|
|
410
|
+
begin: "(" + m + "[\\*&\\s]+){1," + b + "}" + u,
|
|
390
411
|
returnBegin: !0,
|
|
391
412
|
end: /[{;=]/,
|
|
392
413
|
excludeEnd: !0,
|
|
@@ -402,7 +423,7 @@ function h(e) {
|
|
|
402
423
|
{
|
|
403
424
|
begin: u,
|
|
404
425
|
returnBegin: !0,
|
|
405
|
-
contains: [
|
|
426
|
+
contains: [g],
|
|
406
427
|
relevance: 0
|
|
407
428
|
},
|
|
408
429
|
// needed because we do not have look-behind on the below rule
|
|
@@ -416,7 +437,7 @@ function h(e) {
|
|
|
416
437
|
begin: /:/,
|
|
417
438
|
endsWithParent: !0,
|
|
418
439
|
contains: [
|
|
419
|
-
|
|
440
|
+
r,
|
|
420
441
|
i
|
|
421
442
|
]
|
|
422
443
|
},
|
|
@@ -435,9 +456,9 @@ function h(e) {
|
|
|
435
456
|
contains: [
|
|
436
457
|
a,
|
|
437
458
|
e.C_BLOCK_COMMENT_MODE,
|
|
438
|
-
s,
|
|
439
|
-
i,
|
|
440
459
|
r,
|
|
460
|
+
i,
|
|
461
|
+
s,
|
|
441
462
|
// Count matching parentheses.
|
|
442
463
|
{
|
|
443
464
|
begin: /\(/,
|
|
@@ -448,17 +469,17 @@ function h(e) {
|
|
|
448
469
|
"self",
|
|
449
470
|
a,
|
|
450
471
|
e.C_BLOCK_COMMENT_MODE,
|
|
451
|
-
|
|
472
|
+
r,
|
|
452
473
|
i,
|
|
453
|
-
|
|
474
|
+
s
|
|
454
475
|
]
|
|
455
476
|
}
|
|
456
477
|
]
|
|
457
478
|
},
|
|
458
|
-
|
|
479
|
+
s,
|
|
459
480
|
a,
|
|
460
481
|
e.C_BLOCK_COMMENT_MODE,
|
|
461
|
-
o
|
|
482
|
+
...o
|
|
462
483
|
]
|
|
463
484
|
};
|
|
464
485
|
return {
|
|
@@ -476,12 +497,12 @@ function h(e) {
|
|
|
476
497
|
illegal: "</",
|
|
477
498
|
classNameAliases: { "function.dispatch": "built_in" },
|
|
478
499
|
contains: [].concat(
|
|
479
|
-
|
|
480
|
-
|
|
500
|
+
y,
|
|
501
|
+
O,
|
|
481
502
|
p,
|
|
482
503
|
l,
|
|
483
504
|
[
|
|
484
|
-
o,
|
|
505
|
+
...o,
|
|
485
506
|
{
|
|
486
507
|
// containers: ie, `vector <int> rooms (9);`
|
|
487
508
|
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*<(?!<)",
|
|
@@ -489,7 +510,7 @@ function h(e) {
|
|
|
489
510
|
keywords: t,
|
|
490
511
|
contains: [
|
|
491
512
|
"self",
|
|
492
|
-
|
|
513
|
+
s
|
|
493
514
|
]
|
|
494
515
|
},
|
|
495
516
|
{
|
|
@@ -513,5 +534,5 @@ function h(e) {
|
|
|
513
534
|
};
|
|
514
535
|
}
|
|
515
536
|
export {
|
|
516
|
-
|
|
537
|
+
S as default
|
|
517
538
|
};
|
|
@@ -10,7 +10,7 @@ const s = (t) => ({
|
|
|
10
10
|
},
|
|
11
11
|
UNICODE_RANGE: {
|
|
12
12
|
scope: "number",
|
|
13
|
-
begin: /\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,
|
|
13
|
+
begin: /\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/
|
|
14
14
|
},
|
|
15
15
|
FUNCTION_DISPATCH: {
|
|
16
16
|
className: "built_in",
|
|
@@ -431,6 +431,11 @@ const s = (t) => ({
|
|
|
431
431
|
"container-type",
|
|
432
432
|
"content",
|
|
433
433
|
"content-visibility",
|
|
434
|
+
"corner-bottom-left-shape",
|
|
435
|
+
"corner-bottom-right-shape",
|
|
436
|
+
"corner-shape",
|
|
437
|
+
"corner-top-left-shape",
|
|
438
|
+
"corner-top-right-shape",
|
|
434
439
|
"counter-increment",
|
|
435
440
|
"counter-reset",
|
|
436
441
|
"counter-set",
|
|
@@ -800,8 +805,8 @@ const s = (t) => ({
|
|
|
800
805
|
"z-index",
|
|
801
806
|
"zoom"
|
|
802
807
|
].sort().reverse();
|
|
803
|
-
function
|
|
804
|
-
const
|
|
808
|
+
function h(t) {
|
|
809
|
+
const i = t.regex, e = s(t), r = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, n = "and or not only", a = /@-?\w[\w]*(-\w+)*/, l = "[a-zA-Z-][a-zA-Z0-9_-]*", o = [
|
|
805
810
|
t.APOS_STRING_MODE,
|
|
806
811
|
t.QUOTE_STRING_MODE
|
|
807
812
|
];
|
|
@@ -860,7 +865,7 @@ function u(t) {
|
|
|
860
865
|
e.IMPORTANT,
|
|
861
866
|
e.CSS_NUMBER_MODE,
|
|
862
867
|
e.UNICODE_RANGE,
|
|
863
|
-
...
|
|
868
|
+
...o,
|
|
864
869
|
// needed to highlight these as strings and to avoid issues with
|
|
865
870
|
// illegal characters that might be inside urls that would trigger the
|
|
866
871
|
// languages illegal stack
|
|
@@ -871,7 +876,7 @@ function u(t) {
|
|
|
871
876
|
// from keywords
|
|
872
877
|
keywords: { built_in: "url data-uri" },
|
|
873
878
|
contains: [
|
|
874
|
-
...
|
|
879
|
+
...o,
|
|
875
880
|
{
|
|
876
881
|
className: "string",
|
|
877
882
|
// any character other than `)` as in `url()` will be the start
|
|
@@ -886,7 +891,7 @@ function u(t) {
|
|
|
886
891
|
]
|
|
887
892
|
},
|
|
888
893
|
{
|
|
889
|
-
begin:
|
|
894
|
+
begin: i.lookahead(/@/),
|
|
890
895
|
end: "[{;]",
|
|
891
896
|
relevance: 0,
|
|
892
897
|
illegal: /:/,
|
|
@@ -911,7 +916,7 @@ function u(t) {
|
|
|
911
916
|
begin: /[a-z-]+(?=:)/,
|
|
912
917
|
className: "attribute"
|
|
913
918
|
},
|
|
914
|
-
...
|
|
919
|
+
...o,
|
|
915
920
|
e.CSS_NUMBER_MODE
|
|
916
921
|
]
|
|
917
922
|
}
|
|
@@ -925,5 +930,5 @@ function u(t) {
|
|
|
925
930
|
};
|
|
926
931
|
}
|
|
927
932
|
export {
|
|
928
|
-
|
|
933
|
+
h as default
|
|
929
934
|
};
|