@banyan_cloud/roots 1.0.91 → 1.0.92

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/cjs/index.js CHANGED
@@ -20527,126 +20527,134 @@ function c(Prism) {
20527
20527
  delete Prism.languages.c['boolean'];
20528
20528
  }
20529
20529
 
20530
- var refractorC$1 = c_1;
20531
- var cpp_1 = cpp;
20532
- cpp.displayName = 'cpp';
20533
- cpp.aliases = [];
20534
- function cpp(Prism) {
20535
- Prism.register(refractorC$1)
20536
- ;(function (Prism) {
20537
- var keyword =
20538
- /\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/;
20539
- var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(
20540
- /<keyword>/g,
20541
- function () {
20542
- return keyword.source
20543
- }
20544
- );
20545
- Prism.languages.cpp = Prism.languages.extend('c', {
20546
- 'class-name': [
20547
- {
20548
- pattern: RegExp(
20549
- /(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(
20550
- /<keyword>/g,
20551
- function () {
20552
- return keyword.source
20553
- }
20554
- )
20555
- ),
20556
- lookbehind: true
20557
- }, // This is intended to capture the class name of method implementations like:
20558
- // void foo::bar() const {}
20559
- // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
20560
- // it starts with an uppercase letter. This approximation should give decent results.
20561
- /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, // This will capture the class name before destructors like:
20562
- // Foo::~Foo() {}
20563
- /\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
20564
- // parameters, so it can't be a namespace (until C++ adds generic namespaces).
20565
- /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
20566
- ],
20567
- keyword: keyword,
20568
- number: {
20569
- pattern:
20570
- /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
20571
- greedy: true
20572
- },
20573
- operator:
20574
- />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
20575
- boolean: /\b(?:false|true)\b/
20576
- });
20577
- Prism.languages.insertBefore('cpp', 'string', {
20578
- module: {
20579
- // https://en.cppreference.com/w/cpp/language/modules
20580
- pattern: RegExp(
20581
- /(\b(?:import|module)\s+)/.source +
20582
- '(?:' + // header-name
20583
- /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source +
20584
- '|' + // module name or partition or both
20585
- /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(
20586
- /<mod-name>/g,
20587
- function () {
20588
- return modName
20589
- }
20590
- ) +
20591
- ')'
20592
- ),
20593
- lookbehind: true,
20594
- greedy: true,
20595
- inside: {
20596
- string: /^[<"][\s\S]+/,
20597
- operator: /:/,
20598
- punctuation: /\./
20599
- }
20600
- },
20601
- 'raw-string': {
20602
- pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
20603
- alias: 'string',
20604
- greedy: true
20605
- }
20606
- });
20607
- Prism.languages.insertBefore('cpp', 'keyword', {
20608
- 'generic-function': {
20609
- pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
20610
- inside: {
20611
- function: /^\w+/,
20612
- generic: {
20613
- pattern: /<[\s\S]+/,
20614
- alias: 'class-name',
20615
- inside: Prism.languages.cpp
20616
- }
20617
- }
20618
- }
20619
- });
20620
- Prism.languages.insertBefore('cpp', 'operator', {
20621
- 'double-colon': {
20622
- pattern: /::/,
20623
- alias: 'punctuation'
20624
- }
20625
- });
20626
- Prism.languages.insertBefore('cpp', 'class-name', {
20627
- // the base clause is an optional list of parent classes
20628
- // https://en.cppreference.com/w/cpp/language/class
20629
- 'base-clause': {
20630
- pattern:
20631
- /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
20632
- lookbehind: true,
20633
- greedy: true,
20634
- inside: Prism.languages.extend('cpp', {})
20635
- }
20636
- });
20637
- Prism.languages.insertBefore(
20638
- 'inside',
20639
- 'double-colon',
20640
- {
20641
- // All untokenized words that are not namespaces should be class names
20642
- 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i
20643
- },
20644
- Prism.languages.cpp['base-clause']
20645
- );
20646
- })(Prism);
20530
+ var cpp_1;
20531
+ var hasRequiredCpp;
20532
+
20533
+ function requireCpp () {
20534
+ if (hasRequiredCpp) return cpp_1;
20535
+ hasRequiredCpp = 1;
20536
+ var refractorC = c_1;
20537
+ cpp_1 = cpp;
20538
+ cpp.displayName = 'cpp';
20539
+ cpp.aliases = [];
20540
+ function cpp(Prism) {
20541
+ Prism.register(refractorC)
20542
+ ;(function (Prism) {
20543
+ var keyword =
20544
+ /\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/;
20545
+ var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(
20546
+ /<keyword>/g,
20547
+ function () {
20548
+ return keyword.source
20549
+ }
20550
+ );
20551
+ Prism.languages.cpp = Prism.languages.extend('c', {
20552
+ 'class-name': [
20553
+ {
20554
+ pattern: RegExp(
20555
+ /(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(
20556
+ /<keyword>/g,
20557
+ function () {
20558
+ return keyword.source
20559
+ }
20560
+ )
20561
+ ),
20562
+ lookbehind: true
20563
+ }, // This is intended to capture the class name of method implementations like:
20564
+ // void foo::bar() const {}
20565
+ // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
20566
+ // it starts with an uppercase letter. This approximation should give decent results.
20567
+ /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, // This will capture the class name before destructors like:
20568
+ // Foo::~Foo() {}
20569
+ /\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
20570
+ // parameters, so it can't be a namespace (until C++ adds generic namespaces).
20571
+ /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
20572
+ ],
20573
+ keyword: keyword,
20574
+ number: {
20575
+ pattern:
20576
+ /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
20577
+ greedy: true
20578
+ },
20579
+ operator:
20580
+ />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
20581
+ boolean: /\b(?:false|true)\b/
20582
+ });
20583
+ Prism.languages.insertBefore('cpp', 'string', {
20584
+ module: {
20585
+ // https://en.cppreference.com/w/cpp/language/modules
20586
+ pattern: RegExp(
20587
+ /(\b(?:import|module)\s+)/.source +
20588
+ '(?:' + // header-name
20589
+ /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source +
20590
+ '|' + // module name or partition or both
20591
+ /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(
20592
+ /<mod-name>/g,
20593
+ function () {
20594
+ return modName
20595
+ }
20596
+ ) +
20597
+ ')'
20598
+ ),
20599
+ lookbehind: true,
20600
+ greedy: true,
20601
+ inside: {
20602
+ string: /^[<"][\s\S]+/,
20603
+ operator: /:/,
20604
+ punctuation: /\./
20605
+ }
20606
+ },
20607
+ 'raw-string': {
20608
+ pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
20609
+ alias: 'string',
20610
+ greedy: true
20611
+ }
20612
+ });
20613
+ Prism.languages.insertBefore('cpp', 'keyword', {
20614
+ 'generic-function': {
20615
+ pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
20616
+ inside: {
20617
+ function: /^\w+/,
20618
+ generic: {
20619
+ pattern: /<[\s\S]+/,
20620
+ alias: 'class-name',
20621
+ inside: Prism.languages.cpp
20622
+ }
20623
+ }
20624
+ }
20625
+ });
20626
+ Prism.languages.insertBefore('cpp', 'operator', {
20627
+ 'double-colon': {
20628
+ pattern: /::/,
20629
+ alias: 'punctuation'
20630
+ }
20631
+ });
20632
+ Prism.languages.insertBefore('cpp', 'class-name', {
20633
+ // the base clause is an optional list of parent classes
20634
+ // https://en.cppreference.com/w/cpp/language/class
20635
+ 'base-clause': {
20636
+ pattern:
20637
+ /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
20638
+ lookbehind: true,
20639
+ greedy: true,
20640
+ inside: Prism.languages.extend('cpp', {})
20641
+ }
20642
+ });
20643
+ Prism.languages.insertBefore(
20644
+ 'inside',
20645
+ 'double-colon',
20646
+ {
20647
+ // All untokenized words that are not namespaces should be class names
20648
+ 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i
20649
+ },
20650
+ Prism.languages.cpp['base-clause']
20651
+ );
20652
+ })(Prism);
20653
+ }
20654
+ return cpp_1;
20647
20655
  }
20648
20656
 
20649
- var refractorCpp$1 = cpp_1;
20657
+ var refractorCpp$1 = requireCpp();
20650
20658
  var arduino_1 = arduino;
20651
20659
  arduino.displayName = 'arduino';
20652
20660
  arduino.aliases = ['ino'];
@@ -20990,475 +20998,484 @@ function asmatmel(Prism) {
20990
20998
  };
20991
20999
  }
20992
21000
 
20993
- var csharp_1 = csharp;
20994
- csharp.displayName = 'csharp';
20995
- csharp.aliases = ['dotnet', 'cs'];
20996
- function csharp(Prism) {
21001
+ var csharp_1;
21002
+ var hasRequiredCsharp;
21003
+
21004
+ function requireCsharp () {
21005
+ if (hasRequiredCsharp) return csharp_1;
21006
+ hasRequiredCsharp = 1;
21007
+
21008
+ csharp_1 = csharp;
21009
+ csharp.displayName = 'csharp';
21010
+ csharp.aliases = ['dotnet', 'cs'];
21011
+ function csharp(Prism) {
20997
21012
  (function (Prism) {
20998
- /**
20999
- * Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
21000
- *
21001
- * Note: This is a simple text based replacement. Be careful when using backreferences!
21002
- *
21003
- * @param {string} pattern the given pattern.
21004
- * @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
21005
- * @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
21006
- * @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
21007
- */
21008
- function replace(pattern, replacements) {
21009
- return pattern.replace(/<<(\d+)>>/g, function (m, index) {
21010
- return '(?:' + replacements[+index] + ')'
21011
- })
21012
- }
21013
- /**
21014
- * @param {string} pattern
21015
- * @param {string[]} replacements
21016
- * @param {string} [flags]
21017
- * @returns {RegExp}
21018
- */
21019
- function re(pattern, replacements, flags) {
21020
- return RegExp(replace(pattern, replacements), flags || '')
21021
- }
21022
- /**
21023
- * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
21024
- *
21025
- * @param {string} pattern
21026
- * @param {number} depthLog2
21027
- * @returns {string}
21028
- */
21029
- function nested(pattern, depthLog2) {
21030
- for (var i = 0; i < depthLog2; i++) {
21031
- pattern = pattern.replace(/<<self>>/g, function () {
21032
- return '(?:' + pattern + ')'
21033
- });
21034
- }
21035
- return pattern.replace(/<<self>>/g, '[^\\s\\S]')
21036
- } // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
21037
- var keywordKinds = {
21038
- // keywords which represent a return or variable type
21039
- type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
21040
- // keywords which are used to declare a type
21041
- typeDeclaration: 'class enum interface record struct',
21042
- // contextual keywords
21043
- // ("var" and "dynamic" are missing because they are used like types)
21044
- contextual:
21045
- '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*{)',
21046
- // all other keywords
21047
- other:
21048
- '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'
21049
- }; // keywords
21050
- function keywordsToPattern(words) {
21051
- return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'
21052
- }
21053
- var typeDeclarationKeywords = keywordsToPattern(
21054
- keywordKinds.typeDeclaration
21055
- );
21056
- var keywords = RegExp(
21057
- keywordsToPattern(
21058
- keywordKinds.type +
21059
- ' ' +
21060
- keywordKinds.typeDeclaration +
21061
- ' ' +
21062
- keywordKinds.contextual +
21063
- ' ' +
21064
- keywordKinds.other
21065
- )
21066
- );
21067
- var nonTypeKeywords = keywordsToPattern(
21068
- keywordKinds.typeDeclaration +
21069
- ' ' +
21070
- keywordKinds.contextual +
21071
- ' ' +
21072
- keywordKinds.other
21073
- );
21074
- var nonContextualKeywords = keywordsToPattern(
21075
- keywordKinds.type +
21076
- ' ' +
21077
- keywordKinds.typeDeclaration +
21078
- ' ' +
21079
- keywordKinds.other
21080
- ); // types
21081
- var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
21082
- var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
21083
- var name = /@?\b[A-Za-z_]\w*\b/.source;
21084
- var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]);
21085
- var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
21086
- nonTypeKeywords,
21087
- genericName
21088
- ]);
21089
- var array = /\[\s*(?:,\s*)*\]/.source;
21090
- var typeExpressionWithoutTuple = replace(
21091
- /<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,
21092
- [identifier, array]
21093
- );
21094
- var tupleElement = replace(
21095
- /[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,
21096
- [generic, nestedRound, array]
21097
- );
21098
- var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
21099
- var typeExpression = replace(
21100
- /(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,
21101
- [tuple, identifier, array]
21102
- );
21103
- var typeInside = {
21104
- keyword: keywords,
21105
- punctuation: /[<>()?,.:[\]]/
21106
- }; // strings & characters
21107
- // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
21108
- // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
21109
- var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; // simplified pattern
21110
- var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
21111
- var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
21112
- Prism.languages.csharp = Prism.languages.extend('clike', {
21113
- string: [
21114
- {
21115
- pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
21116
- lookbehind: true,
21117
- greedy: true
21118
- },
21119
- {
21120
- pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
21121
- lookbehind: true,
21122
- greedy: true
21123
- }
21124
- ],
21125
- 'class-name': [
21126
- {
21127
- // Using static
21128
- // using static System.Math;
21129
- pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [
21130
- identifier
21131
- ]),
21132
- lookbehind: true,
21133
- inside: typeInside
21134
- },
21135
- {
21136
- // Using alias (type)
21137
- // using Project = PC.MyCompany.Project;
21138
- pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
21139
- name,
21140
- typeExpression
21141
- ]),
21142
- lookbehind: true,
21143
- inside: typeInside
21144
- },
21145
- {
21146
- // Using alias (alias)
21147
- // using Project = PC.MyCompany.Project;
21148
- pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
21149
- lookbehind: true
21150
- },
21151
- {
21152
- // Type declarations
21153
- // class Foo<A, B>
21154
- // interface Foo<out A, B>
21155
- pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
21156
- typeDeclarationKeywords,
21157
- genericName
21158
- ]),
21159
- lookbehind: true,
21160
- inside: typeInside
21161
- },
21162
- {
21163
- // Single catch exception declaration
21164
- // catch(Foo)
21165
- // (things like catch(Foo e) is covered by variable declaration)
21166
- pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
21167
- lookbehind: true,
21168
- inside: typeInside
21169
- },
21170
- {
21171
- // Name of the type parameter of generic constraints
21172
- // where Foo : class
21173
- pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
21174
- lookbehind: true
21175
- },
21176
- {
21177
- // Casts and checks via as and is.
21178
- // as Foo<A>, is Bar<B>
21179
- // (things like if(a is Foo b) is covered by variable declaration)
21180
- pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [
21181
- typeExpressionWithoutTuple
21182
- ]),
21183
- lookbehind: true,
21184
- inside: typeInside
21185
- },
21186
- {
21187
- // Variable, field and parameter declaration
21188
- // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
21189
- pattern: re(
21190
- /\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/
21191
- .source,
21192
- [typeExpression, nonContextualKeywords, name]
21193
- ),
21194
- inside: typeInside
21195
- }
21196
- ],
21197
- keyword: keywords,
21198
- // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
21199
- number:
21200
- /(?:\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,
21201
- operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
21202
- punctuation: /\?\.?|::|[{}[\];(),.:]/
21203
- });
21204
- Prism.languages.insertBefore('csharp', 'number', {
21205
- range: {
21206
- pattern: /\.\./,
21207
- alias: 'operator'
21208
- }
21209
- });
21210
- Prism.languages.insertBefore('csharp', 'punctuation', {
21211
- 'named-parameter': {
21212
- pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
21213
- lookbehind: true,
21214
- alias: 'punctuation'
21215
- }
21216
- });
21217
- Prism.languages.insertBefore('csharp', 'class-name', {
21218
- namespace: {
21219
- // namespace Foo.Bar {}
21220
- // using Foo.Bar;
21221
- pattern: re(
21222
- /(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,
21223
- [name]
21224
- ),
21225
- lookbehind: true,
21226
- inside: {
21227
- punctuation: /\./
21228
- }
21229
- },
21230
- 'type-expression': {
21231
- // default(Foo), typeof(Foo<Bar>), sizeof(int)
21232
- pattern: re(
21233
- /(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/
21234
- .source,
21235
- [nestedRound]
21236
- ),
21237
- lookbehind: true,
21238
- alias: 'class-name',
21239
- inside: typeInside
21240
- },
21241
- 'return-type': {
21242
- // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
21243
- // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
21244
- // int Foo => 0; int Foo { get; set } = 0;
21245
- pattern: re(
21246
- /<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,
21247
- [typeExpression, identifier]
21248
- ),
21249
- inside: typeInside,
21250
- alias: 'class-name'
21251
- },
21252
- 'constructor-invocation': {
21253
- // new List<Foo<Bar[]>> { }
21254
- pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
21255
- lookbehind: true,
21256
- inside: typeInside,
21257
- alias: 'class-name'
21258
- },
21259
- /*'explicit-implementation': {
21260
- // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
21261
- pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
21262
- inside: classNameInside,
21263
- alias: 'class-name'
21264
- },*/
21265
- 'generic-method': {
21266
- // foo<Bar>()
21267
- pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]),
21268
- inside: {
21269
- function: re(/^<<0>>/.source, [name]),
21270
- generic: {
21271
- pattern: RegExp(generic),
21272
- alias: 'class-name',
21273
- inside: typeInside
21274
- }
21275
- }
21276
- },
21277
- 'type-list': {
21278
- // The list of types inherited or of generic constraints
21279
- // class Foo<F> : Bar, IList<FooBar>
21280
- // where F : Bar, IList<int>
21281
- pattern: re(
21282
- /\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|[{;]|=>|$))/
21283
- .source,
21284
- [
21285
- typeDeclarationKeywords,
21286
- genericName,
21287
- name,
21288
- typeExpression,
21289
- keywords.source,
21290
- nestedRound,
21291
- /\bnew\s*\(\s*\)/.source
21292
- ]
21293
- ),
21294
- lookbehind: true,
21295
- inside: {
21296
- 'record-arguments': {
21297
- pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
21298
- genericName,
21299
- nestedRound
21300
- ]),
21301
- lookbehind: true,
21302
- greedy: true,
21303
- inside: Prism.languages.csharp
21304
- },
21305
- keyword: keywords,
21306
- 'class-name': {
21307
- pattern: RegExp(typeExpression),
21308
- greedy: true,
21309
- inside: typeInside
21310
- },
21311
- punctuation: /[,()]/
21312
- }
21313
- },
21314
- preprocessor: {
21315
- pattern: /(^[\t ]*)#.*/m,
21316
- lookbehind: true,
21317
- alias: 'property',
21318
- inside: {
21319
- // highlight preprocessor directives as keywords
21320
- directive: {
21321
- pattern:
21322
- /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
21323
- lookbehind: true,
21324
- alias: 'keyword'
21325
- }
21326
- }
21327
- }
21328
- }); // attributes
21329
- var regularStringOrCharacter = regularString + '|' + character;
21330
- var regularStringCharacterOrComment = replace(
21331
- /\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,
21332
- [regularStringOrCharacter]
21333
- );
21334
- var roundExpression = nested(
21335
- replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
21336
- regularStringCharacterOrComment
21337
- ]),
21338
- 2
21339
- ); // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
21340
- var attrTarget =
21341
- /\b(?:assembly|event|field|method|module|param|property|return|type)\b/
21342
- .source;
21343
- var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
21344
- identifier,
21345
- roundExpression
21346
- ]);
21347
- Prism.languages.insertBefore('csharp', 'class-name', {
21348
- attribute: {
21349
- // Attributes
21350
- // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
21351
- pattern: re(
21352
- /((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/
21353
- .source,
21354
- [attrTarget, attr]
21355
- ),
21356
- lookbehind: true,
21357
- greedy: true,
21358
- inside: {
21359
- target: {
21360
- pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
21361
- alias: 'keyword'
21362
- },
21363
- 'attribute-arguments': {
21364
- pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
21365
- inside: Prism.languages.csharp
21366
- },
21367
- 'class-name': {
21368
- pattern: RegExp(identifier),
21369
- inside: {
21370
- punctuation: /\./
21371
- }
21372
- },
21373
- punctuation: /[:,]/
21374
- }
21375
- }
21376
- }); // string interpolation
21377
- var formatString = /:[^}\r\n]+/.source; // multi line
21378
- var mInterpolationRound = nested(
21379
- replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
21380
- regularStringCharacterOrComment
21381
- ]),
21382
- 2
21383
- );
21384
- var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
21385
- mInterpolationRound,
21386
- formatString
21387
- ]); // single line
21388
- var sInterpolationRound = nested(
21389
- replace(
21390
- /[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/
21391
- .source,
21392
- [regularStringOrCharacter]
21393
- ),
21394
- 2
21395
- );
21396
- var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
21397
- sInterpolationRound,
21398
- formatString
21399
- ]);
21400
- function createInterpolationInside(interpolation, interpolationRound) {
21401
- return {
21402
- interpolation: {
21403
- pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
21404
- lookbehind: true,
21405
- inside: {
21406
- 'format-string': {
21407
- pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
21408
- interpolationRound,
21409
- formatString
21410
- ]),
21411
- lookbehind: true,
21412
- inside: {
21413
- punctuation: /^:/
21414
- }
21415
- },
21416
- punctuation: /^\{|\}$/,
21417
- expression: {
21418
- pattern: /[\s\S]+/,
21419
- alias: 'language-csharp',
21420
- inside: Prism.languages.csharp
21421
- }
21422
- }
21423
- },
21424
- string: /[\s\S]+/
21425
- }
21426
- }
21427
- Prism.languages.insertBefore('csharp', 'string', {
21428
- 'interpolation-string': [
21429
- {
21430
- pattern: re(
21431
- /(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,
21432
- [mInterpolation]
21433
- ),
21434
- lookbehind: true,
21435
- greedy: true,
21436
- inside: createInterpolationInside(mInterpolation, mInterpolationRound)
21437
- },
21438
- {
21439
- pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [
21440
- sInterpolation
21441
- ]),
21442
- lookbehind: true,
21443
- greedy: true,
21444
- inside: createInterpolationInside(sInterpolation, sInterpolationRound)
21445
- }
21446
- ],
21447
- char: {
21448
- pattern: RegExp(character),
21449
- greedy: true
21450
- }
21451
- });
21452
- Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
21453
- })(Prism);
21013
+ /**
21014
+ * Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
21015
+ *
21016
+ * Note: This is a simple text based replacement. Be careful when using backreferences!
21017
+ *
21018
+ * @param {string} pattern the given pattern.
21019
+ * @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
21020
+ * @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
21021
+ * @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
21022
+ */
21023
+ function replace(pattern, replacements) {
21024
+ return pattern.replace(/<<(\d+)>>/g, function (m, index) {
21025
+ return '(?:' + replacements[+index] + ')'
21026
+ })
21027
+ }
21028
+ /**
21029
+ * @param {string} pattern
21030
+ * @param {string[]} replacements
21031
+ * @param {string} [flags]
21032
+ * @returns {RegExp}
21033
+ */
21034
+ function re(pattern, replacements, flags) {
21035
+ return RegExp(replace(pattern, replacements), flags || '')
21036
+ }
21037
+ /**
21038
+ * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
21039
+ *
21040
+ * @param {string} pattern
21041
+ * @param {number} depthLog2
21042
+ * @returns {string}
21043
+ */
21044
+ function nested(pattern, depthLog2) {
21045
+ for (var i = 0; i < depthLog2; i++) {
21046
+ pattern = pattern.replace(/<<self>>/g, function () {
21047
+ return '(?:' + pattern + ')'
21048
+ });
21049
+ }
21050
+ return pattern.replace(/<<self>>/g, '[^\\s\\S]')
21051
+ } // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
21052
+ var keywordKinds = {
21053
+ // keywords which represent a return or variable type
21054
+ type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
21055
+ // keywords which are used to declare a type
21056
+ typeDeclaration: 'class enum interface record struct',
21057
+ // contextual keywords
21058
+ // ("var" and "dynamic" are missing because they are used like types)
21059
+ contextual:
21060
+ '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*{)',
21061
+ // all other keywords
21062
+ other:
21063
+ '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'
21064
+ }; // keywords
21065
+ function keywordsToPattern(words) {
21066
+ return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'
21067
+ }
21068
+ var typeDeclarationKeywords = keywordsToPattern(
21069
+ keywordKinds.typeDeclaration
21070
+ );
21071
+ var keywords = RegExp(
21072
+ keywordsToPattern(
21073
+ keywordKinds.type +
21074
+ ' ' +
21075
+ keywordKinds.typeDeclaration +
21076
+ ' ' +
21077
+ keywordKinds.contextual +
21078
+ ' ' +
21079
+ keywordKinds.other
21080
+ )
21081
+ );
21082
+ var nonTypeKeywords = keywordsToPattern(
21083
+ keywordKinds.typeDeclaration +
21084
+ ' ' +
21085
+ keywordKinds.contextual +
21086
+ ' ' +
21087
+ keywordKinds.other
21088
+ );
21089
+ var nonContextualKeywords = keywordsToPattern(
21090
+ keywordKinds.type +
21091
+ ' ' +
21092
+ keywordKinds.typeDeclaration +
21093
+ ' ' +
21094
+ keywordKinds.other
21095
+ ); // types
21096
+ var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
21097
+ var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
21098
+ var name = /@?\b[A-Za-z_]\w*\b/.source;
21099
+ var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]);
21100
+ var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
21101
+ nonTypeKeywords,
21102
+ genericName
21103
+ ]);
21104
+ var array = /\[\s*(?:,\s*)*\]/.source;
21105
+ var typeExpressionWithoutTuple = replace(
21106
+ /<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,
21107
+ [identifier, array]
21108
+ );
21109
+ var tupleElement = replace(
21110
+ /[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,
21111
+ [generic, nestedRound, array]
21112
+ );
21113
+ var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
21114
+ var typeExpression = replace(
21115
+ /(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,
21116
+ [tuple, identifier, array]
21117
+ );
21118
+ var typeInside = {
21119
+ keyword: keywords,
21120
+ punctuation: /[<>()?,.:[\]]/
21121
+ }; // strings & characters
21122
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
21123
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
21124
+ var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; // simplified pattern
21125
+ var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
21126
+ var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
21127
+ Prism.languages.csharp = Prism.languages.extend('clike', {
21128
+ string: [
21129
+ {
21130
+ pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
21131
+ lookbehind: true,
21132
+ greedy: true
21133
+ },
21134
+ {
21135
+ pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
21136
+ lookbehind: true,
21137
+ greedy: true
21138
+ }
21139
+ ],
21140
+ 'class-name': [
21141
+ {
21142
+ // Using static
21143
+ // using static System.Math;
21144
+ pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [
21145
+ identifier
21146
+ ]),
21147
+ lookbehind: true,
21148
+ inside: typeInside
21149
+ },
21150
+ {
21151
+ // Using alias (type)
21152
+ // using Project = PC.MyCompany.Project;
21153
+ pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
21154
+ name,
21155
+ typeExpression
21156
+ ]),
21157
+ lookbehind: true,
21158
+ inside: typeInside
21159
+ },
21160
+ {
21161
+ // Using alias (alias)
21162
+ // using Project = PC.MyCompany.Project;
21163
+ pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
21164
+ lookbehind: true
21165
+ },
21166
+ {
21167
+ // Type declarations
21168
+ // class Foo<A, B>
21169
+ // interface Foo<out A, B>
21170
+ pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
21171
+ typeDeclarationKeywords,
21172
+ genericName
21173
+ ]),
21174
+ lookbehind: true,
21175
+ inside: typeInside
21176
+ },
21177
+ {
21178
+ // Single catch exception declaration
21179
+ // catch(Foo)
21180
+ // (things like catch(Foo e) is covered by variable declaration)
21181
+ pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
21182
+ lookbehind: true,
21183
+ inside: typeInside
21184
+ },
21185
+ {
21186
+ // Name of the type parameter of generic constraints
21187
+ // where Foo : class
21188
+ pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
21189
+ lookbehind: true
21190
+ },
21191
+ {
21192
+ // Casts and checks via as and is.
21193
+ // as Foo<A>, is Bar<B>
21194
+ // (things like if(a is Foo b) is covered by variable declaration)
21195
+ pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [
21196
+ typeExpressionWithoutTuple
21197
+ ]),
21198
+ lookbehind: true,
21199
+ inside: typeInside
21200
+ },
21201
+ {
21202
+ // Variable, field and parameter declaration
21203
+ // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
21204
+ pattern: re(
21205
+ /\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/
21206
+ .source,
21207
+ [typeExpression, nonContextualKeywords, name]
21208
+ ),
21209
+ inside: typeInside
21210
+ }
21211
+ ],
21212
+ keyword: keywords,
21213
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
21214
+ number:
21215
+ /(?:\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,
21216
+ operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
21217
+ punctuation: /\?\.?|::|[{}[\];(),.:]/
21218
+ });
21219
+ Prism.languages.insertBefore('csharp', 'number', {
21220
+ range: {
21221
+ pattern: /\.\./,
21222
+ alias: 'operator'
21223
+ }
21224
+ });
21225
+ Prism.languages.insertBefore('csharp', 'punctuation', {
21226
+ 'named-parameter': {
21227
+ pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
21228
+ lookbehind: true,
21229
+ alias: 'punctuation'
21230
+ }
21231
+ });
21232
+ Prism.languages.insertBefore('csharp', 'class-name', {
21233
+ namespace: {
21234
+ // namespace Foo.Bar {}
21235
+ // using Foo.Bar;
21236
+ pattern: re(
21237
+ /(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,
21238
+ [name]
21239
+ ),
21240
+ lookbehind: true,
21241
+ inside: {
21242
+ punctuation: /\./
21243
+ }
21244
+ },
21245
+ 'type-expression': {
21246
+ // default(Foo), typeof(Foo<Bar>), sizeof(int)
21247
+ pattern: re(
21248
+ /(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/
21249
+ .source,
21250
+ [nestedRound]
21251
+ ),
21252
+ lookbehind: true,
21253
+ alias: 'class-name',
21254
+ inside: typeInside
21255
+ },
21256
+ 'return-type': {
21257
+ // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
21258
+ // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
21259
+ // int Foo => 0; int Foo { get; set } = 0;
21260
+ pattern: re(
21261
+ /<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,
21262
+ [typeExpression, identifier]
21263
+ ),
21264
+ inside: typeInside,
21265
+ alias: 'class-name'
21266
+ },
21267
+ 'constructor-invocation': {
21268
+ // new List<Foo<Bar[]>> { }
21269
+ pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
21270
+ lookbehind: true,
21271
+ inside: typeInside,
21272
+ alias: 'class-name'
21273
+ },
21274
+ /*'explicit-implementation': {
21275
+ // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
21276
+ pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
21277
+ inside: classNameInside,
21278
+ alias: 'class-name'
21279
+ },*/
21280
+ 'generic-method': {
21281
+ // foo<Bar>()
21282
+ pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]),
21283
+ inside: {
21284
+ function: re(/^<<0>>/.source, [name]),
21285
+ generic: {
21286
+ pattern: RegExp(generic),
21287
+ alias: 'class-name',
21288
+ inside: typeInside
21289
+ }
21290
+ }
21291
+ },
21292
+ 'type-list': {
21293
+ // The list of types inherited or of generic constraints
21294
+ // class Foo<F> : Bar, IList<FooBar>
21295
+ // where F : Bar, IList<int>
21296
+ pattern: re(
21297
+ /\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|[{;]|=>|$))/
21298
+ .source,
21299
+ [
21300
+ typeDeclarationKeywords,
21301
+ genericName,
21302
+ name,
21303
+ typeExpression,
21304
+ keywords.source,
21305
+ nestedRound,
21306
+ /\bnew\s*\(\s*\)/.source
21307
+ ]
21308
+ ),
21309
+ lookbehind: true,
21310
+ inside: {
21311
+ 'record-arguments': {
21312
+ pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
21313
+ genericName,
21314
+ nestedRound
21315
+ ]),
21316
+ lookbehind: true,
21317
+ greedy: true,
21318
+ inside: Prism.languages.csharp
21319
+ },
21320
+ keyword: keywords,
21321
+ 'class-name': {
21322
+ pattern: RegExp(typeExpression),
21323
+ greedy: true,
21324
+ inside: typeInside
21325
+ },
21326
+ punctuation: /[,()]/
21327
+ }
21328
+ },
21329
+ preprocessor: {
21330
+ pattern: /(^[\t ]*)#.*/m,
21331
+ lookbehind: true,
21332
+ alias: 'property',
21333
+ inside: {
21334
+ // highlight preprocessor directives as keywords
21335
+ directive: {
21336
+ pattern:
21337
+ /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
21338
+ lookbehind: true,
21339
+ alias: 'keyword'
21340
+ }
21341
+ }
21342
+ }
21343
+ }); // attributes
21344
+ var regularStringOrCharacter = regularString + '|' + character;
21345
+ var regularStringCharacterOrComment = replace(
21346
+ /\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,
21347
+ [regularStringOrCharacter]
21348
+ );
21349
+ var roundExpression = nested(
21350
+ replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
21351
+ regularStringCharacterOrComment
21352
+ ]),
21353
+ 2
21354
+ ); // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
21355
+ var attrTarget =
21356
+ /\b(?:assembly|event|field|method|module|param|property|return|type)\b/
21357
+ .source;
21358
+ var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
21359
+ identifier,
21360
+ roundExpression
21361
+ ]);
21362
+ Prism.languages.insertBefore('csharp', 'class-name', {
21363
+ attribute: {
21364
+ // Attributes
21365
+ // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
21366
+ pattern: re(
21367
+ /((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/
21368
+ .source,
21369
+ [attrTarget, attr]
21370
+ ),
21371
+ lookbehind: true,
21372
+ greedy: true,
21373
+ inside: {
21374
+ target: {
21375
+ pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
21376
+ alias: 'keyword'
21377
+ },
21378
+ 'attribute-arguments': {
21379
+ pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
21380
+ inside: Prism.languages.csharp
21381
+ },
21382
+ 'class-name': {
21383
+ pattern: RegExp(identifier),
21384
+ inside: {
21385
+ punctuation: /\./
21386
+ }
21387
+ },
21388
+ punctuation: /[:,]/
21389
+ }
21390
+ }
21391
+ }); // string interpolation
21392
+ var formatString = /:[^}\r\n]+/.source; // multi line
21393
+ var mInterpolationRound = nested(
21394
+ replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
21395
+ regularStringCharacterOrComment
21396
+ ]),
21397
+ 2
21398
+ );
21399
+ var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
21400
+ mInterpolationRound,
21401
+ formatString
21402
+ ]); // single line
21403
+ var sInterpolationRound = nested(
21404
+ replace(
21405
+ /[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/
21406
+ .source,
21407
+ [regularStringOrCharacter]
21408
+ ),
21409
+ 2
21410
+ );
21411
+ var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
21412
+ sInterpolationRound,
21413
+ formatString
21414
+ ]);
21415
+ function createInterpolationInside(interpolation, interpolationRound) {
21416
+ return {
21417
+ interpolation: {
21418
+ pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
21419
+ lookbehind: true,
21420
+ inside: {
21421
+ 'format-string': {
21422
+ pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
21423
+ interpolationRound,
21424
+ formatString
21425
+ ]),
21426
+ lookbehind: true,
21427
+ inside: {
21428
+ punctuation: /^:/
21429
+ }
21430
+ },
21431
+ punctuation: /^\{|\}$/,
21432
+ expression: {
21433
+ pattern: /[\s\S]+/,
21434
+ alias: 'language-csharp',
21435
+ inside: Prism.languages.csharp
21436
+ }
21437
+ }
21438
+ },
21439
+ string: /[\s\S]+/
21440
+ }
21441
+ }
21442
+ Prism.languages.insertBefore('csharp', 'string', {
21443
+ 'interpolation-string': [
21444
+ {
21445
+ pattern: re(
21446
+ /(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,
21447
+ [mInterpolation]
21448
+ ),
21449
+ lookbehind: true,
21450
+ greedy: true,
21451
+ inside: createInterpolationInside(mInterpolation, mInterpolationRound)
21452
+ },
21453
+ {
21454
+ pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [
21455
+ sInterpolation
21456
+ ]),
21457
+ lookbehind: true,
21458
+ greedy: true,
21459
+ inside: createInterpolationInside(sInterpolation, sInterpolationRound)
21460
+ }
21461
+ ],
21462
+ char: {
21463
+ pattern: RegExp(character),
21464
+ greedy: true
21465
+ }
21466
+ });
21467
+ Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
21468
+ })(Prism);
21469
+ }
21470
+ return csharp_1;
21454
21471
  }
21455
21472
 
21456
- var refractorCsharp$1 = csharp_1;
21473
+ var refractorCsharp = requireCsharp();
21457
21474
  var aspnet_1 = aspnet;
21458
21475
  aspnet.displayName = 'aspnet';
21459
21476
  aspnet.aliases = [];
21460
21477
  function aspnet(Prism) {
21461
- Prism.register(refractorCsharp$1);
21478
+ Prism.register(refractorCsharp);
21462
21479
  Prism.languages.aspnet = Prism.languages.extend('markup', {
21463
21480
  'page-directive': {
21464
21481
  pattern: /<%\s*@.*%>/,
@@ -22595,59 +22612,68 @@ function bsl(Prism) {
22595
22612
  Prism.languages.oscript = Prism.languages['bsl'];
22596
22613
  }
22597
22614
 
22598
- var cfscript_1 = cfscript;
22599
- cfscript.displayName = 'cfscript';
22600
- cfscript.aliases = [];
22601
- function cfscript(Prism) {
22602
- // https://cfdocs.org/script
22603
- Prism.languages.cfscript = Prism.languages.extend('clike', {
22604
- comment: [
22605
- {
22606
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
22607
- lookbehind: true,
22608
- inside: {
22609
- annotation: {
22610
- pattern: /(?:^|[^.])@[\w\.]+/,
22611
- alias: 'punctuation'
22612
- }
22613
- }
22614
- },
22615
- {
22616
- pattern: /(^|[^\\:])\/\/.*/,
22617
- lookbehind: true,
22618
- greedy: true
22619
- }
22620
- ],
22621
- keyword:
22622
- /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,
22623
- operator: [
22624
- /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,
22625
- /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
22626
- ],
22627
- scope: {
22628
- pattern:
22629
- /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
22630
- alias: 'global'
22631
- },
22632
- type: {
22633
- pattern:
22634
- /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
22635
- alias: 'builtin'
22636
- }
22637
- });
22638
- Prism.languages.insertBefore('cfscript', 'keyword', {
22639
- // This must be declared before keyword because we use "function" inside the lookahead
22640
- 'function-variable': {
22641
- pattern:
22642
- /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
22643
- alias: 'function'
22644
- }
22645
- });
22646
- delete Prism.languages.cfscript['class-name'];
22647
- Prism.languages.cfc = Prism.languages['cfscript'];
22615
+ var cfscript_1;
22616
+ var hasRequiredCfscript;
22617
+
22618
+ function requireCfscript () {
22619
+ if (hasRequiredCfscript) return cfscript_1;
22620
+ hasRequiredCfscript = 1;
22621
+
22622
+ cfscript_1 = cfscript;
22623
+ cfscript.displayName = 'cfscript';
22624
+ cfscript.aliases = [];
22625
+ function cfscript(Prism) {
22626
+ // https://cfdocs.org/script
22627
+ Prism.languages.cfscript = Prism.languages.extend('clike', {
22628
+ comment: [
22629
+ {
22630
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
22631
+ lookbehind: true,
22632
+ inside: {
22633
+ annotation: {
22634
+ pattern: /(?:^|[^.])@[\w\.]+/,
22635
+ alias: 'punctuation'
22636
+ }
22637
+ }
22638
+ },
22639
+ {
22640
+ pattern: /(^|[^\\:])\/\/.*/,
22641
+ lookbehind: true,
22642
+ greedy: true
22643
+ }
22644
+ ],
22645
+ keyword:
22646
+ /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,
22647
+ operator: [
22648
+ /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/,
22649
+ /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
22650
+ ],
22651
+ scope: {
22652
+ pattern:
22653
+ /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
22654
+ alias: 'global'
22655
+ },
22656
+ type: {
22657
+ pattern:
22658
+ /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
22659
+ alias: 'builtin'
22660
+ }
22661
+ });
22662
+ Prism.languages.insertBefore('cfscript', 'keyword', {
22663
+ // This must be declared before keyword because we use "function" inside the lookahead
22664
+ 'function-variable': {
22665
+ pattern:
22666
+ /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
22667
+ alias: 'function'
22668
+ }
22669
+ });
22670
+ delete Prism.languages.cfscript['class-name'];
22671
+ Prism.languages.cfc = Prism.languages['cfscript'];
22672
+ }
22673
+ return cfscript_1;
22648
22674
  }
22649
22675
 
22650
- var refractorCpp = cpp_1;
22676
+ var refractorCpp = requireCpp();
22651
22677
  var chaiscript_1 = chaiscript;
22652
22678
  chaiscript.displayName = 'chaiscript';
22653
22679
  chaiscript.aliases = [];
@@ -22878,772 +22904,833 @@ function cobol(Prism) {
22878
22904
  };
22879
22905
  }
22880
22906
 
22881
- var coffeescript_1 = coffeescript;
22882
- coffeescript.displayName = 'coffeescript';
22883
- coffeescript.aliases = ['coffee'];
22884
- function coffeescript(Prism) {
22907
+ var coffeescript_1;
22908
+ var hasRequiredCoffeescript;
22909
+
22910
+ function requireCoffeescript () {
22911
+ if (hasRequiredCoffeescript) return coffeescript_1;
22912
+ hasRequiredCoffeescript = 1;
22913
+
22914
+ coffeescript_1 = coffeescript;
22915
+ coffeescript.displayName = 'coffeescript';
22916
+ coffeescript.aliases = ['coffee'];
22917
+ function coffeescript(Prism) {
22885
22918
  (function (Prism) {
22886
- // Ignore comments starting with { to privilege string interpolation highlighting
22887
- var comment = /#(?!\{).+/;
22888
- var interpolation = {
22889
- pattern: /#\{[^}]+\}/,
22890
- alias: 'variable'
22891
- };
22892
- Prism.languages.coffeescript = Prism.languages.extend('javascript', {
22893
- comment: comment,
22894
- string: [
22895
- // Strings are multiline
22896
- {
22897
- pattern: /'(?:\\[\s\S]|[^\\'])*'/,
22898
- greedy: true
22899
- },
22900
- {
22901
- // Strings are multiline
22902
- pattern: /"(?:\\[\s\S]|[^\\"])*"/,
22903
- greedy: true,
22904
- inside: {
22905
- interpolation: interpolation
22906
- }
22907
- }
22908
- ],
22909
- keyword:
22910
- /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,
22911
- 'class-member': {
22912
- pattern: /@(?!\d)\w+/,
22913
- alias: 'variable'
22914
- }
22915
- });
22916
- Prism.languages.insertBefore('coffeescript', 'comment', {
22917
- 'multiline-comment': {
22918
- pattern: /###[\s\S]+?###/,
22919
- alias: 'comment'
22920
- },
22921
- // Block regexp can contain comments and interpolation
22922
- 'block-regex': {
22923
- pattern: /\/{3}[\s\S]*?\/{3}/,
22924
- alias: 'regex',
22925
- inside: {
22926
- comment: comment,
22927
- interpolation: interpolation
22928
- }
22929
- }
22930
- });
22931
- Prism.languages.insertBefore('coffeescript', 'string', {
22932
- 'inline-javascript': {
22933
- pattern: /`(?:\\[\s\S]|[^\\`])*`/,
22934
- inside: {
22935
- delimiter: {
22936
- pattern: /^`|`$/,
22937
- alias: 'punctuation'
22938
- },
22939
- script: {
22940
- pattern: /[\s\S]+/,
22941
- alias: 'language-javascript',
22942
- inside: Prism.languages.javascript
22943
- }
22944
- }
22945
- },
22946
- // Block strings
22947
- 'multiline-string': [
22948
- {
22949
- pattern: /'''[\s\S]*?'''/,
22950
- greedy: true,
22951
- alias: 'string'
22952
- },
22953
- {
22954
- pattern: /"""[\s\S]*?"""/,
22955
- greedy: true,
22956
- alias: 'string',
22957
- inside: {
22958
- interpolation: interpolation
22959
- }
22960
- }
22961
- ]
22962
- });
22963
- Prism.languages.insertBefore('coffeescript', 'keyword', {
22964
- // Object property
22965
- property: /(?!\d)\w+(?=\s*:(?!:))/
22966
- });
22967
- delete Prism.languages.coffeescript['template-string'];
22968
- Prism.languages.coffee = Prism.languages.coffeescript;
22969
- })(Prism);
22919
+ // Ignore comments starting with { to privilege string interpolation highlighting
22920
+ var comment = /#(?!\{).+/;
22921
+ var interpolation = {
22922
+ pattern: /#\{[^}]+\}/,
22923
+ alias: 'variable'
22924
+ };
22925
+ Prism.languages.coffeescript = Prism.languages.extend('javascript', {
22926
+ comment: comment,
22927
+ string: [
22928
+ // Strings are multiline
22929
+ {
22930
+ pattern: /'(?:\\[\s\S]|[^\\'])*'/,
22931
+ greedy: true
22932
+ },
22933
+ {
22934
+ // Strings are multiline
22935
+ pattern: /"(?:\\[\s\S]|[^\\"])*"/,
22936
+ greedy: true,
22937
+ inside: {
22938
+ interpolation: interpolation
22939
+ }
22940
+ }
22941
+ ],
22942
+ keyword:
22943
+ /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,
22944
+ 'class-member': {
22945
+ pattern: /@(?!\d)\w+/,
22946
+ alias: 'variable'
22947
+ }
22948
+ });
22949
+ Prism.languages.insertBefore('coffeescript', 'comment', {
22950
+ 'multiline-comment': {
22951
+ pattern: /###[\s\S]+?###/,
22952
+ alias: 'comment'
22953
+ },
22954
+ // Block regexp can contain comments and interpolation
22955
+ 'block-regex': {
22956
+ pattern: /\/{3}[\s\S]*?\/{3}/,
22957
+ alias: 'regex',
22958
+ inside: {
22959
+ comment: comment,
22960
+ interpolation: interpolation
22961
+ }
22962
+ }
22963
+ });
22964
+ Prism.languages.insertBefore('coffeescript', 'string', {
22965
+ 'inline-javascript': {
22966
+ pattern: /`(?:\\[\s\S]|[^\\`])*`/,
22967
+ inside: {
22968
+ delimiter: {
22969
+ pattern: /^`|`$/,
22970
+ alias: 'punctuation'
22971
+ },
22972
+ script: {
22973
+ pattern: /[\s\S]+/,
22974
+ alias: 'language-javascript',
22975
+ inside: Prism.languages.javascript
22976
+ }
22977
+ }
22978
+ },
22979
+ // Block strings
22980
+ 'multiline-string': [
22981
+ {
22982
+ pattern: /'''[\s\S]*?'''/,
22983
+ greedy: true,
22984
+ alias: 'string'
22985
+ },
22986
+ {
22987
+ pattern: /"""[\s\S]*?"""/,
22988
+ greedy: true,
22989
+ alias: 'string',
22990
+ inside: {
22991
+ interpolation: interpolation
22992
+ }
22993
+ }
22994
+ ]
22995
+ });
22996
+ Prism.languages.insertBefore('coffeescript', 'keyword', {
22997
+ // Object property
22998
+ property: /(?!\d)\w+(?=\s*:(?!:))/
22999
+ });
23000
+ delete Prism.languages.coffeescript['template-string'];
23001
+ Prism.languages.coffee = Prism.languages.coffeescript;
23002
+ })(Prism);
23003
+ }
23004
+ return coffeescript_1;
22970
23005
  }
22971
23006
 
22972
- var concurnas_1 = concurnas;
22973
- concurnas.displayName = 'concurnas';
22974
- concurnas.aliases = ['conc'];
22975
- function concurnas(Prism) {
22976
- Prism.languages.concurnas = {
22977
- comment: {
22978
- pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
22979
- lookbehind: true,
22980
- greedy: true
22981
- },
22982
- langext: {
22983
- pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
22984
- greedy: true,
22985
- inside: {
22986
- 'class-name': /^\w+/,
22987
- string: {
22988
- pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
22989
- lookbehind: true
22990
- },
22991
- punctuation: /\|\|/
22992
- }
22993
- },
22994
- function: {
22995
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
22996
- lookbehind: true
22997
- },
22998
- keyword:
22999
- /\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/,
23000
- boolean: /\b(?:false|true)\b/,
23001
- number:
23002
- /\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
23003
- punctuation: /[{}[\];(),.:]/,
23004
- operator:
23005
- /<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
23006
- annotation: {
23007
- pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
23008
- alias: 'builtin'
23009
- }
23010
- };
23011
- Prism.languages.insertBefore('concurnas', 'langext', {
23012
- 'regex-literal': {
23013
- pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
23014
- greedy: true,
23015
- inside: {
23016
- interpolation: {
23017
- pattern:
23018
- /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
23019
- lookbehind: true,
23020
- inside: Prism.languages.concurnas
23021
- },
23022
- regex: /[\s\S]+/
23023
- }
23024
- },
23025
- 'string-literal': {
23026
- pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
23027
- greedy: true,
23028
- inside: {
23029
- interpolation: {
23030
- pattern:
23031
- /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
23032
- lookbehind: true,
23033
- inside: Prism.languages.concurnas
23034
- },
23035
- string: /[\s\S]+/
23036
- }
23037
- }
23038
- });
23039
- Prism.languages.conc = Prism.languages.concurnas;
23007
+ var concurnas_1;
23008
+ var hasRequiredConcurnas;
23009
+
23010
+ function requireConcurnas () {
23011
+ if (hasRequiredConcurnas) return concurnas_1;
23012
+ hasRequiredConcurnas = 1;
23013
+
23014
+ concurnas_1 = concurnas;
23015
+ concurnas.displayName = 'concurnas';
23016
+ concurnas.aliases = ['conc'];
23017
+ function concurnas(Prism) {
23018
+ Prism.languages.concurnas = {
23019
+ comment: {
23020
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
23021
+ lookbehind: true,
23022
+ greedy: true
23023
+ },
23024
+ langext: {
23025
+ pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
23026
+ greedy: true,
23027
+ inside: {
23028
+ 'class-name': /^\w+/,
23029
+ string: {
23030
+ pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
23031
+ lookbehind: true
23032
+ },
23033
+ punctuation: /\|\|/
23034
+ }
23035
+ },
23036
+ function: {
23037
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
23038
+ lookbehind: true
23039
+ },
23040
+ keyword:
23041
+ /\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/,
23042
+ boolean: /\b(?:false|true)\b/,
23043
+ number:
23044
+ /\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
23045
+ punctuation: /[{}[\];(),.:]/,
23046
+ operator:
23047
+ /<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
23048
+ annotation: {
23049
+ pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
23050
+ alias: 'builtin'
23051
+ }
23052
+ };
23053
+ Prism.languages.insertBefore('concurnas', 'langext', {
23054
+ 'regex-literal': {
23055
+ pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
23056
+ greedy: true,
23057
+ inside: {
23058
+ interpolation: {
23059
+ pattern:
23060
+ /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
23061
+ lookbehind: true,
23062
+ inside: Prism.languages.concurnas
23063
+ },
23064
+ regex: /[\s\S]+/
23065
+ }
23066
+ },
23067
+ 'string-literal': {
23068
+ pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
23069
+ greedy: true,
23070
+ inside: {
23071
+ interpolation: {
23072
+ pattern:
23073
+ /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
23074
+ lookbehind: true,
23075
+ inside: Prism.languages.concurnas
23076
+ },
23077
+ string: /[\s\S]+/
23078
+ }
23079
+ }
23080
+ });
23081
+ Prism.languages.conc = Prism.languages.concurnas;
23082
+ }
23083
+ return concurnas_1;
23040
23084
  }
23041
23085
 
23042
- var coq_1 = coq;
23043
- coq.displayName = 'coq';
23044
- coq.aliases = [];
23045
- function coq(Prism) {
23086
+ var coq_1;
23087
+ var hasRequiredCoq;
23088
+
23089
+ function requireCoq () {
23090
+ if (hasRequiredCoq) return coq_1;
23091
+ hasRequiredCoq = 1;
23092
+
23093
+ coq_1 = coq;
23094
+ coq.displayName = 'coq';
23095
+ coq.aliases = [];
23096
+ function coq(Prism) {
23046
23097
  (function (Prism) {
23047
- // https://github.com/coq/coq
23048
- var commentSource = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source;
23049
- for (var i = 0; i < 2; i++) {
23050
- commentSource = commentSource.replace(/<self>/g, function () {
23051
- return commentSource
23052
- });
23053
- }
23054
- commentSource = commentSource.replace(/<self>/g, '[]');
23055
- Prism.languages.coq = {
23056
- comment: RegExp(commentSource),
23057
- string: {
23058
- pattern: /"(?:[^"]|"")*"(?!")/,
23059
- greedy: true
23060
- },
23061
- attribute: [
23062
- {
23063
- pattern: RegExp(
23064
- /#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|<comment>)*\]/.source.replace(
23065
- /<comment>/g,
23066
- function () {
23067
- return commentSource
23068
- }
23069
- )
23070
- ),
23071
- greedy: true,
23072
- alias: 'attr-name',
23073
- inside: {
23074
- comment: RegExp(commentSource),
23075
- string: {
23076
- pattern: /"(?:[^"]|"")*"(?!")/,
23077
- greedy: true
23078
- },
23079
- operator: /=/,
23080
- punctuation: /^#\[|\]$|[,()]/
23081
- }
23082
- },
23083
- {
23084
- pattern:
23085
- /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,
23086
- alias: 'attr-name'
23087
- }
23088
- ],
23089
- keyword:
23090
- /\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/,
23091
- number:
23092
- /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,
23093
- punct: {
23094
- pattern: /@\{|\{\||\[=|:>/,
23095
- alias: 'punctuation'
23096
- },
23097
- operator:
23098
- /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,
23099
- punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/
23100
- };
23101
- })(Prism);
23098
+ // https://github.com/coq/coq
23099
+ var commentSource = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source;
23100
+ for (var i = 0; i < 2; i++) {
23101
+ commentSource = commentSource.replace(/<self>/g, function () {
23102
+ return commentSource
23103
+ });
23104
+ }
23105
+ commentSource = commentSource.replace(/<self>/g, '[]');
23106
+ Prism.languages.coq = {
23107
+ comment: RegExp(commentSource),
23108
+ string: {
23109
+ pattern: /"(?:[^"]|"")*"(?!")/,
23110
+ greedy: true
23111
+ },
23112
+ attribute: [
23113
+ {
23114
+ pattern: RegExp(
23115
+ /#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|<comment>)*\]/.source.replace(
23116
+ /<comment>/g,
23117
+ function () {
23118
+ return commentSource
23119
+ }
23120
+ )
23121
+ ),
23122
+ greedy: true,
23123
+ alias: 'attr-name',
23124
+ inside: {
23125
+ comment: RegExp(commentSource),
23126
+ string: {
23127
+ pattern: /"(?:[^"]|"")*"(?!")/,
23128
+ greedy: true
23129
+ },
23130
+ operator: /=/,
23131
+ punctuation: /^#\[|\]$|[,()]/
23132
+ }
23133
+ },
23134
+ {
23135
+ pattern:
23136
+ /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,
23137
+ alias: 'attr-name'
23138
+ }
23139
+ ],
23140
+ keyword:
23141
+ /\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/,
23142
+ number:
23143
+ /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,
23144
+ punct: {
23145
+ pattern: /@\{|\{\||\[=|:>/,
23146
+ alias: 'punctuation'
23147
+ },
23148
+ operator:
23149
+ /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,
23150
+ punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/
23151
+ };
23152
+ })(Prism);
23153
+ }
23154
+ return coq_1;
23102
23155
  }
23103
23156
 
23104
- var ruby_1 = ruby;
23105
- ruby.displayName = 'ruby';
23106
- ruby.aliases = ['rb'];
23107
- function ruby(Prism) {
23157
+ var ruby_1;
23158
+ var hasRequiredRuby;
23159
+
23160
+ function requireRuby () {
23161
+ if (hasRequiredRuby) return ruby_1;
23162
+ hasRequiredRuby = 1;
23163
+
23164
+ ruby_1 = ruby;
23165
+ ruby.displayName = 'ruby';
23166
+ ruby.aliases = ['rb'];
23167
+ function ruby(Prism) {
23108
23168
  (function (Prism) {
23109
- Prism.languages.ruby = Prism.languages.extend('clike', {
23110
- comment: {
23111
- pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
23112
- greedy: true
23113
- },
23114
- 'class-name': {
23115
- pattern:
23116
- /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
23117
- lookbehind: true,
23118
- inside: {
23119
- punctuation: /[.\\]/
23120
- }
23121
- },
23122
- keyword:
23123
- /\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/,
23124
- operator:
23125
- /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
23126
- punctuation: /[(){}[\].,;]/
23127
- });
23128
- Prism.languages.insertBefore('ruby', 'operator', {
23129
- 'double-colon': {
23130
- pattern: /::/,
23131
- alias: 'punctuation'
23132
- }
23133
- });
23134
- var interpolation = {
23135
- pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
23136
- lookbehind: true,
23137
- inside: {
23138
- content: {
23139
- pattern: /^(#\{)[\s\S]+(?=\}$)/,
23140
- lookbehind: true,
23141
- inside: Prism.languages.ruby
23142
- },
23143
- delimiter: {
23144
- pattern: /^#\{|\}$/,
23145
- alias: 'punctuation'
23146
- }
23147
- }
23148
- };
23149
- delete Prism.languages.ruby.function;
23150
- var percentExpression =
23151
- '(?:' +
23152
- [
23153
- /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
23154
- /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
23155
- /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
23156
- /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
23157
- /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
23158
- ].join('|') +
23159
- ')';
23160
- var symbolName =
23161
- /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/
23162
- .source;
23163
- Prism.languages.insertBefore('ruby', 'keyword', {
23164
- 'regex-literal': [
23165
- {
23166
- pattern: RegExp(
23167
- /%r/.source + percentExpression + /[egimnosux]{0,6}/.source
23168
- ),
23169
- greedy: true,
23170
- inside: {
23171
- interpolation: interpolation,
23172
- regex: /[\s\S]+/
23173
- }
23174
- },
23175
- {
23176
- pattern:
23177
- /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
23178
- lookbehind: true,
23179
- greedy: true,
23180
- inside: {
23181
- interpolation: interpolation,
23182
- regex: /[\s\S]+/
23183
- }
23184
- }
23185
- ],
23186
- variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
23187
- symbol: [
23188
- {
23189
- pattern: RegExp(/(^|[^:]):/.source + symbolName),
23190
- lookbehind: true,
23191
- greedy: true
23192
- },
23193
- {
23194
- pattern: RegExp(
23195
- /([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source
23196
- ),
23197
- lookbehind: true,
23198
- greedy: true
23199
- }
23200
- ],
23201
- 'method-definition': {
23202
- pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
23203
- lookbehind: true,
23204
- inside: {
23205
- function: /\b\w+$/,
23206
- keyword: /^self\b/,
23207
- 'class-name': /^\w+/,
23208
- punctuation: /\./
23209
- }
23210
- }
23211
- });
23212
- Prism.languages.insertBefore('ruby', 'string', {
23213
- 'string-literal': [
23214
- {
23215
- pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
23216
- greedy: true,
23217
- inside: {
23218
- interpolation: interpolation,
23219
- string: /[\s\S]+/
23220
- }
23221
- },
23222
- {
23223
- pattern:
23224
- /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
23225
- greedy: true,
23226
- inside: {
23227
- interpolation: interpolation,
23228
- string: /[\s\S]+/
23229
- }
23230
- },
23231
- {
23232
- pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
23233
- alias: 'heredoc-string',
23234
- greedy: true,
23235
- inside: {
23236
- delimiter: {
23237
- pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
23238
- inside: {
23239
- symbol: /\b\w+/,
23240
- punctuation: /^<<[-~]?/
23241
- }
23242
- },
23243
- interpolation: interpolation,
23244
- string: /[\s\S]+/
23245
- }
23246
- },
23247
- {
23248
- pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
23249
- alias: 'heredoc-string',
23250
- greedy: true,
23251
- inside: {
23252
- delimiter: {
23253
- pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
23254
- inside: {
23255
- symbol: /\b\w+/,
23256
- punctuation: /^<<[-~]?'|'$/
23257
- }
23258
- },
23259
- string: /[\s\S]+/
23260
- }
23261
- }
23262
- ],
23263
- 'command-literal': [
23264
- {
23265
- pattern: RegExp(/%x/.source + percentExpression),
23266
- greedy: true,
23267
- inside: {
23268
- interpolation: interpolation,
23269
- command: {
23270
- pattern: /[\s\S]+/,
23271
- alias: 'string'
23272
- }
23273
- }
23274
- },
23275
- {
23276
- pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
23277
- greedy: true,
23278
- inside: {
23279
- interpolation: interpolation,
23280
- command: {
23281
- pattern: /[\s\S]+/,
23282
- alias: 'string'
23283
- }
23284
- }
23285
- }
23286
- ]
23287
- });
23288
- delete Prism.languages.ruby.string;
23289
- Prism.languages.insertBefore('ruby', 'number', {
23290
- builtin:
23291
- /\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/,
23292
- constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
23293
- });
23294
- Prism.languages.rb = Prism.languages.ruby;
23295
- })(Prism);
23169
+ Prism.languages.ruby = Prism.languages.extend('clike', {
23170
+ comment: {
23171
+ pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
23172
+ greedy: true
23173
+ },
23174
+ 'class-name': {
23175
+ pattern:
23176
+ /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
23177
+ lookbehind: true,
23178
+ inside: {
23179
+ punctuation: /[.\\]/
23180
+ }
23181
+ },
23182
+ keyword:
23183
+ /\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/,
23184
+ operator:
23185
+ /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
23186
+ punctuation: /[(){}[\].,;]/
23187
+ });
23188
+ Prism.languages.insertBefore('ruby', 'operator', {
23189
+ 'double-colon': {
23190
+ pattern: /::/,
23191
+ alias: 'punctuation'
23192
+ }
23193
+ });
23194
+ var interpolation = {
23195
+ pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
23196
+ lookbehind: true,
23197
+ inside: {
23198
+ content: {
23199
+ pattern: /^(#\{)[\s\S]+(?=\}$)/,
23200
+ lookbehind: true,
23201
+ inside: Prism.languages.ruby
23202
+ },
23203
+ delimiter: {
23204
+ pattern: /^#\{|\}$/,
23205
+ alias: 'punctuation'
23206
+ }
23207
+ }
23208
+ };
23209
+ delete Prism.languages.ruby.function;
23210
+ var percentExpression =
23211
+ '(?:' +
23212
+ [
23213
+ /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
23214
+ /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
23215
+ /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
23216
+ /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
23217
+ /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
23218
+ ].join('|') +
23219
+ ')';
23220
+ var symbolName =
23221
+ /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/
23222
+ .source;
23223
+ Prism.languages.insertBefore('ruby', 'keyword', {
23224
+ 'regex-literal': [
23225
+ {
23226
+ pattern: RegExp(
23227
+ /%r/.source + percentExpression + /[egimnosux]{0,6}/.source
23228
+ ),
23229
+ greedy: true,
23230
+ inside: {
23231
+ interpolation: interpolation,
23232
+ regex: /[\s\S]+/
23233
+ }
23234
+ },
23235
+ {
23236
+ pattern:
23237
+ /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
23238
+ lookbehind: true,
23239
+ greedy: true,
23240
+ inside: {
23241
+ interpolation: interpolation,
23242
+ regex: /[\s\S]+/
23243
+ }
23244
+ }
23245
+ ],
23246
+ variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
23247
+ symbol: [
23248
+ {
23249
+ pattern: RegExp(/(^|[^:]):/.source + symbolName),
23250
+ lookbehind: true,
23251
+ greedy: true
23252
+ },
23253
+ {
23254
+ pattern: RegExp(
23255
+ /([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source
23256
+ ),
23257
+ lookbehind: true,
23258
+ greedy: true
23259
+ }
23260
+ ],
23261
+ 'method-definition': {
23262
+ pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
23263
+ lookbehind: true,
23264
+ inside: {
23265
+ function: /\b\w+$/,
23266
+ keyword: /^self\b/,
23267
+ 'class-name': /^\w+/,
23268
+ punctuation: /\./
23269
+ }
23270
+ }
23271
+ });
23272
+ Prism.languages.insertBefore('ruby', 'string', {
23273
+ 'string-literal': [
23274
+ {
23275
+ pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
23276
+ greedy: true,
23277
+ inside: {
23278
+ interpolation: interpolation,
23279
+ string: /[\s\S]+/
23280
+ }
23281
+ },
23282
+ {
23283
+ pattern:
23284
+ /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
23285
+ greedy: true,
23286
+ inside: {
23287
+ interpolation: interpolation,
23288
+ string: /[\s\S]+/
23289
+ }
23290
+ },
23291
+ {
23292
+ pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
23293
+ alias: 'heredoc-string',
23294
+ greedy: true,
23295
+ inside: {
23296
+ delimiter: {
23297
+ pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
23298
+ inside: {
23299
+ symbol: /\b\w+/,
23300
+ punctuation: /^<<[-~]?/
23301
+ }
23302
+ },
23303
+ interpolation: interpolation,
23304
+ string: /[\s\S]+/
23305
+ }
23306
+ },
23307
+ {
23308
+ pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
23309
+ alias: 'heredoc-string',
23310
+ greedy: true,
23311
+ inside: {
23312
+ delimiter: {
23313
+ pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
23314
+ inside: {
23315
+ symbol: /\b\w+/,
23316
+ punctuation: /^<<[-~]?'|'$/
23317
+ }
23318
+ },
23319
+ string: /[\s\S]+/
23320
+ }
23321
+ }
23322
+ ],
23323
+ 'command-literal': [
23324
+ {
23325
+ pattern: RegExp(/%x/.source + percentExpression),
23326
+ greedy: true,
23327
+ inside: {
23328
+ interpolation: interpolation,
23329
+ command: {
23330
+ pattern: /[\s\S]+/,
23331
+ alias: 'string'
23332
+ }
23333
+ }
23334
+ },
23335
+ {
23336
+ pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
23337
+ greedy: true,
23338
+ inside: {
23339
+ interpolation: interpolation,
23340
+ command: {
23341
+ pattern: /[\s\S]+/,
23342
+ alias: 'string'
23343
+ }
23344
+ }
23345
+ }
23346
+ ]
23347
+ });
23348
+ delete Prism.languages.ruby.string;
23349
+ Prism.languages.insertBefore('ruby', 'number', {
23350
+ builtin:
23351
+ /\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/,
23352
+ constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
23353
+ });
23354
+ Prism.languages.rb = Prism.languages.ruby;
23355
+ })(Prism);
23356
+ }
23357
+ return ruby_1;
23296
23358
  }
23297
23359
 
23298
- var refractorRuby = ruby_1;
23299
- var crystal_1 = crystal;
23300
- crystal.displayName = 'crystal';
23301
- crystal.aliases = [];
23302
- function crystal(Prism) {
23303
- Prism.register(refractorRuby)
23304
- ;(function (Prism) {
23305
- Prism.languages.crystal = Prism.languages.extend('ruby', {
23306
- keyword: [
23307
- /\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/,
23308
- {
23309
- pattern: /(\.\s*)(?:is_a|responds_to)\?/,
23310
- lookbehind: true
23311
- }
23312
- ],
23313
- number:
23314
- /\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/,
23315
- operator: [/->/, Prism.languages.ruby.operator],
23316
- punctuation: /[(){}[\].,;\\]/
23317
- });
23318
- Prism.languages.insertBefore('crystal', 'string-literal', {
23319
- attribute: {
23320
- pattern: /@\[.*?\]/,
23321
- inside: {
23322
- delimiter: {
23323
- pattern: /^@\[|\]$/,
23324
- alias: 'punctuation'
23325
- },
23326
- attribute: {
23327
- pattern: /^(\s*)\w+/,
23328
- lookbehind: true,
23329
- alias: 'class-name'
23330
- },
23331
- args: {
23332
- pattern: /\S(?:[\s\S]*\S)?/,
23333
- inside: Prism.languages.crystal
23334
- }
23335
- }
23336
- },
23337
- expansion: {
23338
- pattern: /\{(?:\{.*?\}|%.*?%)\}/,
23339
- inside: {
23340
- content: {
23341
- pattern: /^(\{.)[\s\S]+(?=.\}$)/,
23342
- lookbehind: true,
23343
- inside: Prism.languages.crystal
23344
- },
23345
- delimiter: {
23346
- pattern: /^\{[\{%]|[\}%]\}$/,
23347
- alias: 'operator'
23348
- }
23349
- }
23350
- },
23351
- char: {
23352
- pattern:
23353
- /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,
23354
- greedy: true
23355
- }
23356
- });
23357
- })(Prism);
23358
- }
23360
+ var crystal_1;
23361
+ var hasRequiredCrystal;
23359
23362
 
23360
- var refractorCsharp = csharp_1;
23361
- var cshtml_1 = cshtml;
23362
- cshtml.displayName = 'cshtml';
23363
- cshtml.aliases = ['razor'];
23364
- function cshtml(Prism) {
23365
- Prism.register(refractorCsharp)
23366
- // Docs:
23367
- // https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio
23368
- // https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0
23369
- ;(function (Prism) {
23370
- var commentLike = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//
23371
- .source;
23372
- var stringLike =
23373
- /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source +
23374
- '|' +
23375
- /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
23376
- /**
23377
- * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
23378
- *
23379
- * @param {string} pattern
23380
- * @param {number} depthLog2
23381
- * @returns {string}
23382
- */
23383
- function nested(pattern, depthLog2) {
23384
- for (var i = 0; i < depthLog2; i++) {
23385
- pattern = pattern.replace(/<self>/g, function () {
23386
- return '(?:' + pattern + ')'
23387
- });
23388
- }
23389
- return pattern
23390
- .replace(/<self>/g, '[^\\s\\S]')
23391
- .replace(/<str>/g, '(?:' + stringLike + ')')
23392
- .replace(/<comment>/g, '(?:' + commentLike + ')')
23393
- }
23394
- var round = nested(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2);
23395
- var square = nested(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 2);
23396
- var curly = nested(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2);
23397
- var angle = nested(/<(?:[^<>'"@/]|<str>|<comment>|<self>)*>/.source, 2); // Note about the above bracket patterns:
23398
- // They all ignore HTML expressions that might be in the C# code. This is a problem because HTML (like strings and
23399
- // comments) is parsed differently. This is a huge problem because HTML might contain brackets and quotes which
23400
- // messes up the bracket and string counting implemented by the above patterns.
23401
- //
23402
- // This problem is not fixable because 1) HTML expression are highly context sensitive and very difficult to detect
23403
- // and 2) they require one capturing group at every nested level. See the `tagRegion` pattern to admire the
23404
- // complexity of an HTML expression.
23405
- //
23406
- // To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also
23407
- // allows invalid characters to support HTML expressions like this: <p>That's it!</p>.
23408
- var tagAttrs =
23409
- /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/
23410
- .source;
23411
- var tagContent = /(?!\d)[^\s>\/=$<%]+/.source + tagAttrs + /\s*\/?>/.source;
23412
- var tagRegion =
23413
- /\B@?/.source +
23414
- '(?:' +
23415
- /<([a-zA-Z][\w:]*)/.source +
23416
- tagAttrs +
23417
- /\s*>/.source +
23418
- '(?:' +
23419
- (/[^<]/.source +
23420
- '|' + // all tags that are not the start tag
23421
- // eslint-disable-next-line regexp/strict
23422
- /<\/?(?!\1\b)/.source +
23423
- tagContent +
23424
- '|' + // nested start tag
23425
- nested(
23426
- // eslint-disable-next-line regexp/strict
23427
- /<\1/.source +
23428
- tagAttrs +
23429
- /\s*>/.source +
23430
- '(?:' +
23431
- (/[^<]/.source +
23432
- '|' + // all tags that are not the start tag
23433
- // eslint-disable-next-line regexp/strict
23434
- /<\/?(?!\1\b)/.source +
23435
- tagContent +
23436
- '|' +
23437
- '<self>') +
23438
- ')*' + // eslint-disable-next-line regexp/strict
23439
- /<\/\1\s*>/.source,
23440
- 2
23441
- )) +
23442
- ')*' + // eslint-disable-next-line regexp/strict
23443
- /<\/\1\s*>/.source +
23444
- '|' +
23445
- /</.source +
23446
- tagContent +
23447
- ')'; // Now for the actual language definition(s):
23448
- //
23449
- // Razor as a language has 2 parts:
23450
- // 1) CSHTML: A markup-like language that has been extended with inline C# code expressions and blocks.
23451
- // 2) C#+HTML: A variant of C# that can contain CSHTML tags as expressions.
23452
- //
23453
- // In the below code, both CSHTML and C#+HTML will be create as separate language definitions that reference each
23454
- // other. However, only CSHTML will be exported via `Prism.languages`.
23455
- Prism.languages.cshtml = Prism.languages.extend('markup', {});
23456
- var csharpWithHtml = Prism.languages.insertBefore(
23457
- 'csharp',
23458
- 'string',
23459
- {
23460
- html: {
23461
- pattern: RegExp(tagRegion),
23462
- greedy: true,
23463
- inside: Prism.languages.cshtml
23464
- }
23465
- },
23466
- {
23467
- csharp: Prism.languages.extend('csharp', {})
23468
- }
23469
- );
23470
- var cs = {
23471
- pattern: /\S[\s\S]*/,
23472
- alias: 'language-csharp',
23473
- inside: csharpWithHtml
23474
- };
23475
- Prism.languages.insertBefore('cshtml', 'prolog', {
23476
- 'razor-comment': {
23477
- pattern: /@\*[\s\S]*?\*@/,
23478
- greedy: true,
23479
- alias: 'comment'
23480
- },
23481
- block: {
23482
- pattern: RegExp(
23483
- /(^|[^@])@/.source +
23484
- '(?:' +
23485
- [
23486
- // @{ ... }
23487
- curly, // @code{ ... }
23488
- /(?:code|functions)\s*/.source + curly, // @for (...) { ... }
23489
- /(?:for|foreach|lock|switch|using|while)\s*/.source +
23490
- round +
23491
- /\s*/.source +
23492
- curly, // @do { ... } while (...);
23493
- /do\s*/.source +
23494
- curly +
23495
- /\s*while\s*/.source +
23496
- round +
23497
- /(?:\s*;)?/.source, // @try { ... } catch (...) { ... } finally { ... }
23498
- /try\s*/.source +
23499
- curly +
23500
- /\s*catch\s*/.source +
23501
- round +
23502
- /\s*/.source +
23503
- curly +
23504
- /\s*finally\s*/.source +
23505
- curly, // @if (...) {...} else if (...) {...} else {...}
23506
- /if\s*/.source +
23507
- round +
23508
- /\s*/.source +
23509
- curly +
23510
- '(?:' +
23511
- /\s*else/.source +
23512
- '(?:' +
23513
- /\s+if\s*/.source +
23514
- round +
23515
- ')?' +
23516
- /\s*/.source +
23517
- curly +
23518
- ')*'
23519
- ].join('|') +
23520
- ')'
23521
- ),
23522
- lookbehind: true,
23523
- greedy: true,
23524
- inside: {
23525
- keyword: /^@\w*/,
23526
- csharp: cs
23527
- }
23528
- },
23529
- directive: {
23530
- pattern:
23531
- /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
23532
- lookbehind: true,
23533
- greedy: true,
23534
- inside: {
23535
- keyword: /^@\w+/,
23536
- csharp: cs
23537
- }
23538
- },
23539
- value: {
23540
- pattern: RegExp(
23541
- /(^|[^@])@/.source +
23542
- /(?:await\b\s*)?/.source +
23543
- '(?:' +
23544
- /\w+\b/.source +
23545
- '|' +
23546
- round +
23547
- ')' +
23548
- '(?:' +
23549
- /[?!]?\.\w+\b/.source +
23550
- '|' +
23551
- round +
23552
- '|' +
23553
- square +
23554
- '|' +
23555
- angle +
23556
- round +
23557
- ')*'
23558
- ),
23559
- lookbehind: true,
23560
- greedy: true,
23561
- alias: 'variable',
23562
- inside: {
23563
- keyword: /^@/,
23564
- csharp: cs
23565
- }
23566
- },
23567
- 'delegate-operator': {
23568
- pattern: /(^|[^@])@(?=<)/,
23569
- lookbehind: true,
23570
- alias: 'operator'
23571
- }
23572
- });
23573
- Prism.languages.razor = Prism.languages.cshtml;
23574
- })(Prism);
23363
+ function requireCrystal () {
23364
+ if (hasRequiredCrystal) return crystal_1;
23365
+ hasRequiredCrystal = 1;
23366
+ var refractorRuby = requireRuby();
23367
+ crystal_1 = crystal;
23368
+ crystal.displayName = 'crystal';
23369
+ crystal.aliases = [];
23370
+ function crystal(Prism) {
23371
+ Prism.register(refractorRuby)
23372
+ ;(function (Prism) {
23373
+ Prism.languages.crystal = Prism.languages.extend('ruby', {
23374
+ keyword: [
23375
+ /\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/,
23376
+ {
23377
+ pattern: /(\.\s*)(?:is_a|responds_to)\?/,
23378
+ lookbehind: true
23379
+ }
23380
+ ],
23381
+ number:
23382
+ /\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/,
23383
+ operator: [/->/, Prism.languages.ruby.operator],
23384
+ punctuation: /[(){}[\].,;\\]/
23385
+ });
23386
+ Prism.languages.insertBefore('crystal', 'string-literal', {
23387
+ attribute: {
23388
+ pattern: /@\[.*?\]/,
23389
+ inside: {
23390
+ delimiter: {
23391
+ pattern: /^@\[|\]$/,
23392
+ alias: 'punctuation'
23393
+ },
23394
+ attribute: {
23395
+ pattern: /^(\s*)\w+/,
23396
+ lookbehind: true,
23397
+ alias: 'class-name'
23398
+ },
23399
+ args: {
23400
+ pattern: /\S(?:[\s\S]*\S)?/,
23401
+ inside: Prism.languages.crystal
23402
+ }
23403
+ }
23404
+ },
23405
+ expansion: {
23406
+ pattern: /\{(?:\{.*?\}|%.*?%)\}/,
23407
+ inside: {
23408
+ content: {
23409
+ pattern: /^(\{.)[\s\S]+(?=.\}$)/,
23410
+ lookbehind: true,
23411
+ inside: Prism.languages.crystal
23412
+ },
23413
+ delimiter: {
23414
+ pattern: /^\{[\{%]|[\}%]\}$/,
23415
+ alias: 'operator'
23416
+ }
23417
+ }
23418
+ },
23419
+ char: {
23420
+ pattern:
23421
+ /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,
23422
+ greedy: true
23423
+ }
23424
+ });
23425
+ })(Prism);
23426
+ }
23427
+ return crystal_1;
23428
+ }
23429
+
23430
+ var cshtml_1;
23431
+ var hasRequiredCshtml;
23432
+
23433
+ function requireCshtml () {
23434
+ if (hasRequiredCshtml) return cshtml_1;
23435
+ hasRequiredCshtml = 1;
23436
+ var refractorCsharp = requireCsharp();
23437
+ cshtml_1 = cshtml;
23438
+ cshtml.displayName = 'cshtml';
23439
+ cshtml.aliases = ['razor'];
23440
+ function cshtml(Prism) {
23441
+ Prism.register(refractorCsharp)
23442
+ // Docs:
23443
+ // https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio
23444
+ // https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0
23445
+ ;(function (Prism) {
23446
+ var commentLike = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//
23447
+ .source;
23448
+ var stringLike =
23449
+ /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source +
23450
+ '|' +
23451
+ /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
23452
+ /**
23453
+ * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
23454
+ *
23455
+ * @param {string} pattern
23456
+ * @param {number} depthLog2
23457
+ * @returns {string}
23458
+ */
23459
+ function nested(pattern, depthLog2) {
23460
+ for (var i = 0; i < depthLog2; i++) {
23461
+ pattern = pattern.replace(/<self>/g, function () {
23462
+ return '(?:' + pattern + ')'
23463
+ });
23464
+ }
23465
+ return pattern
23466
+ .replace(/<self>/g, '[^\\s\\S]')
23467
+ .replace(/<str>/g, '(?:' + stringLike + ')')
23468
+ .replace(/<comment>/g, '(?:' + commentLike + ')')
23469
+ }
23470
+ var round = nested(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2);
23471
+ var square = nested(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 2);
23472
+ var curly = nested(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2);
23473
+ var angle = nested(/<(?:[^<>'"@/]|<str>|<comment>|<self>)*>/.source, 2); // Note about the above bracket patterns:
23474
+ // They all ignore HTML expressions that might be in the C# code. This is a problem because HTML (like strings and
23475
+ // comments) is parsed differently. This is a huge problem because HTML might contain brackets and quotes which
23476
+ // messes up the bracket and string counting implemented by the above patterns.
23477
+ //
23478
+ // This problem is not fixable because 1) HTML expression are highly context sensitive and very difficult to detect
23479
+ // and 2) they require one capturing group at every nested level. See the `tagRegion` pattern to admire the
23480
+ // complexity of an HTML expression.
23481
+ //
23482
+ // To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also
23483
+ // allows invalid characters to support HTML expressions like this: <p>That's it!</p>.
23484
+ var tagAttrs =
23485
+ /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/
23486
+ .source;
23487
+ var tagContent = /(?!\d)[^\s>\/=$<%]+/.source + tagAttrs + /\s*\/?>/.source;
23488
+ var tagRegion =
23489
+ /\B@?/.source +
23490
+ '(?:' +
23491
+ /<([a-zA-Z][\w:]*)/.source +
23492
+ tagAttrs +
23493
+ /\s*>/.source +
23494
+ '(?:' +
23495
+ (/[^<]/.source +
23496
+ '|' + // all tags that are not the start tag
23497
+ // eslint-disable-next-line regexp/strict
23498
+ /<\/?(?!\1\b)/.source +
23499
+ tagContent +
23500
+ '|' + // nested start tag
23501
+ nested(
23502
+ // eslint-disable-next-line regexp/strict
23503
+ /<\1/.source +
23504
+ tagAttrs +
23505
+ /\s*>/.source +
23506
+ '(?:' +
23507
+ (/[^<]/.source +
23508
+ '|' + // all tags that are not the start tag
23509
+ // eslint-disable-next-line regexp/strict
23510
+ /<\/?(?!\1\b)/.source +
23511
+ tagContent +
23512
+ '|' +
23513
+ '<self>') +
23514
+ ')*' + // eslint-disable-next-line regexp/strict
23515
+ /<\/\1\s*>/.source,
23516
+ 2
23517
+ )) +
23518
+ ')*' + // eslint-disable-next-line regexp/strict
23519
+ /<\/\1\s*>/.source +
23520
+ '|' +
23521
+ /</.source +
23522
+ tagContent +
23523
+ ')'; // Now for the actual language definition(s):
23524
+ //
23525
+ // Razor as a language has 2 parts:
23526
+ // 1) CSHTML: A markup-like language that has been extended with inline C# code expressions and blocks.
23527
+ // 2) C#+HTML: A variant of C# that can contain CSHTML tags as expressions.
23528
+ //
23529
+ // In the below code, both CSHTML and C#+HTML will be create as separate language definitions that reference each
23530
+ // other. However, only CSHTML will be exported via `Prism.languages`.
23531
+ Prism.languages.cshtml = Prism.languages.extend('markup', {});
23532
+ var csharpWithHtml = Prism.languages.insertBefore(
23533
+ 'csharp',
23534
+ 'string',
23535
+ {
23536
+ html: {
23537
+ pattern: RegExp(tagRegion),
23538
+ greedy: true,
23539
+ inside: Prism.languages.cshtml
23540
+ }
23541
+ },
23542
+ {
23543
+ csharp: Prism.languages.extend('csharp', {})
23544
+ }
23545
+ );
23546
+ var cs = {
23547
+ pattern: /\S[\s\S]*/,
23548
+ alias: 'language-csharp',
23549
+ inside: csharpWithHtml
23550
+ };
23551
+ Prism.languages.insertBefore('cshtml', 'prolog', {
23552
+ 'razor-comment': {
23553
+ pattern: /@\*[\s\S]*?\*@/,
23554
+ greedy: true,
23555
+ alias: 'comment'
23556
+ },
23557
+ block: {
23558
+ pattern: RegExp(
23559
+ /(^|[^@])@/.source +
23560
+ '(?:' +
23561
+ [
23562
+ // @{ ... }
23563
+ curly, // @code{ ... }
23564
+ /(?:code|functions)\s*/.source + curly, // @for (...) { ... }
23565
+ /(?:for|foreach|lock|switch|using|while)\s*/.source +
23566
+ round +
23567
+ /\s*/.source +
23568
+ curly, // @do { ... } while (...);
23569
+ /do\s*/.source +
23570
+ curly +
23571
+ /\s*while\s*/.source +
23572
+ round +
23573
+ /(?:\s*;)?/.source, // @try { ... } catch (...) { ... } finally { ... }
23574
+ /try\s*/.source +
23575
+ curly +
23576
+ /\s*catch\s*/.source +
23577
+ round +
23578
+ /\s*/.source +
23579
+ curly +
23580
+ /\s*finally\s*/.source +
23581
+ curly, // @if (...) {...} else if (...) {...} else {...}
23582
+ /if\s*/.source +
23583
+ round +
23584
+ /\s*/.source +
23585
+ curly +
23586
+ '(?:' +
23587
+ /\s*else/.source +
23588
+ '(?:' +
23589
+ /\s+if\s*/.source +
23590
+ round +
23591
+ ')?' +
23592
+ /\s*/.source +
23593
+ curly +
23594
+ ')*'
23595
+ ].join('|') +
23596
+ ')'
23597
+ ),
23598
+ lookbehind: true,
23599
+ greedy: true,
23600
+ inside: {
23601
+ keyword: /^@\w*/,
23602
+ csharp: cs
23603
+ }
23604
+ },
23605
+ directive: {
23606
+ pattern:
23607
+ /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
23608
+ lookbehind: true,
23609
+ greedy: true,
23610
+ inside: {
23611
+ keyword: /^@\w+/,
23612
+ csharp: cs
23613
+ }
23614
+ },
23615
+ value: {
23616
+ pattern: RegExp(
23617
+ /(^|[^@])@/.source +
23618
+ /(?:await\b\s*)?/.source +
23619
+ '(?:' +
23620
+ /\w+\b/.source +
23621
+ '|' +
23622
+ round +
23623
+ ')' +
23624
+ '(?:' +
23625
+ /[?!]?\.\w+\b/.source +
23626
+ '|' +
23627
+ round +
23628
+ '|' +
23629
+ square +
23630
+ '|' +
23631
+ angle +
23632
+ round +
23633
+ ')*'
23634
+ ),
23635
+ lookbehind: true,
23636
+ greedy: true,
23637
+ alias: 'variable',
23638
+ inside: {
23639
+ keyword: /^@/,
23640
+ csharp: cs
23641
+ }
23642
+ },
23643
+ 'delegate-operator': {
23644
+ pattern: /(^|[^@])@(?=<)/,
23645
+ lookbehind: true,
23646
+ alias: 'operator'
23647
+ }
23648
+ });
23649
+ Prism.languages.razor = Prism.languages.cshtml;
23650
+ })(Prism);
23651
+ }
23652
+ return cshtml_1;
23575
23653
  }
23576
23654
 
23577
- var csp_1 = csp;
23578
- csp.displayName = 'csp';
23579
- csp.aliases = [];
23580
- function csp(Prism) {
23655
+ var csp_1;
23656
+ var hasRequiredCsp;
23657
+
23658
+ function requireCsp () {
23659
+ if (hasRequiredCsp) return csp_1;
23660
+ hasRequiredCsp = 1;
23661
+
23662
+ csp_1 = csp;
23663
+ csp.displayName = 'csp';
23664
+ csp.aliases = [];
23665
+ function csp(Prism) {
23581
23666
  (function (Prism) {
23582
- /**
23583
- * @param {string} source
23584
- * @returns {RegExp}
23585
- */
23586
- function value(source) {
23587
- return RegExp(
23588
- /([ \t])/.source + '(?:' + source + ')' + /(?=[\s;]|$)/.source,
23589
- 'i'
23590
- )
23591
- }
23592
- Prism.languages.csp = {
23593
- directive: {
23594
- pattern:
23595
- /(^|[\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,
23596
- lookbehind: true,
23597
- alias: 'property'
23598
- },
23599
- scheme: {
23600
- pattern: value(/[a-z][a-z0-9.+-]*:/.source),
23601
- lookbehind: true
23602
- },
23603
- none: {
23604
- pattern: value(/'none'/.source),
23605
- lookbehind: true,
23606
- alias: 'keyword'
23607
- },
23608
- nonce: {
23609
- pattern: value(/'nonce-[-+/\w=]+'/.source),
23610
- lookbehind: true,
23611
- alias: 'number'
23612
- },
23613
- hash: {
23614
- pattern: value(/'sha(?:256|384|512)-[-+/\w=]+'/.source),
23615
- lookbehind: true,
23616
- alias: 'number'
23617
- },
23618
- host: {
23619
- pattern: value(
23620
- /[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source +
23621
- '|' +
23622
- /\*[^\s;,']*/.source +
23623
- '|' +
23624
- /[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source
23625
- ),
23626
- lookbehind: true,
23627
- alias: 'url',
23628
- inside: {
23629
- important: /\*/
23630
- }
23631
- },
23632
- keyword: [
23633
- {
23634
- pattern: value(/'unsafe-[a-z-]+'/.source),
23635
- lookbehind: true,
23636
- alias: 'unsafe'
23637
- },
23638
- {
23639
- pattern: value(/'[a-z-]+'/.source),
23640
- lookbehind: true,
23641
- alias: 'safe'
23642
- }
23643
- ],
23644
- punctuation: /;/
23645
- };
23646
- })(Prism);
23667
+ /**
23668
+ * @param {string} source
23669
+ * @returns {RegExp}
23670
+ */
23671
+ function value(source) {
23672
+ return RegExp(
23673
+ /([ \t])/.source + '(?:' + source + ')' + /(?=[\s;]|$)/.source,
23674
+ 'i'
23675
+ )
23676
+ }
23677
+ Prism.languages.csp = {
23678
+ directive: {
23679
+ pattern:
23680
+ /(^|[\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,
23681
+ lookbehind: true,
23682
+ alias: 'property'
23683
+ },
23684
+ scheme: {
23685
+ pattern: value(/[a-z][a-z0-9.+-]*:/.source),
23686
+ lookbehind: true
23687
+ },
23688
+ none: {
23689
+ pattern: value(/'none'/.source),
23690
+ lookbehind: true,
23691
+ alias: 'keyword'
23692
+ },
23693
+ nonce: {
23694
+ pattern: value(/'nonce-[-+/\w=]+'/.source),
23695
+ lookbehind: true,
23696
+ alias: 'number'
23697
+ },
23698
+ hash: {
23699
+ pattern: value(/'sha(?:256|384|512)-[-+/\w=]+'/.source),
23700
+ lookbehind: true,
23701
+ alias: 'number'
23702
+ },
23703
+ host: {
23704
+ pattern: value(
23705
+ /[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source +
23706
+ '|' +
23707
+ /\*[^\s;,']*/.source +
23708
+ '|' +
23709
+ /[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source
23710
+ ),
23711
+ lookbehind: true,
23712
+ alias: 'url',
23713
+ inside: {
23714
+ important: /\*/
23715
+ }
23716
+ },
23717
+ keyword: [
23718
+ {
23719
+ pattern: value(/'unsafe-[a-z-]+'/.source),
23720
+ lookbehind: true,
23721
+ alias: 'unsafe'
23722
+ },
23723
+ {
23724
+ pattern: value(/'[a-z-]+'/.source),
23725
+ lookbehind: true,
23726
+ alias: 'safe'
23727
+ }
23728
+ ],
23729
+ punctuation: /;/
23730
+ };
23731
+ })(Prism);
23732
+ }
23733
+ return csp_1;
23647
23734
  }
23648
23735
 
23649
23736
  var cssExtras_1;
@@ -25110,7 +25197,7 @@ var hasRequiredErb;
25110
25197
  function requireErb () {
25111
25198
  if (hasRequiredErb) return erb_1;
25112
25199
  hasRequiredErb = 1;
25113
- var refractorRuby = ruby_1;
25200
+ var refractorRuby = requireRuby();
25114
25201
  var refractorMarkupTemplating = requireMarkupTemplating();
25115
25202
  erb_1 = erb;
25116
25203
  erb.displayName = 'erb';
@@ -27592,7 +27679,7 @@ var hasRequiredHaml;
27592
27679
  function requireHaml () {
27593
27680
  if (hasRequiredHaml) return haml_1;
27594
27681
  hasRequiredHaml = 1;
27595
- var refractorRuby = ruby_1;
27682
+ var refractorRuby = requireRuby();
27596
27683
  haml_1 = haml;
27597
27684
  haml.displayName = 'haml';
27598
27685
  haml.aliases = [];
@@ -40028,7 +40115,7 @@ function requireT4Cs () {
40028
40115
  if (hasRequiredT4Cs) return t4Cs_1;
40029
40116
  hasRequiredT4Cs = 1;
40030
40117
  var refractorT4Templating = requireT4Templating();
40031
- var refractorCsharp = csharp_1;
40118
+ var refractorCsharp = requireCsharp();
40032
40119
  t4Cs_1 = t4Cs;
40033
40120
  t4Cs.displayName = 't4Cs';
40034
40121
  t4Cs.aliases = [];
@@ -42800,20 +42887,20 @@ refractor.register(brightscript_1);
42800
42887
  refractor.register(bro_1);
42801
42888
  refractor.register(bsl_1);
42802
42889
  refractor.register(c_1);
42803
- refractor.register(cfscript_1);
42890
+ refractor.register(requireCfscript());
42804
42891
  refractor.register(chaiscript_1);
42805
42892
  refractor.register(cil_1);
42806
42893
  refractor.register(clojure_1);
42807
42894
  refractor.register(cmake_1);
42808
42895
  refractor.register(cobol_1);
42809
- refractor.register(coffeescript_1);
42810
- refractor.register(concurnas_1);
42811
- refractor.register(coq_1);
42812
- refractor.register(cpp_1);
42813
- refractor.register(crystal_1);
42814
- refractor.register(csharp_1);
42815
- refractor.register(cshtml_1);
42816
- refractor.register(csp_1);
42896
+ refractor.register(requireCoffeescript());
42897
+ refractor.register(requireConcurnas());
42898
+ refractor.register(requireCoq());
42899
+ refractor.register(requireCpp());
42900
+ refractor.register(requireCrystal());
42901
+ refractor.register(requireCsharp());
42902
+ refractor.register(requireCshtml());
42903
+ refractor.register(requireCsp());
42817
42904
  refractor.register(requireCssExtras());
42818
42905
  refractor.register(requireCsv());
42819
42906
  refractor.register(requireCypher());
@@ -42976,7 +43063,7 @@ refractor.register(requireRest());
42976
43063
  refractor.register(requireRip());
42977
43064
  refractor.register(requireRoboconf());
42978
43065
  refractor.register(requireRobotframework());
42979
- refractor.register(ruby_1);
43066
+ refractor.register(requireRuby());
42980
43067
  refractor.register(requireRust());
42981
43068
  refractor.register(requireSas());
42982
43069
  refractor.register(requireSass());
@@ -109777,7 +109864,11 @@ var BaseAreaChart = function BaseAreaChart(props) {
109777
109864
  show: xAxisLabelShow
109778
109865
  },
109779
109866
  splitLine: {
109780
- show: xSplitLineShow
109867
+ show: xSplitLineShow,
109868
+ lineStyle: {
109869
+ color: axisSplitColor,
109870
+ type: splitType
109871
+ }
109781
109872
  },
109782
109873
  axisLine: {
109783
109874
  show: xAxisLineShow
@@ -110325,7 +110416,9 @@ var generateOptions = function generateOptions(optionData) {
110325
110416
  return null;
110326
110417
  }
110327
110418
  };
110328
- var BaseWidget = function BaseWidget(props) {
110419
+
110420
+ // eslint-disable-next-line prefer-arrow-callback
110421
+ var BaseWidget = /*#__PURE__*/React.forwardRef(function BaseWidget(props, ref) {
110329
110422
  var _options$length, _options$length2;
110330
110423
  // eslint-disable-next-line object-curly-newline
110331
110424
  var loading = props.loading,
@@ -110339,7 +110432,11 @@ var BaseWidget = function BaseWidget(props) {
110339
110432
  fallbackProps = props.fallbackProps,
110340
110433
  theme = props.theme,
110341
110434
  setFallback = props.setFallback,
110342
- showFallback = props.showFallback;
110435
+ showFallback = props.showFallback,
110436
+ style = props.style,
110437
+ onMouseDown = props.onMouseDown,
110438
+ onMouseUp = props.onMouseUp,
110439
+ onTouchEnd = props.onTouchEnd;
110343
110440
  var emptyChartData = React.useMemo(function () {
110344
110441
  return React.Children.toArray(children).every(function (child) {
110345
110442
  var _child$props$seriesDa, _child$props, _child$props$seriesDa2;
@@ -110351,7 +110448,12 @@ var BaseWidget = function BaseWidget(props) {
110351
110448
  setFallback(emptyChartData);
110352
110449
  }, [emptyChartData]);
110353
110450
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
110451
+ ref: ref,
110354
110452
  className: classes(modules_6a0e74b6.root, className),
110453
+ style: style,
110454
+ onMouseDown: onMouseDown,
110455
+ onMouseUp: onMouseUp,
110456
+ onTouchEnd: onTouchEnd,
110355
110457
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
110356
110458
  className: modules_6a0e74b6.header,
110357
110459
  "data-elem": "header",
@@ -110397,7 +110499,7 @@ var BaseWidget = function BaseWidget(props) {
110397
110499
  })]
110398
110500
  })]
110399
110501
  });
110400
- };
110502
+ });
110401
110503
  BaseWidget.propTypes = {
110402
110504
  loading: propTypes$1.exports.bool,
110403
110505
  title: propTypes$1.exports.string,