fix highlighting of scala strings

This commit is contained in:
nightwing 2012-06-01 14:52:51 +04:00
commit e38875cdfc

View file

@ -75,11 +75,16 @@ var ScalaHighlightRules = function() {
token : "string.regexp",
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
token : "string",
regex : '"""',
next : "tstring"
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
token : "string",
regex : '"',
next : "string"
}, {
token : "symbol.constant", // single line
regex : "'[\\w\\d_]+"
}, {
token : "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F]+\\b"
@ -131,6 +136,32 @@ var ScalaHighlightRules = function() {
merge : true,
regex : ".+"
}
],
"string" : [
{
token : "escape",
regex : '\\\\"',
}, {
token : "string",
merge : true,
regex : '"',
next : "start"
}, {
token : "string",
regex : '[^"\\\\]+',
merge : true
}
],
"tstring" : [
{
token : "string", // closing comment
regex : '"{3,5}',
next : "start"
}, {
token : "string", // comment spanning whole line
merge : true,
regex : ".+?"
}
]
};