diff --git a/lib/ace/mode/sh_highlight_rules.js b/lib/ace/mode/sh_highlight_rules.js index 43f536f4..9dd9aa33 100644 --- a/lib/ace/mode/sh_highlight_rules.js +++ b/lib/ace/mode/sh_highlight_rules.js @@ -99,8 +99,12 @@ var ShHighlightRules = function() { }, { defaultToken: "string" }] - }, { + }, { + regex : "<<<", + token : "keyword.operator" + }, { stateName: "heredoc", + regex : "(<<)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)", onMatch : function(value, currentState, stack) { var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; var tokens = value.split(this.splitRegex); @@ -113,7 +117,6 @@ var ShHighlightRules = function() { {type:"string", value: tokens[5]} ]; }, - regex : "(<<-?)(\\s*)(['\"`]?)([\\w\-]+)(['\"`]?)", rules: { heredoc: [{ onMatch: function(value, currentState, stack) { @@ -131,7 +134,7 @@ var ShHighlightRules = function() { }], indentedHeredoc: [{ token: "string", - regex: "^ +" + regex: "^\t+" }, { onMatch: function(value, currentState, stack) { if (value === stack[1]) { @@ -178,7 +181,7 @@ var ShHighlightRules = function() { regex : integer + "\\b" }, { token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" }, { token : "keyword.operator", regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="