GraphQL\Language\Lexer::readDigits PHP Метод

readDigits() приватный Метод

Returns the new position in the source after reading digits.
private readDigits ( $start, $firstCode )
    private function readDigits($start, $firstCode)
    {
        $body = $this->source->body;
        $position = $start;
        $code = $firstCode;
        if ($code >= 48 && $code <= 57) {
            // 0 - 9
            do {
                $code = Utils::charCodeAt($body, ++$position);
            } while ($code >= 48 && $code <= 57);
            // 0 - 9
            return $position;
        }
        if ($position > $this->source->length - 1) {
            $code = null;
        }
        throw new SyntaxError($this->source, $position, 'Invalid number, expected digit but got: ' . Utils::printCharCode($code));
    }