highlight escapes in sh mode
This commit is contained in:
parent
fa13f377e1
commit
4b398798c0
1 changed files with 22 additions and 4 deletions
|
|
@ -77,12 +77,28 @@ var ShHighlightRules = function() {
|
|||
var func = "(?:" + variableName + "\\s*\\(\\))";
|
||||
|
||||
this.$rules = {
|
||||
"start" : [ {
|
||||
"start" : [{
|
||||
token : "constant",
|
||||
regex : /\\./
|
||||
}, {
|
||||
token : ["text", "comment"],
|
||||
regex : /(^|\s)(#.*)$/
|
||||
}, {
|
||||
token : "string", // " string
|
||||
regex : '"(?:[^\\\\]|\\\\.)*?"'
|
||||
token : "string",
|
||||
regex : '"',
|
||||
push : [{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\(?:[$abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
|
||||
}, {
|
||||
token : "constant",
|
||||
regex : /\$\w+/
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"',
|
||||
next: "pop"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
}, {
|
||||
token : "variable.language",
|
||||
regex : builtinVariable
|
||||
|
|
@ -97,7 +113,7 @@ var ShHighlightRules = function() {
|
|||
regex : fileDescriptor
|
||||
}, {
|
||||
token : "string", // ' string
|
||||
regex : "'(?:[^\\\\]|\\\\.)*?'"
|
||||
start : "'", end : "'"
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : floatNumber
|
||||
|
|
@ -118,6 +134,8 @@ var ShHighlightRules = function() {
|
|||
regex : "[\\]\\)\\}]"
|
||||
} ]
|
||||
};
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
oop.inherits(ShHighlightRules, TextHighlightRules);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue