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",
|
token : "string.regexp",
|
||||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"
|
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string", // " string start
|
||||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
regex : '"',
|
||||||
}, {
|
|
||||||
token : "string", // multi line string start
|
|
||||||
regex : '["][\\s\\S]*',
|
|
||||||
next : "qqstring"
|
next : "qqstring"
|
||||||
}, {
|
}, {
|
||||||
token : "string", // single line
|
token : "string", // ' string start
|
||||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
regex : "'",
|
||||||
}, {
|
|
||||||
token : "string", // multi line string start
|
|
||||||
regex : "['][\\s\\S]+",
|
|
||||||
next : "qstring"
|
next : "qstring"
|
||||||
}, {
|
}, {
|
||||||
token : "constant.numeric", // hex
|
token : "constant.numeric", // hex
|
||||||
|
|
@ -1040,33 +1034,45 @@ var PhpHighlightRules = function() {
|
||||||
],
|
],
|
||||||
"qqstring" : [
|
"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",
|
token : "string",
|
||||||
regex : '"',
|
regex : '"',
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '[^"]+'
|
regex : '.+?'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qstring" : [
|
"qstring" : [
|
||||||
{
|
{
|
||||||
|
token : "constant.language.escape",
|
||||||
|
regex : "\\\\['\\\\]"
|
||||||
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : "'",
|
regex : "'",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : "[^']+"
|
regex : ".+?"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"htmlcomment" : [
|
"htmlcomment" : [
|
||||||
{
|
{
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : ".*?-->",
|
regex : ".*?-->",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : ".+"
|
regex : ".+"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"htmltag" : [
|
"htmltag" : [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue