lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js in gollum-3.1.2 vs lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js in gollum-3.1.3

- old
+ new

@@ -23,21 +23,23 @@ }, DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment regex : "\\/\\*", - merge : true, next : "comment" }, { - token : "string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + token : "string", // character + regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))'/ }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + token : "string", start : '"', end : '"|$', next: [ + {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, + {token: "invalid", regex: /\\./} + ] }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + token : "string", start : '@"', end : '"', next:[ + {token: "constant.language.escape", regex: '""'} + ] }, { token : "constant.numeric", // hex regex : "0[xX][0-9a-fA-F]+\\b" }, { token : "constant.numeric", // float @@ -45,17 +47,18 @@ }, { token : "constant.language.boolean", regex : "(?:true|false)\\b" }, { token : keywordMapper, - // TODO: Unicode escape sequences - // TODO: Unicode identifiers regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { token : "keyword.operator", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" }, { + token : "keyword", + regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" + }, { token : "punctuation.operator", regex : "\\?|\\:|\\,|\\;|\\." }, { token : "paren.lparen", regex : "[[({]" @@ -72,17 +75,17 @@ token : "comment", // closing comment regex : ".*?\\*\\/", next : "start" }, { token : "comment", // comment spanning whole line - merge : true, regex : ".+" } ] }; this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); }; oop.inherits(CSharpHighlightRules, TextHighlightRules); exports.CSharpHighlightRules = CSharpHighlightRules;