fix herestring highlighting in sh mode
This commit is contained in:
parent
09ddbeb341
commit
9f2fba320d
1 changed files with 7 additions and 4 deletions
|
|
@ -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 : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue