fix highlighting of scala strings
This commit is contained in:
parent
316023834e
commit
e38875cdfc
1 changed files with 35 additions and 4 deletions
|
|
@ -75,11 +75,16 @@ var ScalaHighlightRules = function() {
|
||||||
token : "string.regexp",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string",
|
||||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
regex : '"""',
|
||||||
|
next : "tstring"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string",
|
||||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
regex : '"',
|
||||||
|
next : "string"
|
||||||
|
}, {
|
||||||
|
token : "symbol.constant", // single line
|
||||||
|
regex : "'[\\w\\d_]+"
|
||||||
}, {
|
}, {
|
||||||
token : "constant.numeric", // hex
|
token : "constant.numeric", // hex
|
||||||
regex : "0[xX][0-9a-fA-F]+\\b"
|
regex : "0[xX][0-9a-fA-F]+\\b"
|
||||||
|
|
@ -131,6 +136,32 @@ var ScalaHighlightRules = function() {
|
||||||
merge : true,
|
merge : true,
|
||||||
regex : ".+"
|
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 : ".+?"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue