php mode: nicer regexp

This commit is contained in:
André Fiedler 2010-12-20 01:03:58 +08:00 committed by Fabian Jakobs
commit a2dc7c8456

View file

@ -462,7 +462,7 @@ PhpHighlightRules = function() {
"start" : [
{
token : "support", // php open tag
regex : "<\\?php|<\\?\\=|<\\?"
regex : "<\\?(?:php|\\=)"
},
{
token : "support", // php close tag
@ -540,7 +540,7 @@ PhpHighlightRules = function() {
else if (value == "debugger")
return "invalid.deprecated";
else
if(value.match(/^\$[a-zA-Z][a-zA-Z0-9_]*$|^self$|^parent$/))
if(value.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))
return "variable";
return "identifier";
},