Skip to content

Commit 92db310

Browse files
committed
make it work with scopes
1 parent b52aea3 commit 92db310

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/mode/_test/highlight_rules_test.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ function checkModes() {
104104
var str = blockComment.start + " " + blockComment.end;
105105
str = blockComment.start + str;
106106
if (blockComment.nestable)
107-
str += blockComment.end;
107+
str += blockComment.end;
108108
var data = tokenizer.getLineTokens(str, "start");
109-
var isBroken = data.tokens.some(function(t) { return !/comment/.test(t.type); });
109+
var isBroken = data.tokens.some(function(t) { return !/comment|empty/.test(t.type); });
110110
if (isBroken) {
111111
die("broken blockComment in " + modeName, data);
112112
}
@@ -224,7 +224,9 @@ function generateTestData(names, force) {
224224
var tokenizedLine = "";
225225
data.tokens.forEach(function(x) {
226226
tokenizedLine += x.value;
227-
tmp.push(JSON.stringify([x.type, x.value]));
227+
if (x.type != "empty") {
228+
tmp.push(JSON.stringify([x.type, x.value]));
229+
}
228230
});
229231
if (tokenizedLine != line)
230232
tmp.push(JSON.stringify(line));
@@ -278,6 +280,7 @@ function testMode(modeName, i) {
278280
line = lineData.values.join("");
279281

280282
var tokens = tokenizer.getLineTokens(line, state);
283+
tokens.tokens = tokens.tokens.filter((el) => el.type != "empty");
281284
var values = tokens.tokens.map(function(x) {return x.value;});
282285
var types = tokens.tokens.map(function(x) {return x.type;});
283286

0 commit comments

Comments
 (0)