@dangl/angular-material-shared 1.2.1-beta0003 → 1.2.1-beta0013

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.
Files changed (109) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/plugins/advlist/plugin.js +1 -1
  3. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -1
  4. package/tinymce-assets/plugins/anchor/plugin.js +1 -1
  5. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -1
  6. package/tinymce-assets/plugins/autolink/plugin.js +1 -1
  7. package/tinymce-assets/plugins/autolink/plugin.min.js +1 -1
  8. package/tinymce-assets/plugins/autoresize/plugin.js +15 -7
  9. package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -2
  10. package/tinymce-assets/plugins/autosave/plugin.js +1 -1
  11. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -1
  12. package/tinymce-assets/plugins/bbcode/plugin.js +1 -2
  13. package/tinymce-assets/plugins/bbcode/plugin.min.js +2 -2
  14. package/tinymce-assets/plugins/charmap/plugin.js +1 -1
  15. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -1
  16. package/tinymce-assets/plugins/code/plugin.js +1 -1
  17. package/tinymce-assets/plugins/code/plugin.min.js +1 -1
  18. package/tinymce-assets/plugins/codesample/plugin.js +1887 -2006
  19. package/tinymce-assets/plugins/codesample/plugin.min.js +2 -2
  20. package/tinymce-assets/plugins/colorpicker/plugin.js +1 -2
  21. package/tinymce-assets/plugins/colorpicker/plugin.min.js +2 -2
  22. package/tinymce-assets/plugins/contextmenu/plugin.js +1 -2
  23. package/tinymce-assets/plugins/contextmenu/plugin.min.js +2 -2
  24. package/tinymce-assets/plugins/directionality/plugin.js +1 -1
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +1 -1
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -1
  28. package/tinymce-assets/plugins/fullpage/plugin.js +1 -2
  29. package/tinymce-assets/plugins/fullpage/plugin.min.js +2 -2
  30. package/tinymce-assets/plugins/fullscreen/plugin.js +385 -2
  31. package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
  32. package/tinymce-assets/plugins/help/plugin.js +68 -75
  33. package/tinymce-assets/plugins/help/plugin.min.js +2 -2
  34. package/tinymce-assets/plugins/hr/plugin.js +1 -1
  35. package/tinymce-assets/plugins/hr/plugin.min.js +1 -1
  36. package/tinymce-assets/plugins/image/plugin.js +38 -20
  37. package/tinymce-assets/plugins/image/plugin.min.js +2 -2
  38. package/tinymce-assets/plugins/imagetools/plugin.js +229 -195
  39. package/tinymce-assets/plugins/imagetools/plugin.min.js +2 -2
  40. package/tinymce-assets/plugins/importcss/plugin.js +1 -1
  41. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -1
  42. package/tinymce-assets/plugins/insertdatetime/plugin.js +11 -8
  43. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -2
  44. package/tinymce-assets/plugins/legacyoutput/plugin.js +1 -2
  45. package/tinymce-assets/plugins/legacyoutput/plugin.min.js +2 -2
  46. package/tinymce-assets/plugins/link/plugin.js +20 -13
  47. package/tinymce-assets/plugins/link/plugin.min.js +2 -2
  48. package/tinymce-assets/plugins/lists/plugin.js +2 -2
  49. package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
  50. package/tinymce-assets/plugins/media/plugin.js +43 -48
  51. package/tinymce-assets/plugins/media/plugin.min.js +2 -2
  52. package/tinymce-assets/plugins/nonbreaking/plugin.js +1 -1
  53. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +1 -1
  54. package/tinymce-assets/plugins/noneditable/plugin.js +1 -1
  55. package/tinymce-assets/plugins/noneditable/plugin.min.js +1 -1
  56. package/tinymce-assets/plugins/pagebreak/plugin.js +1 -1
  57. package/tinymce-assets/plugins/pagebreak/plugin.min.js +1 -1
  58. package/tinymce-assets/plugins/paste/plugin.js +35 -3
  59. package/tinymce-assets/plugins/paste/plugin.min.js +2 -2
  60. package/tinymce-assets/plugins/preview/plugin.js +1 -1
  61. package/tinymce-assets/plugins/preview/plugin.min.js +1 -1
  62. package/tinymce-assets/plugins/print/plugin.js +1 -1
  63. package/tinymce-assets/plugins/print/plugin.min.js +1 -1
  64. package/tinymce-assets/plugins/quickbars/plugin.js +1 -1
  65. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -1
  66. package/tinymce-assets/plugins/save/plugin.js +1 -1
  67. package/tinymce-assets/plugins/save/plugin.min.js +1 -1
  68. package/tinymce-assets/plugins/searchreplace/plugin.js +1 -1
  69. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -1
  70. package/tinymce-assets/plugins/spellchecker/plugin.js +1 -2
  71. package/tinymce-assets/plugins/spellchecker/plugin.min.js +2 -2
  72. package/tinymce-assets/plugins/tabfocus/plugin.js +1 -1
  73. package/tinymce-assets/plugins/tabfocus/plugin.min.js +1 -1
  74. package/tinymce-assets/plugins/table/plugin.js +456 -381
  75. package/tinymce-assets/plugins/table/plugin.min.js +2 -2
  76. package/tinymce-assets/plugins/template/plugin.js +1 -1
  77. package/tinymce-assets/plugins/template/plugin.min.js +1 -1
  78. package/tinymce-assets/plugins/textcolor/plugin.js +1 -2
  79. package/tinymce-assets/plugins/textcolor/plugin.min.js +2 -2
  80. package/tinymce-assets/plugins/textpattern/plugin.js +2 -2
  81. package/tinymce-assets/plugins/textpattern/plugin.min.js +2 -2
  82. package/tinymce-assets/plugins/toc/plugin.js +1 -1
  83. package/tinymce-assets/plugins/toc/plugin.min.js +1 -1
  84. package/tinymce-assets/plugins/visualblocks/plugin.js +1 -1
  85. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -1
  86. package/tinymce-assets/plugins/visualchars/plugin.js +1 -1
  87. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -1
  88. package/tinymce-assets/plugins/wordcount/plugin.js +1 -1
  89. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -1
  90. package/tinymce-assets/skins/ui/oxide/content.css +1 -1
  91. package/tinymce-assets/skins/ui/oxide/content.inline.css +1 -1
  92. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -1
  93. package/tinymce-assets/skins/ui/oxide/content.min.css +1 -1
  94. package/tinymce-assets/skins/ui/oxide/skin.css +7 -7
  95. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  96. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +7 -7
  97. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -1
  98. package/tinymce-assets/skins/ui/oxide-dark/content.css +1 -1
  99. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +1 -1
  100. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -1
  101. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -1
  102. package/tinymce-assets/skins/ui/oxide-dark/skin.css +7 -7
  103. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  104. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +7 -7
  105. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
  106. package/tinymce-assets/themes/mobile/theme.js +225 -700
  107. package/tinymce-assets/themes/mobile/theme.min.js +2 -2
  108. package/tinymce-assets/themes/silver/theme.js +3224 -3686
  109. package/tinymce-assets/themes/silver/theme.min.js +2 -2
@@ -4,7 +4,7 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  (function () {
10
10
  'use strict';
@@ -141,2087 +141,1968 @@
141
141
  (function (define, exports, module, require) {
142
142
  var oldprism = window.Prism;
143
143
  window.Prism = { manual: true };
144
- (function (f) {
145
- if (typeof exports === 'object' && typeof module !== 'undefined') {
146
- module.exports = f();
147
- } else if (typeof define === 'function' && define.amd) {
148
- define([], f);
149
- } else {
150
- var g;
151
- if (typeof window !== 'undefined') {
152
- g = window;
153
- } else if (typeof global !== 'undefined') {
154
- g = global;
155
- } else if (typeof self !== 'undefined') {
156
- g = self;
157
- } else {
158
- g = this;
159
- }
160
- g.EphoxContactWrapper = f();
161
- }
162
- }(function () {
163
- return function () {
164
- function r(e, n, t) {
165
- function o(i, f) {
166
- if (!n[i]) {
167
- if (!e[i]) {
168
- var c = 'function' == typeof require && require;
169
- if (!f && c)
170
- return c(i, !0);
171
- if (u)
172
- return u(i, !0);
173
- var a = new Error('Cannot find module \'' + i + '\'');
174
- throw a.code = 'MODULE_NOT_FOUND', a;
175
- }
176
- var p = n[i] = { exports: {} };
177
- e[i][0].call(p.exports, function (r) {
178
- var n = e[i][1][r];
179
- return o(n || r);
180
- }, p, p.exports, r, e, n, t);
181
- }
182
- return n[i].exports;
183
- }
184
- for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)
185
- o(t[i]);
186
- return o;
187
- }
188
- return r;
189
- }()({
190
- 1: [
191
- function (require, module, exports) {
192
- Prism.languages.c = Prism.languages.extend('clike', {
193
- 'comment': {
194
- pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
195
- greedy: true
144
+ (function (global, factory) {
145
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EphoxContactWrapper = factory());
146
+ }(this, function () {
147
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
148
+ var prismCore = { exports: {} };
149
+ (function (module) {
150
+ var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {};
151
+ var Prism = function (_self) {
152
+ var lang = /\blang(?:uage)?-([\w-]+)\b/i;
153
+ var uniqueId = 0;
154
+ var plainTextGrammar = {};
155
+ var _ = {
156
+ manual: _self.Prism && _self.Prism.manual,
157
+ disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
158
+ util: {
159
+ encode: function encode(tokens) {
160
+ if (tokens instanceof Token) {
161
+ return new Token(tokens.type, encode(tokens.content), tokens.alias);
162
+ } else if (Array.isArray(tokens)) {
163
+ return tokens.map(encode);
164
+ } else {
165
+ return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
166
+ }
196
167
  },
197
- 'class-name': {
198
- pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
199
- lookbehind: true
168
+ type: function (o) {
169
+ return Object.prototype.toString.call(o).slice(8, -1);
200
170
  },
201
- 'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
202
- 'function': /\b[a-z_]\w*(?=\s*\()/i,
203
- 'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
204
- 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
205
- });
206
- Prism.languages.insertBefore('c', 'string', {
207
- 'macro': {
208
- pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
209
- lookbehind: true,
210
- greedy: true,
211
- alias: 'property',
212
- inside: {
213
- 'string': [
214
- {
215
- pattern: /^(#\s*include\s*)<[^>]+>/,
216
- lookbehind: true
217
- },
218
- Prism.languages.c['string']
219
- ],
220
- 'comment': Prism.languages.c['comment'],
221
- 'macro-name': [
222
- {
223
- pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
224
- lookbehind: true
225
- },
226
- {
227
- pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
228
- lookbehind: true,
229
- alias: 'function'
171
+ objId: function (obj) {
172
+ if (!obj['__id']) {
173
+ Object.defineProperty(obj, '__id', { value: ++uniqueId });
174
+ }
175
+ return obj['__id'];
176
+ },
177
+ clone: function deepClone(o, visited) {
178
+ visited = visited || {};
179
+ var clone;
180
+ var id;
181
+ switch (_.util.type(o)) {
182
+ case 'Object':
183
+ id = _.util.objId(o);
184
+ if (visited[id]) {
185
+ return visited[id];
186
+ }
187
+ clone = {};
188
+ visited[id] = clone;
189
+ for (var key in o) {
190
+ if (o.hasOwnProperty(key)) {
191
+ clone[key] = deepClone(o[key], visited);
230
192
  }
231
- ],
232
- 'directive': {
233
- pattern: /^(#\s*)[a-z]+/,
234
- lookbehind: true,
235
- alias: 'keyword'
236
- },
237
- 'directive-hash': /^#/,
238
- 'punctuation': /##|\\(?=[\r\n])/,
239
- 'expression': {
240
- pattern: /\S[\s\S]*/,
241
- inside: Prism.languages.c
242
193
  }
194
+ return clone;
195
+ case 'Array':
196
+ id = _.util.objId(o);
197
+ if (visited[id]) {
198
+ return visited[id];
199
+ }
200
+ clone = [];
201
+ visited[id] = clone;
202
+ o.forEach(function (v, i) {
203
+ clone[i] = deepClone(v, visited);
204
+ });
205
+ return clone;
206
+ default:
207
+ return o;
243
208
  }
244
209
  },
245
- 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/
246
- });
247
- delete Prism.languages.c['boolean'];
248
- },
249
- {}
250
- ],
251
- 2: [
252
- function (require, module, exports) {
253
- Prism.languages.clike = {
254
- 'comment': [
255
- {
256
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
257
- lookbehind: true,
258
- greedy: true
259
- },
260
- {
261
- pattern: /(^|[^\\:])\/\/.*/,
262
- lookbehind: true,
263
- greedy: true
210
+ getLanguage: function (element) {
211
+ while (element && !lang.test(element.className)) {
212
+ element = element.parentElement;
264
213
  }
265
- ],
266
- 'string': {
267
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
268
- greedy: true
269
- },
270
- 'class-name': {
271
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
272
- lookbehind: true,
273
- inside: { 'punctuation': /[.\\]/ }
214
+ if (element) {
215
+ return (element.className.match(lang) || [
216
+ ,
217
+ 'none'
218
+ ])[1].toLowerCase();
219
+ }
220
+ return 'none';
274
221
  },
275
- 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
276
- 'boolean': /\b(?:true|false)\b/,
277
- 'function': /\b\w+(?=\()/,
278
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
279
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
280
- 'punctuation': /[{}[\];(),.:]/
281
- };
282
- },
283
- {}
284
- ],
285
- 3: [
286
- function (require, module, exports) {
287
- (function (global) {
288
- (function () {
289
- var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {};
290
- var Prism = function (_self) {
291
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
292
- var uniqueId = 0;
293
- var plainTextGrammar = {};
294
- var _ = {
295
- manual: _self.Prism && _self.Prism.manual,
296
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
297
- util: {
298
- encode: function encode(tokens) {
299
- if (tokens instanceof Token) {
300
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
301
- } else if (Array.isArray(tokens)) {
302
- return tokens.map(encode);
303
- } else {
304
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
305
- }
306
- },
307
- type: function (o) {
308
- return Object.prototype.toString.call(o).slice(8, -1);
309
- },
310
- objId: function (obj) {
311
- if (!obj['__id']) {
312
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
313
- }
314
- return obj['__id'];
315
- },
316
- clone: function deepClone(o, visited) {
317
- visited = visited || {};
318
- var clone;
319
- var id;
320
- switch (_.util.type(o)) {
321
- case 'Object':
322
- id = _.util.objId(o);
323
- if (visited[id]) {
324
- return visited[id];
325
- }
326
- clone = {};
327
- visited[id] = clone;
328
- for (var key in o) {
329
- if (o.hasOwnProperty(key)) {
330
- clone[key] = deepClone(o[key], visited);
331
- }
332
- }
333
- return clone;
334
- case 'Array':
335
- id = _.util.objId(o);
336
- if (visited[id]) {
337
- return visited[id];
338
- }
339
- clone = [];
340
- visited[id] = clone;
341
- o.forEach(function (v, i) {
342
- clone[i] = deepClone(v, visited);
343
- });
344
- return clone;
345
- default:
346
- return o;
347
- }
348
- },
349
- getLanguage: function (element) {
350
- while (element && !lang.test(element.className)) {
351
- element = element.parentElement;
352
- }
353
- if (element) {
354
- return (element.className.match(lang) || [
355
- ,
356
- 'none'
357
- ])[1].toLowerCase();
358
- }
359
- return 'none';
360
- },
361
- currentScript: function () {
362
- if (typeof document === 'undefined') {
363
- return null;
364
- }
365
- if ('currentScript' in document && 1 < 2) {
366
- return document.currentScript;
367
- }
368
- try {
369
- throw new Error();
370
- } catch (err) {
371
- var src = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(err.stack) || [])[1];
372
- if (src) {
373
- var scripts = document.getElementsByTagName('script');
374
- for (var i in scripts) {
375
- if (scripts[i].src == src) {
376
- return scripts[i];
377
- }
378
- }
379
- }
380
- return null;
381
- }
382
- },
383
- isActive: function (element, className, defaultActivation) {
384
- var no = 'no-' + className;
385
- while (element) {
386
- var classList = element.classList;
387
- if (classList.contains(className)) {
388
- return true;
389
- }
390
- if (classList.contains(no)) {
391
- return false;
392
- }
393
- element = element.parentElement;
394
- }
395
- return !!defaultActivation;
396
- }
397
- },
398
- languages: {
399
- plain: plainTextGrammar,
400
- plaintext: plainTextGrammar,
401
- text: plainTextGrammar,
402
- txt: plainTextGrammar,
403
- extend: function (id, redef) {
404
- var lang = _.util.clone(_.languages[id]);
405
- for (var key in redef) {
406
- lang[key] = redef[key];
407
- }
408
- return lang;
409
- },
410
- insertBefore: function (inside, before, insert, root) {
411
- root = root || _.languages;
412
- var grammar = root[inside];
413
- var ret = {};
414
- for (var token in grammar) {
415
- if (grammar.hasOwnProperty(token)) {
416
- if (token == before) {
417
- for (var newToken in insert) {
418
- if (insert.hasOwnProperty(newToken)) {
419
- ret[newToken] = insert[newToken];
420
- }
421
- }
422
- }
423
- if (!insert.hasOwnProperty(token)) {
424
- ret[token] = grammar[token];
425
- }
426
- }
427
- }
428
- var old = root[inside];
429
- root[inside] = ret;
430
- _.languages.DFS(_.languages, function (key, value) {
431
- if (value === old && key != inside) {
432
- this[key] = ret;
433
- }
434
- });
435
- return ret;
436
- },
437
- DFS: function DFS(o, callback, type, visited) {
438
- visited = visited || {};
439
- var objId = _.util.objId;
440
- for (var i in o) {
441
- if (o.hasOwnProperty(i)) {
442
- callback.call(o, i, o[i], type || i);
443
- var property = o[i];
444
- var propertyType = _.util.type(property);
445
- if (propertyType === 'Object' && !visited[objId(property)]) {
446
- visited[objId(property)] = true;
447
- DFS(property, callback, null, visited);
448
- } else if (propertyType === 'Array' && !visited[objId(property)]) {
449
- visited[objId(property)] = true;
450
- DFS(property, callback, i, visited);
451
- }
452
- }
453
- }
454
- }
455
- },
456
- plugins: {},
457
- highlightAll: function (async, callback) {
458
- _.highlightAllUnder(document, async, callback);
459
- },
460
- highlightAllUnder: function (container, async, callback) {
461
- var env = {
462
- callback: callback,
463
- container: container,
464
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
465
- };
466
- _.hooks.run('before-highlightall', env);
467
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
468
- _.hooks.run('before-all-elements-highlight', env);
469
- for (var i = 0, element; element = env.elements[i++];) {
470
- _.highlightElement(element, async === true, env.callback);
471
- }
472
- },
473
- highlightElement: function (element, async, callback) {
474
- var language = _.util.getLanguage(element);
475
- var grammar = _.languages[language];
476
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
477
- var parent = element.parentElement;
478
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
479
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
480
- }
481
- var code = element.textContent;
482
- var env = {
483
- element: element,
484
- language: language,
485
- grammar: grammar,
486
- code: code
487
- };
488
- function insertHighlightedCode(highlightedCode) {
489
- env.highlightedCode = highlightedCode;
490
- _.hooks.run('before-insert', env);
491
- env.element.innerHTML = env.highlightedCode;
492
- _.hooks.run('after-highlight', env);
493
- _.hooks.run('complete', env);
494
- callback && callback.call(env.element);
495
- }
496
- _.hooks.run('before-sanity-check', env);
497
- parent = env.element.parentElement;
498
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
499
- parent.setAttribute('tabindex', '0');
500
- }
501
- if (!env.code) {
502
- _.hooks.run('complete', env);
503
- callback && callback.call(env.element);
504
- return;
505
- }
506
- _.hooks.run('before-highlight', env);
507
- if (!env.grammar) {
508
- insertHighlightedCode(_.util.encode(env.code));
509
- return;
510
- }
511
- if (async && _self.Worker) {
512
- var worker = new Worker(_.filename);
513
- worker.onmessage = function (evt) {
514
- insertHighlightedCode(evt.data);
515
- };
516
- worker.postMessage(JSON.stringify({
517
- language: env.language,
518
- code: env.code,
519
- immediateClose: true
520
- }));
521
- } else {
522
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
523
- }
524
- },
525
- highlight: function (text, grammar, language) {
526
- var env = {
527
- code: text,
528
- grammar: grammar,
529
- language: language
530
- };
531
- _.hooks.run('before-tokenize', env);
532
- env.tokens = _.tokenize(env.code, env.grammar);
533
- _.hooks.run('after-tokenize', env);
534
- return Token.stringify(_.util.encode(env.tokens), env.language);
535
- },
536
- tokenize: function (text, grammar) {
537
- var rest = grammar.rest;
538
- if (rest) {
539
- for (var token in rest) {
540
- grammar[token] = rest[token];
541
- }
542
- delete grammar.rest;
543
- }
544
- var tokenList = new LinkedList();
545
- addAfter(tokenList, tokenList.head, text);
546
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
547
- return toArray(tokenList);
548
- },
549
- hooks: {
550
- all: {},
551
- add: function (name, callback) {
552
- var hooks = _.hooks.all;
553
- hooks[name] = hooks[name] || [];
554
- hooks[name].push(callback);
555
- },
556
- run: function (name, env) {
557
- var callbacks = _.hooks.all[name];
558
- if (!callbacks || !callbacks.length) {
559
- return;
560
- }
561
- for (var i = 0, callback; callback = callbacks[i++];) {
562
- callback(env);
563
- }
222
+ currentScript: function () {
223
+ if (typeof document === 'undefined') {
224
+ return null;
225
+ }
226
+ if ('currentScript' in document && 1 < 2) {
227
+ return document.currentScript;
228
+ }
229
+ try {
230
+ throw new Error();
231
+ } catch (err) {
232
+ var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
233
+ if (src) {
234
+ var scripts = document.getElementsByTagName('script');
235
+ for (var i in scripts) {
236
+ if (scripts[i].src == src) {
237
+ return scripts[i];
564
238
  }
565
- },
566
- Token: Token
567
- };
568
- _self.Prism = _;
569
- function Token(type, content, alias, matchedStr) {
570
- this.type = type;
571
- this.content = content;
572
- this.alias = alias;
573
- this.length = (matchedStr || '').length | 0;
574
- }
575
- Token.stringify = function stringify(o, language) {
576
- if (typeof o == 'string') {
577
- return o;
578
- }
579
- if (Array.isArray(o)) {
580
- var s = '';
581
- o.forEach(function (e) {
582
- s += stringify(e, language);
583
- });
584
- return s;
585
239
  }
586
- var env = {
587
- type: o.type,
588
- content: stringify(o.content, language),
589
- tag: 'span',
590
- classes: [
591
- 'token',
592
- o.type
593
- ],
594
- attributes: {},
595
- language: language
596
- };
597
- var aliases = o.alias;
598
- if (aliases) {
599
- if (Array.isArray(aliases)) {
600
- Array.prototype.push.apply(env.classes, aliases);
601
- } else {
602
- env.classes.push(aliases);
240
+ }
241
+ return null;
242
+ }
243
+ },
244
+ isActive: function (element, className, defaultActivation) {
245
+ var no = 'no-' + className;
246
+ while (element) {
247
+ var classList = element.classList;
248
+ if (classList.contains(className)) {
249
+ return true;
250
+ }
251
+ if (classList.contains(no)) {
252
+ return false;
253
+ }
254
+ element = element.parentElement;
255
+ }
256
+ return !!defaultActivation;
257
+ }
258
+ },
259
+ languages: {
260
+ plain: plainTextGrammar,
261
+ plaintext: plainTextGrammar,
262
+ text: plainTextGrammar,
263
+ txt: plainTextGrammar,
264
+ extend: function (id, redef) {
265
+ var lang = _.util.clone(_.languages[id]);
266
+ for (var key in redef) {
267
+ lang[key] = redef[key];
268
+ }
269
+ return lang;
270
+ },
271
+ insertBefore: function (inside, before, insert, root) {
272
+ root = root || _.languages;
273
+ var grammar = root[inside];
274
+ var ret = {};
275
+ for (var token in grammar) {
276
+ if (grammar.hasOwnProperty(token)) {
277
+ if (token == before) {
278
+ for (var newToken in insert) {
279
+ if (insert.hasOwnProperty(newToken)) {
280
+ ret[newToken] = insert[newToken];
281
+ }
603
282
  }
604
283
  }
605
- _.hooks.run('wrap', env);
606
- var attributes = '';
607
- for (var name in env.attributes) {
608
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
609
- }
610
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
611
- };
612
- function matchPattern(pattern, pos, text, lookbehind) {
613
- pattern.lastIndex = pos;
614
- var match = pattern.exec(text);
615
- if (match && lookbehind && match[1]) {
616
- var lookbehindLength = match[1].length;
617
- match.index += lookbehindLength;
618
- match[0] = match[0].slice(lookbehindLength);
284
+ if (!insert.hasOwnProperty(token)) {
285
+ ret[token] = grammar[token];
619
286
  }
620
- return match;
621
287
  }
622
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
623
- for (var token in grammar) {
624
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
625
- continue;
626
- }
627
- var patterns = grammar[token];
628
- patterns = Array.isArray(patterns) ? patterns : [patterns];
629
- for (var j = 0; j < patterns.length; ++j) {
630
- if (rematch && rematch.cause == token + ',' + j) {
631
- return;
632
- }
633
- var patternObj = patterns[j];
634
- var inside = patternObj.inside;
635
- var lookbehind = !!patternObj.lookbehind;
636
- var greedy = !!patternObj.greedy;
637
- var alias = patternObj.alias;
638
- if (greedy && !patternObj.pattern.global) {
639
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
640
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
641
- }
642
- var pattern = patternObj.pattern || patternObj;
643
- for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
644
- if (rematch && pos >= rematch.reach) {
645
- break;
646
- }
647
- var str = currentNode.value;
648
- if (tokenList.length > text.length) {
649
- return;
650
- }
651
- if (str instanceof Token) {
652
- continue;
653
- }
654
- var removeCount = 1;
655
- var match;
656
- if (greedy) {
657
- match = matchPattern(pattern, pos, text, lookbehind);
658
- if (!match) {
659
- break;
660
- }
661
- var from = match.index;
662
- var to = match.index + match[0].length;
663
- var p = pos;
664
- p += currentNode.value.length;
665
- while (from >= p) {
666
- currentNode = currentNode.next;
667
- p += currentNode.value.length;
668
- }
669
- p -= currentNode.value.length;
670
- pos = p;
671
- if (currentNode.value instanceof Token) {
672
- continue;
673
- }
674
- for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next) {
675
- removeCount++;
676
- p += k.value.length;
677
- }
678
- removeCount--;
679
- str = text.slice(pos, p);
680
- match.index -= pos;
681
- } else {
682
- match = matchPattern(pattern, 0, str, lookbehind);
683
- if (!match) {
684
- continue;
685
- }
686
- }
687
- var from = match.index;
688
- var matchStr = match[0];
689
- var before = str.slice(0, from);
690
- var after = str.slice(from + matchStr.length);
691
- var reach = pos + str.length;
692
- if (rematch && reach > rematch.reach) {
693
- rematch.reach = reach;
694
- }
695
- var removeFrom = currentNode.prev;
696
- if (before) {
697
- removeFrom = addAfter(tokenList, removeFrom, before);
698
- pos += before.length;
699
- }
700
- removeRange(tokenList, removeFrom, removeCount);
701
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
702
- currentNode = addAfter(tokenList, removeFrom, wrapped);
703
- if (after) {
704
- addAfter(tokenList, currentNode, after);
705
- }
706
- if (removeCount > 1) {
707
- var nestedRematch = {
708
- cause: token + ',' + j,
709
- reach: reach
710
- };
711
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
712
- if (rematch && nestedRematch.reach > rematch.reach) {
713
- rematch.reach = nestedRematch.reach;
714
- }
715
- }
716
- }
717
- }
288
+ }
289
+ var old = root[inside];
290
+ root[inside] = ret;
291
+ _.languages.DFS(_.languages, function (key, value) {
292
+ if (value === old && key != inside) {
293
+ this[key] = ret;
294
+ }
295
+ });
296
+ return ret;
297
+ },
298
+ DFS: function DFS(o, callback, type, visited) {
299
+ visited = visited || {};
300
+ var objId = _.util.objId;
301
+ for (var i in o) {
302
+ if (o.hasOwnProperty(i)) {
303
+ callback.call(o, i, o[i], type || i);
304
+ var property = o[i];
305
+ var propertyType = _.util.type(property);
306
+ if (propertyType === 'Object' && !visited[objId(property)]) {
307
+ visited[objId(property)] = true;
308
+ DFS(property, callback, null, visited);
309
+ } else if (propertyType === 'Array' && !visited[objId(property)]) {
310
+ visited[objId(property)] = true;
311
+ DFS(property, callback, i, visited);
718
312
  }
719
313
  }
720
- function LinkedList() {
721
- var head = {
722
- value: null,
723
- prev: null,
724
- next: null
725
- };
726
- var tail = {
727
- value: null,
728
- prev: head,
729
- next: null
730
- };
731
- head.next = tail;
732
- this.head = head;
733
- this.tail = tail;
734
- this.length = 0;
314
+ }
315
+ }
316
+ },
317
+ plugins: {},
318
+ highlightAll: function (async, callback) {
319
+ _.highlightAllUnder(document, async, callback);
320
+ },
321
+ highlightAllUnder: function (container, async, callback) {
322
+ var env = {
323
+ callback: callback,
324
+ container: container,
325
+ selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
326
+ };
327
+ _.hooks.run('before-highlightall', env);
328
+ env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
329
+ _.hooks.run('before-all-elements-highlight', env);
330
+ for (var i = 0, element; element = env.elements[i++];) {
331
+ _.highlightElement(element, async === true, env.callback);
332
+ }
333
+ },
334
+ highlightElement: function (element, async, callback) {
335
+ var language = _.util.getLanguage(element);
336
+ var grammar = _.languages[language];
337
+ element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
338
+ var parent = element.parentElement;
339
+ if (parent && parent.nodeName.toLowerCase() === 'pre') {
340
+ parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
341
+ }
342
+ var code = element.textContent;
343
+ var env = {
344
+ element: element,
345
+ language: language,
346
+ grammar: grammar,
347
+ code: code
348
+ };
349
+ function insertHighlightedCode(highlightedCode) {
350
+ env.highlightedCode = highlightedCode;
351
+ _.hooks.run('before-insert', env);
352
+ env.element.innerHTML = env.highlightedCode;
353
+ _.hooks.run('after-highlight', env);
354
+ _.hooks.run('complete', env);
355
+ callback && callback.call(env.element);
356
+ }
357
+ _.hooks.run('before-sanity-check', env);
358
+ parent = env.element.parentElement;
359
+ if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
360
+ parent.setAttribute('tabindex', '0');
361
+ }
362
+ if (!env.code) {
363
+ _.hooks.run('complete', env);
364
+ callback && callback.call(env.element);
365
+ return;
366
+ }
367
+ _.hooks.run('before-highlight', env);
368
+ if (!env.grammar) {
369
+ insertHighlightedCode(_.util.encode(env.code));
370
+ return;
371
+ }
372
+ if (async && _self.Worker) {
373
+ var worker = new Worker(_.filename);
374
+ worker.onmessage = function (evt) {
375
+ insertHighlightedCode(evt.data);
376
+ };
377
+ worker.postMessage(JSON.stringify({
378
+ language: env.language,
379
+ code: env.code,
380
+ immediateClose: true
381
+ }));
382
+ } else {
383
+ insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
384
+ }
385
+ },
386
+ highlight: function (text, grammar, language) {
387
+ var env = {
388
+ code: text,
389
+ grammar: grammar,
390
+ language: language
391
+ };
392
+ _.hooks.run('before-tokenize', env);
393
+ env.tokens = _.tokenize(env.code, env.grammar);
394
+ _.hooks.run('after-tokenize', env);
395
+ return Token.stringify(_.util.encode(env.tokens), env.language);
396
+ },
397
+ tokenize: function (text, grammar) {
398
+ var rest = grammar.rest;
399
+ if (rest) {
400
+ for (var token in rest) {
401
+ grammar[token] = rest[token];
402
+ }
403
+ delete grammar.rest;
404
+ }
405
+ var tokenList = new LinkedList();
406
+ addAfter(tokenList, tokenList.head, text);
407
+ matchGrammar(text, tokenList, grammar, tokenList.head, 0);
408
+ return toArray(tokenList);
409
+ },
410
+ hooks: {
411
+ all: {},
412
+ add: function (name, callback) {
413
+ var hooks = _.hooks.all;
414
+ hooks[name] = hooks[name] || [];
415
+ hooks[name].push(callback);
416
+ },
417
+ run: function (name, env) {
418
+ var callbacks = _.hooks.all[name];
419
+ if (!callbacks || !callbacks.length) {
420
+ return;
421
+ }
422
+ for (var i = 0, callback; callback = callbacks[i++];) {
423
+ callback(env);
424
+ }
425
+ }
426
+ },
427
+ Token: Token
428
+ };
429
+ _self.Prism = _;
430
+ function Token(type, content, alias, matchedStr) {
431
+ this.type = type;
432
+ this.content = content;
433
+ this.alias = alias;
434
+ this.length = (matchedStr || '').length | 0;
435
+ }
436
+ Token.stringify = function stringify(o, language) {
437
+ if (typeof o == 'string') {
438
+ return o;
439
+ }
440
+ if (Array.isArray(o)) {
441
+ var s = '';
442
+ o.forEach(function (e) {
443
+ s += stringify(e, language);
444
+ });
445
+ return s;
446
+ }
447
+ var env = {
448
+ type: o.type,
449
+ content: stringify(o.content, language),
450
+ tag: 'span',
451
+ classes: [
452
+ 'token',
453
+ o.type
454
+ ],
455
+ attributes: {},
456
+ language: language
457
+ };
458
+ var aliases = o.alias;
459
+ if (aliases) {
460
+ if (Array.isArray(aliases)) {
461
+ Array.prototype.push.apply(env.classes, aliases);
462
+ } else {
463
+ env.classes.push(aliases);
464
+ }
465
+ }
466
+ _.hooks.run('wrap', env);
467
+ var attributes = '';
468
+ for (var name in env.attributes) {
469
+ attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
470
+ }
471
+ return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
472
+ };
473
+ function matchPattern(pattern, pos, text, lookbehind) {
474
+ pattern.lastIndex = pos;
475
+ var match = pattern.exec(text);
476
+ if (match && lookbehind && match[1]) {
477
+ var lookbehindLength = match[1].length;
478
+ match.index += lookbehindLength;
479
+ match[0] = match[0].slice(lookbehindLength);
480
+ }
481
+ return match;
482
+ }
483
+ function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
484
+ for (var token in grammar) {
485
+ if (!grammar.hasOwnProperty(token) || !grammar[token]) {
486
+ continue;
487
+ }
488
+ var patterns = grammar[token];
489
+ patterns = Array.isArray(patterns) ? patterns : [patterns];
490
+ for (var j = 0; j < patterns.length; ++j) {
491
+ if (rematch && rematch.cause == token + ',' + j) {
492
+ return;
493
+ }
494
+ var patternObj = patterns[j];
495
+ var inside = patternObj.inside;
496
+ var lookbehind = !!patternObj.lookbehind;
497
+ var greedy = !!patternObj.greedy;
498
+ var alias = patternObj.alias;
499
+ if (greedy && !patternObj.pattern.global) {
500
+ var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
501
+ patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
502
+ }
503
+ var pattern = patternObj.pattern || patternObj;
504
+ for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
505
+ if (rematch && pos >= rematch.reach) {
506
+ break;
735
507
  }
736
- function addAfter(list, node, value) {
737
- var next = node.next;
738
- var newNode = {
739
- value: value,
740
- prev: node,
741
- next: next
742
- };
743
- node.next = newNode;
744
- next.prev = newNode;
745
- list.length++;
746
- return newNode;
508
+ var str = currentNode.value;
509
+ if (tokenList.length > text.length) {
510
+ return;
747
511
  }
748
- function removeRange(list, node, count) {
749
- var next = node.next;
750
- for (var i = 0; i < count && next !== list.tail; i++) {
751
- next = next.next;
752
- }
753
- node.next = next;
754
- next.prev = node;
755
- list.length -= i;
512
+ if (str instanceof Token) {
513
+ continue;
756
514
  }
757
- function toArray(list) {
758
- var array = [];
759
- var node = list.head.next;
760
- while (node !== list.tail) {
761
- array.push(node.value);
762
- node = node.next;
515
+ var removeCount = 1;
516
+ var match;
517
+ if (greedy) {
518
+ match = matchPattern(pattern, pos, text, lookbehind);
519
+ if (!match) {
520
+ break;
763
521
  }
764
- return array;
765
- }
766
- if (!_self.document) {
767
- if (!_self.addEventListener) {
768
- return _;
522
+ var from = match.index;
523
+ var to = match.index + match[0].length;
524
+ var p = pos;
525
+ p += currentNode.value.length;
526
+ while (from >= p) {
527
+ currentNode = currentNode.next;
528
+ p += currentNode.value.length;
769
529
  }
770
- if (!_.disableWorkerMessageHandler) {
771
- _self.addEventListener('message', function (evt) {
772
- var message = JSON.parse(evt.data);
773
- var lang = message.language;
774
- var code = message.code;
775
- var immediateClose = message.immediateClose;
776
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
777
- if (immediateClose) {
778
- _self.close();
779
- }
780
- }, false);
530
+ p -= currentNode.value.length;
531
+ pos = p;
532
+ if (currentNode.value instanceof Token) {
533
+ continue;
781
534
  }
782
- return _;
783
- }
784
- var script = _.util.currentScript();
785
- if (script) {
786
- _.filename = script.src;
787
- if (script.hasAttribute('data-manual')) {
788
- _.manual = true;
535
+ for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next) {
536
+ removeCount++;
537
+ p += k.value.length;
789
538
  }
790
- }
791
- function highlightAutomaticallyCallback() {
792
- if (!_.manual) {
793
- _.highlightAll();
539
+ removeCount--;
540
+ str = text.slice(pos, p);
541
+ match.index -= pos;
542
+ } else {
543
+ match = matchPattern(pattern, 0, str, lookbehind);
544
+ if (!match) {
545
+ continue;
794
546
  }
795
547
  }
796
- if (!_.manual) {
797
- var readyState = document.readyState;
798
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
799
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
800
- } else {
801
- if (window.requestAnimationFrame) {
802
- window.requestAnimationFrame(highlightAutomaticallyCallback);
803
- } else {
804
- window.setTimeout(highlightAutomaticallyCallback, 16);
805
- }
806
- }
548
+ var from = match.index;
549
+ var matchStr = match[0];
550
+ var before = str.slice(0, from);
551
+ var after = str.slice(from + matchStr.length);
552
+ var reach = pos + str.length;
553
+ if (rematch && reach > rematch.reach) {
554
+ rematch.reach = reach;
807
555
  }
808
- return _;
809
- }(_self);
810
- if (typeof module !== 'undefined' && module.exports) {
811
- module.exports = Prism;
812
- }
813
- if (typeof global !== 'undefined') {
814
- global.Prism = Prism;
815
- }
816
- }.call(this));
817
- }.call(this, typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {}));
818
- },
819
- {}
820
- ],
821
- 4: [
822
- function (require, module, exports) {
823
- (function (Prism) {
824
- var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
825
- var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () {
826
- return keyword.source;
827
- });
828
- Prism.languages.cpp = Prism.languages.extend('c', {
829
- 'class-name': [
830
- {
831
- pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function () {
832
- return keyword.source;
833
- })),
834
- lookbehind: true
835
- },
836
- /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
837
- /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
838
- /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
839
- ],
840
- 'keyword': keyword,
841
- 'number': {
842
- pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
843
- greedy: true
844
- },
845
- 'operator': />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
846
- 'boolean': /\b(?:true|false)\b/
847
- });
848
- Prism.languages.insertBefore('cpp', 'string', {
849
- 'module': {
850
- pattern: RegExp(/(\b(?:module|import)\s+)/.source + '(?:' + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + '|' + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function () {
851
- return modName;
852
- }) + ')'),
853
- lookbehind: true,
854
- greedy: true,
855
- inside: {
856
- 'string': /^[<"][\s\S]+/,
857
- 'operator': /:/,
858
- 'punctuation': /\./
556
+ var removeFrom = currentNode.prev;
557
+ if (before) {
558
+ removeFrom = addAfter(tokenList, removeFrom, before);
559
+ pos += before.length;
859
560
  }
860
- },
861
- 'raw-string': {
862
- pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
863
- alias: 'string',
864
- greedy: true
865
- }
866
- });
867
- Prism.languages.insertBefore('cpp', 'keyword', {
868
- 'generic-function': {
869
- pattern: /\b[a-z_]\w*\s*<(?:[^<>]|<(?:[^<>])*>)*>(?=\s*\()/i,
870
- inside: {
871
- 'function': /^\w+/,
872
- 'generic': {
873
- pattern: /<[\s\S]+/,
874
- alias: 'class-name',
875
- inside: Prism.languages.cpp
561
+ removeRange(tokenList, removeFrom, removeCount);
562
+ var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
563
+ currentNode = addAfter(tokenList, removeFrom, wrapped);
564
+ if (after) {
565
+ addAfter(tokenList, currentNode, after);
566
+ }
567
+ if (removeCount > 1) {
568
+ var nestedRematch = {
569
+ cause: token + ',' + j,
570
+ reach: reach
571
+ };
572
+ matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
573
+ if (rematch && nestedRematch.reach > rematch.reach) {
574
+ rematch.reach = nestedRematch.reach;
876
575
  }
877
576
  }
878
577
  }
879
- });
880
- Prism.languages.insertBefore('cpp', 'operator', {
881
- 'double-colon': {
882
- pattern: /::/,
883
- alias: 'punctuation'
884
- }
885
- });
886
- Prism.languages.insertBefore('cpp', 'class-name', {
887
- 'base-clause': {
888
- pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
889
- lookbehind: true,
890
- greedy: true,
891
- inside: Prism.languages.extend('cpp', {})
578
+ }
579
+ }
580
+ }
581
+ function LinkedList() {
582
+ var head = {
583
+ value: null,
584
+ prev: null,
585
+ next: null
586
+ };
587
+ var tail = {
588
+ value: null,
589
+ prev: head,
590
+ next: null
591
+ };
592
+ head.next = tail;
593
+ this.head = head;
594
+ this.tail = tail;
595
+ this.length = 0;
596
+ }
597
+ function addAfter(list, node, value) {
598
+ var next = node.next;
599
+ var newNode = {
600
+ value: value,
601
+ prev: node,
602
+ next: next
603
+ };
604
+ node.next = newNode;
605
+ next.prev = newNode;
606
+ list.length++;
607
+ return newNode;
608
+ }
609
+ function removeRange(list, node, count) {
610
+ var next = node.next;
611
+ for (var i = 0; i < count && next !== list.tail; i++) {
612
+ next = next.next;
613
+ }
614
+ node.next = next;
615
+ next.prev = node;
616
+ list.length -= i;
617
+ }
618
+ function toArray(list) {
619
+ var array = [];
620
+ var node = list.head.next;
621
+ while (node !== list.tail) {
622
+ array.push(node.value);
623
+ node = node.next;
624
+ }
625
+ return array;
626
+ }
627
+ if (!_self.document) {
628
+ if (!_self.addEventListener) {
629
+ return _;
630
+ }
631
+ if (!_.disableWorkerMessageHandler) {
632
+ _self.addEventListener('message', function (evt) {
633
+ var message = JSON.parse(evt.data);
634
+ var lang = message.language;
635
+ var code = message.code;
636
+ var immediateClose = message.immediateClose;
637
+ _self.postMessage(_.highlight(code, _.languages[lang], lang));
638
+ if (immediateClose) {
639
+ _self.close();
892
640
  }
893
- });
894
- Prism.languages.insertBefore('inside', 'double-colon', { 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i }, Prism.languages.cpp['base-clause']);
895
- }(Prism));
641
+ }, false);
642
+ }
643
+ return _;
644
+ }
645
+ var script = _.util.currentScript();
646
+ if (script) {
647
+ _.filename = script.src;
648
+ if (script.hasAttribute('data-manual')) {
649
+ _.manual = true;
650
+ }
651
+ }
652
+ function highlightAutomaticallyCallback() {
653
+ if (!_.manual) {
654
+ _.highlightAll();
655
+ }
656
+ }
657
+ if (!_.manual) {
658
+ var readyState = document.readyState;
659
+ if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
660
+ document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
661
+ } else {
662
+ if (window.requestAnimationFrame) {
663
+ window.requestAnimationFrame(highlightAutomaticallyCallback);
664
+ } else {
665
+ window.setTimeout(highlightAutomaticallyCallback, 16);
666
+ }
667
+ }
668
+ }
669
+ return _;
670
+ }(_self);
671
+ if (module.exports) {
672
+ module.exports = Prism;
673
+ }
674
+ if (typeof commonjsGlobal !== 'undefined') {
675
+ commonjsGlobal.Prism = Prism;
676
+ }
677
+ }(prismCore));
678
+ Prism.languages.clike = {
679
+ 'comment': [
680
+ {
681
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
682
+ lookbehind: true,
683
+ greedy: true
896
684
  },
897
- {}
685
+ {
686
+ pattern: /(^|[^\\:])\/\/.*/,
687
+ lookbehind: true,
688
+ greedy: true
689
+ }
898
690
  ],
899
- 5: [
900
- function (require, module, exports) {
901
- (function (Prism) {
902
- function replace(pattern, replacements) {
903
- return pattern.replace(/<<(\d+)>>/g, function (m, index) {
904
- return '(?:' + replacements[+index] + ')';
905
- });
906
- }
907
- function re(pattern, replacements, flags) {
908
- return RegExp(replace(pattern, replacements), flags || '');
691
+ 'string': {
692
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
693
+ greedy: true
694
+ },
695
+ 'class-name': {
696
+ pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
697
+ lookbehind: true,
698
+ inside: { 'punctuation': /[.\\]/ }
699
+ },
700
+ 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
701
+ 'boolean': /\b(?:true|false)\b/,
702
+ 'function': /\b\w+(?=\()/,
703
+ 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
704
+ 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
705
+ 'punctuation': /[{}[\];(),.:]/
706
+ };
707
+ (function (Prism) {
708
+ function getPlaceholder(language, index) {
709
+ return '___' + language.toUpperCase() + index + '___';
710
+ }
711
+ Object.defineProperties(Prism.languages['markup-templating'] = {}, {
712
+ buildPlaceholders: {
713
+ value: function (env, language, placeholderPattern, replaceFilter) {
714
+ if (env.language !== language) {
715
+ return;
909
716
  }
910
- function nested(pattern, depthLog2) {
911
- for (var i = 0; i < depthLog2; i++) {
912
- pattern = pattern.replace(/<<self>>/g, function () {
913
- return '(?:' + pattern + ')';
914
- });
717
+ var tokenStack = env.tokenStack = [];
718
+ env.code = env.code.replace(placeholderPattern, function (match) {
719
+ if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
720
+ return match;
915
721
  }
916
- return pattern.replace(/<<self>>/g, '[^\\s\\S]');
917
- }
918
- var keywordKinds = {
919
- type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
920
- typeDeclaration: 'class enum interface struct',
921
- contextual: 'add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where',
922
- other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
923
- };
924
- function keywordsToPattern(words) {
925
- return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
722
+ var i = tokenStack.length;
723
+ var placeholder;
724
+ while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
725
+ ++i;
726
+ }
727
+ tokenStack[i] = match;
728
+ return placeholder;
729
+ });
730
+ env.grammar = Prism.languages.markup;
731
+ }
732
+ },
733
+ tokenizePlaceholders: {
734
+ value: function (env, language) {
735
+ if (env.language !== language || !env.tokenStack) {
736
+ return;
926
737
  }
927
- var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration);
928
- var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other));
929
- var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other);
930
- var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other);
931
- var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2);
932
- var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
933
- var name = /@?\b[A-Za-z_]\w*\b/.source;
934
- var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [
935
- name,
936
- generic
937
- ]);
938
- var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
939
- nonTypeKeywords,
940
- genericName
941
- ]);
942
- var array = /\[\s*(?:,\s*)*\]/.source;
943
- var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [
944
- identifier,
945
- array
946
- ]);
947
- var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [
948
- generic,
949
- nestedRound,
950
- array
951
- ]);
952
- var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
953
- var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [
954
- tuple,
955
- identifier,
956
- array
957
- ]);
958
- var typeInside = {
959
- 'keyword': keywords,
960
- 'punctuation': /[<>()?,.:[\]]/
961
- };
962
- var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source;
963
- var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
964
- var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
965
- Prism.languages.csharp = Prism.languages.extend('clike', {
966
- 'string': [
967
- {
968
- pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
969
- lookbehind: true,
970
- greedy: true
971
- },
972
- {
973
- pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
974
- lookbehind: true,
975
- greedy: true
976
- },
977
- {
978
- pattern: RegExp(character),
979
- greedy: true,
980
- alias: 'character'
738
+ env.grammar = Prism.languages[language];
739
+ var j = 0;
740
+ var keys = Object.keys(env.tokenStack);
741
+ function walkTokens(tokens) {
742
+ for (var i = 0; i < tokens.length; i++) {
743
+ if (j >= keys.length) {
744
+ break;
981
745
  }
982
- ],
983
- 'class-name': [
984
- {
985
- pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]),
986
- lookbehind: true,
987
- inside: typeInside
988
- },
989
- {
990
- pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
991
- name,
992
- typeExpression
993
- ]),
994
- lookbehind: true,
995
- inside: typeInside
996
- },
997
- {
998
- pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
999
- lookbehind: true
1000
- },
1001
- {
1002
- pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
1003
- typeDeclarationKeywords,
1004
- genericName
1005
- ]),
1006
- lookbehind: true,
1007
- inside: typeInside
1008
- },
1009
- {
1010
- pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
1011
- lookbehind: true,
1012
- inside: typeInside
1013
- },
1014
- {
1015
- pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
1016
- lookbehind: true
1017
- },
1018
- {
1019
- pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]),
1020
- lookbehind: true,
1021
- inside: typeInside
1022
- },
1023
- {
1024
- pattern: re(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [
1025
- typeExpression,
1026
- nonContextualKeywords,
1027
- name
1028
- ]),
1029
- inside: typeInside
746
+ var token = tokens[i];
747
+ if (typeof token === 'string' || token.content && typeof token.content === 'string') {
748
+ var k = keys[j];
749
+ var t = env.tokenStack[k];
750
+ var s = typeof token === 'string' ? token : token.content;
751
+ var placeholder = getPlaceholder(language, k);
752
+ var index = s.indexOf(placeholder);
753
+ if (index > -1) {
754
+ ++j;
755
+ var before = s.substring(0, index);
756
+ var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
757
+ var after = s.substring(index + placeholder.length);
758
+ var replacement = [];
759
+ if (before) {
760
+ replacement.push.apply(replacement, walkTokens([before]));
761
+ }
762
+ replacement.push(middle);
763
+ if (after) {
764
+ replacement.push.apply(replacement, walkTokens([after]));
765
+ }
766
+ if (typeof token === 'string') {
767
+ tokens.splice.apply(tokens, [
768
+ i,
769
+ 1
770
+ ].concat(replacement));
771
+ } else {
772
+ token.content = replacement;
773
+ }
774
+ }
775
+ } else if (token.content) {
776
+ walkTokens(token.content);
1030
777
  }
1031
- ],
1032
- 'keyword': keywords,
1033
- 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,
1034
- 'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
1035
- 'punctuation': /\?\.?|::|[{}[\];(),.:]/
1036
- });
1037
- Prism.languages.insertBefore('csharp', 'number', {
1038
- 'range': {
1039
- pattern: /\.\./,
1040
- alias: 'operator'
1041
- }
1042
- });
1043
- Prism.languages.insertBefore('csharp', 'punctuation', {
1044
- 'named-parameter': {
1045
- pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
1046
- lookbehind: true,
1047
- alias: 'punctuation'
1048
778
  }
1049
- });
1050
- Prism.languages.insertBefore('csharp', 'class-name', {
1051
- 'namespace': {
1052
- pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]),
1053
- lookbehind: true,
1054
- inside: { 'punctuation': /\./ }
1055
- },
1056
- 'type-expression': {
1057
- pattern: re(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]),
1058
- lookbehind: true,
1059
- alias: 'class-name',
1060
- inside: typeInside
1061
- },
1062
- 'return-type': {
1063
- pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [
1064
- typeExpression,
1065
- identifier
1066
- ]),
1067
- inside: typeInside,
1068
- alias: 'class-name'
1069
- },
1070
- 'constructor-invocation': {
1071
- pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
1072
- lookbehind: true,
1073
- inside: typeInside,
1074
- alias: 'class-name'
1075
- },
1076
- 'generic-method': {
1077
- pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [
1078
- name,
1079
- generic
1080
- ]),
1081
- inside: {
1082
- 'function': re(/^<<0>>/.source, [name]),
1083
- 'generic': {
1084
- pattern: RegExp(generic),
1085
- alias: 'class-name',
1086
- inside: typeInside
1087
- }
1088
- }
1089
- },
1090
- 'type-list': {
1091
- pattern: re(/\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [
1092
- typeDeclarationKeywords,
1093
- genericName,
1094
- name,
1095
- typeExpression,
1096
- keywords.source
1097
- ]),
1098
- lookbehind: true,
1099
- inside: {
1100
- 'keyword': keywords,
1101
- 'class-name': {
1102
- pattern: RegExp(typeExpression),
1103
- greedy: true,
1104
- inside: typeInside
1105
- },
1106
- 'punctuation': /,/
1107
- }
1108
- },
1109
- 'preprocessor': {
1110
- pattern: /(^[\t ]*)#.*/m,
1111
- lookbehind: true,
1112
- alias: 'property',
1113
- inside: {
1114
- 'directive': {
1115
- pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,
1116
- lookbehind: true,
1117
- alias: 'keyword'
1118
- }
1119
- }
1120
- }
1121
- });
1122
- var regularStringOrCharacter = regularString + '|' + character;
1123
- var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]);
1124
- var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
1125
- var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source;
1126
- var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
1127
- identifier,
1128
- roundExpression
1129
- ]);
1130
- Prism.languages.insertBefore('csharp', 'class-name', {
1131
- 'attribute': {
1132
- pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [
1133
- attrTarget,
1134
- attr
1135
- ]),
1136
- lookbehind: true,
1137
- greedy: true,
1138
- inside: {
1139
- 'target': {
1140
- pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
1141
- alias: 'keyword'
1142
- },
1143
- 'attribute-arguments': {
1144
- pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
1145
- inside: Prism.languages.csharp
1146
- },
1147
- 'class-name': {
1148
- pattern: RegExp(identifier),
1149
- inside: { 'punctuation': /\./ }
1150
- },
1151
- 'punctuation': /[:,]/
1152
- }
1153
- }
1154
- });
1155
- var formatString = /:[^}\r\n]+/.source;
1156
- var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
1157
- var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
1158
- mInterpolationRound,
1159
- formatString
1160
- ]);
1161
- var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2);
1162
- var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
1163
- sInterpolationRound,
1164
- formatString
1165
- ]);
1166
- function createInterpolationInside(interpolation, interpolationRound) {
1167
- return {
1168
- 'interpolation': {
1169
- pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
1170
- lookbehind: true,
1171
- inside: {
1172
- 'format-string': {
1173
- pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
1174
- interpolationRound,
1175
- formatString
1176
- ]),
1177
- lookbehind: true,
1178
- inside: { 'punctuation': /^:/ }
1179
- },
1180
- 'punctuation': /^\{|\}$/,
1181
- 'expression': {
1182
- pattern: /[\s\S]+/,
1183
- alias: 'language-csharp',
1184
- inside: Prism.languages.csharp
1185
- }
1186
- }
1187
- },
1188
- 'string': /[\s\S]+/
1189
- };
779
+ return tokens;
1190
780
  }
1191
- Prism.languages.insertBefore('csharp', 'string', {
1192
- 'interpolation-string': [
1193
- {
1194
- pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]),
1195
- lookbehind: true,
1196
- greedy: true,
1197
- inside: createInterpolationInside(mInterpolation, mInterpolationRound)
1198
- },
1199
- {
1200
- pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]),
1201
- lookbehind: true,
1202
- greedy: true,
1203
- inside: createInterpolationInside(sInterpolation, sInterpolationRound)
1204
- }
1205
- ]
1206
- });
1207
- }(Prism));
1208
- Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
1209
- },
1210
- {}
1211
- ],
1212
- 6: [
1213
- function (require, module, exports) {
1214
- (function (Prism) {
1215
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1216
- Prism.languages.css = {
1217
- 'comment': /\/\*[\s\S]*?\*\//,
1218
- 'atrule': {
1219
- pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1220
- inside: {
1221
- 'rule': /^@[\w-]+/,
1222
- 'selector-function-argument': {
1223
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1224
- lookbehind: true,
1225
- alias: 'selector'
1226
- },
1227
- 'keyword': {
1228
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1229
- lookbehind: true
1230
- }
1231
- }
1232
- },
1233
- 'url': {
1234
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1235
- greedy: true,
1236
- inside: {
1237
- 'function': /^url/i,
1238
- 'punctuation': /^\(|\)$/,
1239
- 'string': {
1240
- pattern: RegExp('^' + string.source + '$'),
1241
- alias: 'url'
1242
- }
1243
- }
1244
- },
1245
- 'selector': {
1246
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1247
- lookbehind: true
1248
- },
1249
- 'string': {
1250
- pattern: string,
1251
- greedy: true
1252
- },
1253
- 'property': {
1254
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1255
- lookbehind: true
1256
- },
1257
- 'important': /!important\b/i,
1258
- 'function': {
1259
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1260
- lookbehind: true
1261
- },
1262
- 'punctuation': /[(){};:,]/
1263
- };
1264
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1265
- var markup = Prism.languages.markup;
1266
- if (markup) {
1267
- markup.tag.addInlined('style', 'css');
1268
- markup.tag.addAttribute('style', 'css');
1269
- }
1270
- }(Prism));
1271
- },
1272
- {}
1273
- ],
1274
- 7: [
1275
- function (require, module, exports) {
1276
- (function (Prism) {
1277
- var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
1278
- var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
1279
- var className = {
1280
- pattern: RegExp(classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1281
- lookbehind: true,
1282
- inside: {
1283
- 'namespace': {
1284
- pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
1285
- inside: { 'punctuation': /\./ }
1286
- },
1287
- 'punctuation': /\./
1288
- }
1289
- };
1290
- Prism.languages.java = Prism.languages.extend('clike', {
1291
- 'class-name': [
1292
- className,
1293
- {
1294
- pattern: RegExp(classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),
1295
- lookbehind: true,
1296
- inside: className.inside
1297
- }
1298
- ],
1299
- 'keyword': keywords,
1300
- 'function': [
1301
- Prism.languages.clike.function,
1302
- {
1303
- pattern: /(::\s*)[a-z_]\w*/,
1304
- lookbehind: true
1305
- }
1306
- ],
1307
- 'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
1308
- 'operator': {
1309
- pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
1310
- lookbehind: true
1311
- }
1312
- });
1313
- Prism.languages.insertBefore('java', 'string', {
1314
- 'triple-quoted-string': {
1315
- pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
1316
- greedy: true,
1317
- alias: 'string'
1318
- }
1319
- });
1320
- Prism.languages.insertBefore('java', 'class-name', {
1321
- 'annotation': {
1322
- pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
1323
- lookbehind: true,
1324
- alias: 'punctuation'
1325
- },
1326
- 'generics': {
1327
- pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
1328
- inside: {
1329
- 'class-name': className,
1330
- 'keyword': keywords,
1331
- 'punctuation': /[<>(),.:]/,
1332
- 'operator': /[?&|]/
1333
- }
1334
- },
1335
- 'namespace': {
1336
- pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function () {
1337
- return keywords.source;
1338
- })),
1339
- lookbehind: true,
1340
- inside: { 'punctuation': /\./ }
1341
- }
1342
- });
1343
- }(Prism));
1344
- },
1345
- {}
1346
- ],
1347
- 8: [
1348
- function (require, module, exports) {
1349
- Prism.languages.javascript = Prism.languages.extend('clike', {
1350
- 'class-name': [
1351
- Prism.languages.clike['class-name'],
1352
- {
1353
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
1354
- lookbehind: true
1355
- }
1356
- ],
1357
- 'keyword': [
1358
- {
1359
- pattern: /((?:^|\})\s*)catch\b/,
1360
- lookbehind: true
1361
- },
1362
- {
1363
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1364
- lookbehind: true
1365
- }
1366
- ],
1367
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1368
- 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
1369
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1370
- });
1371
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
1372
- Prism.languages.insertBefore('javascript', 'keyword', {
1373
- 'regex': {
1374
- pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
1375
- lookbehind: true,
1376
- greedy: true,
1377
- inside: {
1378
- 'regex-source': {
1379
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1380
- lookbehind: true,
1381
- alias: 'language-regex',
1382
- inside: Prism.languages.regex
1383
- },
1384
- 'regex-delimiter': /^\/|\/$/,
1385
- 'regex-flags': /^[a-z]+$/
1386
- }
1387
- },
1388
- 'function-variable': {
1389
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1390
- alias: 'function'
781
+ walkTokens(env.tokens);
782
+ }
783
+ }
784
+ });
785
+ }(Prism));
786
+ Prism.languages.c = Prism.languages.extend('clike', {
787
+ 'comment': {
788
+ pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
789
+ greedy: true
790
+ },
791
+ 'class-name': {
792
+ pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
793
+ lookbehind: true
794
+ },
795
+ 'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
796
+ 'function': /\b[a-z_]\w*(?=\s*\()/i,
797
+ 'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
798
+ 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
799
+ });
800
+ Prism.languages.insertBefore('c', 'string', {
801
+ 'macro': {
802
+ pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
803
+ lookbehind: true,
804
+ greedy: true,
805
+ alias: 'property',
806
+ inside: {
807
+ 'string': [
808
+ {
809
+ pattern: /^(#\s*include\s*)<[^>]+>/,
810
+ lookbehind: true
1391
811
  },
1392
- 'parameter': [
1393
- {
1394
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1395
- lookbehind: true,
1396
- inside: Prism.languages.javascript
1397
- },
1398
- {
1399
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1400
- lookbehind: true,
1401
- inside: Prism.languages.javascript
1402
- },
1403
- {
1404
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1405
- lookbehind: true,
1406
- inside: Prism.languages.javascript
1407
- },
1408
- {
1409
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1410
- lookbehind: true,
1411
- inside: Prism.languages.javascript
1412
- }
1413
- ],
1414
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1415
- });
1416
- Prism.languages.insertBefore('javascript', 'string', {
1417
- 'hashbang': {
1418
- pattern: /^#!.*/,
1419
- greedy: true,
1420
- alias: 'comment'
812
+ Prism.languages.c['string']
813
+ ],
814
+ 'comment': Prism.languages.c['comment'],
815
+ 'macro-name': [
816
+ {
817
+ pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
818
+ lookbehind: true
1421
819
  },
1422
- 'template-string': {
1423
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1424
- greedy: true,
1425
- inside: {
1426
- 'template-punctuation': {
1427
- pattern: /^`|`$/,
1428
- alias: 'string'
1429
- },
1430
- 'interpolation': {
1431
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1432
- lookbehind: true,
1433
- inside: {
1434
- 'interpolation-punctuation': {
1435
- pattern: /^\$\{|\}$/,
1436
- alias: 'punctuation'
1437
- },
1438
- rest: Prism.languages.javascript
1439
- }
1440
- },
1441
- 'string': /[\s\S]+/
1442
- }
820
+ {
821
+ pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
822
+ lookbehind: true,
823
+ alias: 'function'
1443
824
  }
1444
- });
1445
- if (Prism.languages.markup) {
1446
- Prism.languages.markup.tag.addInlined('script', 'javascript');
1447
- Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, 'javascript');
825
+ ],
826
+ 'directive': {
827
+ pattern: /^(#\s*)[a-z]+/,
828
+ lookbehind: true,
829
+ alias: 'keyword'
830
+ },
831
+ 'directive-hash': /^#/,
832
+ 'punctuation': /##|\\(?=[\r\n])/,
833
+ 'expression': {
834
+ pattern: /\S[\s\S]*/,
835
+ inside: Prism.languages.c
1448
836
  }
1449
- Prism.languages.js = Prism.languages.javascript;
837
+ }
838
+ },
839
+ 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/
840
+ });
841
+ delete Prism.languages.c['boolean'];
842
+ (function (Prism) {
843
+ var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
844
+ var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () {
845
+ return keyword.source;
846
+ });
847
+ Prism.languages.cpp = Prism.languages.extend('c', {
848
+ 'class-name': [
849
+ {
850
+ pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function () {
851
+ return keyword.source;
852
+ })),
853
+ lookbehind: true
854
+ },
855
+ /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
856
+ /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
857
+ /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
858
+ ],
859
+ 'keyword': keyword,
860
+ 'number': {
861
+ pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
862
+ greedy: true
1450
863
  },
1451
- {}
1452
- ],
1453
- 9: [
1454
- function (require, module, exports) {
1455
- (function (Prism) {
1456
- function getPlaceholder(language, index) {
1457
- return '___' + language.toUpperCase() + index + '___';
1458
- }
1459
- Object.defineProperties(Prism.languages['markup-templating'] = {}, {
1460
- buildPlaceholders: {
1461
- value: function (env, language, placeholderPattern, replaceFilter) {
1462
- if (env.language !== language) {
1463
- return;
1464
- }
1465
- var tokenStack = env.tokenStack = [];
1466
- env.code = env.code.replace(placeholderPattern, function (match) {
1467
- if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
1468
- return match;
1469
- }
1470
- var i = tokenStack.length;
1471
- var placeholder;
1472
- while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
1473
- ++i;
1474
- }
1475
- tokenStack[i] = match;
1476
- return placeholder;
1477
- });
1478
- env.grammar = Prism.languages.markup;
1479
- }
1480
- },
1481
- tokenizePlaceholders: {
1482
- value: function (env, language) {
1483
- if (env.language !== language || !env.tokenStack) {
1484
- return;
1485
- }
1486
- env.grammar = Prism.languages[language];
1487
- var j = 0;
1488
- var keys = Object.keys(env.tokenStack);
1489
- function walkTokens(tokens) {
1490
- for (var i = 0; i < tokens.length; i++) {
1491
- if (j >= keys.length) {
1492
- break;
1493
- }
1494
- var token = tokens[i];
1495
- if (typeof token === 'string' || token.content && typeof token.content === 'string') {
1496
- var k = keys[j];
1497
- var t = env.tokenStack[k];
1498
- var s = typeof token === 'string' ? token : token.content;
1499
- var placeholder = getPlaceholder(language, k);
1500
- var index = s.indexOf(placeholder);
1501
- if (index > -1) {
1502
- ++j;
1503
- var before = s.substring(0, index);
1504
- var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
1505
- var after = s.substring(index + placeholder.length);
1506
- var replacement = [];
1507
- if (before) {
1508
- replacement.push.apply(replacement, walkTokens([before]));
1509
- }
1510
- replacement.push(middle);
1511
- if (after) {
1512
- replacement.push.apply(replacement, walkTokens([after]));
1513
- }
1514
- if (typeof token === 'string') {
1515
- tokens.splice.apply(tokens, [
1516
- i,
1517
- 1
1518
- ].concat(replacement));
1519
- } else {
1520
- token.content = replacement;
1521
- }
1522
- }
1523
- } else if (token.content) {
1524
- walkTokens(token.content);
1525
- }
1526
- }
1527
- return tokens;
1528
- }
1529
- walkTokens(env.tokens);
1530
- }
1531
- }
1532
- });
1533
- }(Prism));
864
+ 'operator': />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
865
+ 'boolean': /\b(?:true|false)\b/
866
+ });
867
+ Prism.languages.insertBefore('cpp', 'string', {
868
+ 'module': {
869
+ pattern: RegExp(/(\b(?:module|import)\s+)/.source + '(?:' + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + '|' + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function () {
870
+ return modName;
871
+ }) + ')'),
872
+ lookbehind: true,
873
+ greedy: true,
874
+ inside: {
875
+ 'string': /^[<"][\s\S]+/,
876
+ 'operator': /:/,
877
+ 'punctuation': /\./
878
+ }
1534
879
  },
1535
- {}
1536
- ],
1537
- 10: [
1538
- function (require, module, exports) {
1539
- Prism.languages.markup = {
1540
- 'comment': /<!--[\s\S]*?-->/,
1541
- 'prolog': /<\?[\s\S]+?\?>/,
1542
- 'doctype': {
1543
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1544
- greedy: true,
1545
- inside: {
1546
- 'internal-subset': {
1547
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1548
- lookbehind: true,
1549
- greedy: true,
1550
- inside: null
1551
- },
1552
- 'string': {
1553
- pattern: /"[^"]*"|'[^']*'/,
1554
- greedy: true
1555
- },
1556
- 'punctuation': /^<!|>$|[[\]]/,
1557
- 'doctype-tag': /^DOCTYPE/,
1558
- 'name': /[^\s<>'"]+/
1559
- }
1560
- },
1561
- 'cdata': /<!\[CDATA\[[\s\S]*?\]\]>/i,
1562
- 'tag': {
1563
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1564
- greedy: true,
1565
- inside: {
1566
- 'tag': {
1567
- pattern: /^<\/?[^\s>\/]+/,
1568
- inside: {
1569
- 'punctuation': /^<\/?/,
1570
- 'namespace': /^[^\s>\/:]+:/
1571
- }
1572
- },
1573
- 'special-attr': [],
1574
- 'attr-value': {
1575
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1576
- inside: {
1577
- 'punctuation': [
1578
- {
1579
- pattern: /^=/,
1580
- alias: 'attr-equals'
1581
- },
1582
- /"|'/
1583
- ]
1584
- }
1585
- },
1586
- 'punctuation': /\/?>/,
1587
- 'attr-name': {
1588
- pattern: /[^\s>\/]+/,
1589
- inside: { 'namespace': /^[^\s>\/:]+:/ }
1590
- }
1591
- }
1592
- },
1593
- 'entity': [
1594
- {
1595
- pattern: /&[\da-z]{1,8};/i,
1596
- alias: 'named-entity'
1597
- },
1598
- /&#x?[\da-f]{1,8};/i
1599
- ]
1600
- };
1601
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity'];
1602
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1603
- Prism.hooks.add('wrap', function (env) {
1604
- if (env.type === 'entity') {
1605
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1606
- }
1607
- });
1608
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1609
- value: function addInlined(tagName, lang) {
1610
- var includedCdataInside = {};
1611
- includedCdataInside['language-' + lang] = {
1612
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1613
- lookbehind: true,
1614
- inside: Prism.languages[lang]
1615
- };
1616
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1617
- var inside = {
1618
- 'included-cdata': {
1619
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1620
- inside: includedCdataInside
1621
- }
1622
- };
1623
- inside['language-' + lang] = {
1624
- pattern: /[\s\S]+/,
1625
- inside: Prism.languages[lang]
1626
- };
1627
- var def = {};
1628
- def[tagName] = {
1629
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () {
1630
- return tagName;
1631
- }), 'i'),
1632
- lookbehind: true,
1633
- greedy: true,
1634
- inside: inside
1635
- };
1636
- Prism.languages.insertBefore('markup', 'cdata', def);
1637
- }
1638
- });
1639
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1640
- value: function (attrName, lang) {
1641
- Prism.languages.markup.tag.inside['special-attr'].push({
1642
- pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'),
1643
- lookbehind: true,
1644
- inside: {
1645
- 'attr-name': /^[^\s=]+/,
1646
- 'attr-value': {
1647
- pattern: /=[\s\S]+/,
1648
- inside: {
1649
- 'value': {
1650
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1651
- lookbehind: true,
1652
- alias: [
1653
- lang,
1654
- 'language-' + lang
1655
- ],
1656
- inside: Prism.languages[lang]
1657
- },
1658
- 'punctuation': [
1659
- {
1660
- pattern: /^=/,
1661
- alias: 'attr-equals'
1662
- },
1663
- /"|'/
1664
- ]
1665
- }
1666
- }
1667
- }
1668
- });
880
+ 'raw-string': {
881
+ pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
882
+ alias: 'string',
883
+ greedy: true
884
+ }
885
+ });
886
+ Prism.languages.insertBefore('cpp', 'keyword', {
887
+ 'generic-function': {
888
+ pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
889
+ inside: {
890
+ 'function': /^\w+/,
891
+ 'generic': {
892
+ pattern: /<[\s\S]+/,
893
+ alias: 'class-name',
894
+ inside: Prism.languages.cpp
1669
895
  }
1670
- });
1671
- Prism.languages.html = Prism.languages.markup;
1672
- Prism.languages.mathml = Prism.languages.markup;
1673
- Prism.languages.svg = Prism.languages.markup;
1674
- Prism.languages.xml = Prism.languages.extend('markup', {});
1675
- Prism.languages.ssml = Prism.languages.xml;
1676
- Prism.languages.atom = Prism.languages.xml;
1677
- Prism.languages.rss = Prism.languages.xml;
1678
- },
1679
- {}
1680
- ],
1681
- 11: [
1682
- function (require, module, exports) {
1683
- (function (Prism) {
1684
- var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/;
1685
- var constant = [
1686
- {
1687
- pattern: /\b(?:false|true)\b/i,
1688
- alias: 'boolean'
1689
- },
1690
- {
1691
- pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
1692
- greedy: true,
1693
- lookbehind: true
1694
- },
1695
- {
1696
- pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
1697
- greedy: true,
1698
- lookbehind: true
1699
- },
1700
- /\b(?:null)\b/i,
1701
- /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/
1702
- ];
1703
- var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i;
1704
- var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
1705
- var punctuation = /[{}\[\](),:;]/;
1706
- Prism.languages.php = {
1707
- 'delimiter': {
1708
- pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
1709
- alias: 'important'
1710
- },
1711
- 'comment': comment,
1712
- 'variable': /\$+(?:\w+\b|(?=\{))/i,
1713
- 'package': {
1714
- pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1715
- lookbehind: true,
1716
- inside: { 'punctuation': /\\/ }
1717
- },
1718
- 'class-name-definition': {
1719
- pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
1720
- lookbehind: true,
1721
- alias: 'class-name'
1722
- },
1723
- 'function-definition': {
1724
- pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
1725
- lookbehind: true,
1726
- alias: 'function'
1727
- },
1728
- 'keyword': [
1729
- {
1730
- pattern: /(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,
1731
- alias: 'type-casting',
1732
- greedy: true,
1733
- lookbehind: true
1734
- },
1735
- {
1736
- pattern: /([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,
1737
- alias: 'type-hint',
1738
- greedy: true,
1739
- lookbehind: true
1740
- },
1741
- {
1742
- pattern: /([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,
1743
- alias: 'type-hint',
1744
- greedy: true,
1745
- lookbehind: true
1746
- },
1747
- {
1748
- pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,
1749
- alias: 'return-type',
1750
- greedy: true,
1751
- lookbehind: true
1752
- },
1753
- {
1754
- pattern: /(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,
1755
- alias: 'return-type',
1756
- greedy: true,
1757
- lookbehind: true
1758
- },
1759
- {
1760
- pattern: /\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,
1761
- alias: 'type-declaration',
1762
- greedy: true
1763
- },
1764
- {
1765
- pattern: /(\|\s*)(?:null|false)\b/i,
1766
- alias: 'type-declaration',
1767
- greedy: true,
1768
- lookbehind: true
1769
- },
1770
- {
1771
- pattern: /\b(?:parent|self|static)(?=\s*::)/i,
1772
- alias: 'static-context',
1773
- greedy: true
1774
- },
1775
- {
1776
- pattern: /(\byield\s+)from\b/i,
1777
- lookbehind: true
1778
- },
1779
- /\bclass\b/i,
1780
- {
1781
- pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
1782
- lookbehind: true
1783
- }
1784
- ],
1785
- 'argument-name': {
1786
- pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,
1787
- lookbehind: true
1788
- },
1789
- 'class-name': [
1790
- {
1791
- pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
1792
- greedy: true,
1793
- lookbehind: true
1794
- },
1795
- {
1796
- pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
1797
- greedy: true,
1798
- lookbehind: true
1799
- },
1800
- {
1801
- pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
1802
- greedy: true
1803
- },
1804
- {
1805
- pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
1806
- alias: 'class-name-fully-qualified',
1807
- greedy: true,
1808
- lookbehind: true,
1809
- inside: { 'punctuation': /\\/ }
1810
- },
1811
- {
1812
- pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
1813
- alias: 'class-name-fully-qualified',
1814
- greedy: true,
1815
- inside: { 'punctuation': /\\/ }
1816
- },
1817
- {
1818
- pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1819
- alias: 'class-name-fully-qualified',
1820
- greedy: true,
1821
- lookbehind: true,
1822
- inside: { 'punctuation': /\\/ }
1823
- },
1824
- {
1825
- pattern: /\b[a-z_]\w*(?=\s*\$)/i,
1826
- alias: 'type-declaration',
1827
- greedy: true
1828
- },
1829
- {
1830
- pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
1831
- alias: [
1832
- 'class-name-fully-qualified',
1833
- 'type-declaration'
1834
- ],
1835
- greedy: true,
1836
- inside: { 'punctuation': /\\/ }
1837
- },
1838
- {
1839
- pattern: /\b[a-z_]\w*(?=\s*::)/i,
1840
- alias: 'static-context',
1841
- greedy: true
1842
- },
1843
- {
1844
- pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
1845
- alias: [
1846
- 'class-name-fully-qualified',
1847
- 'static-context'
1848
- ],
1849
- greedy: true,
1850
- inside: { 'punctuation': /\\/ }
1851
- },
1852
- {
1853
- pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
1854
- alias: 'type-hint',
1855
- greedy: true,
1856
- lookbehind: true
1857
- },
1858
- {
1859
- pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
1860
- alias: [
1861
- 'class-name-fully-qualified',
1862
- 'type-hint'
1863
- ],
1864
- greedy: true,
1865
- lookbehind: true,
1866
- inside: { 'punctuation': /\\/ }
1867
- },
1868
- {
1869
- pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
1870
- alias: 'return-type',
1871
- greedy: true,
1872
- lookbehind: true
1873
- },
1874
- {
1875
- pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1876
- alias: [
1877
- 'class-name-fully-qualified',
1878
- 'return-type'
1879
- ],
1880
- greedy: true,
1881
- lookbehind: true,
1882
- inside: { 'punctuation': /\\/ }
1883
- }
1884
- ],
1885
- 'constant': constant,
1886
- 'function': {
1887
- pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
1888
- lookbehind: true,
1889
- inside: { 'punctuation': /\\/ }
1890
- },
1891
- 'property': {
1892
- pattern: /(->\s*)\w+/,
1893
- lookbehind: true
1894
- },
1895
- 'number': number,
1896
- 'operator': operator,
1897
- 'punctuation': punctuation
1898
- };
1899
- var string_interpolation = {
1900
- pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
1901
- lookbehind: true,
1902
- inside: Prism.languages.php
1903
- };
1904
- var string = [
1905
- {
1906
- pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
1907
- alias: 'nowdoc-string',
1908
- greedy: true,
1909
- inside: {
1910
- 'delimiter': {
1911
- pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
1912
- alias: 'symbol',
1913
- inside: { 'punctuation': /^<<<'?|[';]$/ }
1914
- }
1915
- }
1916
- },
1917
- {
1918
- pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
1919
- alias: 'heredoc-string',
1920
- greedy: true,
1921
- inside: {
1922
- 'delimiter': {
1923
- pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
1924
- alias: 'symbol',
1925
- inside: { 'punctuation': /^<<<"?|[";]$/ }
1926
- },
1927
- 'interpolation': string_interpolation
1928
- }
1929
- },
1930
- {
1931
- pattern: /`(?:\\[\s\S]|[^\\`])*`/,
1932
- alias: 'backtick-quoted-string',
1933
- greedy: true
1934
- },
1935
- {
1936
- pattern: /'(?:\\[\s\S]|[^\\'])*'/,
1937
- alias: 'single-quoted-string',
1938
- greedy: true
1939
- },
1940
- {
1941
- pattern: /"(?:\\[\s\S]|[^\\"])*"/,
1942
- alias: 'double-quoted-string',
1943
- greedy: true,
1944
- inside: { 'interpolation': string_interpolation }
1945
- }
1946
- ];
1947
- Prism.languages.insertBefore('php', 'variable', {
1948
- 'string': string,
1949
- 'attribute': {
1950
- pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
1951
- greedy: true,
1952
- inside: {
1953
- 'attribute-content': {
1954
- pattern: /^(#\[)[\s\S]+(?=\]$)/,
1955
- lookbehind: true,
1956
- inside: {
1957
- 'comment': comment,
1958
- 'string': string,
1959
- 'attribute-class-name': [
1960
- {
1961
- pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
1962
- alias: 'class-name',
1963
- greedy: true,
1964
- lookbehind: true
1965
- },
1966
- {
1967
- pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
1968
- alias: [
1969
- 'class-name',
1970
- 'class-name-fully-qualified'
1971
- ],
1972
- greedy: true,
1973
- lookbehind: true,
1974
- inside: { 'punctuation': /\\/ }
1975
- }
1976
- ],
1977
- 'constant': constant,
1978
- 'number': number,
1979
- 'operator': operator,
1980
- 'punctuation': punctuation
1981
- }
1982
- },
1983
- 'delimiter': {
1984
- pattern: /^#\[|\]$/,
1985
- alias: 'punctuation'
1986
- }
1987
- }
1988
- }
1989
- });
1990
- Prism.hooks.add('before-tokenize', function (env) {
1991
- if (!/<\?/.test(env.code)) {
1992
- return;
1993
- }
1994
- var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi;
1995
- Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
1996
- });
1997
- Prism.hooks.add('after-tokenize', function (env) {
1998
- Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php');
1999
- });
2000
- }(Prism));
896
+ }
897
+ }
898
+ });
899
+ Prism.languages.insertBefore('cpp', 'operator', {
900
+ 'double-colon': {
901
+ pattern: /::/,
902
+ alias: 'punctuation'
903
+ }
904
+ });
905
+ Prism.languages.insertBefore('cpp', 'class-name', {
906
+ 'base-clause': {
907
+ pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
908
+ lookbehind: true,
909
+ greedy: true,
910
+ inside: Prism.languages.extend('cpp', {})
911
+ }
912
+ });
913
+ Prism.languages.insertBefore('inside', 'double-colon', { 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i }, Prism.languages.cpp['base-clause']);
914
+ }(Prism));
915
+ (function (Prism) {
916
+ function replace(pattern, replacements) {
917
+ return pattern.replace(/<<(\d+)>>/g, function (m, index) {
918
+ return '(?:' + replacements[+index] + ')';
919
+ });
920
+ }
921
+ function re(pattern, replacements, flags) {
922
+ return RegExp(replace(pattern, replacements), flags || '');
923
+ }
924
+ function nested(pattern, depthLog2) {
925
+ for (var i = 0; i < depthLog2; i++) {
926
+ pattern = pattern.replace(/<<self>>/g, function () {
927
+ return '(?:' + pattern + ')';
928
+ });
929
+ }
930
+ return pattern.replace(/<<self>>/g, '[^\\s\\S]');
931
+ }
932
+ var keywordKinds = {
933
+ type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
934
+ typeDeclaration: 'class enum interface record struct',
935
+ contextual: 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)',
936
+ other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
937
+ };
938
+ function keywordsToPattern(words) {
939
+ return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
940
+ }
941
+ var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration);
942
+ var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other));
943
+ var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other);
944
+ var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other);
945
+ var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2);
946
+ var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
947
+ var name = /@?\b[A-Za-z_]\w*\b/.source;
948
+ var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [
949
+ name,
950
+ generic
951
+ ]);
952
+ var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
953
+ nonTypeKeywords,
954
+ genericName
955
+ ]);
956
+ var array = /\[\s*(?:,\s*)*\]/.source;
957
+ var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [
958
+ identifier,
959
+ array
960
+ ]);
961
+ var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [
962
+ generic,
963
+ nestedRound,
964
+ array
965
+ ]);
966
+ var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
967
+ var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [
968
+ tuple,
969
+ identifier,
970
+ array
971
+ ]);
972
+ var typeInside = {
973
+ 'keyword': keywords,
974
+ 'punctuation': /[<>()?,.:[\]]/
975
+ };
976
+ var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source;
977
+ var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
978
+ var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
979
+ Prism.languages.csharp = Prism.languages.extend('clike', {
980
+ 'string': [
981
+ {
982
+ pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
983
+ lookbehind: true,
984
+ greedy: true
985
+ },
986
+ {
987
+ pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
988
+ lookbehind: true,
989
+ greedy: true
990
+ },
991
+ {
992
+ pattern: RegExp(character),
993
+ greedy: true,
994
+ alias: 'character'
995
+ }
996
+ ],
997
+ 'class-name': [
998
+ {
999
+ pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]),
1000
+ lookbehind: true,
1001
+ inside: typeInside
1002
+ },
1003
+ {
1004
+ pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
1005
+ name,
1006
+ typeExpression
1007
+ ]),
1008
+ lookbehind: true,
1009
+ inside: typeInside
1010
+ },
1011
+ {
1012
+ pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
1013
+ lookbehind: true
1014
+ },
1015
+ {
1016
+ pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
1017
+ typeDeclarationKeywords,
1018
+ genericName
1019
+ ]),
1020
+ lookbehind: true,
1021
+ inside: typeInside
1022
+ },
1023
+ {
1024
+ pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
1025
+ lookbehind: true,
1026
+ inside: typeInside
1027
+ },
1028
+ {
1029
+ pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
1030
+ lookbehind: true
1031
+ },
1032
+ {
1033
+ pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]),
1034
+ lookbehind: true,
1035
+ inside: typeInside
1036
+ },
1037
+ {
1038
+ pattern: re(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [
1039
+ typeExpression,
1040
+ nonContextualKeywords,
1041
+ name
1042
+ ]),
1043
+ inside: typeInside
1044
+ }
1045
+ ],
1046
+ 'keyword': keywords,
1047
+ 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,
1048
+ 'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
1049
+ 'punctuation': /\?\.?|::|[{}[\];(),.:]/
1050
+ });
1051
+ Prism.languages.insertBefore('csharp', 'number', {
1052
+ 'range': {
1053
+ pattern: /\.\./,
1054
+ alias: 'operator'
1055
+ }
1056
+ });
1057
+ Prism.languages.insertBefore('csharp', 'punctuation', {
1058
+ 'named-parameter': {
1059
+ pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
1060
+ lookbehind: true,
1061
+ alias: 'punctuation'
1062
+ }
1063
+ });
1064
+ Prism.languages.insertBefore('csharp', 'class-name', {
1065
+ 'namespace': {
1066
+ pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]),
1067
+ lookbehind: true,
1068
+ inside: { 'punctuation': /\./ }
2001
1069
  },
2002
- {}
2003
- ],
2004
- 12: [
2005
- function (require, module, exports) {
2006
- Prism.languages.python = {
2007
- 'comment': {
2008
- pattern: /(^|[^\\])#.*/,
2009
- lookbehind: true
2010
- },
2011
- 'string-interpolation': {
2012
- pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1070
+ 'type-expression': {
1071
+ pattern: re(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]),
1072
+ lookbehind: true,
1073
+ alias: 'class-name',
1074
+ inside: typeInside
1075
+ },
1076
+ 'return-type': {
1077
+ pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [
1078
+ typeExpression,
1079
+ identifier
1080
+ ]),
1081
+ inside: typeInside,
1082
+ alias: 'class-name'
1083
+ },
1084
+ 'constructor-invocation': {
1085
+ pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
1086
+ lookbehind: true,
1087
+ inside: typeInside,
1088
+ alias: 'class-name'
1089
+ },
1090
+ 'generic-method': {
1091
+ pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [
1092
+ name,
1093
+ generic
1094
+ ]),
1095
+ inside: {
1096
+ 'function': re(/^<<0>>/.source, [name]),
1097
+ 'generic': {
1098
+ pattern: RegExp(generic),
1099
+ alias: 'class-name',
1100
+ inside: typeInside
1101
+ }
1102
+ }
1103
+ },
1104
+ 'type-list': {
1105
+ pattern: re(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [
1106
+ typeDeclarationKeywords,
1107
+ genericName,
1108
+ name,
1109
+ typeExpression,
1110
+ keywords.source,
1111
+ nestedRound,
1112
+ /\bnew\s*\(\s*\)/.source
1113
+ ]),
1114
+ lookbehind: true,
1115
+ inside: {
1116
+ 'record-arguments': {
1117
+ pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
1118
+ genericName,
1119
+ nestedRound
1120
+ ]),
1121
+ lookbehind: true,
2013
1122
  greedy: true,
2014
- inside: {
2015
- 'interpolation': {
2016
- pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
2017
- lookbehind: true,
2018
- inside: {
2019
- 'format-spec': {
2020
- pattern: /(:)[^:(){}]+(?=\}$)/,
2021
- lookbehind: true
2022
- },
2023
- 'conversion-option': {
2024
- pattern: /![sra](?=[:}]$)/,
2025
- alias: 'punctuation'
2026
- },
2027
- rest: null
2028
- }
2029
- },
2030
- 'string': /[\s\S]+/
2031
- }
1123
+ inside: Prism.languages.csharp
2032
1124
  },
2033
- 'triple-quoted-string': {
2034
- pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,
1125
+ 'keyword': keywords,
1126
+ 'class-name': {
1127
+ pattern: RegExp(typeExpression),
2035
1128
  greedy: true,
2036
- alias: 'string'
1129
+ inside: typeInside
2037
1130
  },
2038
- 'string': {
2039
- pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
2040
- greedy: true
1131
+ 'punctuation': /[,()]/
1132
+ }
1133
+ },
1134
+ 'preprocessor': {
1135
+ pattern: /(^[\t ]*)#.*/m,
1136
+ lookbehind: true,
1137
+ alias: 'property',
1138
+ inside: {
1139
+ 'directive': {
1140
+ pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
1141
+ lookbehind: true,
1142
+ alias: 'keyword'
1143
+ }
1144
+ }
1145
+ }
1146
+ });
1147
+ var regularStringOrCharacter = regularString + '|' + character;
1148
+ var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]);
1149
+ var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
1150
+ var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source;
1151
+ var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
1152
+ identifier,
1153
+ roundExpression
1154
+ ]);
1155
+ Prism.languages.insertBefore('csharp', 'class-name', {
1156
+ 'attribute': {
1157
+ pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [
1158
+ attrTarget,
1159
+ attr
1160
+ ]),
1161
+ lookbehind: true,
1162
+ greedy: true,
1163
+ inside: {
1164
+ 'target': {
1165
+ pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
1166
+ alias: 'keyword'
2041
1167
  },
2042
- 'function': {
2043
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
2044
- lookbehind: true
1168
+ 'attribute-arguments': {
1169
+ pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
1170
+ inside: Prism.languages.csharp
2045
1171
  },
2046
1172
  'class-name': {
2047
- pattern: /(\bclass\s+)\w+/i,
2048
- lookbehind: true
1173
+ pattern: RegExp(identifier),
1174
+ inside: { 'punctuation': /\./ }
2049
1175
  },
2050
- 'decorator': {
2051
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/im,
1176
+ 'punctuation': /[:,]/
1177
+ }
1178
+ }
1179
+ });
1180
+ var formatString = /:[^}\r\n]+/.source;
1181
+ var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
1182
+ var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
1183
+ mInterpolationRound,
1184
+ formatString
1185
+ ]);
1186
+ var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2);
1187
+ var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
1188
+ sInterpolationRound,
1189
+ formatString
1190
+ ]);
1191
+ function createInterpolationInside(interpolation, interpolationRound) {
1192
+ return {
1193
+ 'interpolation': {
1194
+ pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
1195
+ lookbehind: true,
1196
+ inside: {
1197
+ 'format-string': {
1198
+ pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
1199
+ interpolationRound,
1200
+ formatString
1201
+ ]),
1202
+ lookbehind: true,
1203
+ inside: { 'punctuation': /^:/ }
1204
+ },
1205
+ 'punctuation': /^\{|\}$/,
1206
+ 'expression': {
1207
+ pattern: /[\s\S]+/,
1208
+ alias: 'language-csharp',
1209
+ inside: Prism.languages.csharp
1210
+ }
1211
+ }
1212
+ },
1213
+ 'string': /[\s\S]+/
1214
+ };
1215
+ }
1216
+ Prism.languages.insertBefore('csharp', 'string', {
1217
+ 'interpolation-string': [
1218
+ {
1219
+ pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]),
1220
+ lookbehind: true,
1221
+ greedy: true,
1222
+ inside: createInterpolationInside(mInterpolation, mInterpolationRound)
1223
+ },
1224
+ {
1225
+ pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]),
1226
+ lookbehind: true,
1227
+ greedy: true,
1228
+ inside: createInterpolationInside(sInterpolation, sInterpolationRound)
1229
+ }
1230
+ ]
1231
+ });
1232
+ }(Prism));
1233
+ Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
1234
+ (function (Prism) {
1235
+ var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1236
+ Prism.languages.css = {
1237
+ 'comment': /\/\*[\s\S]*?\*\//,
1238
+ 'atrule': {
1239
+ pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1240
+ inside: {
1241
+ 'rule': /^@[\w-]+/,
1242
+ 'selector-function-argument': {
1243
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
2052
1244
  lookbehind: true,
2053
- alias: [
2054
- 'annotation',
2055
- 'punctuation'
2056
- ],
2057
- inside: { 'punctuation': /\./ }
1245
+ alias: 'selector'
2058
1246
  },
2059
- 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2060
- 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
2061
- 'boolean': /\b(?:True|False|None)\b/,
2062
- 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,
2063
- 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2064
- 'punctuation': /[{}[\];(),.:]/
2065
- };
2066
- Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
2067
- Prism.languages.py = Prism.languages.python;
1247
+ 'keyword': {
1248
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1249
+ lookbehind: true
1250
+ }
1251
+ }
1252
+ },
1253
+ 'url': {
1254
+ pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1255
+ greedy: true,
1256
+ inside: {
1257
+ 'function': /^url/i,
1258
+ 'punctuation': /^\(|\)$/,
1259
+ 'string': {
1260
+ pattern: RegExp('^' + string.source + '$'),
1261
+ alias: 'url'
1262
+ }
1263
+ }
1264
+ },
1265
+ 'selector': {
1266
+ pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1267
+ lookbehind: true
1268
+ },
1269
+ 'string': {
1270
+ pattern: string,
1271
+ greedy: true
1272
+ },
1273
+ 'property': {
1274
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1275
+ lookbehind: true
1276
+ },
1277
+ 'important': /!important\b/i,
1278
+ 'function': {
1279
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1280
+ lookbehind: true
1281
+ },
1282
+ 'punctuation': /[(){};:,]/
1283
+ };
1284
+ Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1285
+ var markup = Prism.languages.markup;
1286
+ if (markup) {
1287
+ markup.tag.addInlined('style', 'css');
1288
+ markup.tag.addAttribute('style', 'css');
1289
+ }
1290
+ }(Prism));
1291
+ (function (Prism) {
1292
+ var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
1293
+ var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
1294
+ var className = {
1295
+ pattern: RegExp(classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1296
+ lookbehind: true,
1297
+ inside: {
1298
+ 'namespace': {
1299
+ pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
1300
+ inside: { 'punctuation': /\./ }
1301
+ },
1302
+ 'punctuation': /\./
1303
+ }
1304
+ };
1305
+ Prism.languages.java = Prism.languages.extend('clike', {
1306
+ 'class-name': [
1307
+ className,
1308
+ {
1309
+ pattern: RegExp(classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),
1310
+ lookbehind: true,
1311
+ inside: className.inside
1312
+ }
1313
+ ],
1314
+ 'keyword': keywords,
1315
+ 'function': [
1316
+ Prism.languages.clike.function,
1317
+ {
1318
+ pattern: /(::\s*)[a-z_]\w*/,
1319
+ lookbehind: true
1320
+ }
1321
+ ],
1322
+ 'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
1323
+ 'operator': {
1324
+ pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
1325
+ lookbehind: true
1326
+ }
1327
+ });
1328
+ Prism.languages.insertBefore('java', 'string', {
1329
+ 'triple-quoted-string': {
1330
+ pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
1331
+ greedy: true,
1332
+ alias: 'string'
1333
+ }
1334
+ });
1335
+ Prism.languages.insertBefore('java', 'class-name', {
1336
+ 'annotation': {
1337
+ pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
1338
+ lookbehind: true,
1339
+ alias: 'punctuation'
1340
+ },
1341
+ 'generics': {
1342
+ pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
1343
+ inside: {
1344
+ 'class-name': className,
1345
+ 'keyword': keywords,
1346
+ 'punctuation': /[<>(),.:]/,
1347
+ 'operator': /[?&|]/
1348
+ }
2068
1349
  },
2069
- {}
1350
+ 'namespace': {
1351
+ pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function () {
1352
+ return keywords.source;
1353
+ })),
1354
+ lookbehind: true,
1355
+ inside: { 'punctuation': /\./ }
1356
+ }
1357
+ });
1358
+ }(Prism));
1359
+ Prism.languages.javascript = Prism.languages.extend('clike', {
1360
+ 'class-name': [
1361
+ Prism.languages.clike['class-name'],
1362
+ {
1363
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
1364
+ lookbehind: true
1365
+ }
2070
1366
  ],
2071
- 13: [
2072
- function (require, module, exports) {
2073
- (function (Prism) {
2074
- Prism.languages.ruby = Prism.languages.extend('clike', {
2075
- 'comment': [
2076
- /#.*/,
2077
- {
2078
- pattern: /^=begin\s[\s\S]*?^=end/m,
2079
- greedy: true
2080
- }
2081
- ],
2082
- 'class-name': {
2083
- pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,
2084
- lookbehind: true,
2085
- inside: { 'punctuation': /[.\\]/ }
1367
+ 'keyword': [
1368
+ {
1369
+ pattern: /((?:^|\})\s*)catch\b/,
1370
+ lookbehind: true
1371
+ },
1372
+ {
1373
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1374
+ lookbehind: true
1375
+ }
1376
+ ],
1377
+ 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1378
+ 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
1379
+ 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1380
+ });
1381
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
1382
+ Prism.languages.insertBefore('javascript', 'keyword', {
1383
+ 'regex': {
1384
+ pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
1385
+ lookbehind: true,
1386
+ greedy: true,
1387
+ inside: {
1388
+ 'regex-source': {
1389
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1390
+ lookbehind: true,
1391
+ alias: 'language-regex',
1392
+ inside: Prism.languages.regex
1393
+ },
1394
+ 'regex-delimiter': /^\/|\/$/,
1395
+ 'regex-flags': /^[a-z]+$/
1396
+ }
1397
+ },
1398
+ 'function-variable': {
1399
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1400
+ alias: 'function'
1401
+ },
1402
+ 'parameter': [
1403
+ {
1404
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1405
+ lookbehind: true,
1406
+ inside: Prism.languages.javascript
1407
+ },
1408
+ {
1409
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1410
+ lookbehind: true,
1411
+ inside: Prism.languages.javascript
1412
+ },
1413
+ {
1414
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1415
+ lookbehind: true,
1416
+ inside: Prism.languages.javascript
1417
+ },
1418
+ {
1419
+ pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1420
+ lookbehind: true,
1421
+ inside: Prism.languages.javascript
1422
+ }
1423
+ ],
1424
+ 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1425
+ });
1426
+ Prism.languages.insertBefore('javascript', 'string', {
1427
+ 'hashbang': {
1428
+ pattern: /^#!.*/,
1429
+ greedy: true,
1430
+ alias: 'comment'
1431
+ },
1432
+ 'template-string': {
1433
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1434
+ greedy: true,
1435
+ inside: {
1436
+ 'template-punctuation': {
1437
+ pattern: /^`|`$/,
1438
+ alias: 'string'
1439
+ },
1440
+ 'interpolation': {
1441
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1442
+ lookbehind: true,
1443
+ inside: {
1444
+ 'interpolation-punctuation': {
1445
+ pattern: /^\$\{|\}$/,
1446
+ alias: 'punctuation'
2086
1447
  },
2087
- 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/
2088
- });
2089
- var interpolation = {
2090
- pattern: /#\{[^}]+\}/,
2091
- inside: {
2092
- 'delimiter': {
2093
- pattern: /^#\{|\}$/,
2094
- alias: 'tag'
2095
- },
2096
- rest: Prism.languages.ruby
2097
- }
2098
- };
2099
- delete Prism.languages.ruby.function;
2100
- Prism.languages.insertBefore('ruby', 'keyword', {
2101
- 'regex': [
1448
+ rest: Prism.languages.javascript
1449
+ }
1450
+ },
1451
+ 'string': /[\s\S]+/
1452
+ }
1453
+ }
1454
+ });
1455
+ if (Prism.languages.markup) {
1456
+ Prism.languages.markup.tag.addInlined('script', 'javascript');
1457
+ Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, 'javascript');
1458
+ }
1459
+ Prism.languages.js = Prism.languages.javascript;
1460
+ Prism.languages.markup = {
1461
+ 'comment': {
1462
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1463
+ greedy: true
1464
+ },
1465
+ 'prolog': {
1466
+ pattern: /<\?[\s\S]+?\?>/,
1467
+ greedy: true
1468
+ },
1469
+ 'doctype': {
1470
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1471
+ greedy: true,
1472
+ inside: {
1473
+ 'internal-subset': {
1474
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1475
+ lookbehind: true,
1476
+ greedy: true,
1477
+ inside: null
1478
+ },
1479
+ 'string': {
1480
+ pattern: /"[^"]*"|'[^']*'/,
1481
+ greedy: true
1482
+ },
1483
+ 'punctuation': /^<!|>$|[[\]]/,
1484
+ 'doctype-tag': /^DOCTYPE/i,
1485
+ 'name': /[^\s<>'"]+/
1486
+ }
1487
+ },
1488
+ 'cdata': {
1489
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1490
+ greedy: true
1491
+ },
1492
+ 'tag': {
1493
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1494
+ greedy: true,
1495
+ inside: {
1496
+ 'tag': {
1497
+ pattern: /^<\/?[^\s>\/]+/,
1498
+ inside: {
1499
+ 'punctuation': /^<\/?/,
1500
+ 'namespace': /^[^\s>\/:]+:/
1501
+ }
1502
+ },
1503
+ 'special-attr': [],
1504
+ 'attr-value': {
1505
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1506
+ inside: {
1507
+ 'punctuation': [
2102
1508
  {
2103
- pattern: RegExp(/%r/.source + '(?:' + [
2104
- /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2105
- /\((?:[^()\\]|\\[\s\S])*\)/.source,
2106
- /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2107
- /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2108
- /<(?:[^<>\\]|\\[\s\S])*>/.source
2109
- ].join('|') + ')' + /[egimnosux]{0,6}/.source),
2110
- greedy: true,
2111
- inside: { 'interpolation': interpolation }
1509
+ pattern: /^=/,
1510
+ alias: 'attr-equals'
2112
1511
  },
2113
- {
2114
- pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
1512
+ /"|'/
1513
+ ]
1514
+ }
1515
+ },
1516
+ 'punctuation': /\/?>/,
1517
+ 'attr-name': {
1518
+ pattern: /[^\s>\/]+/,
1519
+ inside: { 'namespace': /^[^\s>\/:]+:/ }
1520
+ }
1521
+ }
1522
+ },
1523
+ 'entity': [
1524
+ {
1525
+ pattern: /&[\da-z]{1,8};/i,
1526
+ alias: 'named-entity'
1527
+ },
1528
+ /&#x?[\da-f]{1,8};/i
1529
+ ]
1530
+ };
1531
+ Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity'];
1532
+ Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1533
+ Prism.hooks.add('wrap', function (env) {
1534
+ if (env.type === 'entity') {
1535
+ env.attributes['title'] = env.content.replace(/&amp;/, '&');
1536
+ }
1537
+ });
1538
+ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1539
+ value: function addInlined(tagName, lang) {
1540
+ var includedCdataInside = {};
1541
+ includedCdataInside['language-' + lang] = {
1542
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1543
+ lookbehind: true,
1544
+ inside: Prism.languages[lang]
1545
+ };
1546
+ includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1547
+ var inside = {
1548
+ 'included-cdata': {
1549
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1550
+ inside: includedCdataInside
1551
+ }
1552
+ };
1553
+ inside['language-' + lang] = {
1554
+ pattern: /[\s\S]+/,
1555
+ inside: Prism.languages[lang]
1556
+ };
1557
+ var def = {};
1558
+ def[tagName] = {
1559
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () {
1560
+ return tagName;
1561
+ }), 'i'),
1562
+ lookbehind: true,
1563
+ greedy: true,
1564
+ inside: inside
1565
+ };
1566
+ Prism.languages.insertBefore('markup', 'cdata', def);
1567
+ }
1568
+ });
1569
+ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1570
+ value: function (attrName, lang) {
1571
+ Prism.languages.markup.tag.inside['special-attr'].push({
1572
+ pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'),
1573
+ lookbehind: true,
1574
+ inside: {
1575
+ 'attr-name': /^[^\s=]+/,
1576
+ 'attr-value': {
1577
+ pattern: /=[\s\S]+/,
1578
+ inside: {
1579
+ 'value': {
1580
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
2115
1581
  lookbehind: true,
2116
- greedy: true,
2117
- inside: { 'interpolation': interpolation }
2118
- }
2119
- ],
2120
- 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
2121
- 'symbol': {
2122
- pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,
2123
- lookbehind: true
2124
- },
2125
- 'method-definition': {
2126
- pattern: /(\bdef\s+)[\w.]+/,
2127
- lookbehind: true,
2128
- inside: {
2129
- 'function': /\w+$/,
2130
- rest: Prism.languages.ruby
2131
- }
1582
+ alias: [
1583
+ lang,
1584
+ 'language-' + lang
1585
+ ],
1586
+ inside: Prism.languages[lang]
1587
+ },
1588
+ 'punctuation': [
1589
+ {
1590
+ pattern: /^=/,
1591
+ alias: 'attr-equals'
1592
+ },
1593
+ /"|'/
1594
+ ]
2132
1595
  }
2133
- });
2134
- Prism.languages.insertBefore('ruby', 'number', {
2135
- 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
2136
- 'constant': /\b[A-Z]\w*(?:[?!]|\b)/
2137
- });
2138
- Prism.languages.ruby.string = [
2139
- {
2140
- pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [
2141
- /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2142
- /\((?:[^()\\]|\\[\s\S])*\)/.source,
2143
- /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2144
- /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2145
- /<(?:[^<>\\]|\\[\s\S])*>/.source
2146
- ].join('|') + ')'),
2147
- greedy: true,
2148
- inside: { 'interpolation': interpolation }
2149
- },
2150
- {
2151
- pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2152
- greedy: true,
2153
- inside: { 'interpolation': interpolation }
2154
- },
2155
- {
2156
- pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2157
- alias: 'heredoc-string',
2158
- greedy: true,
2159
- inside: {
2160
- 'delimiter': {
2161
- pattern: /^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,
2162
- alias: 'symbol',
2163
- inside: { 'punctuation': /^<<[-~]?/ }
1596
+ }
1597
+ }
1598
+ });
1599
+ }
1600
+ });
1601
+ Prism.languages.html = Prism.languages.markup;
1602
+ Prism.languages.mathml = Prism.languages.markup;
1603
+ Prism.languages.svg = Prism.languages.markup;
1604
+ Prism.languages.xml = Prism.languages.extend('markup', {});
1605
+ Prism.languages.ssml = Prism.languages.xml;
1606
+ Prism.languages.atom = Prism.languages.xml;
1607
+ Prism.languages.rss = Prism.languages.xml;
1608
+ (function (Prism) {
1609
+ var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/;
1610
+ var constant = [
1611
+ {
1612
+ pattern: /\b(?:false|true)\b/i,
1613
+ alias: 'boolean'
1614
+ },
1615
+ {
1616
+ pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
1617
+ greedy: true,
1618
+ lookbehind: true
1619
+ },
1620
+ {
1621
+ pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
1622
+ greedy: true,
1623
+ lookbehind: true
1624
+ },
1625
+ /\b(?:null)\b/i,
1626
+ /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/
1627
+ ];
1628
+ var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i;
1629
+ var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
1630
+ var punctuation = /[{}\[\](),:;]/;
1631
+ Prism.languages.php = {
1632
+ 'delimiter': {
1633
+ pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
1634
+ alias: 'important'
1635
+ },
1636
+ 'comment': comment,
1637
+ 'variable': /\$+(?:\w+\b|(?=\{))/i,
1638
+ 'package': {
1639
+ pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1640
+ lookbehind: true,
1641
+ inside: { 'punctuation': /\\/ }
1642
+ },
1643
+ 'class-name-definition': {
1644
+ pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
1645
+ lookbehind: true,
1646
+ alias: 'class-name'
1647
+ },
1648
+ 'function-definition': {
1649
+ pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
1650
+ lookbehind: true,
1651
+ alias: 'function'
1652
+ },
1653
+ 'keyword': [
1654
+ {
1655
+ pattern: /(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,
1656
+ alias: 'type-casting',
1657
+ greedy: true,
1658
+ lookbehind: true
1659
+ },
1660
+ {
1661
+ pattern: /([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,
1662
+ alias: 'type-hint',
1663
+ greedy: true,
1664
+ lookbehind: true
1665
+ },
1666
+ {
1667
+ pattern: /([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,
1668
+ alias: 'type-hint',
1669
+ greedy: true,
1670
+ lookbehind: true
1671
+ },
1672
+ {
1673
+ pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,
1674
+ alias: 'return-type',
1675
+ greedy: true,
1676
+ lookbehind: true
1677
+ },
1678
+ {
1679
+ pattern: /(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,
1680
+ alias: 'return-type',
1681
+ greedy: true,
1682
+ lookbehind: true
1683
+ },
1684
+ {
1685
+ pattern: /\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,
1686
+ alias: 'type-declaration',
1687
+ greedy: true
1688
+ },
1689
+ {
1690
+ pattern: /(\|\s*)(?:null|false)\b/i,
1691
+ alias: 'type-declaration',
1692
+ greedy: true,
1693
+ lookbehind: true
1694
+ },
1695
+ {
1696
+ pattern: /\b(?:parent|self|static)(?=\s*::)/i,
1697
+ alias: 'static-context',
1698
+ greedy: true
1699
+ },
1700
+ {
1701
+ pattern: /(\byield\s+)from\b/i,
1702
+ lookbehind: true
1703
+ },
1704
+ /\bclass\b/i,
1705
+ {
1706
+ pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
1707
+ lookbehind: true
1708
+ }
1709
+ ],
1710
+ 'argument-name': {
1711
+ pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,
1712
+ lookbehind: true
1713
+ },
1714
+ 'class-name': [
1715
+ {
1716
+ pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
1717
+ greedy: true,
1718
+ lookbehind: true
1719
+ },
1720
+ {
1721
+ pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
1722
+ greedy: true,
1723
+ lookbehind: true
1724
+ },
1725
+ {
1726
+ pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
1727
+ greedy: true
1728
+ },
1729
+ {
1730
+ pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
1731
+ alias: 'class-name-fully-qualified',
1732
+ greedy: true,
1733
+ lookbehind: true,
1734
+ inside: { 'punctuation': /\\/ }
1735
+ },
1736
+ {
1737
+ pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
1738
+ alias: 'class-name-fully-qualified',
1739
+ greedy: true,
1740
+ inside: { 'punctuation': /\\/ }
1741
+ },
1742
+ {
1743
+ pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1744
+ alias: 'class-name-fully-qualified',
1745
+ greedy: true,
1746
+ lookbehind: true,
1747
+ inside: { 'punctuation': /\\/ }
1748
+ },
1749
+ {
1750
+ pattern: /\b[a-z_]\w*(?=\s*\$)/i,
1751
+ alias: 'type-declaration',
1752
+ greedy: true
1753
+ },
1754
+ {
1755
+ pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
1756
+ alias: [
1757
+ 'class-name-fully-qualified',
1758
+ 'type-declaration'
1759
+ ],
1760
+ greedy: true,
1761
+ inside: { 'punctuation': /\\/ }
1762
+ },
1763
+ {
1764
+ pattern: /\b[a-z_]\w*(?=\s*::)/i,
1765
+ alias: 'static-context',
1766
+ greedy: true
1767
+ },
1768
+ {
1769
+ pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
1770
+ alias: [
1771
+ 'class-name-fully-qualified',
1772
+ 'static-context'
1773
+ ],
1774
+ greedy: true,
1775
+ inside: { 'punctuation': /\\/ }
1776
+ },
1777
+ {
1778
+ pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
1779
+ alias: 'type-hint',
1780
+ greedy: true,
1781
+ lookbehind: true
1782
+ },
1783
+ {
1784
+ pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
1785
+ alias: [
1786
+ 'class-name-fully-qualified',
1787
+ 'type-hint'
1788
+ ],
1789
+ greedy: true,
1790
+ lookbehind: true,
1791
+ inside: { 'punctuation': /\\/ }
1792
+ },
1793
+ {
1794
+ pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
1795
+ alias: 'return-type',
1796
+ greedy: true,
1797
+ lookbehind: true
1798
+ },
1799
+ {
1800
+ pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1801
+ alias: [
1802
+ 'class-name-fully-qualified',
1803
+ 'return-type'
1804
+ ],
1805
+ greedy: true,
1806
+ lookbehind: true,
1807
+ inside: { 'punctuation': /\\/ }
1808
+ }
1809
+ ],
1810
+ 'constant': constant,
1811
+ 'function': {
1812
+ pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
1813
+ lookbehind: true,
1814
+ inside: { 'punctuation': /\\/ }
1815
+ },
1816
+ 'property': {
1817
+ pattern: /(->\s*)\w+/,
1818
+ lookbehind: true
1819
+ },
1820
+ 'number': number,
1821
+ 'operator': operator,
1822
+ 'punctuation': punctuation
1823
+ };
1824
+ var string_interpolation = {
1825
+ pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
1826
+ lookbehind: true,
1827
+ inside: Prism.languages.php
1828
+ };
1829
+ var string = [
1830
+ {
1831
+ pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
1832
+ alias: 'nowdoc-string',
1833
+ greedy: true,
1834
+ inside: {
1835
+ 'delimiter': {
1836
+ pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
1837
+ alias: 'symbol',
1838
+ inside: { 'punctuation': /^<<<'?|[';]$/ }
1839
+ }
1840
+ }
1841
+ },
1842
+ {
1843
+ pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
1844
+ alias: 'heredoc-string',
1845
+ greedy: true,
1846
+ inside: {
1847
+ 'delimiter': {
1848
+ pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
1849
+ alias: 'symbol',
1850
+ inside: { 'punctuation': /^<<<"?|[";]$/ }
1851
+ },
1852
+ 'interpolation': string_interpolation
1853
+ }
1854
+ },
1855
+ {
1856
+ pattern: /`(?:\\[\s\S]|[^\\`])*`/,
1857
+ alias: 'backtick-quoted-string',
1858
+ greedy: true
1859
+ },
1860
+ {
1861
+ pattern: /'(?:\\[\s\S]|[^\\'])*'/,
1862
+ alias: 'single-quoted-string',
1863
+ greedy: true
1864
+ },
1865
+ {
1866
+ pattern: /"(?:\\[\s\S]|[^\\"])*"/,
1867
+ alias: 'double-quoted-string',
1868
+ greedy: true,
1869
+ inside: { 'interpolation': string_interpolation }
1870
+ }
1871
+ ];
1872
+ Prism.languages.insertBefore('php', 'variable', {
1873
+ 'string': string,
1874
+ 'attribute': {
1875
+ pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
1876
+ greedy: true,
1877
+ inside: {
1878
+ 'attribute-content': {
1879
+ pattern: /^(#\[)[\s\S]+(?=\]$)/,
1880
+ lookbehind: true,
1881
+ inside: {
1882
+ 'comment': comment,
1883
+ 'string': string,
1884
+ 'attribute-class-name': [
1885
+ {
1886
+ pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
1887
+ alias: 'class-name',
1888
+ greedy: true,
1889
+ lookbehind: true
2164
1890
  },
2165
- 'interpolation': interpolation
2166
- }
2167
- },
2168
- {
2169
- pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2170
- alias: 'heredoc-string',
2171
- greedy: true,
2172
- inside: {
2173
- 'delimiter': {
2174
- pattern: /^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,
2175
- alias: 'symbol',
2176
- inside: { 'punctuation': /^<<[-~]?'|'$/ }
1891
+ {
1892
+ pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
1893
+ alias: [
1894
+ 'class-name',
1895
+ 'class-name-fully-qualified'
1896
+ ],
1897
+ greedy: true,
1898
+ lookbehind: true,
1899
+ inside: { 'punctuation': /\\/ }
2177
1900
  }
2178
- }
1901
+ ],
1902
+ 'constant': constant,
1903
+ 'number': number,
1904
+ 'operator': operator,
1905
+ 'punctuation': punctuation
2179
1906
  }
2180
- ];
2181
- Prism.languages.rb = Prism.languages.ruby;
2182
- }(Prism));
1907
+ },
1908
+ 'delimiter': {
1909
+ pattern: /^#\[|\]$/,
1910
+ alias: 'punctuation'
1911
+ }
1912
+ }
1913
+ }
1914
+ });
1915
+ Prism.hooks.add('before-tokenize', function (env) {
1916
+ if (!/<\?/.test(env.code)) {
1917
+ return;
1918
+ }
1919
+ var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi;
1920
+ Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
1921
+ });
1922
+ Prism.hooks.add('after-tokenize', function (env) {
1923
+ Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php');
1924
+ });
1925
+ }(Prism));
1926
+ Prism.languages.python = {
1927
+ 'comment': {
1928
+ pattern: /(^|[^\\])#.*/,
1929
+ lookbehind: true
1930
+ },
1931
+ 'string-interpolation': {
1932
+ pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1933
+ greedy: true,
1934
+ inside: {
1935
+ 'interpolation': {
1936
+ pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
1937
+ lookbehind: true,
1938
+ inside: {
1939
+ 'format-spec': {
1940
+ pattern: /(:)[^:(){}]+(?=\}$)/,
1941
+ lookbehind: true
1942
+ },
1943
+ 'conversion-option': {
1944
+ pattern: /![sra](?=[:}]$)/,
1945
+ alias: 'punctuation'
1946
+ },
1947
+ rest: null
1948
+ }
1949
+ },
1950
+ 'string': /[\s\S]+/
1951
+ }
1952
+ },
1953
+ 'triple-quoted-string': {
1954
+ pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,
1955
+ greedy: true,
1956
+ alias: 'string'
1957
+ },
1958
+ 'string': {
1959
+ pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
1960
+ greedy: true
1961
+ },
1962
+ 'function': {
1963
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
1964
+ lookbehind: true
1965
+ },
1966
+ 'class-name': {
1967
+ pattern: /(\bclass\s+)\w+/i,
1968
+ lookbehind: true
1969
+ },
1970
+ 'decorator': {
1971
+ pattern: /(^[\t ]*)@\w+(?:\.\w+)*/im,
1972
+ lookbehind: true,
1973
+ alias: [
1974
+ 'annotation',
1975
+ 'punctuation'
1976
+ ],
1977
+ inside: { 'punctuation': /\./ }
1978
+ },
1979
+ 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
1980
+ 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
1981
+ 'boolean': /\b(?:True|False|None)\b/,
1982
+ 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?\b/i,
1983
+ 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
1984
+ 'punctuation': /[{}[\];(),.:]/
1985
+ };
1986
+ Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
1987
+ Prism.languages.py = Prism.languages.python;
1988
+ (function (Prism) {
1989
+ Prism.languages.ruby = Prism.languages.extend('clike', {
1990
+ 'comment': [
1991
+ /#.*/,
1992
+ {
1993
+ pattern: /^=begin\s[\s\S]*?^=end/m,
1994
+ greedy: true
1995
+ }
1996
+ ],
1997
+ 'class-name': {
1998
+ pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,
1999
+ lookbehind: true,
2000
+ inside: { 'punctuation': /[.\\]/ }
2183
2001
  },
2184
- {}
2185
- ],
2186
- 14: [
2187
- function (require, module, exports) {
2188
- var Prism = require('prismjs/components/prism-core');
2189
- require('prismjs/components/prism-clike');
2190
- require('prismjs/components/prism-markup-templating');
2191
- require('prismjs/components/prism-c');
2192
- require('prismjs/components/prism-cpp');
2193
- require('prismjs/components/prism-csharp');
2194
- require('prismjs/components/prism-css');
2195
- require('prismjs/components/prism-java');
2196
- require('prismjs/components/prism-javascript');
2197
- require('prismjs/components/prism-markup');
2198
- require('prismjs/components/prism-php');
2199
- require('prismjs/components/prism-python');
2200
- require('prismjs/components/prism-ruby');
2201
- module.exports = { boltExport: Prism };
2002
+ 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/
2003
+ });
2004
+ var interpolation = {
2005
+ pattern: /#\{[^}]+\}/,
2006
+ inside: {
2007
+ 'delimiter': {
2008
+ pattern: /^#\{|\}$/,
2009
+ alias: 'tag'
2010
+ },
2011
+ rest: Prism.languages.ruby
2012
+ }
2013
+ };
2014
+ delete Prism.languages.ruby.function;
2015
+ Prism.languages.insertBefore('ruby', 'keyword', {
2016
+ 'regex': [
2017
+ {
2018
+ pattern: RegExp(/%r/.source + '(?:' + [
2019
+ /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2020
+ /\((?:[^()\\]|\\[\s\S])*\)/.source,
2021
+ /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2022
+ /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2023
+ /<(?:[^<>\\]|\\[\s\S])*>/.source
2024
+ ].join('|') + ')' + /[egimnosux]{0,6}/.source),
2025
+ greedy: true,
2026
+ inside: { 'interpolation': interpolation }
2027
+ },
2028
+ {
2029
+ pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
2030
+ lookbehind: true,
2031
+ greedy: true,
2032
+ inside: { 'interpolation': interpolation }
2033
+ }
2034
+ ],
2035
+ 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
2036
+ 'symbol': {
2037
+ pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,
2038
+ lookbehind: true
2039
+ },
2040
+ 'method-definition': {
2041
+ pattern: /(\bdef\s+)[\w.]+/,
2042
+ lookbehind: true,
2043
+ inside: {
2044
+ 'function': /\w+$/,
2045
+ rest: Prism.languages.ruby
2046
+ }
2047
+ }
2048
+ });
2049
+ Prism.languages.insertBefore('ruby', 'number', {
2050
+ 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
2051
+ 'constant': /\b[A-Z]\w*(?:[?!]|\b)/
2052
+ });
2053
+ Prism.languages.ruby.string = [
2054
+ {
2055
+ pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [
2056
+ /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2057
+ /\((?:[^()\\]|\\[\s\S])*\)/.source,
2058
+ /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2059
+ /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2060
+ /<(?:[^<>\\]|\\[\s\S])*>/.source
2061
+ ].join('|') + ')'),
2062
+ greedy: true,
2063
+ inside: { 'interpolation': interpolation }
2064
+ },
2065
+ {
2066
+ pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2067
+ greedy: true,
2068
+ inside: { 'interpolation': interpolation }
2069
+ },
2070
+ {
2071
+ pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2072
+ alias: 'heredoc-string',
2073
+ greedy: true,
2074
+ inside: {
2075
+ 'delimiter': {
2076
+ pattern: /^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,
2077
+ alias: 'symbol',
2078
+ inside: { 'punctuation': /^<<[-~]?/ }
2079
+ },
2080
+ 'interpolation': interpolation
2081
+ }
2202
2082
  },
2203
2083
  {
2204
- 'prismjs/components/prism-c': 1,
2205
- 'prismjs/components/prism-clike': 2,
2206
- 'prismjs/components/prism-core': 3,
2207
- 'prismjs/components/prism-cpp': 4,
2208
- 'prismjs/components/prism-csharp': 5,
2209
- 'prismjs/components/prism-css': 6,
2210
- 'prismjs/components/prism-java': 7,
2211
- 'prismjs/components/prism-javascript': 8,
2212
- 'prismjs/components/prism-markup': 10,
2213
- 'prismjs/components/prism-markup-templating': 9,
2214
- 'prismjs/components/prism-php': 11,
2215
- 'prismjs/components/prism-python': 12,
2216
- 'prismjs/components/prism-ruby': 13
2084
+ pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2085
+ alias: 'heredoc-string',
2086
+ greedy: true,
2087
+ inside: {
2088
+ 'delimiter': {
2089
+ pattern: /^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,
2090
+ alias: 'symbol',
2091
+ inside: { 'punctuation': /^<<[-~]?'|'$/ }
2092
+ }
2093
+ }
2217
2094
  }
2218
- ]
2219
- }, {}, [14])(14);
2095
+ ];
2096
+ Prism.languages.rb = Prism.languages.ruby;
2097
+ }(Prism));
2098
+ var Prism$1 = prismCore.exports;
2099
+ var prismjs = { boltExport: Prism$1 };
2100
+ return prismjs;
2220
2101
  }));
2221
2102
  var prism = window.Prism;
2222
2103
  window.Prism = oldprism;
2223
2104
  return prism;
2224
- }(undefined, exports$1, module, undefined));
2105
+ }(undefined, exports$1, module));
2225
2106
  var Prism$1 = module.exports.boltExport;
2226
2107
 
2227
2108
  var getLanguages$1 = function (editor) {