HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/.local/lib/python3.10/site-packages/packaging/__pycache__/_tokenizer.cpython-310.pyc
o

���g��@s$UddlmZddlZddlZddlmZddlmZmZddl	m
Z
eGdd�d��ZGd	d
�d
e�Z
idd�d
d�dd�dd�dd�dd�de�dej��dd�dd�dd�dd �d!e�d"ej��d#e�e
je
jejejB��d$d%�d&d'�d(d)�d*d+�d,d-d.d/��Zd0ed1<Gd2d3�d3�ZdS)4�)�annotationsN)�	dataclass)�Iterator�NoReturn�)�	Specifierc@s&eZdZUded<ded<ded<dS)�Token�str�name�text�int�positionN)�__name__�
__module__�__qualname__�__annotations__�rr�G/home/arjun/.local/lib/python3.10/site-packages/packaging/_tokenizer.pyrs
rcs,eZdZdZd
�fd	d
�Zddd�Z�ZS)�ParserSyntaxErrorz7The provided source text could not be parsed correctly.�messager	�source�span�tuple[int, int]�return�Nonecs ||_||_||_t���dS)N)rrr�super�__init__)�selfrrr��	__class__rrrszParserSyntaxError.__init__cCs>d|jdd|jd|jdd}d�|j|j|g�S)N� r�~r�^z
    )r�joinrr)r�markerrrr�__str__"s*zParserSyntaxError.__str__)rr	rr	rrrr)rr	)rrr�__doc__rr%�
__classcell__rrrrrs
r�LEFT_PARENTHESISz\(�RIGHT_PARENTHESISz\)�LEFT_BRACKETz\[�
RIGHT_BRACKETz\]�	SEMICOLON�;�COMMA�,�
QUOTED_STRINGzk
            (
                ('[^']*')
                |
                ("[^"]*")
            )
        �OPz(===|==|~=|!=|<=|>=|<|>)�BOOLOPz\b(or|and)\b�INz\bin\b�NOTz\bnot\b�VARIABLEa�
            \b(
                python_version
                |python_full_version
                |os[._]name
                |sys[._]platform
                |platform_(release|system)
                |platform[._](version|machine|python_implementation)
                |python_implementation
                |implementation_(name|version)
                |extra
            )\b
        �	SPECIFIER�ATz\@�URLz[^ \t]+�
IDENTIFIERz\b[a-zA-Z0-9][a-zA-Z0-9._-]*\b�VERSION_PREFIX_TRAILz\.\*z\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*z[ \t]+�$)�VERSION_LOCAL_LABEL_TRAIL�WS�END� dict[str, str | re.Pattern[str]]�
DEFAULT_RULESc@sjeZdZdZd(dd	�Zd)dd�Zd
d�d*dd�Zd+dd�Zd,dd�Zddd�d-d d!�Z	e
jd.d&d'��ZdS)/�	Tokenizerz�Context-sensitive token parsing.

    Provides methods to examine the input stream to check whether the next token
    matches.
    rr	�rulesr?rrcCs*||_dd�|��D�|_d|_d|_dS)NcSsi|]
\}}|t�|��qSr)�re�compile)�.0r
�patternrrr�
<dictcomp>hs�z&Tokenizer.__init__.<locals>.<dictcomp>r)r�itemsrB�
next_tokenr
)rrrBrrrras�
zTokenizer.__init__r
cCs|�|�r|��dSdS)z8Move beyond provided token name, if at current position.N)�check�read)rr
rrr�consumens
�zTokenizer.consumeF)�peekrM�boolcCsz|jdusJd|�d|j����||jvsJd|����|j|}|�|j|j�}|dur/dS|s;t||d|j�|_dS)z�Check whether the next token has the provided name.

        By default, if the check succeeds, the token *must* be read before
        another check. If `peek` is set to `True`, the token is not loaded and
        would need to be checked again.
        NzCannot check for z, already have zUnknown token name: FrT)rIrB�matchrr
r)rr
rM�
expressionrOrrrrJss�
zTokenizer.check�expectedrcCs"|�|�s
|�d|����|��S)zsExpect a certain token name next, failing with a syntax error otherwise.

        The token is *not* read.
        z	Expected )rJ�raise_syntax_errorrK)rr
rQrrr�expect�s
zTokenizer.expectcCs0|j}|dus	J�|jt|j�7_d|_|S)z%Consume the next token and return it.N)rIr
�lenr)r�tokenrrrrK�s
zTokenizer.readN)�
span_start�span_endrrV�
int | NonerWrcCs4|dur|jn||dur|jn|f}t||j|d��)z.Raise ParserSyntaxError at the given position.N)rr)r
rr)rrrVrWrrrrrR�s	��zTokenizer.raise_syntax_error�
open_token�close_token�around�Iterator[None]ccsh�|�|�r|j}|��nd}dV|durdS|�|�s.|jd|�d|�d|��|d�|��dS)NzExpected matching z for z, after )rV)rJr
rKrR)rrYrZr[�
open_positionrrr�enclosing_tokens�s�


�zTokenizer.enclosing_tokens)rr	rBr?rr)r
r	rr)r
r	rMrNrrN)r
r	rQr	rr)rr)rr	rVrXrWrXrr)rYr	rZr	r[r	rr\)
rrrr&rrLrJrSrKrR�
contextlib�contextmanagerr^rrrrrAZs




	�rA)�
__future__rr_rC�dataclassesr�typingrr�
specifiersrr�	ExceptionrrD�VERBOSE�_operator_regex_str�_version_regex_str�
IGNORECASEr@rrArrrr�<module>st������������
��%

��)�*�+�,�-�3