improve php variable regexp
This commit is contained in:
parent
0eb2b74a66
commit
31e1a2d1f3
1 changed files with 2 additions and 4 deletions
|
|
@ -969,13 +969,11 @@ var PhpLangHighlightRules = 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_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|self|parent)$/))
|
||||||
return "variable";
|
return "variable";
|
||||||
return "identifier";
|
return "identifier";
|
||||||
},
|
},
|
||||||
// TODO: Unicode escape sequences
|
regex : "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\b"
|
||||||
// TODO: Unicode identifiers
|
|
||||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
|
||||||
}, {
|
}, {
|
||||||
onMatch : function(value, currentSate, state) {
|
onMatch : function(value, currentSate, state) {
|
||||||
value = value.substr(3);
|
value = value.substr(3);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue