Moves the peek token forward.

@return Token|null
496820
public function peek()
    {
        if (isset($this->tokens[$this->current + ++$this->peek])) {
            return $this->tokens[$this->current + $this->peek];
        } else {
            return null;
        }
    }
1067280
public function next()
    {
        $this->peek = 0;
        if (isset($this->tokens[$this->current])) {
            return $this->tokens[$this->current++];
        }
    }
323011
public function shift(): ?self
    {
        $further = $this->further;
        if (!$further) {
            return null;
        }
        $passed = $this->passed;

        $passed[] = array_shift($further);
        return new static($this->subject, $passed, $further, $this->eof, $this->tag);
    }
642874
protected function advance()
    {
        $this->cursor = $this->token->getEnd();
        return $this->token = $this->lexer->readToken($this->cursor);
    }
432950
public function move(Token $token) {
			$this->begin = $token->begin;
			$this->end = $token->end;

			unset($this->after, $this->before);
		}
840394
public function getToken()
    {
        if(isset($this->_tokens[$this->_position])) {
            return $this->_tokens[$this->_position];
        } else {
            return null;
        }
    }
1136589
protected function next() {
		$get = $this->get();
		if ($get !== '/') {
			return $get;
		}
		switch ($this->peek()) {
			case '/':
				return $this->singleLineComment();
			case '*':
				return $this->multipleLineComment();
			default:
				return $get;
		}
	}
229974
protected function NextItem()
	{
		while (true)
		{
			if ( ! $this->accept )
			{
				if ( ! $this->MoveNextIter() )
				{
					return null;
				}
				$this->first = true;
				if ( $this->matchSelf && $this->TestItem() )
				{
					$this->sequentialPosition++;
					return $this->curr;
				}
			}
			if ( $this->first)
			{
				$this->accept = $this->MoveToFirst( $this->curr );
				$this->first = false;
			}
			else
			{
				$this->accept = $this->MoveToNext( $this->curr );
			}
			if ( $this->accept )
			{
				if ( $this->TestItem() )
				{
					$this->sequentialPosition++;
					return $this->curr;
				}
			}
		}
	}
249768
public function peek()
    {
        $l = count($this->tokens);
        if ($l == 0) {
            return null;
        } else {
            return $this->tokens[$l - 1];
        }
    }
162685
public function next()
    {
        $this->pointerAtStart = false;
        $this->pointerAtEnd = next($this->stream) === false;
    }
144196
public int moveTokens() {
        int count;
        if(token == -1) {
            return 0;
        }

        int skip = limit - token;
        if(skip < 0) {
            return 0;
        }

        if((count = token - buffer.start) != 0) {
            System.arraycopy(buffer.buffer, token, buffer.buffer, buffer.start, skip);
            token = buffer.start;
            marker -= count;
            cursor -= count;
            toktmp -= count;
            limit -= count;
            lineptr -= count;
            linectptr -= count;
        }
        return skip;
    }
76862
public function nextToken()
    {
        if ($this->_input === null) {
            return null;
        }

        do {
            if (! preg_match('/[a-zA-Z0-9]+/', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_position)) {
                // It covers both cases a) there are no matches (preg_match(...) === 0)
                // b) error occured (preg_match(...) === FALSE)
                return null;
            }

            $str = $match[0][0];
            $pos = $match[0][1];
            $endpos = $pos + strlen($str);

            $this->_position = $endpos;

            $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($str, $pos, $endpos));
        } while ($token === null); // try again if token is skipped

        return $token;
    }
1296798
public function shift() {
    $items = $this->getItems();
    if ($items->isEmpty()) {
      return NULL;
    }
    if (count($items) === 1) {
      $pop_item = $items[0];
      $pop_item->remove();
      return $pop_item;
    }
    $pop_item = $items[0];
    $pop_item->nextUntil(function ($node) {
      if ($node instanceof HiddenNode) {
        return FALSE;
      }
      if ($node instanceof TokenNode && $node->getType() === ',') {
        return FALSE;
      }
      return TRUE;
    })->remove();
    $pop_item->remove();
    return $pop_item;
  }
355800
protected function prev_token(){
		$this->tok = prev( $this->input );
		$this->t = self::token_to_symbol( $this->tok );
		return $this->tok;
	}
708558
private function peekLine()
    {
        if ($this->filePeek == null) {
            $this->filePeek = fgets($this->fileHandle);
        }

        return $this->filePeek;
    }
1132889
public function moveToToken(Token $token) {

      if (!$token->isValid()) {
        $this->setValid(false);
        return new Token();
      }

      $tokenIndex = $token->getIndex();


      foreach ($this->collection as $index => $collectionToken) {
        if ($collectionToken->getIndex() === $tokenIndex) {
          $this->setPosition($index);
          return $collectionToken;
        }
      }

      $this->setValid(false);
      return new Token();
    }
1027811
protected function NextItem()
	{
		while ( $this->iter->MoveNext() )
		{
		    if ( $this->iter->getSequentialPosition() == $this->position )
		    {
		    	$this->iter->ResetSequentialPosition();
		        return $this->iter->getCurrent();
		    }
		}
		return null;
	}