HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/packaging/__pycache__/_tokenizer.cpython-37.pyc
B

��f��@s�UddlZddlZddlmZddlmZmZmZmZm	Z	m
Z
ddlmZeGdd�d��Z
Gdd	�d	e�Zd
ddd
dde�dej�dddde�dej�e�ejejejejB�dddddddd�Zded<Gd d!�d!�ZdS)"�N)�	dataclass)�Dict�Iterator�NoReturn�Optional�Tuple�Union�)�	Specifierc@s&eZdZUeed<eed<eed<dS)�Token�name�text�positionN)�__name__�
__module__�__qualname__�str�__annotations__�int�rr�E/opt/alt/python37/lib/python3.7/site-packages/packaging/_tokenizer.pyr	s
rcsBeZdZdZeeeeefdd��fdd�Zed�dd�Z�Z	S)	�ParserSyntaxErrorz7The provided source text could not be parsed correctly.N)�message�source�span�returncs ||_||_||_t���dS)N)rrr�super�__init__)�selfrrr)�	__class__rrrszParserSyntaxError.__init__)rcCs>d|jdd|jd|jdd}d�|j|j|g�S)N� r�~r	�^z
    )r�joinrr)r�markerrrr�__str__ s*zParserSyntaxError.__str__)
rrr�__doc__rrrrr%�
__classcell__rr)rrrs
rz\(z\)z\[z\]�;�,zk
            (
                ('[^']*')
                |
                ("[^"]*")
            )
        z(===|==|~=|!=|<=|>=|<|>)z\b(or|and)\bz\bin\bz\bnot\ba�
            \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
        z\@z[^ \t]+z\b[a-zA-Z0-9][a-zA-Z0-9._-]*\bz\.\*z\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*z[ \t]+�$)ZLEFT_PARENTHESISZRIGHT_PARENTHESISZLEFT_BRACKETZ
RIGHT_BRACKET�	SEMICOLON�COMMAZ
QUOTED_STRING�OP�BOOLOP�INZNOT�VARIABLEZ	SPECIFIER�AT�URL�
IDENTIFIERZVERSION_PREFIX_TRAILZVERSION_LOCAL_LABEL_TRAILZWSZENDz&Dict[str, Union[str, re.Pattern[str]]]�
DEFAULT_RULESc@s�eZdZdZeddd�dd�Zedd�dd	�Zd
d�eeed�d
d�Zeee	d�dd�Z
e	d�dd�Zddd�eee
ee
ed�dd�Zejeeeedd�dd��ZdS)�	Tokenizerz�Context-sensitive token parsing.

    Provides methods to examine the input stream to check whether the next token
    matches.
    z&Dict[str, Union[str, re.Pattern[str]]]N)r�rulesrcCs*||_dd�|��D�|_d|_d|_dS)NcSsi|]\}}t�|�|�qSr)�re�compile)�.0r�patternrrr�
<dictcomp>fsz&Tokenizer.__init__.<locals>.<dictcomp>r)r�itemsr6�
next_tokenr)rrr6rrrr_s
zTokenizer.__init__)rrcCs|�|�r|��dS)z8Move beyond provided token name, if at current position.N)�check�read)rrrrr�consumels
zTokenizer.consumeF)�peek)rrArcCsz|jdks td|�d|j����||jks8td|����|j|}|�|j|j�}|dkr^dS|svt||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)r=�AssertionErrorr6�matchrrr)rrrAZ
expressionrCrrrr>qs
zTokenizer.check)r�expectedrcCs"|�|�s|�d|����|��S)zsExpect a certain token name next, failing with a syntax error otherwise.

        The token is *not* read.
        z	Expected )r>�raise_syntax_errorr?)rrrDrrr�expect�s
zTokenizer.expect)rcCs0|j}|dk	st�|jt|j�7_d|_|S)z%Consume the next token and return it.N)r=rBr�lenr
)r�tokenrrrr?�s
zTokenizer.read)�
span_start�span_end)rrIrJrcCs8|dkr|jn||dkr|jn|f}t||j|d��dS)z.Raise ParserSyntaxError at the given position.N)rr)rrr)rrrIrJrrrrrE�s	zTokenizer.raise_syntax_error)�
open_token�close_token�aroundrccsf|�|�r|j}|��nd}dV|dkr0dS|�|�sZ|jd|�d|�d|��|d�|��dS)NzExpected matching z for z, after )rI)r>rr?rE)rrKrLrMZ
open_positionrrr�enclosing_tokens�s


zTokenizer.enclosing_tokens)rrrr&rrr@�boolr>rrFr?rrrrE�
contextlib�contextmanagerrrNrrrrr5Xs	r5)rPr7Zdataclassesr�typingrrrrrr�
specifiersr
r�	Exceptionrr8�VERBOSEZ_operator_regex_strZ_version_regex_str�
IGNORECASEr4rr5rrrr�<module>sD