aboutsummaryrefslogtreecommitdiff
path: root/node_modules/highlight.js/lib/languages/cs.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/highlight.js/lib/languages/cs.js')
-rw-r--r--node_modules/highlight.js/lib/languages/cs.js24
1 files changed, 17 insertions, 7 deletions
diff --git a/node_modules/highlight.js/lib/languages/cs.js b/node_modules/highlight.js/lib/languages/cs.js
index f68039222..b92473c31 100644
--- a/node_modules/highlight.js/lib/languages/cs.js
+++ b/node_modules/highlight.js/lib/languages/cs.js
@@ -3,12 +3,11 @@ module.exports = function(hljs) {
keyword:
// Normal keywords.
'abstract as base bool break byte case catch char checked const continue decimal ' +
- 'default delegate do double else enum event explicit extern finally fixed float ' +
- 'for foreach goto if implicit in int interface internal is lock long ' +
+ 'default delegate do double enum event explicit extern finally fixed float ' +
+ 'for foreach goto if implicit in int interface internal is lock long nameof ' +
'object operator out override params private protected public readonly ref sbyte ' +
'sealed short sizeof stackalloc static string struct switch this try typeof ' +
'uint ulong unchecked unsafe ushort using virtual void volatile while ' +
- 'nameof ' +
// Contextual keywords.
'add alias ascending async await by descending dynamic equals from get global group into join ' +
'let on orderby partial remove select set value var where yield',
@@ -72,6 +71,7 @@ module.exports = function(hljs) {
};
var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?';
+
return {
aliases: ['csharp'],
keywords: KEYWORDS,
@@ -105,7 +105,9 @@ module.exports = function(hljs) {
{
className: 'meta',
begin: '#', end: '$',
- keywords: {'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'}
+ keywords: {
+ 'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'
+ }
},
STRING,
hljs.C_NUMBER_MODE,
@@ -128,15 +130,23 @@ module.exports = function(hljs) {
]
},
{
+ // [Attributes("")]
+ className: 'meta',
+ begin: '^\\s*\\[', excludeBegin: true, end: '\\]', excludeEnd: true,
+ contains: [
+ {className: 'meta-string', begin: /"/, end: /"/}
+ ]
+ },
+ {
// Expression keywords prevent 'keyword Name(...)' from being
// recognized as a function definition
- beginKeywords: 'new return throw await',
+ beginKeywords: 'new return throw await else',
relevance: 0
},
{
className: 'function',
- begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/,
- excludeEnd: true,
+ begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true,
+ end: /[{;=]/, excludeEnd: true,
keywords: KEYWORDS,
contains: [
{