fix php heredoc highlighting inside array

fixes #1561
This commit is contained in:
nightwing 2013-08-23 11:46:49 +04:00
commit 48e672b710
2 changed files with 4 additions and 4 deletions

View file

@ -816,7 +816,7 @@ PHP.Lexer = function( src, ini ) {
if ( heredoc !== undefined ) { if ( heredoc !== undefined ) {
// we are in a heredoc // 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");

View file

@ -988,7 +988,7 @@ var PhpLangHighlightRules = function() {
next: "heredoc" next: "heredoc"
}, { }, {
token : "keyword.operator", token : "keyword.operator",
regex : "::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" regex : "::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|!=|!==|<=|>=|=>|<<=|>>=|>>>=|<>|<|>|=|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, { }, {
token : "paren.lparen", token : "paren.lparen",
regex : "[[({]" regex : "[[({]"
@ -1003,13 +1003,13 @@ var PhpLangHighlightRules = function() {
"heredoc" : [ "heredoc" : [
{ {
onMatch : function(value, currentSate, stack) { onMatch : function(value, currentSate, stack) {
if (stack[1] + ";" != value) if (stack[1] != value)
return "string"; return "string";
stack.shift(); stack.shift();
stack.shift(); stack.shift();
return "markup.list" return "markup.list"
}, },
regex : "^\\w+;$", regex : "^\\w+(?=;?$)",
next: "start" next: "start"
}, { }, {
token: "string", token: "string",