diff --git a/lib/ace/mode/php_highlight_rules.js b/lib/ace/mode/php_highlight_rules.js index 299a16b1..430fc0ec 100644 --- a/lib/ace/mode/php_highlight_rules.js +++ b/lib/ace/mode/php_highlight_rules.js @@ -974,6 +974,16 @@ var PhpLangHighlightRules = function() { // TODO: Unicode escape sequences // TODO: Unicode identifiers regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + }, { + token : function(value, currentSate, state) { + value = value.substr(3); + if (value[0] == "'" || value[0] == '"') + value = value.slice(1, -1); + state.unshift(this.next, value); + return "markup.list"; + }, + regex : /<<<(?:\w+|'\w+'|"\w+")$/, + next: "heredoc" }, { token : "keyword.operator", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" @@ -988,6 +998,22 @@ var PhpLangHighlightRules = function() { regex : "\\s+" } ], + "heredoc" : [ + { + token : function(value, currentSate, stack) { + if (stack[1] + ";" != value) + return "string"; + stack.shift(); + stack.shift(); + return "markup.list" + }, + regex : "^\\w+;$", + next: "start" + }, { + token: "string", + regex : ".*", + } + ], "comment" : [ { token : "comment", // closing comment