define(function(require, exports, module) {
"use strict";

var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

var CSharpHighlightRules = function() {
    var keywordMapper = this.createKeywordMapper({
        "variable.language": "this",
        "keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic",
        "constant.language": "null|true|false"
    }, "identifier");

    // regexp must not have capturing parentheses. Use (?:) instead.
    // regexps are ordered -> the first match is used

    this.$rules = {
        "start" : [
            {
                token : "comment",
                regex : "\\/\\/.*$"
            },
            DocCommentHighlightRules.getStartRule("doc-start"),
            {
                token : "comment", // multi line comment
                regex : "\\/\\*",
                next : "comment"
            }, {
                token : "string.regexp",
                regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
            }, {
                token : "string", // single line
                regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
            }, {
                token : "string", // single line
                regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
            }, {
                token : "constant.numeric", // hex
                regex : "0[xX][0-9a-fA-F]+\\b"
            }, {
                token : "constant.numeric", // float
                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
            }, {
                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 : "punctuation.operator",
                regex : "\\?|\\:|\\,|\\;|\\."
            }, {
                token : "paren.lparen",
                regex : "[[({]"
            }, {
                token : "paren.rparen",
                regex : "[\\])}]"
            }, {
                token : "text",
                regex : "\\s+"
            }
        ],
        "comment" : [
            {
                token : "comment", // closing comment
                regex : ".*?\\*\\/",
                next : "start"
            }, {
                token : "comment", // comment spanning whole line
                regex : ".+"
            }
        ]
    };

    this.embedRules(DocCommentHighlightRules, "doc-",
        [ DocCommentHighlightRules.getEndRule("start") ]);
};

oop.inherits(CSharpHighlightRules, TextHighlightRules);

exports.CSharpHighlightRules = CSharpHighlightRules;
});

@@ -1672,35 +1672,33 @@
 string%22, // 
-single line
+character
 %0A           
@@ -1714,44 +1714,59 @@
 x : 
-'%5B%22%5D(?:(?:%5C%5C%5C%5C.)%7C(?:%5B%5E%22%5C%5C%5C%5C%5D))*?%5B%22%5D'
+/'(?:.%7C%5C%5C(:?u%5B%5Cda-fA-F%5D+%7Cx%5B%5Cda-fA-F%5D+%7C%5Btbrf'%22n%5D))'/
 %0A   
@@ -1817,83 +1817,391 @@
 g%22, 
-// single line%0A               
+start : '%22', end : '%22%7C$', next: %5B%0A                    %7Btoken: %22constant.language.escape%22,
  regex
- 
 : 
-%22%5B'%5D(?:(?:%5C%5C%5C%5C.)%7C(?:%5B%5E'%5C%5C%5C%5C%5D))*?%5B'%5D%22
+/%5C%5C(:?u%5B%5Cda-fA-F%5D+%7Cx%5B%5Cda-fA-F%5D+%7C%5Btbrf'%22n%5D)/%7D,%0A                    %7Btoken: %22invalid%22, regex: /%5C%5C./%7D%0A                %5D%0A            %7D, %7B%0A                token : %22string%22, start : '@%22', end : '%22', next:%5B%0A                    %7Btoken: %22constant.language.escape%22, regex: '%22%22'%7D%0A                %5D
 %0A   
@@ -2630,103 +2630,8 @@
 er,%0A
-                // TODO: Unicode escape sequences%0A                // TODO: Unicode identifiers%0A
     
@@ -3747,16 +3747,43 @@
 t%22) %5D);%0A
+    this.normalizeRules();%0A
 %7D;%0A%0Aoop.

fix highlighting of c# strings