public function skipUntil($type)
    {
        while ( ! $this->isNext($type) && $this->moveNext());

        if ( ! $this->isNext($type)) {
            throw new \RuntimeException(sprintf('Could not find the token %s.', $this->getName($type)));
        }
    }
public function skipUntil($type)
    {
        while ( ! $this->isNext($type) && $this->moveNext());

        if ( ! $this->isNext($type)) {
            throw new \RuntimeException(sprintf('Could not find the token %s.', $this->getName($type)));
        }
    }
public function skipUntil ( $ type ) { while ( ! $ this -> isNext ( $ type ) && $ this -> moveNext ( ) ) ; if ( ! $ this -> isNext ( $ type ) ) { throw new \ RuntimeException ( sprintf ( 'Could not find the token %s.' , $ this -> getName ( $ type ) ) ) ; } }
Skips the token stream until a token of the given type.

@param integer $type

@throws \RuntimeException When the token is not found
Skips the token stream until a token of the given type .