diff --git a/lib/ace/mode/php/php.js b/lib/ace/mode/php/php.js index de5e5a99..67346058 100644 --- a/lib/ace/mode/php/php.js +++ b/lib/ace/mode/php/php.js @@ -689,7 +689,7 @@ PHP.Lexer = function( src, ini ) { result = result.substring( match[ 0 ].length ); - match = result.match(/^(\-\>)([a-zA-Z0-9_\x7f-\xff]*)/); + match = result.match(/^(\-\>)\s*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*(\()/); if ( match !== null ) { @@ -703,6 +703,9 @@ PHP.Lexer = function( src, ini ) { match[ 2 ], line ]); + if (match[3]) { + results.push(match[3]); + } result = result.substring( match[ 0 ].length ); } @@ -714,9 +717,9 @@ PHP.Lexer = function( src, ini ) { var re; if ( curlyOpen > 0) { - re = /^([^\\\$"{}\]]|\\.)+/g; + re = /^([^\\\$"{}\]\)]|\\.)+/g; } else { - re = /^([^\\\$"{]|\\.|{[^\$])+/g; + re = /^([^\\\$"{]|\\.|{[^\$]|\$(?=[^a-zA-Z_\x7f-\xff]))+/g;; } while(( match = result.match( re )) !== null ) {