HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/packaging/__pycache__/_tokenizer.cpython-310.pyc
o

�N�g��@s UddlZddlZddlmZddlmZmZmZmZm	Z	m
Z
ddlmZeGdd�d��Z
Gdd	�d	e�Zid
d�dd
�dd�dd�dd�dd�dd�de�dej��dd�dd�dd�d d!�d"e�d#ej��d$e�ejejejB��d%d&�d'd(�d)d*�d+d,d-��Zd.ed/<Gd0d1�d1�ZdS)2�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�H/opt/saltstack/salt/lib/python3.10/site-packages/packaging/_tokenizer.pyr	s
rcsHeZdZdZdededeeefddf�fdd�Zdefd	d
�Z�Z	S)�ParserSyntaxErrorz7The provided source text could not be parsed correctly.�message�source�span�returnNcs ||_||_||_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)rZmarkerrrr�__str__ s*zParserSyntaxError.__str__)
rrr�__doc__rrrrr%�
__classcell__rrrrrs��
��
rZLPARENz\s*\(ZLEFT_PARENTHESISz\(ZRIGHT_PARENTHESISz\)ZLEFT_BRACKETz\[Z
RIGHT_BRACKETz\]Z	SEMICOLON�;�COMMA�,Z
QUOTED_STRINGzk
            (
                ('[^']*')
                |
                ("[^"]*")
            )
        �OPz(===|==|~=|!=|<=|>=|<|>)ZBOOLOPz\b(or|and)\b�INz\bin\bZNOTz\bnot\bZVARIABLEa�
            \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
        �VERSION�ATz\@ZURLz[^ \t]+Z
IDENTIFIERz\b[a-zA-Z0-9][a-zA-Z0-9._-]*\bz[ \t]+�$)ZWSZEND�&Dict[str, Union[str, re.Pattern[str]]]�
DEFAULT_RULESc	@s�eZdZdZdeddddfdd�Zd	eddfd
d�Zdd
�d	ededefdd�Zd	edede	fdd�Z
de	fdd�Zddd�dedee
dee
defdd�Zejdededeefdd��ZdS) �	Tokenizerz�Context-sensitive token parsing.

    Provides methods to examine the input stream to check whether the next token
    matches.
    r�rulesr0rNcCs*||_dd�|��D�|_d|_d|_dS)NcSsi|]
\}}|t�|��qSr)�re�compile)�.0r�patternrrr�
<dictcomp>bs�z&Tokenizer.__init__.<locals>.<dictcomp>r)r�itemsr3�
next_tokenr)rrr3rrrr[s�
zTokenizer.__init__rcCs|�|�r|��dSdS)z8Move beyond provided token name, if at current position.N)�check�read)rrrrr�consumehs
�zTokenizer.consumeF)�peekr>cCsz|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)r:r3�matchrrr)rrr>Z
expressionr?rrrr;ms�
zTokenizer.check�expectedcCs"|�|�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r@rrr�expect�s
zTokenizer.expectcCs0|j}|dus	J�|jt|j�7_d|_|S)z%Consume the next token and return it.N)r:r�lenr
)r�tokenrrrr<�s
zTokenizer.read)�
span_start�span_endrrErFcCs4|dur|jn||dur|jn|f}t||j|d��)z.Raise ParserSyntaxError at the given position.N)rr)rrr)rrrErFrrrrrA�s	��zTokenizer.raise_syntax_error�
open_token�close_tokenccs`�|�|�r|j}|��nd}|duV|durdS|�|�s*|jd|��|d�|��dS)NzExpected closing )rE)r;rr<rA)rrGrHZ
open_positionrrr�enclosing_tokens�s�



�zTokenizer.enclosing_tokens)rrrr&rrr=�boolr;rrBr<rrrrA�
contextlib�contextmanagerrrIrrrrr2Ts4��
�
	����
� r2)rKr4Zdataclassesr�typingrrrrrrZ
specifiersr
r�	Exceptionrr5�VERBOSEZ_version_regex_str�
IGNORECASEr1rr2rrrr�<module>sj
 �������������
��&�'�(�)�*�/