clean up string rule for lean-mode

This commit is contained in:
Soonho Kong 2015-02-24 13:21:22 -05:00
commit 34d80e81ca

View file

@ -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);