U
    dd                     @   s6   d Z ddlmZ ddlZeeeeef dddZdS )zDNS GENERATE range conversion.    )TupleN)textreturnc                 C   s  d}d}d}d}d}| r0| d dkr0t jd| D ]b}|dkrZ|dkrZt|}d}d}q4|dkrtt|}d}d}q4| r||7 }q4t jd	| q4|dkrt jd
n&|dkrt|}n|dkstt|}|dkst|dkst||krt jd|||fS )zConvert the text form of a range in a ``$GENERATE`` statement to an
    integer.

    *text*, a ``str``, the textual range in ``$GENERATE`` form.

    Returns a tuple of three ``int`` values ``(start, stop, step)``.
        r   -z!Start cannot be a negative number/   zCould not parse %szno stop value specifiedzstart must be <= stop)dns	exceptionSyntaxErrorintisdigitAssertionError)r   startstopstepcurstatec r   ./tmp/pip-unpacked-wheel-pk5slln3/dns/grange.py	from_text   s<    	


r   )__doc__typingr   r   strr   r   r   r   r   r   <module>   s   