non greedy js strings
This commit is contained in:
parent
0c360f39a6
commit
e56b9284da
1 changed files with 10 additions and 10 deletions
|
|
@ -65,7 +65,7 @@ var JavaScriptHighlightRules = function() {
|
|||
}, "identifier");
|
||||
|
||||
// keywords which can be followed by regular expressions
|
||||
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
|
||||
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
|
||||
|
||||
// TODO: Unicode escape sequences
|
||||
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
|
||||
|
|
@ -186,7 +186,7 @@ var JavaScriptHighlightRules = function() {
|
|||
regex : identifierRe
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
|
||||
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
|
||||
next : "regex_allowed"
|
||||
}, {
|
||||
token : "punctuation.operator",
|
||||
|
|
@ -341,10 +341,6 @@ var JavaScriptHighlightRules = function() {
|
|||
{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '[^"\\\\]+',
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "\\\\$",
|
||||
|
|
@ -355,16 +351,16 @@ var JavaScriptHighlightRules = function() {
|
|||
regex : '"|$',
|
||||
next : "start",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '.|\\w+|\\s+',
|
||||
merge : true
|
||||
}
|
||||
],
|
||||
"qstring" : [
|
||||
{
|
||||
token : "constant.language.escape",
|
||||
regex : escapedRe
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "[^'\\\\]+",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : "\\\\$",
|
||||
|
|
@ -375,6 +371,10 @@ var JavaScriptHighlightRules = function() {
|
|||
regex : "'|$",
|
||||
next : "start",
|
||||
merge : true
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '.|\\w+|\\s+',
|
||||
merge : true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue