fix highlighting of multiline php strings
This commit is contained in:
parent
675386fc4c
commit
d2dfec41ee
1 changed files with 26 additions and 20 deletions
|
|
@ -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" : [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue