a
    sd_  ã                   @   s   d Z ddlZdd„ ZdS )zDNS GENERATE range conversion.é    Nc                 C   sð   d}d}d}| r(| d dkr(t j d¡‚| D ]b}|dkrR|dkrRt|ƒ}d}d}q,|dkrlt|ƒ}d}d}q,| ¡ r~||7 }q,t j d	| ¡‚q,|d
v r¢t j ¡ ‚|dkr²t|ƒ}|dkrÂt|ƒ}|dksÎJ ‚|dksÚJ ‚||ksæJ ‚|||fS )zÜConvert 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 %s)r   é   )ÚdnsZ	exceptionÚSyntaxErrorÚintÚisdigit)ÚtextÚstepZcurÚstateÚcÚstartÚstop© r   ú,/usr/lib/python3/dist-packages/dns/grange.pyÚ	from_text   s6    


r   )Ú__doc__r	   r   r   r   r   r   Ú<module>   s   