@@ -310,6 +310,7 @@ Parser.prototype.parse = function (code, filename) {
310
310
const result = program ( childs , this . _errors , this . _docs , this . _tokens ) ;
311
311
if ( this . debug ) {
312
312
const errors = this . ast . checkNodes ( ) ;
313
+ /* istanbul ignore next */
313
314
if ( errors . length > 0 ) {
314
315
errors . forEach ( function ( error ) {
315
316
if ( error . position ) {
@@ -372,6 +373,7 @@ Parser.prototype.error = function (expect) {
372
373
if ( this . token !== this . EOF ) {
373
374
if ( isNumber ( this . token ) ) {
374
375
let symbol = this . text ( ) ;
376
+ /* istanbul ignore next */
375
377
if ( symbol . length > 10 ) {
376
378
symbol = symbol . substring ( 0 , 7 ) + "..." ;
377
379
}
@@ -412,6 +414,7 @@ Parser.prototype.node = function (name) {
412
414
if ( this . _docIndex < this . _docs . length ) {
413
415
docs = this . _docs . slice ( this . _docIndex ) ;
414
416
this . _docIndex = this . _docs . length ;
417
+ /* istanbul ignore next */
415
418
if ( this . debug ) {
416
419
// eslint-disable-next-line no-console
417
420
console . log ( new Error ( "Append docs on " + name ) ) ;
@@ -514,11 +517,13 @@ Parser.prototype.showlog = function () {
514
517
line = stack [ offset ] . trim ( ) ;
515
518
let found = false ;
516
519
for ( let i = 0 ; i < ignoreStack . length ; i ++ ) {
520
+ /* istanbul ignore next */
517
521
if ( line . substring ( 3 , 3 + ignoreStack [ i ] . length ) === ignoreStack [ i ] ) {
518
522
found = true ;
519
523
break ;
520
524
}
521
525
}
526
+ /* istanbul ignore next */
522
527
if ( ! found ) {
523
528
break ;
524
529
}
@@ -629,7 +634,7 @@ Parser.prototype.lex = function () {
629
634
if ( this . extractTokens ) {
630
635
do {
631
636
// the token
632
- this . token = this . lexer . lex ( ) || this . EOF ;
637
+ this . token = this . lexer . lex ( ) || /* istanbul ignore next */ this . EOF ;
633
638
if ( this . token === this . EOF ) return this ;
634
639
let entry = this . lexer . yytext ;
635
640
if (
@@ -672,7 +677,7 @@ Parser.prototype.lex = function () {
672
677
this . token === this . tok . T_OPEN_TAG
673
678
) ;
674
679
} else {
675
- this . token = this . lexer . lex ( ) || this . EOF ;
680
+ this . token = this . lexer . lex ( ) || /* istanbul ignore next */ this . EOF ;
676
681
}
677
682
return this ;
678
683
} ;
@@ -708,6 +713,7 @@ Parser.prototype.is = function (type) {
708
713
require ( "./parser/variable.js" ) ,
709
714
] . forEach ( function ( ext ) {
710
715
for ( const k in ext ) {
716
+ /* istanbul ignore next */
711
717
if ( Object . prototype . hasOwnProperty . call ( Parser . prototype , k ) ) {
712
718
// @see https://github.com/glayzzle/php-parser/issues/234
713
719
throw new Error ( "Function " + k + " is already defined - collision" ) ;
0 commit comments