improve php variable regexp

This commit is contained in:
nightwing 2014-02-05 21:24:03 +04:00
commit 31e1a2d1f3

View file

@ -969,13 +969,11 @@ var PhpLangHighlightRules = 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_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|self|parent)$/))
return "variable";
return "identifier";
},
// TODO: Unicode escape sequences
// TODO: Unicode identifiers
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
regex : "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\b"
}, {
onMatch : function(value, currentSate, state) {
value = value.substr(3);