diff --git a/lib/ace/mode/lean_highlight_rules.js b/lib/ace/mode/lean_highlight_rules.js index 91440169..4ba9d484 100644 --- a/lib/ace/mode/lean_highlight_rules.js +++ b/lib/ace/mode/lean_highlight_rules.js @@ -100,12 +100,15 @@ var leanHighlightRules = function() { regex : "\\/-", next : "comment" }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + stateName: "qqstring", + token : "string.start", regex : '"', next : [ + {token : "string.end", regex : '"', next : "start"}, + {token : "string", regex : "\\\\$", next : "qqstring"}, + {token : "string", regex : "\\n$", next : "qqstring"}, + {token : "constant.language.escape", regex : /\\./}, + {defaultToken: "string"} + ] }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" }, { token : "constant.numeric", // hex regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" @@ -141,6 +144,7 @@ var leanHighlightRules = function() { this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); + this.normalizeRules(); }; oop.inherits(leanHighlightRules, TextHighlightRules);