def read_digits(source, start, first_code):
    body = source.body
    position = start
    code = first_code

    if code is not None and 48 <= code <= 57:  # 0 - 9
        while True:
            position += 1
            code = char_code_at(body, position)

            if not (code is not None and 48 <= code <= 57):
                break

        return position

    raise LanguageError(
        source,
        position,
        u'Invalid number, expected digit but got: {}.'.format(print_char_code(code))
    )
dataset/ETHPy150Open graphql-python/graphql-core/graphql/core/language/lexer.py/read_digits/original