@@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
THE SOFTWARE.
22
22
*/
23
- /* Version v1.1.0 , Build time: 6-December-2016 10:31:29 */
23
+ /* Version v1.1.2 , Build time: 5-October-2017 13:33:04 */
24
24
var parserlib = ( function ( ) {
25
25
var require ;
26
26
require = ( function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; var f = new Error ( "Cannot find module '" + o + "'" ) ; throw f . code = "MODULE_NOT_FOUND" , f } var l = n [ o ] = { exports :{ } } ; t [ o ] [ 0 ] . call ( l . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ?n :e ) } , l , l . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ) ( { "parserlib-core" :[ function ( require , module , exports ) {
@@ -58,7 +58,7 @@ function EventTarget() {
58
58
59
59
EventTarget . prototype = {
60
60
61
- //restore constructor
61
+ // restore constructor
62
62
constructor : EventTarget ,
63
63
64
64
/**
@@ -97,9 +97,9 @@ EventTarget.prototype = {
97
97
98
98
if ( this . _listeners [ event . type ] ) {
99
99
100
- //create a copy of the array and use that so listeners can't chane
100
+ // create a copy of the array and use that so listeners can't chane
101
101
var listeners = this . _listeners [ event . type ] . concat ( ) ;
102
- for ( var i = 0 , len = listeners . length ; i < len ; i ++ ) {
102
+ for ( var i = 0 , len = listeners . length ; i < len ; i ++ ) {
103
103
listeners [ i ] . call ( this , event ) ;
104
104
}
105
105
}
@@ -115,7 +115,7 @@ EventTarget.prototype = {
115
115
removeListener : function ( type , listener ) {
116
116
if ( this . _listeners [ type ] ) {
117
117
var listeners = this . _listeners [ type ] ;
118
- for ( var i = 0 , len = listeners . length ; i < len ; i ++ ) {
118
+ for ( var i = 0 , len = listeners . length ; i < len ; i ++ ) {
119
119
if ( listeners [ i ] === listener ) {
120
120
listeners . splice ( i , 1 ) ;
121
121
break ;
@@ -201,9 +201,9 @@ TokenStreamBase.createTokenData = function(tokens) {
201
201
202
202
var nameMap = [ ] ,
203
203
typeMap = Object . create ( null ) ,
204
- tokenData = tokens . concat ( [ ] ) ,
205
- i = 0 ,
206
- len = tokenData . length + 1 ;
204
+ tokenData = tokens . concat ( [ ] ) ,
205
+ i = 0 ,
206
+ len = tokenData . length + 1 ;
207
207
208
208
tokenData . UNKNOWN = - 1 ;
209
209
tokenData . unshift ( { name :"EOF" } ) ;
@@ -252,7 +252,7 @@ TokenStreamBase.prototype = {
252
252
*/
253
253
match : function ( tokenTypes , channel ) {
254
254
255
- //always convert to an array, makes things easier
255
+ // always convert to an array, makes things easier
256
256
if ( ! ( tokenTypes instanceof Array ) ) {
257
257
tokenTypes = [ tokenTypes ] ;
258
258
}
@@ -267,7 +267,7 @@ TokenStreamBase.prototype = {
267
267
}
268
268
}
269
269
270
- //no match found, put the token back
270
+ // no match found, put the token back
271
271
this . unget ( ) ;
272
272
return false ;
273
273
} ,
@@ -285,7 +285,7 @@ TokenStreamBase.prototype = {
285
285
286
286
var token ;
287
287
288
- //always convert to an array, makes things easier
288
+ // always convert to an array, makes things easier
289
289
if ( ! ( tokenTypes instanceof Array ) ) {
290
290
tokenTypes = [ tokenTypes ] ;
291
291
}
@@ -328,61 +328,61 @@ TokenStreamBase.prototype = {
328
328
*/
329
329
get : function ( channel ) {
330
330
331
- var tokenInfo = this . _tokenData ,
332
- i = 0 ,
331
+ var tokenInfo = this . _tokenData ,
332
+ i = 0 ,
333
333
token ,
334
334
info ;
335
335
336
- //check the lookahead buffer first
336
+ // check the lookahead buffer first
337
337
if ( this . _lt . length && this . _ltIndex >= 0 && this . _ltIndex < this . _lt . length ) {
338
338
339
339
i ++ ;
340
340
this . _token = this . _lt [ this . _ltIndex ++ ] ;
341
341
info = tokenInfo [ this . _token . type ] ;
342
342
343
- //obey channels logic
344
- while ( ( info . channel !== undefined && channel !== info . channel ) &&
343
+ // obey channels logic
344
+ while ( ( typeof info . channel !== " undefined" && channel !== info . channel ) &&
345
345
this . _ltIndex < this . _lt . length ) {
346
346
this . _token = this . _lt [ this . _ltIndex ++ ] ;
347
347
info = tokenInfo [ this . _token . type ] ;
348
348
i ++ ;
349
349
}
350
350
351
- //here be dragons
352
- if ( ( info . channel === undefined || channel === info . channel ) &&
351
+ // here be dragons
352
+ if ( ( typeof info . channel === " undefined" || channel === info . channel ) &&
353
353
this . _ltIndex <= this . _lt . length ) {
354
354
this . _ltIndexCache . push ( i ) ;
355
355
return this . _token . type ;
356
356
}
357
357
}
358
358
359
- //call token retriever method
359
+ // call token retriever method
360
360
token = this . _getToken ( ) ;
361
361
362
- //if it should be hidden, don't save a token
362
+ // if it should be hidden, don't save a token
363
363
if ( token . type > - 1 && ! tokenInfo [ token . type ] . hide ) {
364
364
365
- //apply token channel
365
+ // apply token channel
366
366
token . channel = tokenInfo [ token . type ] . channel ;
367
367
368
- //save for later
368
+ // save for later
369
369
this . _token = token ;
370
370
this . _lt . push ( token ) ;
371
371
372
- //save space that will be moved (must be done before array is truncated)
372
+ // save space that will be moved (must be done before array is truncated)
373
373
this . _ltIndexCache . push ( this . _lt . length - this . _ltIndex + i ) ;
374
374
375
- //keep the buffer under 5 items
375
+ // keep the buffer under 5 items
376
376
if ( this . _lt . length > 5 ) {
377
377
this . _lt . shift ( ) ;
378
378
}
379
379
380
- //also keep the shift buffer under 5 items
380
+ // also keep the shift buffer under 5 items
381
381
if ( this . _ltIndexCache . length > 5 ) {
382
382
this . _ltIndexCache . shift ( ) ;
383
383
}
384
384
385
- //update lookahead index
385
+ // update lookahead index
386
386
this . _ltIndex = this . _lt . length ;
387
387
}
388
388
@@ -394,10 +394,10 @@ TokenStreamBase.prototype = {
394
394
info = tokenInfo [ token . type ] ;
395
395
if ( info &&
396
396
( info . hide ||
397
- ( info . channel !== undefined && channel !== info . channel ) ) ) {
397
+ ( typeof info . channel !== " undefined" && channel !== info . channel ) ) ) {
398
398
return this . get ( channel ) ;
399
399
} else {
400
- //return just the type
400
+ // return just the type
401
401
return token . type ;
402
402
}
403
403
} ,
@@ -416,26 +416,26 @@ TokenStreamBase.prototype = {
416
416
var total = index ,
417
417
tt ;
418
418
if ( index > 0 ) {
419
- //TODO: Store 5 somewhere
419
+ // TODO: Store 5 somewhere
420
420
if ( index > 5 ) {
421
421
throw new Error ( "Too much lookahead." ) ;
422
422
}
423
423
424
- //get all those tokens
424
+ // get all those tokens
425
425
while ( total ) {
426
426
tt = this . get ( ) ;
427
427
total -- ;
428
428
}
429
429
430
- //unget all those tokens
430
+ // unget all those tokens
431
431
while ( total < index ) {
432
432
this . unget ( ) ;
433
433
total ++ ;
434
434
}
435
435
} else if ( index < 0 ) {
436
436
437
- if ( this . _lt [ this . _ltIndex + index ] ) {
438
- tt = this . _lt [ this . _ltIndex + index ] . type ;
437
+ if ( this . _lt [ this . _ltIndex + index ] ) {
438
+ tt = this . _lt [ this . _ltIndex + index ] . type ;
439
439
} else {
440
440
throw new Error ( "Too much lookbehind." ) ;
441
441
}
@@ -460,11 +460,11 @@ TokenStreamBase.prototype = {
460
460
*/
461
461
LT : function ( index ) {
462
462
463
- //lookahead first to prime the token buffer
463
+ // lookahead first to prime the token buffer
464
464
this . LA ( index ) ;
465
465
466
- //now find the token, subtract one because _ltIndex is already at the next index
467
- return this . _lt [ this . _ltIndex + index - 1 ] ;
466
+ // now find the token, subtract one because _ltIndex is already at the next index
467
+ return this . _lt [ this . _ltIndex + index - 1 ] ;
468
468
} ,
469
469
470
470
/**
@@ -570,7 +570,7 @@ function SyntaxError(message, line, col) {
570
570
571
571
}
572
572
573
- //inherit from Error
573
+ // inherit from Error
574
574
SyntaxError . prototype = Object . create ( Error . prototype ) ; // jshint ignore:line
575
575
SyntaxError . prototype . constructor = SyntaxError ; // jshint ignore:line
576
576
@@ -699,7 +699,7 @@ StringReader.prototype = {
699
699
// and reset column count
700
700
if ( this . _input . charAt ( this . _cursor ) === "\n" ) {
701
701
this . _line ++ ;
702
- this . _col = 1 ;
702
+ this . _col = 1 ;
703
703
} else {
704
704
this . _col ++ ;
705
705
}
0 commit comments