diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:10:37 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:11:17 +0200 |
commit | 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch) | |
tree | 70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/highlight.js/lib/languages/cs.js | |
parent | aca1143cb9eed16cf37f04e475e4257418dd18ac (diff) | |
download | wallet-core-7a3df06eb573d36142bd1a8e03c5ce8752d300b3.tar.xz |
fix build issues and add typedoc
Diffstat (limited to 'node_modules/highlight.js/lib/languages/cs.js')
-rw-r--r-- | node_modules/highlight.js/lib/languages/cs.js | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/node_modules/highlight.js/lib/languages/cs.js b/node_modules/highlight.js/lib/languages/cs.js new file mode 100644 index 000000000..f68039222 --- /dev/null +++ b/node_modules/highlight.js/lib/languages/cs.js @@ -0,0 +1,166 @@ +module.exports = function(hljs) { + var KEYWORDS = { + 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 ' + + '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', + literal: + 'null false true' + }; + + var VERBATIM_STRING = { + className: 'string', + begin: '@"', end: '"', + contains: [{begin: '""'}] + }; + var VERBATIM_STRING_NO_LF = hljs.inherit(VERBATIM_STRING, {illegal: /\n/}); + var SUBST = { + className: 'subst', + begin: '{', end: '}', + keywords: KEYWORDS + }; + var SUBST_NO_LF = hljs.inherit(SUBST, {illegal: /\n/}); + var INTERPOLATED_STRING = { + className: 'string', + begin: /\$"/, end: '"', + illegal: /\n/, + contains: [{begin: '{{'}, {begin: '}}'}, hljs.BACKSLASH_ESCAPE, SUBST_NO_LF] + }; + var INTERPOLATED_VERBATIM_STRING = { + className: 'string', + begin: /\$@"/, end: '"', + contains: [{begin: '{{'}, {begin: '}}'}, {begin: '""'}, SUBST] + }; + var INTERPOLATED_VERBATIM_STRING_NO_LF = hljs.inherit(INTERPOLATED_VERBATIM_STRING, { + illegal: /\n/, + contains: [{begin: '{{'}, {begin: '}}'}, {begin: '""'}, SUBST_NO_LF] + }); + SUBST.contains = [ + INTERPOLATED_VERBATIM_STRING, + INTERPOLATED_STRING, + VERBATIM_STRING, + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE, + hljs.C_NUMBER_MODE, + hljs.C_BLOCK_COMMENT_MODE + ]; + SUBST_NO_LF.contains = [ + INTERPOLATED_VERBATIM_STRING_NO_LF, + INTERPOLATED_STRING, + VERBATIM_STRING_NO_LF, + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE, + hljs.C_NUMBER_MODE, + hljs.inherit(hljs.C_BLOCK_COMMENT_MODE, {illegal: /\n/}) + ]; + var STRING = { + variants: [ + INTERPOLATED_VERBATIM_STRING, + INTERPOLATED_STRING, + VERBATIM_STRING, + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE + ] + }; + + var TYPE_IDENT_RE = hljs.IDENT_RE + '(<' + hljs.IDENT_RE + '(\\s*,\\s*' + hljs.IDENT_RE + ')*>)?(\\[\\])?'; + return { + aliases: ['csharp'], + keywords: KEYWORDS, + illegal: /::/, + contains: [ + hljs.COMMENT( + '///', + '$', + { + returnBegin: true, + contains: [ + { + className: 'doctag', + variants: [ + { + begin: '///', relevance: 0 + }, + { + begin: '<!--|-->' + }, + { + begin: '</?', end: '>' + } + ] + } + ] + } + ), + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE, + { + className: 'meta', + begin: '#', end: '$', + keywords: {'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'} + }, + STRING, + hljs.C_NUMBER_MODE, + { + beginKeywords: 'class interface', end: /[{;=]/, + illegal: /[^\s:]/, + contains: [ + hljs.TITLE_MODE, + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE + ] + }, + { + beginKeywords: 'namespace', end: /[{;=]/, + illegal: /[^\s:]/, + contains: [ + hljs.inherit(hljs.TITLE_MODE, {begin: '[a-zA-Z](\\.?\\w)*'}), + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE + ] + }, + { + // Expression keywords prevent 'keyword Name(...)' from being + // recognized as a function definition + beginKeywords: 'new return throw await', + relevance: 0 + }, + { + className: 'function', + begin: '(' + TYPE_IDENT_RE + '\\s+)+' + hljs.IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/, + excludeEnd: true, + keywords: KEYWORDS, + contains: [ + { + begin: hljs.IDENT_RE + '\\s*\\(', returnBegin: true, + contains: [hljs.TITLE_MODE], + relevance: 0 + }, + { + className: 'params', + begin: /\(/, end: /\)/, + excludeBegin: true, + excludeEnd: true, + keywords: KEYWORDS, + relevance: 0, + contains: [ + STRING, + hljs.C_NUMBER_MODE, + hljs.C_BLOCK_COMMENT_MODE + ] + }, + hljs.C_LINE_COMMENT_MODE, + hljs.C_BLOCK_COMMENT_MODE + ] + } + ] + }; +};
\ No newline at end of file |