src/Language/Lexer.php
protected function readName($position)
    {
        $end = $position + 1;
        $length = $this->source->getLength();
        $body = $this->source->getBody();

        while (
            $end < $length &&
            ($code = $this->charCodeAt($end)) &&
            (
                $code === 95 || // _
                $code >= 48 && $code <= 57 || // 0-9
                $code >= 65 && $code <= 90 || // A-Z
                $code >= 97 && $code <= 122 // a-z
            )
        ) {
            ++$end;
        }

        $value = mb_substr($body, $position, $end - $position, 'UTF-8');
        return new Token(Token::NAME_TYPE, $position, $end, $value);
    }
protected function readName($position)
    {
        $end = $position + 1;
        $length = $this->source->getLength();
        $body = $this->source->getBody();

        while (
            $end < $length &&
            ($code = $this->charCodeAt($end)) &&
            (
                $code === 95 || // _
                $code >= 48 && $code <= 57 || // 0-9
                $code >= 65 && $code <= 90 || // A-Z
                $code >= 97 && $code <= 122 // a-z
            )
        ) {
            ++$end;
        }

        $value = mb_substr($body, $position, $end - $position, 'UTF-8');
        return new Token(Token::NAME_TYPE, $position, $end, $value);
    }
protected function readName ( $ position ) { $ end = $ position + 1 ; $ length = $ this -> source -> getLength ( ) ; $ body = $ this -> source -> getBody ( ) ; while ( $ end < $ length && ( $ code = $ this -> charCodeAt ( $ end ) ) && ( $ code === 95 || // _ $ code >= 48 && $ code <= 57 || // 0-9 $ code >= 65 && $ code <= 90 || // A-Z $ code >= 97 && $ code <= 122 // a-z ) ) { ++ $ end ; } $ value = mb_substr ( $ body , $ position , $ end - $ position , 'UTF-8' ) ; return new Token ( Token :: NAME_TYPE , $ position , $ end , $ value ) ; }
Reads an alphanumeric + underscore name from the source.

[_A-Za-z][_0-9A-Za-z]*

@param int $position

@return \Fubhy\GraphQL\Language\Token
Reads an alphanumeric + underscore name from the source .