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" : [ "start" : [
{ {
token : "support", // php open tag token : "support", // php open tag
regex : "<\\?php|<\\?\\=|<\\?" regex : "<\\?(?:php|\\=)"
}, },
{ {
token : "support", // php close tag token : "support", // php close tag
@ -540,7 +540,7 @@ PhpHighlightRules = function() {
else if (value == "debugger") else if (value == "debugger")
return "invalid.deprecated"; return "invalid.deprecated";
else 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 "variable";
return "identifier"; return "identifier";
}, },