react-ai-renderer 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5775,126 +5775,134 @@ function c(Prism) {
5775
5775
  delete Prism.languages.c['boolean'];
5776
5776
  }
5777
5777
 
5778
- var refractorC$1 = c_1;
5779
- var cpp_1 = cpp;
5780
- cpp.displayName = 'cpp';
5781
- cpp.aliases = [];
5782
- function cpp(Prism) {
5783
- Prism.register(refractorC$1)
5784
- ;(function (Prism) {
5785
- var keyword =
5786
- /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_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|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
5787
- var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(
5788
- /<keyword>/g,
5789
- function () {
5790
- return keyword.source
5791
- }
5792
- );
5793
- Prism.languages.cpp = Prism.languages.extend('c', {
5794
- 'class-name': [
5795
- {
5796
- pattern: RegExp(
5797
- /(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(
5798
- /<keyword>/g,
5799
- function () {
5800
- return keyword.source
5801
- }
5802
- )
5803
- ),
5804
- lookbehind: true
5805
- }, // This is intended to capture the class name of method implementations like:
5806
- // void foo::bar() const {}
5807
- // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
5808
- // it starts with an uppercase letter. This approximation should give decent results.
5809
- /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, // This will capture the class name before destructors like:
5810
- // Foo::~Foo() {}
5811
- /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, // This also intends to capture the class name of method implementations but here the class has template
5812
- // parameters, so it can't be a namespace (until C++ adds generic namespaces).
5813
- /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
5814
- ],
5815
- keyword: keyword,
5816
- number: {
5817
- pattern:
5818
- /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
5819
- greedy: true
5820
- },
5821
- operator:
5822
- />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
5823
- boolean: /\b(?:false|true)\b/
5824
- });
5825
- Prism.languages.insertBefore('cpp', 'string', {
5826
- module: {
5827
- // https://en.cppreference.com/w/cpp/language/modules
5828
- pattern: RegExp(
5829
- /(\b(?:import|module)\s+)/.source +
5830
- '(?:' + // header-name
5831
- /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source +
5832
- '|' + // module name or partition or both
5833
- /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(
5834
- /<mod-name>/g,
5835
- function () {
5836
- return modName
5837
- }
5838
- ) +
5839
- ')'
5840
- ),
5841
- lookbehind: true,
5842
- greedy: true,
5843
- inside: {
5844
- string: /^[<"][\s\S]+/,
5845
- operator: /:/,
5846
- punctuation: /\./
5847
- }
5848
- },
5849
- 'raw-string': {
5850
- pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
5851
- alias: 'string',
5852
- greedy: true
5853
- }
5854
- });
5855
- Prism.languages.insertBefore('cpp', 'keyword', {
5856
- 'generic-function': {
5857
- pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
5858
- inside: {
5859
- function: /^\w+/,
5860
- generic: {
5861
- pattern: /<[\s\S]+/,
5862
- alias: 'class-name',
5863
- inside: Prism.languages.cpp
5864
- }
5865
- }
5866
- }
5867
- });
5868
- Prism.languages.insertBefore('cpp', 'operator', {
5869
- 'double-colon': {
5870
- pattern: /::/,
5871
- alias: 'punctuation'
5872
- }
5873
- });
5874
- Prism.languages.insertBefore('cpp', 'class-name', {
5875
- // the base clause is an optional list of parent classes
5876
- // https://en.cppreference.com/w/cpp/language/class
5877
- 'base-clause': {
5878
- pattern:
5879
- /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
5880
- lookbehind: true,
5881
- greedy: true,
5882
- inside: Prism.languages.extend('cpp', {})
5883
- }
5884
- });
5885
- Prism.languages.insertBefore(
5886
- 'inside',
5887
- 'double-colon',
5888
- {
5889
- // All untokenized words that are not namespaces should be class names
5890
- 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i
5891
- },
5892
- Prism.languages.cpp['base-clause']
5893
- );
5894
- })(Prism);
5778
+ var cpp_1;
5779
+ var hasRequiredCpp;
5780
+
5781
+ function requireCpp () {
5782
+ if (hasRequiredCpp) return cpp_1;
5783
+ hasRequiredCpp = 1;
5784
+ var refractorC = c_1;
5785
+ cpp_1 = cpp;
5786
+ cpp.displayName = 'cpp';
5787
+ cpp.aliases = [];
5788
+ function cpp(Prism) {
5789
+ Prism.register(refractorC)
5790
+ ;(function (Prism) {
5791
+ var keyword =
5792
+ /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_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|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
5793
+ var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(
5794
+ /<keyword>/g,
5795
+ function () {
5796
+ return keyword.source
5797
+ }
5798
+ );
5799
+ Prism.languages.cpp = Prism.languages.extend('c', {
5800
+ 'class-name': [
5801
+ {
5802
+ pattern: RegExp(
5803
+ /(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(
5804
+ /<keyword>/g,
5805
+ function () {
5806
+ return keyword.source
5807
+ }
5808
+ )
5809
+ ),
5810
+ lookbehind: true
5811
+ }, // This is intended to capture the class name of method implementations like:
5812
+ // void foo::bar() const {}
5813
+ // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
5814
+ // it starts with an uppercase letter. This approximation should give decent results.
5815
+ /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, // This will capture the class name before destructors like:
5816
+ // Foo::~Foo() {}
5817
+ /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, // This also intends to capture the class name of method implementations but here the class has template
5818
+ // parameters, so it can't be a namespace (until C++ adds generic namespaces).
5819
+ /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
5820
+ ],
5821
+ keyword: keyword,
5822
+ number: {
5823
+ pattern:
5824
+ /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
5825
+ greedy: true
5826
+ },
5827
+ operator:
5828
+ />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
5829
+ boolean: /\b(?:false|true)\b/
5830
+ });
5831
+ Prism.languages.insertBefore('cpp', 'string', {
5832
+ module: {
5833
+ // https://en.cppreference.com/w/cpp/language/modules
5834
+ pattern: RegExp(
5835
+ /(\b(?:import|module)\s+)/.source +
5836
+ '(?:' + // header-name
5837
+ /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source +
5838
+ '|' + // module name or partition or both
5839
+ /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(
5840
+ /<mod-name>/g,
5841
+ function () {
5842
+ return modName
5843
+ }
5844
+ ) +
5845
+ ')'
5846
+ ),
5847
+ lookbehind: true,
5848
+ greedy: true,
5849
+ inside: {
5850
+ string: /^[<"][\s\S]+/,
5851
+ operator: /:/,
5852
+ punctuation: /\./
5853
+ }
5854
+ },
5855
+ 'raw-string': {
5856
+ pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
5857
+ alias: 'string',
5858
+ greedy: true
5859
+ }
5860
+ });
5861
+ Prism.languages.insertBefore('cpp', 'keyword', {
5862
+ 'generic-function': {
5863
+ pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
5864
+ inside: {
5865
+ function: /^\w+/,
5866
+ generic: {
5867
+ pattern: /<[\s\S]+/,
5868
+ alias: 'class-name',
5869
+ inside: Prism.languages.cpp
5870
+ }
5871
+ }
5872
+ }
5873
+ });
5874
+ Prism.languages.insertBefore('cpp', 'operator', {
5875
+ 'double-colon': {
5876
+ pattern: /::/,
5877
+ alias: 'punctuation'
5878
+ }
5879
+ });
5880
+ Prism.languages.insertBefore('cpp', 'class-name', {
5881
+ // the base clause is an optional list of parent classes
5882
+ // https://en.cppreference.com/w/cpp/language/class
5883
+ 'base-clause': {
5884
+ pattern:
5885
+ /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
5886
+ lookbehind: true,
5887
+ greedy: true,
5888
+ inside: Prism.languages.extend('cpp', {})
5889
+ }
5890
+ });
5891
+ Prism.languages.insertBefore(
5892
+ 'inside',
5893
+ 'double-colon',
5894
+ {
5895
+ // All untokenized words that are not namespaces should be class names
5896
+ 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i
5897
+ },
5898
+ Prism.languages.cpp['base-clause']
5899
+ );
5900
+ })(Prism);
5901
+ }
5902
+ return cpp_1;
5895
5903
  }
5896
5904
 
5897
- var refractorCpp$1 = cpp_1;
5905
+ var refractorCpp$1 = requireCpp();
5898
5906
  var arduino_1 = arduino;
5899
5907
  arduino.displayName = 'arduino';
5900
5908
  arduino.aliases = ['ino'];
@@ -6238,475 +6246,484 @@ function asmatmel(Prism) {
6238
6246
  };
6239
6247
  }
6240
6248
 
6241
- var csharp_1 = csharp;
6242
- csharp.displayName = 'csharp';
6243
- csharp.aliases = ['dotnet', 'cs'];
6244
- function csharp(Prism) {
6249
+ var csharp_1;
6250
+ var hasRequiredCsharp;
6251
+
6252
+ function requireCsharp () {
6253
+ if (hasRequiredCsharp) return csharp_1;
6254
+ hasRequiredCsharp = 1;
6255
+
6256
+ csharp_1 = csharp;
6257
+ csharp.displayName = 'csharp';
6258
+ csharp.aliases = ['dotnet', 'cs'];
6259
+ function csharp(Prism) {
6245
6260
  (function (Prism) {
6246
- /**
6247
- * Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
6248
- *
6249
- * Note: This is a simple text based replacement. Be careful when using backreferences!
6250
- *
6251
- * @param {string} pattern the given pattern.
6252
- * @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
6253
- * @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
6254
- * @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
6255
- */
6256
- function replace(pattern, replacements) {
6257
- return pattern.replace(/<<(\d+)>>/g, function (m, index) {
6258
- return '(?:' + replacements[+index] + ')'
6259
- })
6260
- }
6261
- /**
6262
- * @param {string} pattern
6263
- * @param {string[]} replacements
6264
- * @param {string} [flags]
6265
- * @returns {RegExp}
6266
- */
6267
- function re(pattern, replacements, flags) {
6268
- return RegExp(replace(pattern, replacements), flags || '')
6269
- }
6270
- /**
6271
- * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
6272
- *
6273
- * @param {string} pattern
6274
- * @param {number} depthLog2
6275
- * @returns {string}
6276
- */
6277
- function nested(pattern, depthLog2) {
6278
- for (var i = 0; i < depthLog2; i++) {
6279
- pattern = pattern.replace(/<<self>>/g, function () {
6280
- return '(?:' + pattern + ')'
6281
- });
6282
- }
6283
- return pattern.replace(/<<self>>/g, '[^\\s\\S]')
6284
- } // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
6285
- var keywordKinds = {
6286
- // keywords which represent a return or variable type
6287
- type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
6288
- // keywords which are used to declare a type
6289
- typeDeclaration: 'class enum interface record struct',
6290
- // contextual keywords
6291
- // ("var" and "dynamic" are missing because they are used like types)
6292
- contextual:
6293
- '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*{)',
6294
- // all other keywords
6295
- other:
6296
- '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'
6297
- }; // keywords
6298
- function keywordsToPattern(words) {
6299
- return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'
6300
- }
6301
- var typeDeclarationKeywords = keywordsToPattern(
6302
- keywordKinds.typeDeclaration
6303
- );
6304
- var keywords = RegExp(
6305
- keywordsToPattern(
6306
- keywordKinds.type +
6307
- ' ' +
6308
- keywordKinds.typeDeclaration +
6309
- ' ' +
6310
- keywordKinds.contextual +
6311
- ' ' +
6312
- keywordKinds.other
6313
- )
6314
- );
6315
- var nonTypeKeywords = keywordsToPattern(
6316
- keywordKinds.typeDeclaration +
6317
- ' ' +
6318
- keywordKinds.contextual +
6319
- ' ' +
6320
- keywordKinds.other
6321
- );
6322
- var nonContextualKeywords = keywordsToPattern(
6323
- keywordKinds.type +
6324
- ' ' +
6325
- keywordKinds.typeDeclaration +
6326
- ' ' +
6327
- keywordKinds.other
6328
- ); // types
6329
- var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
6330
- var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
6331
- var name = /@?\b[A-Za-z_]\w*\b/.source;
6332
- var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]);
6333
- var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
6334
- nonTypeKeywords,
6335
- genericName
6336
- ]);
6337
- var array = /\[\s*(?:,\s*)*\]/.source;
6338
- var typeExpressionWithoutTuple = replace(
6339
- /<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,
6340
- [identifier, array]
6341
- );
6342
- var tupleElement = replace(
6343
- /[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,
6344
- [generic, nestedRound, array]
6345
- );
6346
- var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
6347
- var typeExpression = replace(
6348
- /(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,
6349
- [tuple, identifier, array]
6350
- );
6351
- var typeInside = {
6352
- keyword: keywords,
6353
- punctuation: /[<>()?,.:[\]]/
6354
- }; // strings & characters
6355
- // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
6356
- // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
6357
- var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; // simplified pattern
6358
- var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
6359
- var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
6360
- Prism.languages.csharp = Prism.languages.extend('clike', {
6361
- string: [
6362
- {
6363
- pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
6364
- lookbehind: true,
6365
- greedy: true
6366
- },
6367
- {
6368
- pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
6369
- lookbehind: true,
6370
- greedy: true
6371
- }
6372
- ],
6373
- 'class-name': [
6374
- {
6375
- // Using static
6376
- // using static System.Math;
6377
- pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [
6378
- identifier
6379
- ]),
6380
- lookbehind: true,
6381
- inside: typeInside
6382
- },
6383
- {
6384
- // Using alias (type)
6385
- // using Project = PC.MyCompany.Project;
6386
- pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
6387
- name,
6388
- typeExpression
6389
- ]),
6390
- lookbehind: true,
6391
- inside: typeInside
6392
- },
6393
- {
6394
- // Using alias (alias)
6395
- // using Project = PC.MyCompany.Project;
6396
- pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
6397
- lookbehind: true
6398
- },
6399
- {
6400
- // Type declarations
6401
- // class Foo<A, B>
6402
- // interface Foo<out A, B>
6403
- pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
6404
- typeDeclarationKeywords,
6405
- genericName
6406
- ]),
6407
- lookbehind: true,
6408
- inside: typeInside
6409
- },
6410
- {
6411
- // Single catch exception declaration
6412
- // catch(Foo)
6413
- // (things like catch(Foo e) is covered by variable declaration)
6414
- pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
6415
- lookbehind: true,
6416
- inside: typeInside
6417
- },
6418
- {
6419
- // Name of the type parameter of generic constraints
6420
- // where Foo : class
6421
- pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
6422
- lookbehind: true
6423
- },
6424
- {
6425
- // Casts and checks via as and is.
6426
- // as Foo<A>, is Bar<B>
6427
- // (things like if(a is Foo b) is covered by variable declaration)
6428
- pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [
6429
- typeExpressionWithoutTuple
6430
- ]),
6431
- lookbehind: true,
6432
- inside: typeInside
6433
- },
6434
- {
6435
- // Variable, field and parameter declaration
6436
- // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
6437
- pattern: re(
6438
- /\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/
6439
- .source,
6440
- [typeExpression, nonContextualKeywords, name]
6441
- ),
6442
- inside: typeInside
6443
- }
6444
- ],
6445
- keyword: keywords,
6446
- // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
6447
- number:
6448
- /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
6449
- operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
6450
- punctuation: /\?\.?|::|[{}[\];(),.:]/
6451
- });
6452
- Prism.languages.insertBefore('csharp', 'number', {
6453
- range: {
6454
- pattern: /\.\./,
6455
- alias: 'operator'
6456
- }
6457
- });
6458
- Prism.languages.insertBefore('csharp', 'punctuation', {
6459
- 'named-parameter': {
6460
- pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
6461
- lookbehind: true,
6462
- alias: 'punctuation'
6463
- }
6464
- });
6465
- Prism.languages.insertBefore('csharp', 'class-name', {
6466
- namespace: {
6467
- // namespace Foo.Bar {}
6468
- // using Foo.Bar;
6469
- pattern: re(
6470
- /(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,
6471
- [name]
6472
- ),
6473
- lookbehind: true,
6474
- inside: {
6475
- punctuation: /\./
6476
- }
6477
- },
6478
- 'type-expression': {
6479
- // default(Foo), typeof(Foo<Bar>), sizeof(int)
6480
- pattern: re(
6481
- /(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/
6482
- .source,
6483
- [nestedRound]
6484
- ),
6485
- lookbehind: true,
6486
- alias: 'class-name',
6487
- inside: typeInside
6488
- },
6489
- 'return-type': {
6490
- // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
6491
- // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
6492
- // int Foo => 0; int Foo { get; set } = 0;
6493
- pattern: re(
6494
- /<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,
6495
- [typeExpression, identifier]
6496
- ),
6497
- inside: typeInside,
6498
- alias: 'class-name'
6499
- },
6500
- 'constructor-invocation': {
6501
- // new List<Foo<Bar[]>> { }
6502
- pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
6503
- lookbehind: true,
6504
- inside: typeInside,
6505
- alias: 'class-name'
6506
- },
6507
- /*'explicit-implementation': {
6508
- // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
6509
- pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
6510
- inside: classNameInside,
6511
- alias: 'class-name'
6512
- },*/
6513
- 'generic-method': {
6514
- // foo<Bar>()
6515
- pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]),
6516
- inside: {
6517
- function: re(/^<<0>>/.source, [name]),
6518
- generic: {
6519
- pattern: RegExp(generic),
6520
- alias: 'class-name',
6521
- inside: typeInside
6522
- }
6523
- }
6524
- },
6525
- 'type-list': {
6526
- // The list of types inherited or of generic constraints
6527
- // class Foo<F> : Bar, IList<FooBar>
6528
- // where F : Bar, IList<int>
6529
- pattern: re(
6530
- /\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|[{;]|=>|$))/
6531
- .source,
6532
- [
6533
- typeDeclarationKeywords,
6534
- genericName,
6535
- name,
6536
- typeExpression,
6537
- keywords.source,
6538
- nestedRound,
6539
- /\bnew\s*\(\s*\)/.source
6540
- ]
6541
- ),
6542
- lookbehind: true,
6543
- inside: {
6544
- 'record-arguments': {
6545
- pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
6546
- genericName,
6547
- nestedRound
6548
- ]),
6549
- lookbehind: true,
6550
- greedy: true,
6551
- inside: Prism.languages.csharp
6552
- },
6553
- keyword: keywords,
6554
- 'class-name': {
6555
- pattern: RegExp(typeExpression),
6556
- greedy: true,
6557
- inside: typeInside
6558
- },
6559
- punctuation: /[,()]/
6560
- }
6561
- },
6562
- preprocessor: {
6563
- pattern: /(^[\t ]*)#.*/m,
6564
- lookbehind: true,
6565
- alias: 'property',
6566
- inside: {
6567
- // highlight preprocessor directives as keywords
6568
- directive: {
6569
- pattern:
6570
- /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
6571
- lookbehind: true,
6572
- alias: 'keyword'
6573
- }
6574
- }
6575
- }
6576
- }); // attributes
6577
- var regularStringOrCharacter = regularString + '|' + character;
6578
- var regularStringCharacterOrComment = replace(
6579
- /\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,
6580
- [regularStringOrCharacter]
6581
- );
6582
- var roundExpression = nested(
6583
- replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
6584
- regularStringCharacterOrComment
6585
- ]),
6586
- 2
6587
- ); // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
6588
- var attrTarget =
6589
- /\b(?:assembly|event|field|method|module|param|property|return|type)\b/
6590
- .source;
6591
- var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
6592
- identifier,
6593
- roundExpression
6594
- ]);
6595
- Prism.languages.insertBefore('csharp', 'class-name', {
6596
- attribute: {
6597
- // Attributes
6598
- // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
6599
- pattern: re(
6600
- /((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/
6601
- .source,
6602
- [attrTarget, attr]
6603
- ),
6604
- lookbehind: true,
6605
- greedy: true,
6606
- inside: {
6607
- target: {
6608
- pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
6609
- alias: 'keyword'
6610
- },
6611
- 'attribute-arguments': {
6612
- pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
6613
- inside: Prism.languages.csharp
6614
- },
6615
- 'class-name': {
6616
- pattern: RegExp(identifier),
6617
- inside: {
6618
- punctuation: /\./
6619
- }
6620
- },
6621
- punctuation: /[:,]/
6622
- }
6623
- }
6624
- }); // string interpolation
6625
- var formatString = /:[^}\r\n]+/.source; // multi line
6626
- var mInterpolationRound = nested(
6627
- replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
6628
- regularStringCharacterOrComment
6629
- ]),
6630
- 2
6631
- );
6632
- var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
6633
- mInterpolationRound,
6634
- formatString
6635
- ]); // single line
6636
- var sInterpolationRound = nested(
6637
- replace(
6638
- /[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/
6639
- .source,
6640
- [regularStringOrCharacter]
6641
- ),
6642
- 2
6643
- );
6644
- var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
6645
- sInterpolationRound,
6646
- formatString
6647
- ]);
6648
- function createInterpolationInside(interpolation, interpolationRound) {
6649
- return {
6650
- interpolation: {
6651
- pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
6652
- lookbehind: true,
6653
- inside: {
6654
- 'format-string': {
6655
- pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
6656
- interpolationRound,
6657
- formatString
6658
- ]),
6659
- lookbehind: true,
6660
- inside: {
6661
- punctuation: /^:/
6662
- }
6663
- },
6664
- punctuation: /^\{|\}$/,
6665
- expression: {
6666
- pattern: /[\s\S]+/,
6667
- alias: 'language-csharp',
6668
- inside: Prism.languages.csharp
6669
- }
6670
- }
6671
- },
6672
- string: /[\s\S]+/
6673
- }
6674
- }
6675
- Prism.languages.insertBefore('csharp', 'string', {
6676
- 'interpolation-string': [
6677
- {
6678
- pattern: re(
6679
- /(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,
6680
- [mInterpolation]
6681
- ),
6682
- lookbehind: true,
6683
- greedy: true,
6684
- inside: createInterpolationInside(mInterpolation, mInterpolationRound)
6685
- },
6686
- {
6687
- pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [
6688
- sInterpolation
6689
- ]),
6690
- lookbehind: true,
6691
- greedy: true,
6692
- inside: createInterpolationInside(sInterpolation, sInterpolationRound)
6693
- }
6694
- ],
6695
- char: {
6696
- pattern: RegExp(character),
6697
- greedy: true
6698
- }
6699
- });
6700
- Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
6701
- })(Prism);
6261
+ /**
6262
+ * Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
6263
+ *
6264
+ * Note: This is a simple text based replacement. Be careful when using backreferences!
6265
+ *
6266
+ * @param {string} pattern the given pattern.
6267
+ * @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
6268
+ * @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
6269
+ * @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
6270
+ */
6271
+ function replace(pattern, replacements) {
6272
+ return pattern.replace(/<<(\d+)>>/g, function (m, index) {
6273
+ return '(?:' + replacements[+index] + ')'
6274
+ })
6275
+ }
6276
+ /**
6277
+ * @param {string} pattern
6278
+ * @param {string[]} replacements
6279
+ * @param {string} [flags]
6280
+ * @returns {RegExp}
6281
+ */
6282
+ function re(pattern, replacements, flags) {
6283
+ return RegExp(replace(pattern, replacements), flags || '')
6284
+ }
6285
+ /**
6286
+ * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
6287
+ *
6288
+ * @param {string} pattern
6289
+ * @param {number} depthLog2
6290
+ * @returns {string}
6291
+ */
6292
+ function nested(pattern, depthLog2) {
6293
+ for (var i = 0; i < depthLog2; i++) {
6294
+ pattern = pattern.replace(/<<self>>/g, function () {
6295
+ return '(?:' + pattern + ')'
6296
+ });
6297
+ }
6298
+ return pattern.replace(/<<self>>/g, '[^\\s\\S]')
6299
+ } // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
6300
+ var keywordKinds = {
6301
+ // keywords which represent a return or variable type
6302
+ type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
6303
+ // keywords which are used to declare a type
6304
+ typeDeclaration: 'class enum interface record struct',
6305
+ // contextual keywords
6306
+ // ("var" and "dynamic" are missing because they are used like types)
6307
+ contextual:
6308
+ '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*{)',
6309
+ // all other keywords
6310
+ other:
6311
+ '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'
6312
+ }; // keywords
6313
+ function keywordsToPattern(words) {
6314
+ return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'
6315
+ }
6316
+ var typeDeclarationKeywords = keywordsToPattern(
6317
+ keywordKinds.typeDeclaration
6318
+ );
6319
+ var keywords = RegExp(
6320
+ keywordsToPattern(
6321
+ keywordKinds.type +
6322
+ ' ' +
6323
+ keywordKinds.typeDeclaration +
6324
+ ' ' +
6325
+ keywordKinds.contextual +
6326
+ ' ' +
6327
+ keywordKinds.other
6328
+ )
6329
+ );
6330
+ var nonTypeKeywords = keywordsToPattern(
6331
+ keywordKinds.typeDeclaration +
6332
+ ' ' +
6333
+ keywordKinds.contextual +
6334
+ ' ' +
6335
+ keywordKinds.other
6336
+ );
6337
+ var nonContextualKeywords = keywordsToPattern(
6338
+ keywordKinds.type +
6339
+ ' ' +
6340
+ keywordKinds.typeDeclaration +
6341
+ ' ' +
6342
+ keywordKinds.other
6343
+ ); // types
6344
+ var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
6345
+ var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
6346
+ var name = /@?\b[A-Za-z_]\w*\b/.source;
6347
+ var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]);
6348
+ var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
6349
+ nonTypeKeywords,
6350
+ genericName
6351
+ ]);
6352
+ var array = /\[\s*(?:,\s*)*\]/.source;
6353
+ var typeExpressionWithoutTuple = replace(
6354
+ /<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,
6355
+ [identifier, array]
6356
+ );
6357
+ var tupleElement = replace(
6358
+ /[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,
6359
+ [generic, nestedRound, array]
6360
+ );
6361
+ var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
6362
+ var typeExpression = replace(
6363
+ /(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,
6364
+ [tuple, identifier, array]
6365
+ );
6366
+ var typeInside = {
6367
+ keyword: keywords,
6368
+ punctuation: /[<>()?,.:[\]]/
6369
+ }; // strings & characters
6370
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
6371
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
6372
+ var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; // simplified pattern
6373
+ var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
6374
+ var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
6375
+ Prism.languages.csharp = Prism.languages.extend('clike', {
6376
+ string: [
6377
+ {
6378
+ pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
6379
+ lookbehind: true,
6380
+ greedy: true
6381
+ },
6382
+ {
6383
+ pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
6384
+ lookbehind: true,
6385
+ greedy: true
6386
+ }
6387
+ ],
6388
+ 'class-name': [
6389
+ {
6390
+ // Using static
6391
+ // using static System.Math;
6392
+ pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [
6393
+ identifier
6394
+ ]),
6395
+ lookbehind: true,
6396
+ inside: typeInside
6397
+ },
6398
+ {
6399
+ // Using alias (type)
6400
+ // using Project = PC.MyCompany.Project;
6401
+ pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
6402
+ name,
6403
+ typeExpression
6404
+ ]),
6405
+ lookbehind: true,
6406
+ inside: typeInside
6407
+ },
6408
+ {
6409
+ // Using alias (alias)
6410
+ // using Project = PC.MyCompany.Project;
6411
+ pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
6412
+ lookbehind: true
6413
+ },
6414
+ {
6415
+ // Type declarations
6416
+ // class Foo<A, B>
6417
+ // interface Foo<out A, B>
6418
+ pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
6419
+ typeDeclarationKeywords,
6420
+ genericName
6421
+ ]),
6422
+ lookbehind: true,
6423
+ inside: typeInside
6424
+ },
6425
+ {
6426
+ // Single catch exception declaration
6427
+ // catch(Foo)
6428
+ // (things like catch(Foo e) is covered by variable declaration)
6429
+ pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
6430
+ lookbehind: true,
6431
+ inside: typeInside
6432
+ },
6433
+ {
6434
+ // Name of the type parameter of generic constraints
6435
+ // where Foo : class
6436
+ pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
6437
+ lookbehind: true
6438
+ },
6439
+ {
6440
+ // Casts and checks via as and is.
6441
+ // as Foo<A>, is Bar<B>
6442
+ // (things like if(a is Foo b) is covered by variable declaration)
6443
+ pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [
6444
+ typeExpressionWithoutTuple
6445
+ ]),
6446
+ lookbehind: true,
6447
+ inside: typeInside
6448
+ },
6449
+ {
6450
+ // Variable, field and parameter declaration
6451
+ // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
6452
+ pattern: re(
6453
+ /\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/
6454
+ .source,
6455
+ [typeExpression, nonContextualKeywords, name]
6456
+ ),
6457
+ inside: typeInside
6458
+ }
6459
+ ],
6460
+ keyword: keywords,
6461
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
6462
+ number:
6463
+ /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
6464
+ operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
6465
+ punctuation: /\?\.?|::|[{}[\];(),.:]/
6466
+ });
6467
+ Prism.languages.insertBefore('csharp', 'number', {
6468
+ range: {
6469
+ pattern: /\.\./,
6470
+ alias: 'operator'
6471
+ }
6472
+ });
6473
+ Prism.languages.insertBefore('csharp', 'punctuation', {
6474
+ 'named-parameter': {
6475
+ pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
6476
+ lookbehind: true,
6477
+ alias: 'punctuation'
6478
+ }
6479
+ });
6480
+ Prism.languages.insertBefore('csharp', 'class-name', {
6481
+ namespace: {
6482
+ // namespace Foo.Bar {}
6483
+ // using Foo.Bar;
6484
+ pattern: re(
6485
+ /(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,
6486
+ [name]
6487
+ ),
6488
+ lookbehind: true,
6489
+ inside: {
6490
+ punctuation: /\./
6491
+ }
6492
+ },
6493
+ 'type-expression': {
6494
+ // default(Foo), typeof(Foo<Bar>), sizeof(int)
6495
+ pattern: re(
6496
+ /(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/
6497
+ .source,
6498
+ [nestedRound]
6499
+ ),
6500
+ lookbehind: true,
6501
+ alias: 'class-name',
6502
+ inside: typeInside
6503
+ },
6504
+ 'return-type': {
6505
+ // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
6506
+ // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
6507
+ // int Foo => 0; int Foo { get; set } = 0;
6508
+ pattern: re(
6509
+ /<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,
6510
+ [typeExpression, identifier]
6511
+ ),
6512
+ inside: typeInside,
6513
+ alias: 'class-name'
6514
+ },
6515
+ 'constructor-invocation': {
6516
+ // new List<Foo<Bar[]>> { }
6517
+ pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
6518
+ lookbehind: true,
6519
+ inside: typeInside,
6520
+ alias: 'class-name'
6521
+ },
6522
+ /*'explicit-implementation': {
6523
+ // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
6524
+ pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
6525
+ inside: classNameInside,
6526
+ alias: 'class-name'
6527
+ },*/
6528
+ 'generic-method': {
6529
+ // foo<Bar>()
6530
+ pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]),
6531
+ inside: {
6532
+ function: re(/^<<0>>/.source, [name]),
6533
+ generic: {
6534
+ pattern: RegExp(generic),
6535
+ alias: 'class-name',
6536
+ inside: typeInside
6537
+ }
6538
+ }
6539
+ },
6540
+ 'type-list': {
6541
+ // The list of types inherited or of generic constraints
6542
+ // class Foo<F> : Bar, IList<FooBar>
6543
+ // where F : Bar, IList<int>
6544
+ pattern: re(
6545
+ /\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|[{;]|=>|$))/
6546
+ .source,
6547
+ [
6548
+ typeDeclarationKeywords,
6549
+ genericName,
6550
+ name,
6551
+ typeExpression,
6552
+ keywords.source,
6553
+ nestedRound,
6554
+ /\bnew\s*\(\s*\)/.source
6555
+ ]
6556
+ ),
6557
+ lookbehind: true,
6558
+ inside: {
6559
+ 'record-arguments': {
6560
+ pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
6561
+ genericName,
6562
+ nestedRound
6563
+ ]),
6564
+ lookbehind: true,
6565
+ greedy: true,
6566
+ inside: Prism.languages.csharp
6567
+ },
6568
+ keyword: keywords,
6569
+ 'class-name': {
6570
+ pattern: RegExp(typeExpression),
6571
+ greedy: true,
6572
+ inside: typeInside
6573
+ },
6574
+ punctuation: /[,()]/
6575
+ }
6576
+ },
6577
+ preprocessor: {
6578
+ pattern: /(^[\t ]*)#.*/m,
6579
+ lookbehind: true,
6580
+ alias: 'property',
6581
+ inside: {
6582
+ // highlight preprocessor directives as keywords
6583
+ directive: {
6584
+ pattern:
6585
+ /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
6586
+ lookbehind: true,
6587
+ alias: 'keyword'
6588
+ }
6589
+ }
6590
+ }
6591
+ }); // attributes
6592
+ var regularStringOrCharacter = regularString + '|' + character;
6593
+ var regularStringCharacterOrComment = replace(
6594
+ /\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,
6595
+ [regularStringOrCharacter]
6596
+ );
6597
+ var roundExpression = nested(
6598
+ replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
6599
+ regularStringCharacterOrComment
6600
+ ]),
6601
+ 2
6602
+ ); // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
6603
+ var attrTarget =
6604
+ /\b(?:assembly|event|field|method|module|param|property|return|type)\b/
6605
+ .source;
6606
+ var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
6607
+ identifier,
6608
+ roundExpression
6609
+ ]);
6610
+ Prism.languages.insertBefore('csharp', 'class-name', {
6611
+ attribute: {
6612
+ // Attributes
6613
+ // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
6614
+ pattern: re(
6615
+ /((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/
6616
+ .source,
6617
+ [attrTarget, attr]
6618
+ ),
6619
+ lookbehind: true,
6620
+ greedy: true,
6621
+ inside: {
6622
+ target: {
6623
+ pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
6624
+ alias: 'keyword'
6625
+ },
6626
+ 'attribute-arguments': {
6627
+ pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
6628
+ inside: Prism.languages.csharp
6629
+ },
6630
+ 'class-name': {
6631
+ pattern: RegExp(identifier),
6632
+ inside: {
6633
+ punctuation: /\./
6634
+ }
6635
+ },
6636
+ punctuation: /[:,]/
6637
+ }
6638
+ }
6639
+ }); // string interpolation
6640
+ var formatString = /:[^}\r\n]+/.source; // multi line
6641
+ var mInterpolationRound = nested(
6642
+ replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
6643
+ regularStringCharacterOrComment
6644
+ ]),
6645
+ 2
6646
+ );
6647
+ var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
6648
+ mInterpolationRound,
6649
+ formatString
6650
+ ]); // single line
6651
+ var sInterpolationRound = nested(
6652
+ replace(
6653
+ /[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/
6654
+ .source,
6655
+ [regularStringOrCharacter]
6656
+ ),
6657
+ 2
6658
+ );
6659
+ var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
6660
+ sInterpolationRound,
6661
+ formatString
6662
+ ]);
6663
+ function createInterpolationInside(interpolation, interpolationRound) {
6664
+ return {
6665
+ interpolation: {
6666
+ pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
6667
+ lookbehind: true,
6668
+ inside: {
6669
+ 'format-string': {
6670
+ pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
6671
+ interpolationRound,
6672
+ formatString
6673
+ ]),
6674
+ lookbehind: true,
6675
+ inside: {
6676
+ punctuation: /^:/
6677
+ }
6678
+ },
6679
+ punctuation: /^\{|\}$/,
6680
+ expression: {
6681
+ pattern: /[\s\S]+/,
6682
+ alias: 'language-csharp',
6683
+ inside: Prism.languages.csharp
6684
+ }
6685
+ }
6686
+ },
6687
+ string: /[\s\S]+/
6688
+ }
6689
+ }
6690
+ Prism.languages.insertBefore('csharp', 'string', {
6691
+ 'interpolation-string': [
6692
+ {
6693
+ pattern: re(
6694
+ /(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,
6695
+ [mInterpolation]
6696
+ ),
6697
+ lookbehind: true,
6698
+ greedy: true,
6699
+ inside: createInterpolationInside(mInterpolation, mInterpolationRound)
6700
+ },
6701
+ {
6702
+ pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [
6703
+ sInterpolation
6704
+ ]),
6705
+ lookbehind: true,
6706
+ greedy: true,
6707
+ inside: createInterpolationInside(sInterpolation, sInterpolationRound)
6708
+ }
6709
+ ],
6710
+ char: {
6711
+ pattern: RegExp(character),
6712
+ greedy: true
6713
+ }
6714
+ });
6715
+ Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
6716
+ })(Prism);
6717
+ }
6718
+ return csharp_1;
6702
6719
  }
6703
6720
 
6704
- var refractorCsharp$1 = csharp_1;
6721
+ var refractorCsharp = requireCsharp();
6705
6722
  var aspnet_1 = aspnet;
6706
6723
  aspnet.displayName = 'aspnet';
6707
6724
  aspnet.aliases = [];
6708
6725
  function aspnet(Prism) {
6709
- Prism.register(refractorCsharp$1);
6726
+ Prism.register(refractorCsharp);
6710
6727
  Prism.languages.aspnet = Prism.languages.extend('markup', {
6711
6728
  'page-directive': {
6712
6729
  pattern: /<%\s*@.*%>/,
@@ -7019,59 +7036,68 @@ function avisynth(Prism) {
7019
7036
  })(Prism);
7020
7037
  }
7021
7038
 
7022
- var avroIdl_1 = avroIdl;
7023
- avroIdl.displayName = 'avroIdl';
7024
- avroIdl.aliases = [];
7025
- function avroIdl(Prism) {
7026
- // GitHub: https://github.com/apache/avro
7027
- // Docs: https://avro.apache.org/docs/current/idl.html
7028
- Prism.languages['avro-idl'] = {
7029
- comment: {
7030
- pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
7031
- greedy: true
7032
- },
7033
- string: {
7034
- pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
7035
- lookbehind: true,
7036
- greedy: true
7037
- },
7038
- annotation: {
7039
- pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
7040
- greedy: true,
7041
- alias: 'function'
7042
- },
7043
- 'function-identifier': {
7044
- pattern: /`[^\r\n`]+`(?=\s*\()/,
7045
- greedy: true,
7046
- alias: 'function'
7047
- },
7048
- identifier: {
7049
- pattern: /`[^\r\n`]+`/,
7050
- greedy: true
7051
- },
7052
- 'class-name': {
7053
- pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
7054
- lookbehind: true,
7055
- greedy: true
7056
- },
7057
- keyword:
7058
- /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,
7059
- function: /\b[a-z_]\w*(?=\s*\()/i,
7060
- number: [
7061
- {
7062
- pattern:
7063
- /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
7064
- lookbehind: true
7065
- },
7066
- /-?\b(?:Infinity|NaN)\b/
7067
- ],
7068
- operator: /=/,
7069
- punctuation: /[()\[\]{}<>.:,;-]/
7070
- };
7071
- Prism.languages.avdl = Prism.languages['avro-idl'];
7072
- }
7039
+ var avroIdl_1;
7040
+ var hasRequiredAvroIdl;
7073
7041
 
7074
- var bash_1 = bash;
7042
+ function requireAvroIdl () {
7043
+ if (hasRequiredAvroIdl) return avroIdl_1;
7044
+ hasRequiredAvroIdl = 1;
7045
+
7046
+ avroIdl_1 = avroIdl;
7047
+ avroIdl.displayName = 'avroIdl';
7048
+ avroIdl.aliases = [];
7049
+ function avroIdl(Prism) {
7050
+ // GitHub: https://github.com/apache/avro
7051
+ // Docs: https://avro.apache.org/docs/current/idl.html
7052
+ Prism.languages['avro-idl'] = {
7053
+ comment: {
7054
+ pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
7055
+ greedy: true
7056
+ },
7057
+ string: {
7058
+ pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
7059
+ lookbehind: true,
7060
+ greedy: true
7061
+ },
7062
+ annotation: {
7063
+ pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
7064
+ greedy: true,
7065
+ alias: 'function'
7066
+ },
7067
+ 'function-identifier': {
7068
+ pattern: /`[^\r\n`]+`(?=\s*\()/,
7069
+ greedy: true,
7070
+ alias: 'function'
7071
+ },
7072
+ identifier: {
7073
+ pattern: /`[^\r\n`]+`/,
7074
+ greedy: true
7075
+ },
7076
+ 'class-name': {
7077
+ pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
7078
+ lookbehind: true,
7079
+ greedy: true
7080
+ },
7081
+ keyword:
7082
+ /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,
7083
+ function: /\b[a-z_]\w*(?=\s*\()/i,
7084
+ number: [
7085
+ {
7086
+ pattern:
7087
+ /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
7088
+ lookbehind: true
7089
+ },
7090
+ /-?\b(?:Infinity|NaN)\b/
7091
+ ],
7092
+ operator: /=/,
7093
+ punctuation: /[()\[\]{}<>.:,;-]/
7094
+ };
7095
+ Prism.languages.avdl = Prism.languages['avro-idl'];
7096
+ }
7097
+ return avroIdl_1;
7098
+ }
7099
+
7100
+ var bash_1 = bash;
7075
7101
  bash.displayName = 'bash';
7076
7102
  bash.aliases = ['shell'];
7077
7103
  function bash(Prism) {
@@ -7650,30 +7676,39 @@ function bnf(Prism) {
7650
7676
  Prism.languages.rbnf = Prism.languages.bnf;
7651
7677
  }
7652
7678
 
7653
- var brainfuck_1 = brainfuck;
7654
- brainfuck.displayName = 'brainfuck';
7655
- brainfuck.aliases = [];
7656
- function brainfuck(Prism) {
7657
- Prism.languages.brainfuck = {
7658
- pointer: {
7659
- pattern: /<|>/,
7660
- alias: 'keyword'
7661
- },
7662
- increment: {
7663
- pattern: /\+/,
7664
- alias: 'inserted'
7665
- },
7666
- decrement: {
7667
- pattern: /-/,
7668
- alias: 'deleted'
7669
- },
7670
- branching: {
7671
- pattern: /\[|\]/,
7672
- alias: 'important'
7673
- },
7674
- operator: /[.,]/,
7675
- comment: /\S+/
7676
- };
7679
+ var brainfuck_1;
7680
+ var hasRequiredBrainfuck;
7681
+
7682
+ function requireBrainfuck () {
7683
+ if (hasRequiredBrainfuck) return brainfuck_1;
7684
+ hasRequiredBrainfuck = 1;
7685
+
7686
+ brainfuck_1 = brainfuck;
7687
+ brainfuck.displayName = 'brainfuck';
7688
+ brainfuck.aliases = [];
7689
+ function brainfuck(Prism) {
7690
+ Prism.languages.brainfuck = {
7691
+ pointer: {
7692
+ pattern: /<|>/,
7693
+ alias: 'keyword'
7694
+ },
7695
+ increment: {
7696
+ pattern: /\+/,
7697
+ alias: 'inserted'
7698
+ },
7699
+ decrement: {
7700
+ pattern: /-/,
7701
+ alias: 'deleted'
7702
+ },
7703
+ branching: {
7704
+ pattern: /\[|\]/,
7705
+ alias: 'important'
7706
+ },
7707
+ operator: /[.,]/,
7708
+ comment: /\S+/
7709
+ };
7710
+ }
7711
+ return brainfuck_1;
7677
7712
  }
7678
7713
 
7679
7714
  var brightscript_1 = brightscript;
@@ -7895,7 +7930,7 @@ function cfscript(Prism) {
7895
7930
  Prism.languages.cfc = Prism.languages['cfscript'];
7896
7931
  }
7897
7932
 
7898
- var refractorCpp = cpp_1;
7933
+ var refractorCpp = requireCpp();
7899
7934
  var chaiscript_1 = chaiscript;
7900
7935
  chaiscript.displayName = 'chaiscript';
7901
7936
  chaiscript.aliases = [];
@@ -8217,813 +8252,883 @@ function coffeescript(Prism) {
8217
8252
  })(Prism);
8218
8253
  }
8219
8254
 
8220
- var concurnas_1 = concurnas;
8221
- concurnas.displayName = 'concurnas';
8222
- concurnas.aliases = ['conc'];
8223
- function concurnas(Prism) {
8224
- Prism.languages.concurnas = {
8225
- comment: {
8226
- pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
8227
- lookbehind: true,
8228
- greedy: true
8229
- },
8230
- langext: {
8231
- pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
8232
- greedy: true,
8233
- inside: {
8234
- 'class-name': /^\w+/,
8235
- string: {
8236
- pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
8237
- lookbehind: true
8238
- },
8239
- punctuation: /\|\|/
8240
- }
8241
- },
8242
- function: {
8243
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
8244
- lookbehind: true
8245
- },
8246
- keyword:
8247
- /\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,
8248
- boolean: /\b(?:false|true)\b/,
8249
- number:
8250
- /\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
8251
- punctuation: /[{}[\];(),.:]/,
8252
- operator:
8253
- /<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
8254
- annotation: {
8255
- pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
8256
- alias: 'builtin'
8257
- }
8258
- };
8259
- Prism.languages.insertBefore('concurnas', 'langext', {
8260
- 'regex-literal': {
8261
- pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
8262
- greedy: true,
8263
- inside: {
8264
- interpolation: {
8265
- pattern:
8266
- /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
8267
- lookbehind: true,
8268
- inside: Prism.languages.concurnas
8269
- },
8270
- regex: /[\s\S]+/
8271
- }
8272
- },
8273
- 'string-literal': {
8274
- pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
8275
- greedy: true,
8276
- inside: {
8277
- interpolation: {
8278
- pattern:
8279
- /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
8280
- lookbehind: true,
8281
- inside: Prism.languages.concurnas
8282
- },
8283
- string: /[\s\S]+/
8284
- }
8285
- }
8286
- });
8287
- Prism.languages.conc = Prism.languages.concurnas;
8255
+ var concurnas_1;
8256
+ var hasRequiredConcurnas;
8257
+
8258
+ function requireConcurnas () {
8259
+ if (hasRequiredConcurnas) return concurnas_1;
8260
+ hasRequiredConcurnas = 1;
8261
+
8262
+ concurnas_1 = concurnas;
8263
+ concurnas.displayName = 'concurnas';
8264
+ concurnas.aliases = ['conc'];
8265
+ function concurnas(Prism) {
8266
+ Prism.languages.concurnas = {
8267
+ comment: {
8268
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
8269
+ lookbehind: true,
8270
+ greedy: true
8271
+ },
8272
+ langext: {
8273
+ pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
8274
+ greedy: true,
8275
+ inside: {
8276
+ 'class-name': /^\w+/,
8277
+ string: {
8278
+ pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
8279
+ lookbehind: true
8280
+ },
8281
+ punctuation: /\|\|/
8282
+ }
8283
+ },
8284
+ function: {
8285
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
8286
+ lookbehind: true
8287
+ },
8288
+ keyword:
8289
+ /\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,
8290
+ boolean: /\b(?:false|true)\b/,
8291
+ number:
8292
+ /\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
8293
+ punctuation: /[{}[\];(),.:]/,
8294
+ operator:
8295
+ /<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
8296
+ annotation: {
8297
+ pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
8298
+ alias: 'builtin'
8299
+ }
8300
+ };
8301
+ Prism.languages.insertBefore('concurnas', 'langext', {
8302
+ 'regex-literal': {
8303
+ pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
8304
+ greedy: true,
8305
+ inside: {
8306
+ interpolation: {
8307
+ pattern:
8308
+ /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
8309
+ lookbehind: true,
8310
+ inside: Prism.languages.concurnas
8311
+ },
8312
+ regex: /[\s\S]+/
8313
+ }
8314
+ },
8315
+ 'string-literal': {
8316
+ pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
8317
+ greedy: true,
8318
+ inside: {
8319
+ interpolation: {
8320
+ pattern:
8321
+ /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
8322
+ lookbehind: true,
8323
+ inside: Prism.languages.concurnas
8324
+ },
8325
+ string: /[\s\S]+/
8326
+ }
8327
+ }
8328
+ });
8329
+ Prism.languages.conc = Prism.languages.concurnas;
8330
+ }
8331
+ return concurnas_1;
8288
8332
  }
8289
8333
 
8290
- var coq_1 = coq;
8291
- coq.displayName = 'coq';
8292
- coq.aliases = [];
8293
- function coq(Prism) {
8334
+ var coq_1;
8335
+ var hasRequiredCoq;
8336
+
8337
+ function requireCoq () {
8338
+ if (hasRequiredCoq) return coq_1;
8339
+ hasRequiredCoq = 1;
8340
+
8341
+ coq_1 = coq;
8342
+ coq.displayName = 'coq';
8343
+ coq.aliases = [];
8344
+ function coq(Prism) {
8294
8345
  (function (Prism) {
8295
- // https://github.com/coq/coq
8296
- var commentSource = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source;
8297
- for (var i = 0; i < 2; i++) {
8298
- commentSource = commentSource.replace(/<self>/g, function () {
8299
- return commentSource
8300
- });
8301
- }
8302
- commentSource = commentSource.replace(/<self>/g, '[]');
8303
- Prism.languages.coq = {
8304
- comment: RegExp(commentSource),
8305
- string: {
8306
- pattern: /"(?:[^"]|"")*"(?!")/,
8307
- greedy: true
8308
- },
8309
- attribute: [
8310
- {
8311
- pattern: RegExp(
8312
- /#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|<comment>)*\]/.source.replace(
8313
- /<comment>/g,
8314
- function () {
8315
- return commentSource
8316
- }
8317
- )
8318
- ),
8319
- greedy: true,
8320
- alias: 'attr-name',
8321
- inside: {
8322
- comment: RegExp(commentSource),
8323
- string: {
8324
- pattern: /"(?:[^"]|"")*"(?!")/,
8325
- greedy: true
8326
- },
8327
- operator: /=/,
8328
- punctuation: /^#\[|\]$|[,()]/
8329
- }
8330
- },
8331
- {
8332
- pattern:
8333
- /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,
8334
- alias: 'attr-name'
8335
- }
8336
- ],
8337
- keyword:
8338
- /\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/,
8339
- number:
8340
- /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,
8341
- punct: {
8342
- pattern: /@\{|\{\||\[=|:>/,
8343
- alias: 'punctuation'
8344
- },
8345
- operator:
8346
- /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,
8347
- punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/
8348
- };
8349
- })(Prism);
8346
+ // https://github.com/coq/coq
8347
+ var commentSource = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source;
8348
+ for (var i = 0; i < 2; i++) {
8349
+ commentSource = commentSource.replace(/<self>/g, function () {
8350
+ return commentSource
8351
+ });
8352
+ }
8353
+ commentSource = commentSource.replace(/<self>/g, '[]');
8354
+ Prism.languages.coq = {
8355
+ comment: RegExp(commentSource),
8356
+ string: {
8357
+ pattern: /"(?:[^"]|"")*"(?!")/,
8358
+ greedy: true
8359
+ },
8360
+ attribute: [
8361
+ {
8362
+ pattern: RegExp(
8363
+ /#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|<comment>)*\]/.source.replace(
8364
+ /<comment>/g,
8365
+ function () {
8366
+ return commentSource
8367
+ }
8368
+ )
8369
+ ),
8370
+ greedy: true,
8371
+ alias: 'attr-name',
8372
+ inside: {
8373
+ comment: RegExp(commentSource),
8374
+ string: {
8375
+ pattern: /"(?:[^"]|"")*"(?!")/,
8376
+ greedy: true
8377
+ },
8378
+ operator: /=/,
8379
+ punctuation: /^#\[|\]$|[,()]/
8380
+ }
8381
+ },
8382
+ {
8383
+ pattern:
8384
+ /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,
8385
+ alias: 'attr-name'
8386
+ }
8387
+ ],
8388
+ keyword:
8389
+ /\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/,
8390
+ number:
8391
+ /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,
8392
+ punct: {
8393
+ pattern: /@\{|\{\||\[=|:>/,
8394
+ alias: 'punctuation'
8395
+ },
8396
+ operator:
8397
+ /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,
8398
+ punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/
8399
+ };
8400
+ })(Prism);
8401
+ }
8402
+ return coq_1;
8350
8403
  }
8351
8404
 
8352
- var ruby_1 = ruby;
8353
- ruby.displayName = 'ruby';
8354
- ruby.aliases = ['rb'];
8355
- function ruby(Prism) {
8405
+ var ruby_1;
8406
+ var hasRequiredRuby;
8407
+
8408
+ function requireRuby () {
8409
+ if (hasRequiredRuby) return ruby_1;
8410
+ hasRequiredRuby = 1;
8411
+
8412
+ ruby_1 = ruby;
8413
+ ruby.displayName = 'ruby';
8414
+ ruby.aliases = ['rb'];
8415
+ function ruby(Prism) {
8356
8416
  (function (Prism) {
8357
- Prism.languages.ruby = Prism.languages.extend('clike', {
8358
- comment: {
8359
- pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
8360
- greedy: true
8361
- },
8362
- 'class-name': {
8363
- pattern:
8364
- /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
8365
- lookbehind: true,
8366
- inside: {
8367
- punctuation: /[.\\]/
8368
- }
8369
- },
8370
- keyword:
8371
- /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
8372
- operator:
8373
- /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
8374
- punctuation: /[(){}[\].,;]/
8375
- });
8376
- Prism.languages.insertBefore('ruby', 'operator', {
8377
- 'double-colon': {
8378
- pattern: /::/,
8379
- alias: 'punctuation'
8380
- }
8381
- });
8382
- var interpolation = {
8383
- pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
8384
- lookbehind: true,
8385
- inside: {
8386
- content: {
8387
- pattern: /^(#\{)[\s\S]+(?=\}$)/,
8388
- lookbehind: true,
8389
- inside: Prism.languages.ruby
8390
- },
8391
- delimiter: {
8392
- pattern: /^#\{|\}$/,
8393
- alias: 'punctuation'
8394
- }
8395
- }
8396
- };
8397
- delete Prism.languages.ruby.function;
8398
- var percentExpression =
8399
- '(?:' +
8400
- [
8401
- /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
8402
- /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
8403
- /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
8404
- /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
8405
- /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
8406
- ].join('|') +
8407
- ')';
8408
- var symbolName =
8409
- /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/
8410
- .source;
8411
- Prism.languages.insertBefore('ruby', 'keyword', {
8412
- 'regex-literal': [
8413
- {
8414
- pattern: RegExp(
8415
- /%r/.source + percentExpression + /[egimnosux]{0,6}/.source
8416
- ),
8417
- greedy: true,
8418
- inside: {
8419
- interpolation: interpolation,
8420
- regex: /[\s\S]+/
8421
- }
8422
- },
8423
- {
8424
- pattern:
8425
- /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
8426
- lookbehind: true,
8427
- greedy: true,
8428
- inside: {
8429
- interpolation: interpolation,
8430
- regex: /[\s\S]+/
8431
- }
8432
- }
8433
- ],
8434
- variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
8435
- symbol: [
8436
- {
8437
- pattern: RegExp(/(^|[^:]):/.source + symbolName),
8438
- lookbehind: true,
8439
- greedy: true
8440
- },
8441
- {
8442
- pattern: RegExp(
8443
- /([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source
8444
- ),
8445
- lookbehind: true,
8446
- greedy: true
8447
- }
8448
- ],
8449
- 'method-definition': {
8450
- pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
8451
- lookbehind: true,
8452
- inside: {
8453
- function: /\b\w+$/,
8454
- keyword: /^self\b/,
8455
- 'class-name': /^\w+/,
8456
- punctuation: /\./
8457
- }
8458
- }
8459
- });
8460
- Prism.languages.insertBefore('ruby', 'string', {
8461
- 'string-literal': [
8462
- {
8463
- pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
8464
- greedy: true,
8465
- inside: {
8466
- interpolation: interpolation,
8467
- string: /[\s\S]+/
8468
- }
8469
- },
8470
- {
8471
- pattern:
8472
- /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
8473
- greedy: true,
8474
- inside: {
8475
- interpolation: interpolation,
8476
- string: /[\s\S]+/
8477
- }
8478
- },
8479
- {
8480
- pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
8481
- alias: 'heredoc-string',
8482
- greedy: true,
8483
- inside: {
8484
- delimiter: {
8485
- pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
8486
- inside: {
8487
- symbol: /\b\w+/,
8488
- punctuation: /^<<[-~]?/
8489
- }
8490
- },
8491
- interpolation: interpolation,
8492
- string: /[\s\S]+/
8493
- }
8494
- },
8495
- {
8496
- pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
8497
- alias: 'heredoc-string',
8498
- greedy: true,
8499
- inside: {
8500
- delimiter: {
8501
- pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
8502
- inside: {
8503
- symbol: /\b\w+/,
8504
- punctuation: /^<<[-~]?'|'$/
8505
- }
8506
- },
8507
- string: /[\s\S]+/
8508
- }
8509
- }
8510
- ],
8511
- 'command-literal': [
8512
- {
8513
- pattern: RegExp(/%x/.source + percentExpression),
8514
- greedy: true,
8515
- inside: {
8516
- interpolation: interpolation,
8517
- command: {
8518
- pattern: /[\s\S]+/,
8519
- alias: 'string'
8520
- }
8521
- }
8522
- },
8523
- {
8524
- pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
8525
- greedy: true,
8526
- inside: {
8527
- interpolation: interpolation,
8528
- command: {
8529
- pattern: /[\s\S]+/,
8530
- alias: 'string'
8531
- }
8532
- }
8533
- }
8534
- ]
8535
- });
8536
- delete Prism.languages.ruby.string;
8537
- Prism.languages.insertBefore('ruby', 'number', {
8538
- builtin:
8539
- /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
8540
- constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
8541
- });
8542
- Prism.languages.rb = Prism.languages.ruby;
8543
- })(Prism);
8417
+ Prism.languages.ruby = Prism.languages.extend('clike', {
8418
+ comment: {
8419
+ pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
8420
+ greedy: true
8421
+ },
8422
+ 'class-name': {
8423
+ pattern:
8424
+ /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
8425
+ lookbehind: true,
8426
+ inside: {
8427
+ punctuation: /[.\\]/
8428
+ }
8429
+ },
8430
+ keyword:
8431
+ /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
8432
+ operator:
8433
+ /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
8434
+ punctuation: /[(){}[\].,;]/
8435
+ });
8436
+ Prism.languages.insertBefore('ruby', 'operator', {
8437
+ 'double-colon': {
8438
+ pattern: /::/,
8439
+ alias: 'punctuation'
8440
+ }
8441
+ });
8442
+ var interpolation = {
8443
+ pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
8444
+ lookbehind: true,
8445
+ inside: {
8446
+ content: {
8447
+ pattern: /^(#\{)[\s\S]+(?=\}$)/,
8448
+ lookbehind: true,
8449
+ inside: Prism.languages.ruby
8450
+ },
8451
+ delimiter: {
8452
+ pattern: /^#\{|\}$/,
8453
+ alias: 'punctuation'
8454
+ }
8455
+ }
8456
+ };
8457
+ delete Prism.languages.ruby.function;
8458
+ var percentExpression =
8459
+ '(?:' +
8460
+ [
8461
+ /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
8462
+ /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
8463
+ /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
8464
+ /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
8465
+ /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
8466
+ ].join('|') +
8467
+ ')';
8468
+ var symbolName =
8469
+ /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/
8470
+ .source;
8471
+ Prism.languages.insertBefore('ruby', 'keyword', {
8472
+ 'regex-literal': [
8473
+ {
8474
+ pattern: RegExp(
8475
+ /%r/.source + percentExpression + /[egimnosux]{0,6}/.source
8476
+ ),
8477
+ greedy: true,
8478
+ inside: {
8479
+ interpolation: interpolation,
8480
+ regex: /[\s\S]+/
8481
+ }
8482
+ },
8483
+ {
8484
+ pattern:
8485
+ /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
8486
+ lookbehind: true,
8487
+ greedy: true,
8488
+ inside: {
8489
+ interpolation: interpolation,
8490
+ regex: /[\s\S]+/
8491
+ }
8492
+ }
8493
+ ],
8494
+ variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
8495
+ symbol: [
8496
+ {
8497
+ pattern: RegExp(/(^|[^:]):/.source + symbolName),
8498
+ lookbehind: true,
8499
+ greedy: true
8500
+ },
8501
+ {
8502
+ pattern: RegExp(
8503
+ /([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source
8504
+ ),
8505
+ lookbehind: true,
8506
+ greedy: true
8507
+ }
8508
+ ],
8509
+ 'method-definition': {
8510
+ pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
8511
+ lookbehind: true,
8512
+ inside: {
8513
+ function: /\b\w+$/,
8514
+ keyword: /^self\b/,
8515
+ 'class-name': /^\w+/,
8516
+ punctuation: /\./
8517
+ }
8518
+ }
8519
+ });
8520
+ Prism.languages.insertBefore('ruby', 'string', {
8521
+ 'string-literal': [
8522
+ {
8523
+ pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
8524
+ greedy: true,
8525
+ inside: {
8526
+ interpolation: interpolation,
8527
+ string: /[\s\S]+/
8528
+ }
8529
+ },
8530
+ {
8531
+ pattern:
8532
+ /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
8533
+ greedy: true,
8534
+ inside: {
8535
+ interpolation: interpolation,
8536
+ string: /[\s\S]+/
8537
+ }
8538
+ },
8539
+ {
8540
+ pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
8541
+ alias: 'heredoc-string',
8542
+ greedy: true,
8543
+ inside: {
8544
+ delimiter: {
8545
+ pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
8546
+ inside: {
8547
+ symbol: /\b\w+/,
8548
+ punctuation: /^<<[-~]?/
8549
+ }
8550
+ },
8551
+ interpolation: interpolation,
8552
+ string: /[\s\S]+/
8553
+ }
8554
+ },
8555
+ {
8556
+ pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
8557
+ alias: 'heredoc-string',
8558
+ greedy: true,
8559
+ inside: {
8560
+ delimiter: {
8561
+ pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
8562
+ inside: {
8563
+ symbol: /\b\w+/,
8564
+ punctuation: /^<<[-~]?'|'$/
8565
+ }
8566
+ },
8567
+ string: /[\s\S]+/
8568
+ }
8569
+ }
8570
+ ],
8571
+ 'command-literal': [
8572
+ {
8573
+ pattern: RegExp(/%x/.source + percentExpression),
8574
+ greedy: true,
8575
+ inside: {
8576
+ interpolation: interpolation,
8577
+ command: {
8578
+ pattern: /[\s\S]+/,
8579
+ alias: 'string'
8580
+ }
8581
+ }
8582
+ },
8583
+ {
8584
+ pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
8585
+ greedy: true,
8586
+ inside: {
8587
+ interpolation: interpolation,
8588
+ command: {
8589
+ pattern: /[\s\S]+/,
8590
+ alias: 'string'
8591
+ }
8592
+ }
8593
+ }
8594
+ ]
8595
+ });
8596
+ delete Prism.languages.ruby.string;
8597
+ Prism.languages.insertBefore('ruby', 'number', {
8598
+ builtin:
8599
+ /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
8600
+ constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
8601
+ });
8602
+ Prism.languages.rb = Prism.languages.ruby;
8603
+ })(Prism);
8604
+ }
8605
+ return ruby_1;
8544
8606
  }
8545
8607
 
8546
- var refractorRuby = ruby_1;
8547
- var crystal_1 = crystal;
8548
- crystal.displayName = 'crystal';
8549
- crystal.aliases = [];
8550
- function crystal(Prism) {
8551
- Prism.register(refractorRuby)
8552
- ;(function (Prism) {
8553
- Prism.languages.crystal = Prism.languages.extend('ruby', {
8554
- keyword: [
8555
- /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/,
8556
- {
8557
- pattern: /(\.\s*)(?:is_a|responds_to)\?/,
8558
- lookbehind: true
8559
- }
8560
- ],
8561
- number:
8562
- /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,
8563
- operator: [/->/, Prism.languages.ruby.operator],
8564
- punctuation: /[(){}[\].,;\\]/
8565
- });
8566
- Prism.languages.insertBefore('crystal', 'string-literal', {
8567
- attribute: {
8568
- pattern: /@\[.*?\]/,
8569
- inside: {
8570
- delimiter: {
8571
- pattern: /^@\[|\]$/,
8572
- alias: 'punctuation'
8573
- },
8574
- attribute: {
8575
- pattern: /^(\s*)\w+/,
8576
- lookbehind: true,
8577
- alias: 'class-name'
8578
- },
8579
- args: {
8580
- pattern: /\S(?:[\s\S]*\S)?/,
8581
- inside: Prism.languages.crystal
8582
- }
8583
- }
8584
- },
8585
- expansion: {
8586
- pattern: /\{(?:\{.*?\}|%.*?%)\}/,
8587
- inside: {
8588
- content: {
8589
- pattern: /^(\{.)[\s\S]+(?=.\}$)/,
8590
- lookbehind: true,
8591
- inside: Prism.languages.crystal
8592
- },
8593
- delimiter: {
8594
- pattern: /^\{[\{%]|[\}%]\}$/,
8595
- alias: 'operator'
8596
- }
8597
- }
8598
- },
8599
- char: {
8600
- pattern:
8601
- /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,
8602
- greedy: true
8603
- }
8604
- });
8605
- })(Prism);
8608
+ var crystal_1;
8609
+ var hasRequiredCrystal;
8610
+
8611
+ function requireCrystal () {
8612
+ if (hasRequiredCrystal) return crystal_1;
8613
+ hasRequiredCrystal = 1;
8614
+ var refractorRuby = requireRuby();
8615
+ crystal_1 = crystal;
8616
+ crystal.displayName = 'crystal';
8617
+ crystal.aliases = [];
8618
+ function crystal(Prism) {
8619
+ Prism.register(refractorRuby)
8620
+ ;(function (Prism) {
8621
+ Prism.languages.crystal = Prism.languages.extend('ruby', {
8622
+ keyword: [
8623
+ /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/,
8624
+ {
8625
+ pattern: /(\.\s*)(?:is_a|responds_to)\?/,
8626
+ lookbehind: true
8627
+ }
8628
+ ],
8629
+ number:
8630
+ /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,
8631
+ operator: [/->/, Prism.languages.ruby.operator],
8632
+ punctuation: /[(){}[\].,;\\]/
8633
+ });
8634
+ Prism.languages.insertBefore('crystal', 'string-literal', {
8635
+ attribute: {
8636
+ pattern: /@\[.*?\]/,
8637
+ inside: {
8638
+ delimiter: {
8639
+ pattern: /^@\[|\]$/,
8640
+ alias: 'punctuation'
8641
+ },
8642
+ attribute: {
8643
+ pattern: /^(\s*)\w+/,
8644
+ lookbehind: true,
8645
+ alias: 'class-name'
8646
+ },
8647
+ args: {
8648
+ pattern: /\S(?:[\s\S]*\S)?/,
8649
+ inside: Prism.languages.crystal
8650
+ }
8651
+ }
8652
+ },
8653
+ expansion: {
8654
+ pattern: /\{(?:\{.*?\}|%.*?%)\}/,
8655
+ inside: {
8656
+ content: {
8657
+ pattern: /^(\{.)[\s\S]+(?=.\}$)/,
8658
+ lookbehind: true,
8659
+ inside: Prism.languages.crystal
8660
+ },
8661
+ delimiter: {
8662
+ pattern: /^\{[\{%]|[\}%]\}$/,
8663
+ alias: 'operator'
8664
+ }
8665
+ }
8666
+ },
8667
+ char: {
8668
+ pattern:
8669
+ /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,
8670
+ greedy: true
8671
+ }
8672
+ });
8673
+ })(Prism);
8674
+ }
8675
+ return crystal_1;
8676
+ }
8677
+
8678
+ var cshtml_1;
8679
+ var hasRequiredCshtml;
8680
+
8681
+ function requireCshtml () {
8682
+ if (hasRequiredCshtml) return cshtml_1;
8683
+ hasRequiredCshtml = 1;
8684
+ var refractorCsharp = requireCsharp();
8685
+ cshtml_1 = cshtml;
8686
+ cshtml.displayName = 'cshtml';
8687
+ cshtml.aliases = ['razor'];
8688
+ function cshtml(Prism) {
8689
+ Prism.register(refractorCsharp)
8690
+ // Docs:
8691
+ // https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio
8692
+ // https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0
8693
+ ;(function (Prism) {
8694
+ var commentLike = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//
8695
+ .source;
8696
+ var stringLike =
8697
+ /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source +
8698
+ '|' +
8699
+ /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
8700
+ /**
8701
+ * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
8702
+ *
8703
+ * @param {string} pattern
8704
+ * @param {number} depthLog2
8705
+ * @returns {string}
8706
+ */
8707
+ function nested(pattern, depthLog2) {
8708
+ for (var i = 0; i < depthLog2; i++) {
8709
+ pattern = pattern.replace(/<self>/g, function () {
8710
+ return '(?:' + pattern + ')'
8711
+ });
8712
+ }
8713
+ return pattern
8714
+ .replace(/<self>/g, '[^\\s\\S]')
8715
+ .replace(/<str>/g, '(?:' + stringLike + ')')
8716
+ .replace(/<comment>/g, '(?:' + commentLike + ')')
8717
+ }
8718
+ var round = nested(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2);
8719
+ var square = nested(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 2);
8720
+ var curly = nested(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2);
8721
+ var angle = nested(/<(?:[^<>'"@/]|<str>|<comment>|<self>)*>/.source, 2); // Note about the above bracket patterns:
8722
+ // They all ignore HTML expressions that might be in the C# code. This is a problem because HTML (like strings and
8723
+ // comments) is parsed differently. This is a huge problem because HTML might contain brackets and quotes which
8724
+ // messes up the bracket and string counting implemented by the above patterns.
8725
+ //
8726
+ // This problem is not fixable because 1) HTML expression are highly context sensitive and very difficult to detect
8727
+ // and 2) they require one capturing group at every nested level. See the `tagRegion` pattern to admire the
8728
+ // complexity of an HTML expression.
8729
+ //
8730
+ // To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also
8731
+ // allows invalid characters to support HTML expressions like this: <p>That's it!</p>.
8732
+ var tagAttrs =
8733
+ /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/
8734
+ .source;
8735
+ var tagContent = /(?!\d)[^\s>\/=$<%]+/.source + tagAttrs + /\s*\/?>/.source;
8736
+ var tagRegion =
8737
+ /\B@?/.source +
8738
+ '(?:' +
8739
+ /<([a-zA-Z][\w:]*)/.source +
8740
+ tagAttrs +
8741
+ /\s*>/.source +
8742
+ '(?:' +
8743
+ (/[^<]/.source +
8744
+ '|' + // all tags that are not the start tag
8745
+ // eslint-disable-next-line regexp/strict
8746
+ /<\/?(?!\1\b)/.source +
8747
+ tagContent +
8748
+ '|' + // nested start tag
8749
+ nested(
8750
+ // eslint-disable-next-line regexp/strict
8751
+ /<\1/.source +
8752
+ tagAttrs +
8753
+ /\s*>/.source +
8754
+ '(?:' +
8755
+ (/[^<]/.source +
8756
+ '|' + // all tags that are not the start tag
8757
+ // eslint-disable-next-line regexp/strict
8758
+ /<\/?(?!\1\b)/.source +
8759
+ tagContent +
8760
+ '|' +
8761
+ '<self>') +
8762
+ ')*' + // eslint-disable-next-line regexp/strict
8763
+ /<\/\1\s*>/.source,
8764
+ 2
8765
+ )) +
8766
+ ')*' + // eslint-disable-next-line regexp/strict
8767
+ /<\/\1\s*>/.source +
8768
+ '|' +
8769
+ /</.source +
8770
+ tagContent +
8771
+ ')'; // Now for the actual language definition(s):
8772
+ //
8773
+ // Razor as a language has 2 parts:
8774
+ // 1) CSHTML: A markup-like language that has been extended with inline C# code expressions and blocks.
8775
+ // 2) C#+HTML: A variant of C# that can contain CSHTML tags as expressions.
8776
+ //
8777
+ // In the below code, both CSHTML and C#+HTML will be create as separate language definitions that reference each
8778
+ // other. However, only CSHTML will be exported via `Prism.languages`.
8779
+ Prism.languages.cshtml = Prism.languages.extend('markup', {});
8780
+ var csharpWithHtml = Prism.languages.insertBefore(
8781
+ 'csharp',
8782
+ 'string',
8783
+ {
8784
+ html: {
8785
+ pattern: RegExp(tagRegion),
8786
+ greedy: true,
8787
+ inside: Prism.languages.cshtml
8788
+ }
8789
+ },
8790
+ {
8791
+ csharp: Prism.languages.extend('csharp', {})
8792
+ }
8793
+ );
8794
+ var cs = {
8795
+ pattern: /\S[\s\S]*/,
8796
+ alias: 'language-csharp',
8797
+ inside: csharpWithHtml
8798
+ };
8799
+ Prism.languages.insertBefore('cshtml', 'prolog', {
8800
+ 'razor-comment': {
8801
+ pattern: /@\*[\s\S]*?\*@/,
8802
+ greedy: true,
8803
+ alias: 'comment'
8804
+ },
8805
+ block: {
8806
+ pattern: RegExp(
8807
+ /(^|[^@])@/.source +
8808
+ '(?:' +
8809
+ [
8810
+ // @{ ... }
8811
+ curly, // @code{ ... }
8812
+ /(?:code|functions)\s*/.source + curly, // @for (...) { ... }
8813
+ /(?:for|foreach|lock|switch|using|while)\s*/.source +
8814
+ round +
8815
+ /\s*/.source +
8816
+ curly, // @do { ... } while (...);
8817
+ /do\s*/.source +
8818
+ curly +
8819
+ /\s*while\s*/.source +
8820
+ round +
8821
+ /(?:\s*;)?/.source, // @try { ... } catch (...) { ... } finally { ... }
8822
+ /try\s*/.source +
8823
+ curly +
8824
+ /\s*catch\s*/.source +
8825
+ round +
8826
+ /\s*/.source +
8827
+ curly +
8828
+ /\s*finally\s*/.source +
8829
+ curly, // @if (...) {...} else if (...) {...} else {...}
8830
+ /if\s*/.source +
8831
+ round +
8832
+ /\s*/.source +
8833
+ curly +
8834
+ '(?:' +
8835
+ /\s*else/.source +
8836
+ '(?:' +
8837
+ /\s+if\s*/.source +
8838
+ round +
8839
+ ')?' +
8840
+ /\s*/.source +
8841
+ curly +
8842
+ ')*'
8843
+ ].join('|') +
8844
+ ')'
8845
+ ),
8846
+ lookbehind: true,
8847
+ greedy: true,
8848
+ inside: {
8849
+ keyword: /^@\w*/,
8850
+ csharp: cs
8851
+ }
8852
+ },
8853
+ directive: {
8854
+ pattern:
8855
+ /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
8856
+ lookbehind: true,
8857
+ greedy: true,
8858
+ inside: {
8859
+ keyword: /^@\w+/,
8860
+ csharp: cs
8861
+ }
8862
+ },
8863
+ value: {
8864
+ pattern: RegExp(
8865
+ /(^|[^@])@/.source +
8866
+ /(?:await\b\s*)?/.source +
8867
+ '(?:' +
8868
+ /\w+\b/.source +
8869
+ '|' +
8870
+ round +
8871
+ ')' +
8872
+ '(?:' +
8873
+ /[?!]?\.\w+\b/.source +
8874
+ '|' +
8875
+ round +
8876
+ '|' +
8877
+ square +
8878
+ '|' +
8879
+ angle +
8880
+ round +
8881
+ ')*'
8882
+ ),
8883
+ lookbehind: true,
8884
+ greedy: true,
8885
+ alias: 'variable',
8886
+ inside: {
8887
+ keyword: /^@/,
8888
+ csharp: cs
8889
+ }
8890
+ },
8891
+ 'delegate-operator': {
8892
+ pattern: /(^|[^@])@(?=<)/,
8893
+ lookbehind: true,
8894
+ alias: 'operator'
8895
+ }
8896
+ });
8897
+ Prism.languages.razor = Prism.languages.cshtml;
8898
+ })(Prism);
8899
+ }
8900
+ return cshtml_1;
8606
8901
  }
8607
8902
 
8608
- var refractorCsharp = csharp_1;
8609
- var cshtml_1 = cshtml;
8610
- cshtml.displayName = 'cshtml';
8611
- cshtml.aliases = ['razor'];
8612
- function cshtml(Prism) {
8613
- Prism.register(refractorCsharp)
8614
- // Docs:
8615
- // https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio
8616
- // https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0
8617
- ;(function (Prism) {
8618
- var commentLike = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//
8619
- .source;
8620
- var stringLike =
8621
- /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source +
8622
- '|' +
8623
- /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
8624
- /**
8625
- * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
8626
- *
8627
- * @param {string} pattern
8628
- * @param {number} depthLog2
8629
- * @returns {string}
8630
- */
8631
- function nested(pattern, depthLog2) {
8632
- for (var i = 0; i < depthLog2; i++) {
8633
- pattern = pattern.replace(/<self>/g, function () {
8634
- return '(?:' + pattern + ')'
8635
- });
8636
- }
8637
- return pattern
8638
- .replace(/<self>/g, '[^\\s\\S]')
8639
- .replace(/<str>/g, '(?:' + stringLike + ')')
8640
- .replace(/<comment>/g, '(?:' + commentLike + ')')
8641
- }
8642
- var round = nested(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2);
8643
- var square = nested(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 2);
8644
- var curly = nested(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2);
8645
- var angle = nested(/<(?:[^<>'"@/]|<str>|<comment>|<self>)*>/.source, 2); // Note about the above bracket patterns:
8646
- // They all ignore HTML expressions that might be in the C# code. This is a problem because HTML (like strings and
8647
- // comments) is parsed differently. This is a huge problem because HTML might contain brackets and quotes which
8648
- // messes up the bracket and string counting implemented by the above patterns.
8649
- //
8650
- // This problem is not fixable because 1) HTML expression are highly context sensitive and very difficult to detect
8651
- // and 2) they require one capturing group at every nested level. See the `tagRegion` pattern to admire the
8652
- // complexity of an HTML expression.
8653
- //
8654
- // To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also
8655
- // allows invalid characters to support HTML expressions like this: <p>That's it!</p>.
8656
- var tagAttrs =
8657
- /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/
8658
- .source;
8659
- var tagContent = /(?!\d)[^\s>\/=$<%]+/.source + tagAttrs + /\s*\/?>/.source;
8660
- var tagRegion =
8661
- /\B@?/.source +
8662
- '(?:' +
8663
- /<([a-zA-Z][\w:]*)/.source +
8664
- tagAttrs +
8665
- /\s*>/.source +
8666
- '(?:' +
8667
- (/[^<]/.source +
8668
- '|' + // all tags that are not the start tag
8669
- // eslint-disable-next-line regexp/strict
8670
- /<\/?(?!\1\b)/.source +
8671
- tagContent +
8672
- '|' + // nested start tag
8673
- nested(
8674
- // eslint-disable-next-line regexp/strict
8675
- /<\1/.source +
8676
- tagAttrs +
8677
- /\s*>/.source +
8678
- '(?:' +
8679
- (/[^<]/.source +
8680
- '|' + // all tags that are not the start tag
8681
- // eslint-disable-next-line regexp/strict
8682
- /<\/?(?!\1\b)/.source +
8683
- tagContent +
8684
- '|' +
8685
- '<self>') +
8686
- ')*' + // eslint-disable-next-line regexp/strict
8687
- /<\/\1\s*>/.source,
8688
- 2
8689
- )) +
8690
- ')*' + // eslint-disable-next-line regexp/strict
8691
- /<\/\1\s*>/.source +
8692
- '|' +
8693
- /</.source +
8694
- tagContent +
8695
- ')'; // Now for the actual language definition(s):
8696
- //
8697
- // Razor as a language has 2 parts:
8698
- // 1) CSHTML: A markup-like language that has been extended with inline C# code expressions and blocks.
8699
- // 2) C#+HTML: A variant of C# that can contain CSHTML tags as expressions.
8700
- //
8701
- // In the below code, both CSHTML and C#+HTML will be create as separate language definitions that reference each
8702
- // other. However, only CSHTML will be exported via `Prism.languages`.
8703
- Prism.languages.cshtml = Prism.languages.extend('markup', {});
8704
- var csharpWithHtml = Prism.languages.insertBefore(
8705
- 'csharp',
8706
- 'string',
8707
- {
8708
- html: {
8709
- pattern: RegExp(tagRegion),
8710
- greedy: true,
8711
- inside: Prism.languages.cshtml
8712
- }
8713
- },
8714
- {
8715
- csharp: Prism.languages.extend('csharp', {})
8716
- }
8717
- );
8718
- var cs = {
8719
- pattern: /\S[\s\S]*/,
8720
- alias: 'language-csharp',
8721
- inside: csharpWithHtml
8722
- };
8723
- Prism.languages.insertBefore('cshtml', 'prolog', {
8724
- 'razor-comment': {
8725
- pattern: /@\*[\s\S]*?\*@/,
8726
- greedy: true,
8727
- alias: 'comment'
8728
- },
8729
- block: {
8730
- pattern: RegExp(
8731
- /(^|[^@])@/.source +
8732
- '(?:' +
8733
- [
8734
- // @{ ... }
8735
- curly, // @code{ ... }
8736
- /(?:code|functions)\s*/.source + curly, // @for (...) { ... }
8737
- /(?:for|foreach|lock|switch|using|while)\s*/.source +
8738
- round +
8739
- /\s*/.source +
8740
- curly, // @do { ... } while (...);
8741
- /do\s*/.source +
8742
- curly +
8743
- /\s*while\s*/.source +
8744
- round +
8745
- /(?:\s*;)?/.source, // @try { ... } catch (...) { ... } finally { ... }
8746
- /try\s*/.source +
8747
- curly +
8748
- /\s*catch\s*/.source +
8749
- round +
8750
- /\s*/.source +
8751
- curly +
8752
- /\s*finally\s*/.source +
8753
- curly, // @if (...) {...} else if (...) {...} else {...}
8754
- /if\s*/.source +
8755
- round +
8756
- /\s*/.source +
8757
- curly +
8758
- '(?:' +
8759
- /\s*else/.source +
8760
- '(?:' +
8761
- /\s+if\s*/.source +
8762
- round +
8763
- ')?' +
8764
- /\s*/.source +
8765
- curly +
8766
- ')*'
8767
- ].join('|') +
8768
- ')'
8769
- ),
8770
- lookbehind: true,
8771
- greedy: true,
8772
- inside: {
8773
- keyword: /^@\w*/,
8774
- csharp: cs
8775
- }
8776
- },
8777
- directive: {
8778
- pattern:
8779
- /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
8780
- lookbehind: true,
8781
- greedy: true,
8782
- inside: {
8783
- keyword: /^@\w+/,
8784
- csharp: cs
8785
- }
8786
- },
8787
- value: {
8788
- pattern: RegExp(
8789
- /(^|[^@])@/.source +
8790
- /(?:await\b\s*)?/.source +
8791
- '(?:' +
8792
- /\w+\b/.source +
8793
- '|' +
8794
- round +
8795
- ')' +
8796
- '(?:' +
8797
- /[?!]?\.\w+\b/.source +
8798
- '|' +
8799
- round +
8800
- '|' +
8801
- square +
8802
- '|' +
8803
- angle +
8804
- round +
8805
- ')*'
8806
- ),
8807
- lookbehind: true,
8808
- greedy: true,
8809
- alias: 'variable',
8810
- inside: {
8811
- keyword: /^@/,
8812
- csharp: cs
8813
- }
8814
- },
8815
- 'delegate-operator': {
8816
- pattern: /(^|[^@])@(?=<)/,
8817
- lookbehind: true,
8818
- alias: 'operator'
8819
- }
8820
- });
8821
- Prism.languages.razor = Prism.languages.cshtml;
8822
- })(Prism);
8903
+ var csp_1;
8904
+ var hasRequiredCsp;
8905
+
8906
+ function requireCsp () {
8907
+ if (hasRequiredCsp) return csp_1;
8908
+ hasRequiredCsp = 1;
8909
+
8910
+ csp_1 = csp;
8911
+ csp.displayName = 'csp';
8912
+ csp.aliases = [];
8913
+ function csp(Prism) {
8914
+ (function (Prism) {
8915
+ /**
8916
+ * @param {string} source
8917
+ * @returns {RegExp}
8918
+ */
8919
+ function value(source) {
8920
+ return RegExp(
8921
+ /([ \t])/.source + '(?:' + source + ')' + /(?=[\s;]|$)/.source,
8922
+ 'i'
8923
+ )
8924
+ }
8925
+ Prism.languages.csp = {
8926
+ directive: {
8927
+ pattern:
8928
+ /(^|[\s;])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[\s;]|$)/i,
8929
+ lookbehind: true,
8930
+ alias: 'property'
8931
+ },
8932
+ scheme: {
8933
+ pattern: value(/[a-z][a-z0-9.+-]*:/.source),
8934
+ lookbehind: true
8935
+ },
8936
+ none: {
8937
+ pattern: value(/'none'/.source),
8938
+ lookbehind: true,
8939
+ alias: 'keyword'
8940
+ },
8941
+ nonce: {
8942
+ pattern: value(/'nonce-[-+/\w=]+'/.source),
8943
+ lookbehind: true,
8944
+ alias: 'number'
8945
+ },
8946
+ hash: {
8947
+ pattern: value(/'sha(?:256|384|512)-[-+/\w=]+'/.source),
8948
+ lookbehind: true,
8949
+ alias: 'number'
8950
+ },
8951
+ host: {
8952
+ pattern: value(
8953
+ /[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source +
8954
+ '|' +
8955
+ /\*[^\s;,']*/.source +
8956
+ '|' +
8957
+ /[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source
8958
+ ),
8959
+ lookbehind: true,
8960
+ alias: 'url',
8961
+ inside: {
8962
+ important: /\*/
8963
+ }
8964
+ },
8965
+ keyword: [
8966
+ {
8967
+ pattern: value(/'unsafe-[a-z-]+'/.source),
8968
+ lookbehind: true,
8969
+ alias: 'unsafe'
8970
+ },
8971
+ {
8972
+ pattern: value(/'[a-z-]+'/.source),
8973
+ lookbehind: true,
8974
+ alias: 'safe'
8975
+ }
8976
+ ],
8977
+ punctuation: /;/
8978
+ };
8979
+ })(Prism);
8980
+ }
8981
+ return csp_1;
8823
8982
  }
8824
8983
 
8825
- var csp_1 = csp;
8826
- csp.displayName = 'csp';
8827
- csp.aliases = [];
8828
- function csp(Prism) {
8984
+ var cssExtras_1;
8985
+ var hasRequiredCssExtras;
8986
+
8987
+ function requireCssExtras () {
8988
+ if (hasRequiredCssExtras) return cssExtras_1;
8989
+ hasRequiredCssExtras = 1;
8990
+
8991
+ cssExtras_1 = cssExtras;
8992
+ cssExtras.displayName = 'cssExtras';
8993
+ cssExtras.aliases = [];
8994
+ function cssExtras(Prism) {
8829
8995
  (function (Prism) {
8830
- /**
8831
- * @param {string} source
8832
- * @returns {RegExp}
8833
- */
8834
- function value(source) {
8835
- return RegExp(
8836
- /([ \t])/.source + '(?:' + source + ')' + /(?=[\s;]|$)/.source,
8837
- 'i'
8838
- )
8839
- }
8840
- Prism.languages.csp = {
8841
- directive: {
8842
- pattern:
8843
- /(^|[\s;])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[\s;]|$)/i,
8844
- lookbehind: true,
8845
- alias: 'property'
8846
- },
8847
- scheme: {
8848
- pattern: value(/[a-z][a-z0-9.+-]*:/.source),
8849
- lookbehind: true
8850
- },
8851
- none: {
8852
- pattern: value(/'none'/.source),
8853
- lookbehind: true,
8854
- alias: 'keyword'
8855
- },
8856
- nonce: {
8857
- pattern: value(/'nonce-[-+/\w=]+'/.source),
8858
- lookbehind: true,
8859
- alias: 'number'
8860
- },
8861
- hash: {
8862
- pattern: value(/'sha(?:256|384|512)-[-+/\w=]+'/.source),
8863
- lookbehind: true,
8864
- alias: 'number'
8865
- },
8866
- host: {
8867
- pattern: value(
8868
- /[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source +
8869
- '|' +
8870
- /\*[^\s;,']*/.source +
8871
- '|' +
8872
- /[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source
8873
- ),
8874
- lookbehind: true,
8875
- alias: 'url',
8876
- inside: {
8877
- important: /\*/
8878
- }
8879
- },
8880
- keyword: [
8881
- {
8882
- pattern: value(/'unsafe-[a-z-]+'/.source),
8883
- lookbehind: true,
8884
- alias: 'unsafe'
8885
- },
8886
- {
8887
- pattern: value(/'[a-z-]+'/.source),
8888
- lookbehind: true,
8889
- alias: 'safe'
8890
- }
8891
- ],
8892
- punctuation: /;/
8893
- };
8894
- })(Prism);
8996
+ var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
8997
+ var selectorInside;
8998
+ Prism.languages.css.selector = {
8999
+ pattern: Prism.languages.css.selector.pattern,
9000
+ lookbehind: true,
9001
+ inside: (selectorInside = {
9002
+ 'pseudo-element':
9003
+ /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
9004
+ 'pseudo-class': /:[-\w]+/,
9005
+ class: /\.[-\w]+/,
9006
+ id: /#[-\w]+/,
9007
+ attribute: {
9008
+ pattern: RegExp('\\[(?:[^[\\]"\']|' + string.source + ')*\\]'),
9009
+ greedy: true,
9010
+ inside: {
9011
+ punctuation: /^\[|\]$/,
9012
+ 'case-sensitivity': {
9013
+ pattern: /(\s)[si]$/i,
9014
+ lookbehind: true,
9015
+ alias: 'keyword'
9016
+ },
9017
+ namespace: {
9018
+ pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
9019
+ lookbehind: true,
9020
+ inside: {
9021
+ punctuation: /\|$/
9022
+ }
9023
+ },
9024
+ 'attr-name': {
9025
+ pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
9026
+ lookbehind: true
9027
+ },
9028
+ 'attr-value': [
9029
+ string,
9030
+ {
9031
+ pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
9032
+ lookbehind: true
9033
+ }
9034
+ ],
9035
+ operator: /[|~*^$]?=/
9036
+ }
9037
+ },
9038
+ 'n-th': [
9039
+ {
9040
+ pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
9041
+ lookbehind: true,
9042
+ inside: {
9043
+ number: /[\dn]+/,
9044
+ operator: /[+-]/
9045
+ }
9046
+ },
9047
+ {
9048
+ pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
9049
+ lookbehind: true
9050
+ }
9051
+ ],
9052
+ combinator: />|\+|~|\|\|/,
9053
+ // the `tag` token has been existed and removed.
9054
+ // because we can't find a perfect tokenize to match it.
9055
+ // if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first.
9056
+ punctuation: /[(),]/
9057
+ })
9058
+ };
9059
+ Prism.languages.css['atrule'].inside['selector-function-argument'].inside =
9060
+ selectorInside;
9061
+ Prism.languages.insertBefore('css', 'property', {
9062
+ variable: {
9063
+ pattern:
9064
+ /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
9065
+ lookbehind: true
9066
+ }
9067
+ });
9068
+ var unit = {
9069
+ pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
9070
+ lookbehind: true
9071
+ }; // 123 -123 .123 -.123 12.3 -12.3
9072
+ var number = {
9073
+ pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
9074
+ lookbehind: true
9075
+ };
9076
+ Prism.languages.insertBefore('css', 'function', {
9077
+ operator: {
9078
+ pattern: /(\s)[+\-*\/](?=\s)/,
9079
+ lookbehind: true
9080
+ },
9081
+ // CAREFUL!
9082
+ // Previewers and Inline color use hexcode and color.
9083
+ hexcode: {
9084
+ pattern: /\B#[\da-f]{3,8}\b/i,
9085
+ alias: 'color'
9086
+ },
9087
+ color: [
9088
+ {
9089
+ pattern:
9090
+ /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
9091
+ lookbehind: true
9092
+ },
9093
+ {
9094
+ pattern:
9095
+ /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
9096
+ inside: {
9097
+ unit: unit,
9098
+ number: number,
9099
+ function: /[\w-]+(?=\()/,
9100
+ punctuation: /[(),]/
9101
+ }
9102
+ }
9103
+ ],
9104
+ // it's important that there is no boundary assertion after the hex digits
9105
+ entity: /\\[\da-f]{1,8}/i,
9106
+ unit: unit,
9107
+ number: number
9108
+ });
9109
+ })(Prism);
9110
+ }
9111
+ return cssExtras_1;
8895
9112
  }
8896
9113
 
8897
- var cssExtras_1 = cssExtras;
8898
- cssExtras.displayName = 'cssExtras';
8899
- cssExtras.aliases = [];
8900
- function cssExtras(Prism) {
8901
- (function (Prism) {
8902
- var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
8903
- var selectorInside;
8904
- Prism.languages.css.selector = {
8905
- pattern: Prism.languages.css.selector.pattern,
8906
- lookbehind: true,
8907
- inside: (selectorInside = {
8908
- 'pseudo-element':
8909
- /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
8910
- 'pseudo-class': /:[-\w]+/,
8911
- class: /\.[-\w]+/,
8912
- id: /#[-\w]+/,
8913
- attribute: {
8914
- pattern: RegExp('\\[(?:[^[\\]"\']|' + string.source + ')*\\]'),
8915
- greedy: true,
8916
- inside: {
8917
- punctuation: /^\[|\]$/,
8918
- 'case-sensitivity': {
8919
- pattern: /(\s)[si]$/i,
8920
- lookbehind: true,
8921
- alias: 'keyword'
8922
- },
8923
- namespace: {
8924
- pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
8925
- lookbehind: true,
8926
- inside: {
8927
- punctuation: /\|$/
8928
- }
8929
- },
8930
- 'attr-name': {
8931
- pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
8932
- lookbehind: true
8933
- },
8934
- 'attr-value': [
8935
- string,
8936
- {
8937
- pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
8938
- lookbehind: true
8939
- }
8940
- ],
8941
- operator: /[|~*^$]?=/
8942
- }
8943
- },
8944
- 'n-th': [
8945
- {
8946
- pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
8947
- lookbehind: true,
8948
- inside: {
8949
- number: /[\dn]+/,
8950
- operator: /[+-]/
8951
- }
8952
- },
8953
- {
8954
- pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
8955
- lookbehind: true
8956
- }
8957
- ],
8958
- combinator: />|\+|~|\|\|/,
8959
- // the `tag` token has been existed and removed.
8960
- // because we can't find a perfect tokenize to match it.
8961
- // if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first.
8962
- punctuation: /[(),]/
8963
- })
8964
- };
8965
- Prism.languages.css['atrule'].inside['selector-function-argument'].inside =
8966
- selectorInside;
8967
- Prism.languages.insertBefore('css', 'property', {
8968
- variable: {
8969
- pattern:
8970
- /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
8971
- lookbehind: true
8972
- }
8973
- });
8974
- var unit = {
8975
- pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
8976
- lookbehind: true
8977
- }; // 123 -123 .123 -.123 12.3 -12.3
8978
- var number = {
8979
- pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
8980
- lookbehind: true
8981
- };
8982
- Prism.languages.insertBefore('css', 'function', {
8983
- operator: {
8984
- pattern: /(\s)[+\-*\/](?=\s)/,
8985
- lookbehind: true
8986
- },
8987
- // CAREFUL!
8988
- // Previewers and Inline color use hexcode and color.
8989
- hexcode: {
8990
- pattern: /\B#[\da-f]{3,8}\b/i,
8991
- alias: 'color'
8992
- },
8993
- color: [
8994
- {
8995
- pattern:
8996
- /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
8997
- lookbehind: true
8998
- },
8999
- {
9000
- pattern:
9001
- /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
9002
- inside: {
9003
- unit: unit,
9004
- number: number,
9005
- function: /[\w-]+(?=\()/,
9006
- punctuation: /[(),]/
9007
- }
9008
- }
9009
- ],
9010
- // it's important that there is no boundary assertion after the hex digits
9011
- entity: /\\[\da-f]{1,8}/i,
9012
- unit: unit,
9013
- number: number
9014
- });
9015
- })(Prism);
9016
- }
9114
+ var csv_1;
9115
+ var hasRequiredCsv;
9017
9116
 
9018
- var csv_1 = csv;
9019
- csv.displayName = 'csv';
9020
- csv.aliases = [];
9021
- function csv(Prism) {
9022
- // https://tools.ietf.org/html/rfc4180
9023
- Prism.languages.csv = {
9024
- value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,
9025
- punctuation: /,/
9026
- };
9117
+ function requireCsv () {
9118
+ if (hasRequiredCsv) return csv_1;
9119
+ hasRequiredCsv = 1;
9120
+
9121
+ csv_1 = csv;
9122
+ csv.displayName = 'csv';
9123
+ csv.aliases = [];
9124
+ function csv(Prism) {
9125
+ // https://tools.ietf.org/html/rfc4180
9126
+ Prism.languages.csv = {
9127
+ value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,
9128
+ punctuation: /,/
9129
+ };
9130
+ }
9131
+ return csv_1;
9027
9132
  }
9028
9133
 
9029
9134
  var cypher_1;
@@ -9075,90 +9180,99 @@ function requireCypher () {
9075
9180
  return cypher_1;
9076
9181
  }
9077
9182
 
9078
- var d_1 = d;
9079
- d.displayName = 'd';
9080
- d.aliases = [];
9081
- function d(Prism) {
9082
- Prism.languages.d = Prism.languages.extend('clike', {
9083
- comment: [
9084
- {
9085
- // Shebang
9086
- pattern: /^\s*#!.+/,
9087
- greedy: true
9088
- },
9089
- {
9090
- pattern: RegExp(
9091
- /(^|[^\\])/.source +
9092
- '(?:' +
9093
- [
9094
- // /+ comment +/
9095
- // Allow one level of nesting
9096
- /\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source, // // comment
9097
- /\/\/.*/.source, // /* comment */
9098
- /\/\*[\s\S]*?\*\//.source
9099
- ].join('|') +
9100
- ')'
9101
- ),
9102
- lookbehind: true,
9103
- greedy: true
9104
- }
9105
- ],
9106
- string: [
9107
- {
9108
- pattern: RegExp(
9109
- [
9110
- // r"", x""
9111
- /\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source, // q"[]", q"()", q"<>", q"{}"
9112
- /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source, // q"IDENT
9113
- // ...
9114
- // IDENT"
9115
- /\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source, // q"//", q"||", etc.
9116
- // eslint-disable-next-line regexp/strict
9117
- /\bq"(.)[\s\S]*?\2"/.source, // eslint-disable-next-line regexp/strict
9118
- /(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source
9119
- ].join('|'),
9120
- 'm'
9121
- ),
9122
- greedy: true
9123
- },
9124
- {
9125
- pattern: /\bq\{(?:\{[^{}]*\}|[^{}])*\}/,
9126
- greedy: true,
9127
- alias: 'token-string'
9128
- }
9129
- ],
9130
- // In order: $, keywords and special tokens, globally defined symbols
9131
- keyword:
9132
- /\$|\b(?:__(?:(?:DATE|EOF|FILE|FUNCTION|LINE|MODULE|PRETTY_FUNCTION|TIMESTAMP|TIME|VENDOR|VERSION)__|gshared|parameters|traits|vector)|abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|dstring|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|ptrdiff_t|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|wstring)\b/,
9133
- number: [
9134
- // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator
9135
- // Hexadecimal numbers must be handled separately to avoid problems with exponent "e"
9136
- /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i,
9137
- {
9138
- pattern:
9139
- /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i,
9140
- lookbehind: true
9141
- }
9142
- ],
9143
- operator:
9144
- /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/
9145
- });
9146
- Prism.languages.insertBefore('d', 'string', {
9147
- // Characters
9148
- // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot'
9149
- char: /'(?:\\(?:\W|\w+)|[^\\])'/
9150
- });
9151
- Prism.languages.insertBefore('d', 'keyword', {
9152
- property: /\B@\w*/
9153
- });
9154
- Prism.languages.insertBefore('d', 'function', {
9155
- register: {
9156
- // Iasm registers
9157
- pattern:
9158
- /\b(?:[ABCD][LHX]|E?(?:BP|DI|SI|SP)|[BS]PL|[ECSDGF]S|CR[0234]|[DS]IL|DR[012367]|E[ABCD]X|X?MM[0-7]|R(?:1[0-5]|[89])[BWD]?|R[ABCD]X|R[BS]P|R[DS]I|TR[3-7]|XMM(?:1[0-5]|[89])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,
9159
- alias: 'variable'
9160
- }
9161
- });
9183
+ var d_1;
9184
+ var hasRequiredD;
9185
+
9186
+ function requireD () {
9187
+ if (hasRequiredD) return d_1;
9188
+ hasRequiredD = 1;
9189
+
9190
+ d_1 = d;
9191
+ d.displayName = 'd';
9192
+ d.aliases = [];
9193
+ function d(Prism) {
9194
+ Prism.languages.d = Prism.languages.extend('clike', {
9195
+ comment: [
9196
+ {
9197
+ // Shebang
9198
+ pattern: /^\s*#!.+/,
9199
+ greedy: true
9200
+ },
9201
+ {
9202
+ pattern: RegExp(
9203
+ /(^|[^\\])/.source +
9204
+ '(?:' +
9205
+ [
9206
+ // /+ comment +/
9207
+ // Allow one level of nesting
9208
+ /\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source, // // comment
9209
+ /\/\/.*/.source, // /* comment */
9210
+ /\/\*[\s\S]*?\*\//.source
9211
+ ].join('|') +
9212
+ ')'
9213
+ ),
9214
+ lookbehind: true,
9215
+ greedy: true
9216
+ }
9217
+ ],
9218
+ string: [
9219
+ {
9220
+ pattern: RegExp(
9221
+ [
9222
+ // r"", x""
9223
+ /\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source, // q"[]", q"()", q"<>", q"{}"
9224
+ /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source, // q"IDENT
9225
+ // ...
9226
+ // IDENT"
9227
+ /\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source, // q"//", q"||", etc.
9228
+ // eslint-disable-next-line regexp/strict
9229
+ /\bq"(.)[\s\S]*?\2"/.source, // eslint-disable-next-line regexp/strict
9230
+ /(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source
9231
+ ].join('|'),
9232
+ 'm'
9233
+ ),
9234
+ greedy: true
9235
+ },
9236
+ {
9237
+ pattern: /\bq\{(?:\{[^{}]*\}|[^{}])*\}/,
9238
+ greedy: true,
9239
+ alias: 'token-string'
9240
+ }
9241
+ ],
9242
+ // In order: $, keywords and special tokens, globally defined symbols
9243
+ keyword:
9244
+ /\$|\b(?:__(?:(?:DATE|EOF|FILE|FUNCTION|LINE|MODULE|PRETTY_FUNCTION|TIMESTAMP|TIME|VENDOR|VERSION)__|gshared|parameters|traits|vector)|abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|dstring|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|ptrdiff_t|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|wstring)\b/,
9245
+ number: [
9246
+ // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator
9247
+ // Hexadecimal numbers must be handled separately to avoid problems with exponent "e"
9248
+ /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i,
9249
+ {
9250
+ pattern:
9251
+ /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i,
9252
+ lookbehind: true
9253
+ }
9254
+ ],
9255
+ operator:
9256
+ /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/
9257
+ });
9258
+ Prism.languages.insertBefore('d', 'string', {
9259
+ // Characters
9260
+ // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot'
9261
+ char: /'(?:\\(?:\W|\w+)|[^\\])'/
9262
+ });
9263
+ Prism.languages.insertBefore('d', 'keyword', {
9264
+ property: /\B@\w*/
9265
+ });
9266
+ Prism.languages.insertBefore('d', 'function', {
9267
+ register: {
9268
+ // Iasm registers
9269
+ pattern:
9270
+ /\b(?:[ABCD][LHX]|E?(?:BP|DI|SI|SP)|[BS]PL|[ECSDGF]S|CR[0234]|[DS]IL|DR[012367]|E[ABCD]X|X?MM[0-7]|R(?:1[0-5]|[89])[BWD]?|R[ABCD]X|R[BS]P|R[DS]I|TR[3-7]|XMM(?:1[0-5]|[89])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,
9271
+ alias: 'variable'
9272
+ }
9273
+ });
9274
+ }
9275
+ return d_1;
9162
9276
  }
9163
9277
 
9164
9278
  var dart_1;
@@ -9254,224 +9368,260 @@ function requireDart () {
9254
9368
  return dart_1;
9255
9369
  }
9256
9370
 
9257
- var dataweave_1 = dataweave;
9258
- dataweave.displayName = 'dataweave';
9259
- dataweave.aliases = [];
9260
- function dataweave(Prism) {
9371
+ var dataweave_1;
9372
+ var hasRequiredDataweave;
9373
+
9374
+ function requireDataweave () {
9375
+ if (hasRequiredDataweave) return dataweave_1;
9376
+ hasRequiredDataweave = 1;
9377
+
9378
+ dataweave_1 = dataweave;
9379
+ dataweave.displayName = 'dataweave';
9380
+ dataweave.aliases = [];
9381
+ function dataweave(Prism) {
9261
9382
  (function (Prism) {
9262
- Prism.languages.dataweave = {
9263
- url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,
9264
- property: {
9265
- pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,
9266
- greedy: true
9267
- },
9268
- string: {
9269
- pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
9270
- greedy: true
9271
- },
9272
- 'mime-type':
9273
- /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/,
9274
- date: {
9275
- pattern: /\|[\w:+-]+\|/,
9276
- greedy: true
9277
- },
9278
- comment: [
9279
- {
9280
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
9281
- lookbehind: true,
9282
- greedy: true
9283
- },
9284
- {
9285
- pattern: /(^|[^\\:])\/\/.*/,
9286
- lookbehind: true,
9287
- greedy: true
9288
- }
9289
- ],
9290
- regex: {
9291
- pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,
9292
- greedy: true
9293
- },
9294
- keyword:
9295
- /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/,
9296
- function: /\b[A-Z_]\w*(?=\s*\()/i,
9297
- number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
9298
- punctuation: /[{}[\];(),.:@]/,
9299
- operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,
9300
- boolean: /\b(?:false|true)\b/
9301
- };
9302
- })(Prism);
9383
+ Prism.languages.dataweave = {
9384
+ url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,
9385
+ property: {
9386
+ pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,
9387
+ greedy: true
9388
+ },
9389
+ string: {
9390
+ pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
9391
+ greedy: true
9392
+ },
9393
+ 'mime-type':
9394
+ /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/,
9395
+ date: {
9396
+ pattern: /\|[\w:+-]+\|/,
9397
+ greedy: true
9398
+ },
9399
+ comment: [
9400
+ {
9401
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
9402
+ lookbehind: true,
9403
+ greedy: true
9404
+ },
9405
+ {
9406
+ pattern: /(^|[^\\:])\/\/.*/,
9407
+ lookbehind: true,
9408
+ greedy: true
9409
+ }
9410
+ ],
9411
+ regex: {
9412
+ pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,
9413
+ greedy: true
9414
+ },
9415
+ keyword:
9416
+ /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/,
9417
+ function: /\b[A-Z_]\w*(?=\s*\()/i,
9418
+ number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
9419
+ punctuation: /[{}[\];(),.:@]/,
9420
+ operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,
9421
+ boolean: /\b(?:false|true)\b/
9422
+ };
9423
+ })(Prism);
9424
+ }
9425
+ return dataweave_1;
9426
+ }
9427
+
9428
+ var dax_1;
9429
+ var hasRequiredDax;
9430
+
9431
+ function requireDax () {
9432
+ if (hasRequiredDax) return dax_1;
9433
+ hasRequiredDax = 1;
9434
+
9435
+ dax_1 = dax;
9436
+ dax.displayName = 'dax';
9437
+ dax.aliases = [];
9438
+ function dax(Prism) {
9439
+ Prism.languages.dax = {
9440
+ comment: {
9441
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,
9442
+ lookbehind: true
9443
+ },
9444
+ 'data-field': {
9445
+ pattern:
9446
+ /'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,
9447
+ alias: 'symbol'
9448
+ },
9449
+ measure: {
9450
+ pattern: /\[[ \w\xA0-\uFFFF]+\]/,
9451
+ alias: 'constant'
9452
+ },
9453
+ string: {
9454
+ pattern: /"(?:[^"]|"")*"(?!")/,
9455
+ greedy: true
9456
+ },
9457
+ function:
9458
+ /\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,
9459
+ keyword:
9460
+ /\b(?:DEFINE|EVALUATE|MEASURE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,
9461
+ boolean: {
9462
+ pattern: /\b(?:FALSE|NULL|TRUE)\b/i,
9463
+ alias: 'constant'
9464
+ },
9465
+ number: /\b\d+(?:\.\d*)?|\B\.\d+\b/,
9466
+ operator: /:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,
9467
+ punctuation: /[;\[\](){}`,.]/
9468
+ };
9469
+ }
9470
+ return dax_1;
9471
+ }
9472
+
9473
+ var dhall_1;
9474
+ var hasRequiredDhall;
9475
+
9476
+ function requireDhall () {
9477
+ if (hasRequiredDhall) return dhall_1;
9478
+ hasRequiredDhall = 1;
9479
+
9480
+ dhall_1 = dhall;
9481
+ dhall.displayName = 'dhall';
9482
+ dhall.aliases = [];
9483
+ function dhall(Prism) {
9484
+ // ABNF grammar:
9485
+ // https://github.com/dhall-lang/dhall-lang/blob/master/standard/dhall.abnf
9486
+ Prism.languages.dhall = {
9487
+ // Multi-line comments can be nested. E.g. {- foo {- bar -} -}
9488
+ // The multi-line pattern is essentially this:
9489
+ // \{-(?:[^-{]|-(?!\})|\{(?!-)|<SELF>)*-\}
9490
+ comment:
9491
+ /--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,
9492
+ string: {
9493
+ pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,
9494
+ greedy: true,
9495
+ inside: {
9496
+ interpolation: {
9497
+ pattern: /\$\{[^{}]*\}/,
9498
+ inside: {
9499
+ expression: {
9500
+ pattern: /(^\$\{)[\s\S]+(?=\}$)/,
9501
+ lookbehind: true,
9502
+ alias: 'language-dhall',
9503
+ inside: null // see blow
9504
+ },
9505
+ punctuation: /\$\{|\}/
9506
+ }
9507
+ }
9508
+ }
9509
+ },
9510
+ label: {
9511
+ pattern: /`[^`]*`/,
9512
+ greedy: true
9513
+ },
9514
+ url: {
9515
+ // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L596
9516
+ pattern:
9517
+ /\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,
9518
+ greedy: true
9519
+ },
9520
+ env: {
9521
+ // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L661
9522
+ pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,
9523
+ greedy: true,
9524
+ inside: {
9525
+ function: /^env/,
9526
+ operator: /^:/,
9527
+ variable: /[\s\S]+/
9528
+ }
9529
+ },
9530
+ hash: {
9531
+ // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L725
9532
+ pattern: /\bsha256:[\da-fA-F]{64}\b/,
9533
+ inside: {
9534
+ function: /sha256/,
9535
+ operator: /:/,
9536
+ number: /[\da-fA-F]{64}/
9537
+ }
9538
+ },
9539
+ // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L359
9540
+ keyword:
9541
+ /\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,
9542
+ builtin: /\b(?:None|Some)\b/,
9543
+ boolean: /\b(?:False|True)\b/,
9544
+ number:
9545
+ /\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,
9546
+ operator:
9547
+ /\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,
9548
+ punctuation: /\.\.|[{}\[\](),./]/,
9549
+ // we'll just assume that every capital word left is a type name
9550
+ 'class-name': /\b[A-Z]\w*\b/
9551
+ };
9552
+ Prism.languages.dhall.string.inside.interpolation.inside.expression.inside =
9553
+ Prism.languages.dhall;
9554
+ }
9555
+ return dhall_1;
9303
9556
  }
9304
9557
 
9305
- var dax_1 = dax;
9306
- dax.displayName = 'dax';
9307
- dax.aliases = [];
9308
- function dax(Prism) {
9309
- Prism.languages.dax = {
9310
- comment: {
9311
- pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,
9312
- lookbehind: true
9313
- },
9314
- 'data-field': {
9315
- pattern:
9316
- /'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,
9317
- alias: 'symbol'
9318
- },
9319
- measure: {
9320
- pattern: /\[[ \w\xA0-\uFFFF]+\]/,
9321
- alias: 'constant'
9322
- },
9323
- string: {
9324
- pattern: /"(?:[^"]|"")*"(?!")/,
9325
- greedy: true
9326
- },
9327
- function:
9328
- /\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,
9329
- keyword:
9330
- /\b(?:DEFINE|EVALUATE|MEASURE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,
9331
- boolean: {
9332
- pattern: /\b(?:FALSE|NULL|TRUE)\b/i,
9333
- alias: 'constant'
9334
- },
9335
- number: /\b\d+(?:\.\d*)?|\B\.\d+\b/,
9336
- operator: /:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,
9337
- punctuation: /[;\[\](){}`,.]/
9338
- };
9339
- }
9558
+ var diff_1;
9559
+ var hasRequiredDiff;
9340
9560
 
9341
- var dhall_1 = dhall;
9342
- dhall.displayName = 'dhall';
9343
- dhall.aliases = [];
9344
- function dhall(Prism) {
9345
- // ABNF grammar:
9346
- // https://github.com/dhall-lang/dhall-lang/blob/master/standard/dhall.abnf
9347
- Prism.languages.dhall = {
9348
- // Multi-line comments can be nested. E.g. {- foo {- bar -} -}
9349
- // The multi-line pattern is essentially this:
9350
- // \{-(?:[^-{]|-(?!\})|\{(?!-)|<SELF>)*-\}
9351
- comment:
9352
- /--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,
9353
- string: {
9354
- pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,
9355
- greedy: true,
9356
- inside: {
9357
- interpolation: {
9358
- pattern: /\$\{[^{}]*\}/,
9359
- inside: {
9360
- expression: {
9361
- pattern: /(^\$\{)[\s\S]+(?=\}$)/,
9362
- lookbehind: true,
9363
- alias: 'language-dhall',
9364
- inside: null // see blow
9365
- },
9366
- punctuation: /\$\{|\}/
9367
- }
9368
- }
9369
- }
9370
- },
9371
- label: {
9372
- pattern: /`[^`]*`/,
9373
- greedy: true
9374
- },
9375
- url: {
9376
- // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L596
9377
- pattern:
9378
- /\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,
9379
- greedy: true
9380
- },
9381
- env: {
9382
- // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L661
9383
- pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,
9384
- greedy: true,
9385
- inside: {
9386
- function: /^env/,
9387
- operator: /^:/,
9388
- variable: /[\s\S]+/
9389
- }
9390
- },
9391
- hash: {
9392
- // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L725
9393
- pattern: /\bsha256:[\da-fA-F]{64}\b/,
9394
- inside: {
9395
- function: /sha256/,
9396
- operator: /:/,
9397
- number: /[\da-fA-F]{64}/
9398
- }
9399
- },
9400
- // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L359
9401
- keyword:
9402
- /\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,
9403
- builtin: /\b(?:None|Some)\b/,
9404
- boolean: /\b(?:False|True)\b/,
9405
- number:
9406
- /\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,
9407
- operator:
9408
- /\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,
9409
- punctuation: /\.\.|[{}\[\](),./]/,
9410
- // we'll just assume that every capital word left is a type name
9411
- 'class-name': /\b[A-Z]\w*\b/
9412
- };
9413
- Prism.languages.dhall.string.inside.interpolation.inside.expression.inside =
9414
- Prism.languages.dhall;
9415
- }
9561
+ function requireDiff () {
9562
+ if (hasRequiredDiff) return diff_1;
9563
+ hasRequiredDiff = 1;
9416
9564
 
9417
- var diff_1 = diff;
9418
- diff.displayName = 'diff';
9419
- diff.aliases = [];
9420
- function diff(Prism) {
9565
+ diff_1 = diff;
9566
+ diff.displayName = 'diff';
9567
+ diff.aliases = [];
9568
+ function diff(Prism) {
9421
9569
  (function (Prism) {
9422
- Prism.languages.diff = {
9423
- coord: [
9424
- // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
9425
- /^(?:\*{3}|-{3}|\+{3}).*$/m, // Match "@@ ... @@" coord lines in unified diff.
9426
- /^@@.*@@$/m, // Match coord lines in normal diff (starts with a number).
9427
- /^\d.*$/m
9428
- ] // deleted, inserted, unchanged, diff
9429
- };
9430
- /**
9431
- * A map from the name of a block to its line prefix.
9432
- *
9433
- * @type {Object<string, string>}
9434
- */
9435
- var PREFIXES = {
9436
- 'deleted-sign': '-',
9437
- 'deleted-arrow': '<',
9438
- 'inserted-sign': '+',
9439
- 'inserted-arrow': '>',
9440
- unchanged: ' ',
9441
- diff: '!'
9442
- }; // add a token for each prefix
9443
- Object.keys(PREFIXES).forEach(function (name) {
9444
- var prefix = PREFIXES[name];
9445
- var alias = [];
9446
- if (!/^\w+$/.test(name)) {
9447
- // "deleted-sign" -> "deleted"
9448
- alias.push(/\w+/.exec(name)[0]);
9449
- }
9450
- if (name === 'diff') {
9451
- alias.push('bold');
9452
- }
9453
- Prism.languages.diff[name] = {
9454
- pattern: RegExp(
9455
- '^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+',
9456
- 'm'
9457
- ),
9458
- alias: alias,
9459
- inside: {
9460
- line: {
9461
- pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
9462
- lookbehind: true
9463
- },
9464
- prefix: {
9465
- pattern: /[\s\S]/,
9466
- alias: /\w+/.exec(name)[0]
9467
- }
9468
- }
9469
- };
9470
- }); // make prefixes available to Diff plugin
9471
- Object.defineProperty(Prism.languages.diff, 'PREFIXES', {
9472
- value: PREFIXES
9473
- });
9474
- })(Prism);
9570
+ Prism.languages.diff = {
9571
+ coord: [
9572
+ // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
9573
+ /^(?:\*{3}|-{3}|\+{3}).*$/m, // Match "@@ ... @@" coord lines in unified diff.
9574
+ /^@@.*@@$/m, // Match coord lines in normal diff (starts with a number).
9575
+ /^\d.*$/m
9576
+ ] // deleted, inserted, unchanged, diff
9577
+ };
9578
+ /**
9579
+ * A map from the name of a block to its line prefix.
9580
+ *
9581
+ * @type {Object<string, string>}
9582
+ */
9583
+ var PREFIXES = {
9584
+ 'deleted-sign': '-',
9585
+ 'deleted-arrow': '<',
9586
+ 'inserted-sign': '+',
9587
+ 'inserted-arrow': '>',
9588
+ unchanged: ' ',
9589
+ diff: '!'
9590
+ }; // add a token for each prefix
9591
+ Object.keys(PREFIXES).forEach(function (name) {
9592
+ var prefix = PREFIXES[name];
9593
+ var alias = [];
9594
+ if (!/^\w+$/.test(name)) {
9595
+ // "deleted-sign" -> "deleted"
9596
+ alias.push(/\w+/.exec(name)[0]);
9597
+ }
9598
+ if (name === 'diff') {
9599
+ alias.push('bold');
9600
+ }
9601
+ Prism.languages.diff[name] = {
9602
+ pattern: RegExp(
9603
+ '^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+',
9604
+ 'm'
9605
+ ),
9606
+ alias: alias,
9607
+ inside: {
9608
+ line: {
9609
+ pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
9610
+ lookbehind: true
9611
+ },
9612
+ prefix: {
9613
+ pattern: /[\s\S]/,
9614
+ alias: /\w+/.exec(name)[0]
9615
+ }
9616
+ }
9617
+ };
9618
+ }); // make prefixes available to Diff plugin
9619
+ Object.defineProperty(Prism.languages.diff, 'PREFIXES', {
9620
+ value: PREFIXES
9621
+ });
9622
+ })(Prism);
9623
+ }
9624
+ return diff_1;
9475
9625
  }
9476
9626
 
9477
9627
  var markupTemplating_1;
@@ -9586,335 +9736,362 @@ function requireMarkupTemplating () {
9586
9736
  token.content = replacement;
9587
9737
  }
9588
9738
  }
9589
- } else if (
9590
- token.content
9591
- /* && typeof token.content !== 'string' */
9592
- ) {
9593
- walkTokens(token.content);
9594
- }
9739
+ } else if (
9740
+ token.content
9741
+ /* && typeof token.content !== 'string' */
9742
+ ) {
9743
+ walkTokens(token.content);
9744
+ }
9745
+ }
9746
+ return tokens
9747
+ }
9748
+ walkTokens(env.tokens);
9749
+ }
9750
+ }
9751
+ });
9752
+ })(Prism);
9753
+ }
9754
+ return markupTemplating_1;
9755
+ }
9756
+
9757
+ var django_1;
9758
+ var hasRequiredDjango;
9759
+
9760
+ function requireDjango () {
9761
+ if (hasRequiredDjango) return django_1;
9762
+ hasRequiredDjango = 1;
9763
+ var refractorMarkupTemplating = requireMarkupTemplating();
9764
+ django_1 = django;
9765
+ django.displayName = 'django';
9766
+ django.aliases = ['jinja2'];
9767
+ function django(Prism) {
9768
+ Prism.register(refractorMarkupTemplating)
9769
+ // Django/Jinja2 syntax definition for Prism.js <http://prismjs.com> syntax highlighter.
9770
+ // Mostly it works OK but can paint code incorrectly on complex html/template tag combinations.
9771
+ ;(function (Prism) {
9772
+ Prism.languages.django = {
9773
+ comment: /^\{#[\s\S]*?#\}$/,
9774
+ tag: {
9775
+ pattern: /(^\{%[+-]?\s*)\w+/,
9776
+ lookbehind: true,
9777
+ alias: 'keyword'
9778
+ },
9779
+ delimiter: {
9780
+ pattern: /^\{[{%][+-]?|[+-]?[}%]\}$/,
9781
+ alias: 'punctuation'
9782
+ },
9783
+ string: {
9784
+ pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
9785
+ greedy: true
9786
+ },
9787
+ filter: {
9788
+ pattern: /(\|)\w+/,
9789
+ lookbehind: true,
9790
+ alias: 'function'
9791
+ },
9792
+ test: {
9793
+ pattern: /(\bis\s+(?:not\s+)?)(?!not\b)\w+/,
9794
+ lookbehind: true,
9795
+ alias: 'function'
9796
+ },
9797
+ function: /\b[a-z_]\w+(?=\s*\()/i,
9798
+ keyword:
9799
+ /\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,
9800
+ operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
9801
+ number: /\b\d+(?:\.\d+)?\b/,
9802
+ boolean: /[Ff]alse|[Nn]one|[Tt]rue/,
9803
+ variable: /\b\w+\b/,
9804
+ punctuation: /[{}[\](),.:;]/
9805
+ };
9806
+ var pattern = /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g;
9807
+ var markupTemplating = Prism.languages['markup-templating'];
9808
+ Prism.hooks.add('before-tokenize', function (env) {
9809
+ markupTemplating.buildPlaceholders(env, 'django', pattern);
9810
+ });
9811
+ Prism.hooks.add('after-tokenize', function (env) {
9812
+ markupTemplating.tokenizePlaceholders(env, 'django');
9813
+ }); // Add an Jinja2 alias
9814
+ Prism.languages.jinja2 = Prism.languages.django;
9815
+ Prism.hooks.add('before-tokenize', function (env) {
9816
+ markupTemplating.buildPlaceholders(env, 'jinja2', pattern);
9817
+ });
9818
+ Prism.hooks.add('after-tokenize', function (env) {
9819
+ markupTemplating.tokenizePlaceholders(env, 'jinja2');
9820
+ });
9821
+ })(Prism);
9822
+ }
9823
+ return django_1;
9824
+ }
9825
+
9826
+ var dnsZoneFile_1;
9827
+ var hasRequiredDnsZoneFile;
9828
+
9829
+ function requireDnsZoneFile () {
9830
+ if (hasRequiredDnsZoneFile) return dnsZoneFile_1;
9831
+ hasRequiredDnsZoneFile = 1;
9832
+
9833
+ dnsZoneFile_1 = dnsZoneFile;
9834
+ dnsZoneFile.displayName = 'dnsZoneFile';
9835
+ dnsZoneFile.aliases = [];
9836
+ function dnsZoneFile(Prism) {
9837
+ Prism.languages['dns-zone-file'] = {
9838
+ comment: /;.*/,
9839
+ string: {
9840
+ pattern: /"(?:\\.|[^"\\\r\n])*"/,
9841
+ greedy: true
9842
+ },
9843
+ variable: [
9844
+ {
9845
+ pattern: /(^\$ORIGIN[ \t]+)\S+/m,
9846
+ lookbehind: true
9847
+ },
9848
+ {
9849
+ pattern: /(^|\s)@(?=\s|$)/,
9850
+ lookbehind: true
9851
+ }
9852
+ ],
9853
+ keyword: /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,
9854
+ class: {
9855
+ // https://tools.ietf.org/html/rfc1035#page-13
9856
+ pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,
9857
+ lookbehind: true,
9858
+ alias: 'keyword'
9859
+ },
9860
+ type: {
9861
+ // https://en.wikipedia.org/wiki/List_of_DNS_record_types
9862
+ pattern:
9863
+ /(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,
9864
+ lookbehind: true,
9865
+ alias: 'keyword'
9866
+ },
9867
+ punctuation: /[()]/
9868
+ };
9869
+ Prism.languages['dns-zone'] = Prism.languages['dns-zone-file'];
9870
+ }
9871
+ return dnsZoneFile_1;
9872
+ }
9873
+
9874
+ var docker_1;
9875
+ var hasRequiredDocker;
9876
+
9877
+ function requireDocker () {
9878
+ if (hasRequiredDocker) return docker_1;
9879
+ hasRequiredDocker = 1;
9880
+
9881
+ docker_1 = docker;
9882
+ docker.displayName = 'docker';
9883
+ docker.aliases = ['dockerfile'];
9884
+ function docker(Prism) {
9885
+ (function (Prism) {
9886
+ // Many of the following regexes will contain negated lookaheads like `[ \t]+(?![ \t])`. This is a trick to ensure
9887
+ // that quantifiers behave *atomically*. Atomic quantifiers are necessary to prevent exponential backtracking.
9888
+ var spaceAfterBackSlash =
9889
+ /\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source; // At least one space, comment, or line break
9890
+ var space = /(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(
9891
+ /<SP_BS>/g,
9892
+ function () {
9893
+ return spaceAfterBackSlash
9894
+ }
9895
+ );
9896
+ var string =
9897
+ /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/
9898
+ .source;
9899
+ var option = /--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(
9900
+ /<STR>/g,
9901
+ function () {
9902
+ return string
9903
+ }
9904
+ );
9905
+ var stringRule = {
9906
+ pattern: RegExp(string),
9907
+ greedy: true
9908
+ };
9909
+ var commentRule = {
9910
+ pattern: /(^[ \t]*)#.*/m,
9911
+ lookbehind: true,
9912
+ greedy: true
9913
+ };
9914
+ /**
9915
+ * @param {string} source
9916
+ * @param {string} flags
9917
+ * @returns {RegExp}
9918
+ */
9919
+ function re(source, flags) {
9920
+ source = source
9921
+ .replace(/<OPT>/g, function () {
9922
+ return option
9923
+ })
9924
+ .replace(/<SP>/g, function () {
9925
+ return space
9926
+ });
9927
+ return RegExp(source, flags)
9928
+ }
9929
+ Prism.languages.docker = {
9930
+ instruction: {
9931
+ pattern:
9932
+ /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,
9933
+ lookbehind: true,
9934
+ greedy: true,
9935
+ inside: {
9936
+ options: {
9937
+ pattern: re(
9938
+ /(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,
9939
+ 'i'
9940
+ ),
9941
+ lookbehind: true,
9942
+ greedy: true,
9943
+ inside: {
9944
+ property: {
9945
+ pattern: /(^|\s)--[\w-]+/,
9946
+ lookbehind: true
9947
+ },
9948
+ string: [
9949
+ stringRule,
9950
+ {
9951
+ pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/,
9952
+ lookbehind: true
9953
+ }
9954
+ ],
9955
+ operator: /\\$/m,
9956
+ punctuation: /=/
9595
9957
  }
9596
- return tokens
9597
- }
9598
- walkTokens(env.tokens);
9958
+ },
9959
+ keyword: [
9960
+ {
9961
+ // https://docs.docker.com/engine/reference/builder/#healthcheck
9962
+ pattern: re(
9963
+ /(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/
9964
+ .source,
9965
+ 'i'
9966
+ ),
9967
+ lookbehind: true,
9968
+ greedy: true
9969
+ },
9970
+ {
9971
+ // https://docs.docker.com/engine/reference/builder/#from
9972
+ pattern: re(
9973
+ /(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/
9974
+ .source,
9975
+ 'i'
9976
+ ),
9977
+ lookbehind: true,
9978
+ greedy: true
9979
+ },
9980
+ {
9981
+ // https://docs.docker.com/engine/reference/builder/#onbuild
9982
+ pattern: re(/(^ONBUILD<SP>)\w+/.source, 'i'),
9983
+ lookbehind: true,
9984
+ greedy: true
9985
+ },
9986
+ {
9987
+ pattern: /^\w+/,
9988
+ greedy: true
9989
+ }
9990
+ ],
9991
+ comment: commentRule,
9992
+ string: stringRule,
9993
+ variable: /\$(?:\w+|\{[^{}"'\\]*\})/,
9994
+ operator: /\\$/m
9599
9995
  }
9600
- }
9601
- });
9996
+ },
9997
+ comment: commentRule
9998
+ };
9999
+ Prism.languages.dockerfile = Prism.languages.docker;
9602
10000
  })(Prism);
9603
10001
  }
9604
- return markupTemplating_1;
10002
+ return docker_1;
9605
10003
  }
9606
10004
 
9607
- var django_1;
9608
- var hasRequiredDjango;
10005
+ var dot_1;
10006
+ var hasRequiredDot;
9609
10007
 
9610
- function requireDjango () {
9611
- if (hasRequiredDjango) return django_1;
9612
- hasRequiredDjango = 1;
9613
- var refractorMarkupTemplating = requireMarkupTemplating();
9614
- django_1 = django;
9615
- django.displayName = 'django';
9616
- django.aliases = ['jinja2'];
9617
- function django(Prism) {
9618
- Prism.register(refractorMarkupTemplating)
9619
- // Django/Jinja2 syntax definition for Prism.js <http://prismjs.com> syntax highlighter.
9620
- // Mostly it works OK but can paint code incorrectly on complex html/template tag combinations.
9621
- ;(function (Prism) {
9622
- Prism.languages.django = {
9623
- comment: /^\{#[\s\S]*?#\}$/,
9624
- tag: {
9625
- pattern: /(^\{%[+-]?\s*)\w+/,
10008
+ function requireDot () {
10009
+ if (hasRequiredDot) return dot_1;
10010
+ hasRequiredDot = 1;
10011
+
10012
+ dot_1 = dot;
10013
+ dot.displayName = 'dot';
10014
+ dot.aliases = ['gv'];
10015
+ function dot(Prism) {
10016
+ (function (Prism) {
10017
+ var ID =
10018
+ '(?:' +
10019
+ [
10020
+ // an identifier
10021
+ /[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source, // a number
10022
+ /-?(?:\.\d+|\d+(?:\.\d*)?)/.source, // a double-quoted string
10023
+ /"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source, // HTML-like string
10024
+ /<(?:[^<>]|(?!<!--)<(?:[^<>"']|"[^"]*"|'[^']*')+>|<!--(?:[^-]|-(?!->))*-->)*>/
10025
+ .source
10026
+ ].join('|') +
10027
+ ')';
10028
+ var IDInside = {
10029
+ markup: {
10030
+ pattern: /(^<)[\s\S]+(?=>$)/,
9626
10031
  lookbehind: true,
9627
- alias: 'keyword'
10032
+ alias: ['language-markup', 'language-html', 'language-xml'],
10033
+ inside: Prism.languages.markup
10034
+ }
10035
+ };
10036
+ /**
10037
+ * @param {string} source
10038
+ * @param {string} flags
10039
+ * @returns {RegExp}
10040
+ */
10041
+ function withID(source, flags) {
10042
+ return RegExp(
10043
+ source.replace(/<ID>/g, function () {
10044
+ return ID
10045
+ }),
10046
+ flags
10047
+ )
10048
+ }
10049
+ Prism.languages.dot = {
10050
+ comment: {
10051
+ pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,
10052
+ greedy: true
9628
10053
  },
9629
- delimiter: {
9630
- pattern: /^\{[{%][+-]?|[+-]?[}%]\}$/,
9631
- alias: 'punctuation'
10054
+ 'graph-name': {
10055
+ pattern: withID(
10056
+ /(\b(?:digraph|graph|subgraph)[ \t\r\n]+)<ID>/.source,
10057
+ 'i'
10058
+ ),
10059
+ lookbehind: true,
10060
+ greedy: true,
10061
+ alias: 'class-name',
10062
+ inside: IDInside
9632
10063
  },
9633
- string: {
9634
- pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
9635
- greedy: true
10064
+ 'attr-value': {
10065
+ pattern: withID(/(=[ \t\r\n]*)<ID>/.source),
10066
+ lookbehind: true,
10067
+ greedy: true,
10068
+ inside: IDInside
9636
10069
  },
9637
- filter: {
9638
- pattern: /(\|)\w+/,
10070
+ 'attr-name': {
10071
+ pattern: withID(/([\[;, \t\r\n])<ID>(?=[ \t\r\n]*=)/.source),
9639
10072
  lookbehind: true,
9640
- alias: 'function'
10073
+ greedy: true,
10074
+ inside: IDInside
9641
10075
  },
9642
- test: {
9643
- pattern: /(\bis\s+(?:not\s+)?)(?!not\b)\w+/,
10076
+ keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,
10077
+ 'compass-point': {
10078
+ pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/,
9644
10079
  lookbehind: true,
9645
- alias: 'function'
10080
+ alias: 'builtin'
9646
10081
  },
9647
- function: /\b[a-z_]\w+(?=\s*\()/i,
9648
- keyword:
9649
- /\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,
9650
- operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
9651
- number: /\b\d+(?:\.\d+)?\b/,
9652
- boolean: /[Ff]alse|[Nn]one|[Tt]rue/,
9653
- variable: /\b\w+\b/,
9654
- punctuation: /[{}[\](),.:;]/
10082
+ node: {
10083
+ pattern: withID(/(^|[^-.\w\x80-\uFFFF\\])<ID>/.source),
10084
+ lookbehind: true,
10085
+ greedy: true,
10086
+ inside: IDInside
10087
+ },
10088
+ operator: /[=:]|-[->]/,
10089
+ punctuation: /[\[\]{};,]/
9655
10090
  };
9656
- var pattern = /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g;
9657
- var markupTemplating = Prism.languages['markup-templating'];
9658
- Prism.hooks.add('before-tokenize', function (env) {
9659
- markupTemplating.buildPlaceholders(env, 'django', pattern);
9660
- });
9661
- Prism.hooks.add('after-tokenize', function (env) {
9662
- markupTemplating.tokenizePlaceholders(env, 'django');
9663
- }); // Add an Jinja2 alias
9664
- Prism.languages.jinja2 = Prism.languages.django;
9665
- Prism.hooks.add('before-tokenize', function (env) {
9666
- markupTemplating.buildPlaceholders(env, 'jinja2', pattern);
9667
- });
9668
- Prism.hooks.add('after-tokenize', function (env) {
9669
- markupTemplating.tokenizePlaceholders(env, 'jinja2');
9670
- });
10091
+ Prism.languages.gv = Prism.languages.dot;
9671
10092
  })(Prism);
9672
10093
  }
9673
- return django_1;
9674
- }
9675
-
9676
- var dnsZoneFile_1 = dnsZoneFile;
9677
- dnsZoneFile.displayName = 'dnsZoneFile';
9678
- dnsZoneFile.aliases = [];
9679
- function dnsZoneFile(Prism) {
9680
- Prism.languages['dns-zone-file'] = {
9681
- comment: /;.*/,
9682
- string: {
9683
- pattern: /"(?:\\.|[^"\\\r\n])*"/,
9684
- greedy: true
9685
- },
9686
- variable: [
9687
- {
9688
- pattern: /(^\$ORIGIN[ \t]+)\S+/m,
9689
- lookbehind: true
9690
- },
9691
- {
9692
- pattern: /(^|\s)@(?=\s|$)/,
9693
- lookbehind: true
9694
- }
9695
- ],
9696
- keyword: /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,
9697
- class: {
9698
- // https://tools.ietf.org/html/rfc1035#page-13
9699
- pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,
9700
- lookbehind: true,
9701
- alias: 'keyword'
9702
- },
9703
- type: {
9704
- // https://en.wikipedia.org/wiki/List_of_DNS_record_types
9705
- pattern:
9706
- /(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,
9707
- lookbehind: true,
9708
- alias: 'keyword'
9709
- },
9710
- punctuation: /[()]/
9711
- };
9712
- Prism.languages['dns-zone'] = Prism.languages['dns-zone-file'];
9713
- }
9714
-
9715
- var docker_1 = docker;
9716
- docker.displayName = 'docker';
9717
- docker.aliases = ['dockerfile'];
9718
- function docker(Prism) {
9719
- (function (Prism) {
9720
- // Many of the following regexes will contain negated lookaheads like `[ \t]+(?![ \t])`. This is a trick to ensure
9721
- // that quantifiers behave *atomically*. Atomic quantifiers are necessary to prevent exponential backtracking.
9722
- var spaceAfterBackSlash =
9723
- /\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source; // At least one space, comment, or line break
9724
- var space = /(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(
9725
- /<SP_BS>/g,
9726
- function () {
9727
- return spaceAfterBackSlash
9728
- }
9729
- );
9730
- var string =
9731
- /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/
9732
- .source;
9733
- var option = /--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(
9734
- /<STR>/g,
9735
- function () {
9736
- return string
9737
- }
9738
- );
9739
- var stringRule = {
9740
- pattern: RegExp(string),
9741
- greedy: true
9742
- };
9743
- var commentRule = {
9744
- pattern: /(^[ \t]*)#.*/m,
9745
- lookbehind: true,
9746
- greedy: true
9747
- };
9748
- /**
9749
- * @param {string} source
9750
- * @param {string} flags
9751
- * @returns {RegExp}
9752
- */
9753
- function re(source, flags) {
9754
- source = source
9755
- .replace(/<OPT>/g, function () {
9756
- return option
9757
- })
9758
- .replace(/<SP>/g, function () {
9759
- return space
9760
- });
9761
- return RegExp(source, flags)
9762
- }
9763
- Prism.languages.docker = {
9764
- instruction: {
9765
- pattern:
9766
- /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,
9767
- lookbehind: true,
9768
- greedy: true,
9769
- inside: {
9770
- options: {
9771
- pattern: re(
9772
- /(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,
9773
- 'i'
9774
- ),
9775
- lookbehind: true,
9776
- greedy: true,
9777
- inside: {
9778
- property: {
9779
- pattern: /(^|\s)--[\w-]+/,
9780
- lookbehind: true
9781
- },
9782
- string: [
9783
- stringRule,
9784
- {
9785
- pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/,
9786
- lookbehind: true
9787
- }
9788
- ],
9789
- operator: /\\$/m,
9790
- punctuation: /=/
9791
- }
9792
- },
9793
- keyword: [
9794
- {
9795
- // https://docs.docker.com/engine/reference/builder/#healthcheck
9796
- pattern: re(
9797
- /(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/
9798
- .source,
9799
- 'i'
9800
- ),
9801
- lookbehind: true,
9802
- greedy: true
9803
- },
9804
- {
9805
- // https://docs.docker.com/engine/reference/builder/#from
9806
- pattern: re(
9807
- /(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/
9808
- .source,
9809
- 'i'
9810
- ),
9811
- lookbehind: true,
9812
- greedy: true
9813
- },
9814
- {
9815
- // https://docs.docker.com/engine/reference/builder/#onbuild
9816
- pattern: re(/(^ONBUILD<SP>)\w+/.source, 'i'),
9817
- lookbehind: true,
9818
- greedy: true
9819
- },
9820
- {
9821
- pattern: /^\w+/,
9822
- greedy: true
9823
- }
9824
- ],
9825
- comment: commentRule,
9826
- string: stringRule,
9827
- variable: /\$(?:\w+|\{[^{}"'\\]*\})/,
9828
- operator: /\\$/m
9829
- }
9830
- },
9831
- comment: commentRule
9832
- };
9833
- Prism.languages.dockerfile = Prism.languages.docker;
9834
- })(Prism);
9835
- }
9836
-
9837
- var dot_1 = dot;
9838
- dot.displayName = 'dot';
9839
- dot.aliases = ['gv'];
9840
- function dot(Prism) {
9841
- (function (Prism) {
9842
- var ID =
9843
- '(?:' +
9844
- [
9845
- // an identifier
9846
- /[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source, // a number
9847
- /-?(?:\.\d+|\d+(?:\.\d*)?)/.source, // a double-quoted string
9848
- /"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source, // HTML-like string
9849
- /<(?:[^<>]|(?!<!--)<(?:[^<>"']|"[^"]*"|'[^']*')+>|<!--(?:[^-]|-(?!->))*-->)*>/
9850
- .source
9851
- ].join('|') +
9852
- ')';
9853
- var IDInside = {
9854
- markup: {
9855
- pattern: /(^<)[\s\S]+(?=>$)/,
9856
- lookbehind: true,
9857
- alias: ['language-markup', 'language-html', 'language-xml'],
9858
- inside: Prism.languages.markup
9859
- }
9860
- };
9861
- /**
9862
- * @param {string} source
9863
- * @param {string} flags
9864
- * @returns {RegExp}
9865
- */
9866
- function withID(source, flags) {
9867
- return RegExp(
9868
- source.replace(/<ID>/g, function () {
9869
- return ID
9870
- }),
9871
- flags
9872
- )
9873
- }
9874
- Prism.languages.dot = {
9875
- comment: {
9876
- pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,
9877
- greedy: true
9878
- },
9879
- 'graph-name': {
9880
- pattern: withID(
9881
- /(\b(?:digraph|graph|subgraph)[ \t\r\n]+)<ID>/.source,
9882
- 'i'
9883
- ),
9884
- lookbehind: true,
9885
- greedy: true,
9886
- alias: 'class-name',
9887
- inside: IDInside
9888
- },
9889
- 'attr-value': {
9890
- pattern: withID(/(=[ \t\r\n]*)<ID>/.source),
9891
- lookbehind: true,
9892
- greedy: true,
9893
- inside: IDInside
9894
- },
9895
- 'attr-name': {
9896
- pattern: withID(/([\[;, \t\r\n])<ID>(?=[ \t\r\n]*=)/.source),
9897
- lookbehind: true,
9898
- greedy: true,
9899
- inside: IDInside
9900
- },
9901
- keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,
9902
- 'compass-point': {
9903
- pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/,
9904
- lookbehind: true,
9905
- alias: 'builtin'
9906
- },
9907
- node: {
9908
- pattern: withID(/(^|[^-.\w\x80-\uFFFF\\])<ID>/.source),
9909
- lookbehind: true,
9910
- greedy: true,
9911
- inside: IDInside
9912
- },
9913
- operator: /[=:]|-[->]/,
9914
- punctuation: /[\[\]{};,]/
9915
- };
9916
- Prism.languages.gv = Prism.languages.dot;
9917
- })(Prism);
10094
+ return dot_1;
9918
10095
  }
9919
10096
 
9920
10097
  var ebnf_1;
@@ -9952,37 +10129,46 @@ function requireEbnf () {
9952
10129
  return ebnf_1;
9953
10130
  }
9954
10131
 
9955
- var editorconfig_1 = editorconfig;
9956
- editorconfig.displayName = 'editorconfig';
9957
- editorconfig.aliases = [];
9958
- function editorconfig(Prism) {
9959
- Prism.languages.editorconfig = {
9960
- // https://editorconfig-specification.readthedocs.io
9961
- comment: /[;#].*/,
9962
- section: {
9963
- pattern: /(^[ \t]*)\[.+\]/m,
9964
- lookbehind: true,
9965
- alias: 'selector',
9966
- inside: {
9967
- regex: /\\\\[\[\]{},!?.*]/,
9968
- // Escape special characters with '\\'
9969
- operator: /[!?]|\.\.|\*{1,2}/,
9970
- punctuation: /[\[\]{},]/
9971
- }
9972
- },
9973
- key: {
9974
- pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,
9975
- lookbehind: true,
9976
- alias: 'attr-name'
9977
- },
9978
- value: {
9979
- pattern: /=.*/,
9980
- alias: 'attr-value',
9981
- inside: {
9982
- punctuation: /^=/
9983
- }
9984
- }
9985
- };
10132
+ var editorconfig_1;
10133
+ var hasRequiredEditorconfig;
10134
+
10135
+ function requireEditorconfig () {
10136
+ if (hasRequiredEditorconfig) return editorconfig_1;
10137
+ hasRequiredEditorconfig = 1;
10138
+
10139
+ editorconfig_1 = editorconfig;
10140
+ editorconfig.displayName = 'editorconfig';
10141
+ editorconfig.aliases = [];
10142
+ function editorconfig(Prism) {
10143
+ Prism.languages.editorconfig = {
10144
+ // https://editorconfig-specification.readthedocs.io
10145
+ comment: /[;#].*/,
10146
+ section: {
10147
+ pattern: /(^[ \t]*)\[.+\]/m,
10148
+ lookbehind: true,
10149
+ alias: 'selector',
10150
+ inside: {
10151
+ regex: /\\\\[\[\]{},!?.*]/,
10152
+ // Escape special characters with '\\'
10153
+ operator: /[!?]|\.\.|\*{1,2}/,
10154
+ punctuation: /[\[\]{},]/
10155
+ }
10156
+ },
10157
+ key: {
10158
+ pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,
10159
+ lookbehind: true,
10160
+ alias: 'attr-name'
10161
+ },
10162
+ value: {
10163
+ pattern: /=.*/,
10164
+ alias: 'attr-value',
10165
+ inside: {
10166
+ punctuation: /^=/
10167
+ }
10168
+ }
10169
+ };
10170
+ }
10171
+ return editorconfig_1;
9986
10172
  }
9987
10173
 
9988
10174
  var eiffel_1;
@@ -10259,7 +10445,7 @@ var hasRequiredErb;
10259
10445
  function requireErb () {
10260
10446
  if (hasRequiredErb) return erb_1;
10261
10447
  hasRequiredErb = 1;
10262
- var refractorRuby = ruby_1;
10448
+ var refractorRuby = requireRuby();
10263
10449
  var refractorMarkupTemplating = requireMarkupTemplating();
10264
10450
  erb_1 = erb;
10265
10451
  erb.displayName = 'erb';
@@ -12741,7 +12927,7 @@ var hasRequiredHaml;
12741
12927
  function requireHaml () {
12742
12928
  if (hasRequiredHaml) return haml_1;
12743
12929
  hasRequiredHaml = 1;
12744
- var refractorRuby = ruby_1;
12930
+ var refractorRuby = requireRuby();
12745
12931
  haml_1 = haml;
12746
12932
  haml.displayName = 'haml';
12747
12933
  haml.aliases = [];
@@ -25177,7 +25363,7 @@ function requireT4Cs () {
25177
25363
  if (hasRequiredT4Cs) return t4Cs_1;
25178
25364
  hasRequiredT4Cs = 1;
25179
25365
  var refractorT4Templating = requireT4Templating();
25180
- var refractorCsharp = csharp_1;
25366
+ var refractorCsharp = requireCsharp();
25181
25367
  t4Cs_1 = t4Cs;
25182
25368
  t4Cs.displayName = 't4Cs';
25183
25369
  t4Cs.aliases = [];
@@ -27935,7 +28121,7 @@ refractor.register(aspnet_1);
27935
28121
  refractor.register(autohotkey_1);
27936
28122
  refractor.register(autoit_1);
27937
28123
  refractor.register(avisynth_1);
27938
- refractor.register(avroIdl_1);
28124
+ refractor.register(requireAvroIdl());
27939
28125
  refractor.register(bash_1);
27940
28126
  refractor.register(basic_1);
27941
28127
  refractor.register(batch_1);
@@ -27944,7 +28130,7 @@ refractor.register(bicep_1);
27944
28130
  refractor.register(birb_1);
27945
28131
  refractor.register(bison_1);
27946
28132
  refractor.register(bnf_1);
27947
- refractor.register(brainfuck_1);
28133
+ refractor.register(requireBrainfuck());
27948
28134
  refractor.register(brightscript_1);
27949
28135
  refractor.register(bro_1);
27950
28136
  refractor.register(bsl_1);
@@ -27956,28 +28142,28 @@ refractor.register(clojure_1);
27956
28142
  refractor.register(cmake_1);
27957
28143
  refractor.register(cobol_1);
27958
28144
  refractor.register(coffeescript_1);
27959
- refractor.register(concurnas_1);
27960
- refractor.register(coq_1);
27961
- refractor.register(cpp_1);
27962
- refractor.register(crystal_1);
27963
- refractor.register(csharp_1);
27964
- refractor.register(cshtml_1);
27965
- refractor.register(csp_1);
27966
- refractor.register(cssExtras_1);
27967
- refractor.register(csv_1);
28145
+ refractor.register(requireConcurnas());
28146
+ refractor.register(requireCoq());
28147
+ refractor.register(requireCpp());
28148
+ refractor.register(requireCrystal());
28149
+ refractor.register(requireCsharp());
28150
+ refractor.register(requireCshtml());
28151
+ refractor.register(requireCsp());
28152
+ refractor.register(requireCssExtras());
28153
+ refractor.register(requireCsv());
27968
28154
  refractor.register(requireCypher());
27969
- refractor.register(d_1);
28155
+ refractor.register(requireD());
27970
28156
  refractor.register(requireDart());
27971
- refractor.register(dataweave_1);
27972
- refractor.register(dax_1);
27973
- refractor.register(dhall_1);
27974
- refractor.register(diff_1);
28157
+ refractor.register(requireDataweave());
28158
+ refractor.register(requireDax());
28159
+ refractor.register(requireDhall());
28160
+ refractor.register(requireDiff());
27975
28161
  refractor.register(requireDjango());
27976
- refractor.register(dnsZoneFile_1);
27977
- refractor.register(docker_1);
27978
- refractor.register(dot_1);
28162
+ refractor.register(requireDnsZoneFile());
28163
+ refractor.register(requireDocker());
28164
+ refractor.register(requireDot());
27979
28165
  refractor.register(requireEbnf());
27980
- refractor.register(editorconfig_1);
28166
+ refractor.register(requireEditorconfig());
27981
28167
  refractor.register(requireEiffel());
27982
28168
  refractor.register(requireEjs());
27983
28169
  refractor.register(requireElixir());
@@ -28125,7 +28311,7 @@ refractor.register(requireRest());
28125
28311
  refractor.register(requireRip());
28126
28312
  refractor.register(requireRoboconf());
28127
28313
  refractor.register(requireRobotframework());
28128
- refractor.register(ruby_1);
28314
+ refractor.register(requireRuby());
28129
28315
  refractor.register(requireRust());
28130
28316
  refractor.register(requireSas());
28131
28317
  refractor.register(requireSass());
@@ -38952,10 +39138,34 @@ function remarkThinkUpdate(content) {
38952
39138
  */
38953
39139
  function escapeContentForStream(content) {
38954
39140
  if (typeof content !== 'string') return content;
38955
- return content.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/{/g, '&#123;').replace(/}/g, '&#125;');
39141
+ // 匹配代码块的正则表达式
39142
+ var codeBlockRegex = /(```[\s\S]*?```|`[^`]*`)/g;
39143
+ // 分割内容为代码块和非代码块部分
39144
+ var parts = content.split(codeBlockRegex);
39145
+ // 对非代码块部分进行转义,保留代码块部分不变
39146
+ return parts.map(function (part, index) {
39147
+ // 奇数索引为代码块部分(根据split的特性)
39148
+ if (index % 2 === 1) {
39149
+ return part; // 代码块部分不转义
39150
+ }
39151
+ // 偶数索引为非代码块部分,进行转义
39152
+ return part.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/{/g, '&#123;').replace(/}/g, '&#125;');
39153
+ }).join('');
38956
39154
  }
38957
39155
 
38958
39156
  var renderTimer = null;
39157
+ /**
39158
+ * 预处理 MDX 内容,转义可能被误认为 HTML 标签的内容
39159
+ * @param content MDX 内容
39160
+ * @returns 处理后的内容
39161
+ */
39162
+ function preprocessMdxContent(content) {
39163
+ // 匹配可能被误认为 HTML 标签的模式,如 <数字、<字母但不是真正的组件标签
39164
+ // 真正的 React 组件标签应该以大写字母开头,如 <Component>
39165
+ // HTML 标签以小写字母开头,如 <div>
39166
+ // 需要排除正常的闭合标签 </Component>
39167
+ return content.replace(/<(?!\/|[A-Z][a-zA-Z]*\b|[a-z][a-zA-Z0-9]*\b)/g, '&lt;');
39168
+ }
38959
39169
  // 辅助函数:格式化props
38960
39170
  function formatProps(props) {
38961
39171
  return Object.entries(props).map(function (_a) {
@@ -38975,7 +39185,7 @@ function formatProps(props) {
38975
39185
  }
38976
39186
  function renderMdx(mdxContent, scope, registeredComponents) {
38977
39187
  return __awaiter(this, void 0, void 0, function () {
38978
- var componentTagRegex, usedComponents, match, vf, XComponent;
39188
+ var componentTagRegex, usedComponents, match, processedContent, vf, XComponent, e_1;
38979
39189
  return __generator(this, function (_a) {
38980
39190
  switch (_a.label) {
38981
39191
  case 0:
@@ -38987,7 +39197,8 @@ function renderMdx(mdxContent, scope, registeredComponents) {
38987
39197
  while ((match = componentTagRegex.exec(mdxContent)) !== null) {
38988
39198
  usedComponents.add(match[1]);
38989
39199
  }
38990
- return [4 /*yield*/, mdx.compile(mdxContent, {
39200
+ processedContent = preprocessMdxContent(mdxContent);
39201
+ return [4 /*yield*/, mdx.compile(processedContent, {
38991
39202
  outputFormat: "function-body",
38992
39203
  remarkPlugins: [[RemarkMath, {
38993
39204
  strict: true
@@ -39010,7 +39221,8 @@ function renderMdx(mdxContent, scope, registeredComponents) {
39010
39221
  scope: scope
39011
39222
  })];
39012
39223
  case 3:
39013
- _a.sent();
39224
+ e_1 = _a.sent();
39225
+ console.log(e_1, 'e');
39014
39226
  return [2 /*return*/, new Promise(function (resolve) {
39015
39227
  renderTimer = setTimeout(function () {
39016
39228
  resolve(/*#__PURE__*/React__namespace.createElement('div', {