Example #1
0
 /**
  * @Warmup(2)
  * @Revs(100)
  * @Iterations(5)
  */
 public function benchIntrospectionQuery()
 {
     $lexer = new Lexer($this->introQuery);
     do {
         $token = $lexer->nextToken();
     } while ($token->kind !== Token::EOF);
 }
Example #2
0
 /**
  * Moves the internal parser object to the next lexed token.
  */
 function advance()
 {
     $prevEnd = $this->token->end;
     $this->prevEnd = $prevEnd;
     $this->token = $this->lexer->nextToken($prevEnd);
 }
Example #3
0
 /**
  * @param string $body
  * @return Token
  */
 private function lexOne($body)
 {
     $lexer = new Lexer(new Source($body));
     return $lexer->nextToken();
 }
Example #4
0
 /**
  * @param string $body
  * @return Token
  */
 private function lexOne($body)
 {
     $lexer = new Lexer(new Source($body));
     return $lexer->advance();
 }
Example #5
0
 /**
  * @return NamedType[]
  */
 function parseImplementsInterfaces()
 {
     $types = [];
     if ($this->lexer->token->value === 'implements') {
         $this->lexer->advance();
         do {
             $types[] = $this->parseNamedType();
         } while ($this->peek(Token::NAME));
     }
     return $types;
 }