Improve multiline string rules

This commit is contained in:
Garen Torikian 2012-04-03 22:45:56 -07:00
commit 57d1e72751

View file

@ -952,14 +952,14 @@ var PhpHighlightRules = function() {
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // multi line string start
regex : '["].*\\\\$',
regex : '["][\\s\\S]*',
next : "qqstring"
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "string", // multi line string start
regex : "['].*\\\\$",
regex : "['][\\s\\S]+",
next : "qstring"
}, {
token : "constant.numeric", // hex
@ -1041,21 +1041,21 @@ var PhpHighlightRules = function() {
"qqstring" : [
{
token : "string",
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
regex : '"',
next : "start"
}, {
token : "string",
regex : '.+'
}
regex : '[^"]+'
},
],
"qstring" : [
{
token : "string",
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
regex : "'",
next : "start"
}, {
token : "string",
regex : '.+'
regex : "[^']+"
}
],
"htmlcomment" : [