diff --git a/lib/ace/mode/php/php.js b/lib/ace/mode/php/php.js index 75393d85..de5e5a99 100644 --- a/lib/ace/mode/php/php.js +++ b/lib/ace/mode/php/php.js @@ -816,7 +816,7 @@ PHP.Lexer = function( src, ini ) { if ( heredoc !== undefined ) { // we are in a heredoc - var regexp = new RegExp('([\\S\\s]*)(\\r\\n|\\n|\\r)(' + heredoc + ')(;|\\r\\n|\\n)',"i"); + var regexp = new RegExp('([\\S\\s]*?)(\\r\\n|\\n|\\r)(' + heredoc + ')(;|\\r\\n|\\n)',"i"); diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index 3828f20a..033671eb 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -988,7 +988,7 @@ var PhpLangHighlightRules = function() { next: "heredoc" }, { token : "keyword.operator", - regex : "::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" + regex : "::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|!=|!==|<=|>=|=>|<<=|>>=|>>>=|<>|<|>|=|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" }, { token : "paren.lparen", regex : "[[({]" @@ -1003,13 +1003,13 @@ var PhpLangHighlightRules = function() { "heredoc" : [ { onMatch : function(value, currentSate, stack) { - if (stack[1] + ";" != value) + if (stack[1] != value) return "string"; stack.shift(); stack.shift(); return "markup.list" }, - regex : "^\\w+;$", + regex : "^\\w+(?=;?$)", next: "start" }, { token: "string",