fix highlighting of multiline php strings

This commit is contained in:
nightwing 2012-05-26 22:03:41 +04:00
commit d2dfec41ee

View file

@ -948,18 +948,12 @@ var PhpHighlightRules = function() {
token : "string.regexp",
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // multi line string start
regex : '["][\\s\\S]*',
token : "string", // " string start
regex : '"',
next : "qqstring"
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "string", // multi line string start
regex : "['][\\s\\S]+",
token : "string", // ' string start
regex : "'",
next : "qstring"
}, {
token : "constant.numeric", // hex
@ -1040,33 +1034,45 @@ var PhpHighlightRules = function() {
],
"qqstring" : [
{
token : "constant.language.escape",
regex : '\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})'
}, {
token : "constant.language.escape",
regex : /\$[\w\d]+(?:\[[\w\d]+\])?/
}, {
token : "constant.language.escape",
regex : /\$\{[^"\}]+\}?/ // this is wrong but ok for now
}, {
token : "string",
regex : '"',
next : "start"
}, {
token : "string",
regex : '[^"]+'
regex : '.+?'
}
],
"qstring" : [
{
token : "constant.language.escape",
regex : "\\\\['\\\\]"
}, {
token : "string",
regex : "'",
next : "start"
}, {
token : "string",
regex : "[^']+"
regex : ".+?"
}
],
"htmlcomment" : [
{
token : "comment",
regex : ".*?-->",
next : "start"
}, {
token : "comment",
regex : ".+"
}
{
token : "comment",
regex : ".*?-->",
next : "start"
}, {
token : "comment",
regex : ".+"
}
],
"htmltag" : [
{