@@ -104,9 +104,9 @@ function checkModes() {
104
104
var str = blockComment . start + " " + blockComment . end ;
105
105
str = blockComment . start + str ;
106
106
if ( blockComment . nestable )
107
- str += blockComment . end ;
107
+ str += blockComment . end ;
108
108
var data = tokenizer . getLineTokens ( str , "start" ) ;
109
- var isBroken = data . tokens . some ( function ( t ) { return ! / c o m m e n t / . test ( t . type ) ; } ) ;
109
+ var isBroken = data . tokens . some ( function ( t ) { return ! / c o m m e n t | e m p t y / . test ( t . type ) ; } ) ;
110
110
if ( isBroken ) {
111
111
die ( "broken blockComment in " + modeName , data ) ;
112
112
}
@@ -224,7 +224,9 @@ function generateTestData(names, force) {
224
224
var tokenizedLine = "" ;
225
225
data . tokens . forEach ( function ( x ) {
226
226
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
+ }
228
230
} ) ;
229
231
if ( tokenizedLine != line )
230
232
tmp . push ( JSON . stringify ( line ) ) ;
@@ -278,6 +280,7 @@ function testMode(modeName, i) {
278
280
line = lineData . values . join ( "" ) ;
279
281
280
282
var tokens = tokenizer . getLineTokens ( line , state ) ;
283
+ tokens . tokens = tokens . tokens . filter ( ( el ) => el . type != "empty" ) ;
281
284
var values = tokens . tokens . map ( function ( x ) { return x . value ; } ) ;
282
285
var types = tokens . tokens . map ( function ( x ) { return x . type ; } ) ;
283
286
0 commit comments