From 31e1a2d1f3b3bc6f6b5dafacd0cc61ab728b742c Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 5 Feb 2014 21:24:03 +0400 Subject: [PATCH] improve php variable regexp --- lib/ace/mode/php_highlight_rules.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index 0c0557d6..f8d5e29e 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -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);