Merge pull request #695 from ajaxorg/highlighting/php

Improve multiline string rules
This commit is contained in:
Zef Hemel 2012-04-03 23:32:50 -07:00
commit daee6d1c3f

View file

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