public boolean skipTemplate ( EnclosingScope scope ) { int start = index ; if ( tryAndMatch ( false , LeftAngle ) == null ) { return true ; } else { boolean firstTime = true ; while ( tryAndMatch ( false , RightAngle ) == null ) { if ( ! firstTime && tryAndMatch ( false , Comma ) == null ) { // Failed to match a comma. Something is wrong index = start ; return false ; } else if ( ! skipLifetimeIdentifier ( scope ) && ! skipType ( scope ) ) { index = start ; return false ; } firstTime = false ; } } // return true ; }
Decide whether we have a template argument list ahead . This actually requires infinite lookahead but in practice is pretty minimal work .