fix highlighting of /"[s]/ in coffeeScript
This commit is contained in:
parent
e2abf0f8f5
commit
3b911019f1
2 changed files with 7 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ define(function(require, exports, module) {
|
||||||
next : "heregex"
|
next : "heregex"
|
||||||
}, {
|
}, {
|
||||||
token : "string.regex",
|
token : "string.regex",
|
||||||
regex : "/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"
|
regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
|
||||||
}, {
|
}, {
|
||||||
token : "comment",
|
token : "comment",
|
||||||
merge : true,
|
merge : true,
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@ module.exports = {
|
||||||
assert.equal(tokens[0].type, "keyword");
|
assert.equal(tokens[0].type, "keyword");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"test: tokenize regexp": function() {
|
||||||
|
var tokens = this.tokenizer.getLineTokens('/"[a]/', "start").tokens;
|
||||||
|
assert.equal(tokens.length, 1);
|
||||||
|
assert.equal(tokens[0].type, "string.regex");
|
||||||
|
},
|
||||||
|
|
||||||
// TODO: disable. not yet implemented
|
// TODO: disable. not yet implemented
|
||||||
"!test tokenize string with interpolation": function() {
|
"!test tokenize string with interpolation": function() {
|
||||||
var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens;
|
var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue