HEX
Server: Apache
System: Linux sh-pro142.hostgator.com.br 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User: okform09 (1324)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //usr/libexec/oracle-cloud-agent/plugins/osms/packaging/_tokenizer.pyc
a

i��f��@s�UddlmZddlZddlZddlmZddlmZmZddl	m
Z
eGdd�d��ZGd	d
�d
e�Z
ddd
ddde�dej�dddde�dej�e�e
je
jejejB�dddddddd�Zded <Gd!d"�d"�ZdS)#�)�annotationsN)�	dataclass)�Iterator�NoReturn�)�	Specifierc@s&eZdZUded<ded<ded<dS)�Token�str�name�text�int�positionN)�__name__�
__module__�__qualname__�__annotations__�rr�x/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/packaging/_tokenizer.pyrs
rcs:eZdZdZddddd��fdd�Zdd�d	d
�Z�ZS)�ParserSyntaxErrorz7The provided source text could not be parsed correctly.r	ztuple[int, int]�None)�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__rr%�
__classcell__rrrrrs
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]+�$)�LEFT_PARENTHESIS�RIGHT_PARENTHESIS�LEFT_BRACKET�
RIGHT_BRACKET�	SEMICOLON�COMMA�
QUOTED_STRING�OP�BOOLOP�IN�NOT�VARIABLE�	SPECIFIER�AT�URL�
IDENTIFIER�VERSION_PREFIX_TRAIL�VERSION_LOCAL_LABEL_TRAIL�WS�END� dict[str, str | re.Pattern[str]]�
DEFAULT_RULESc@s�eZdZdZdddd�dd�Zddd�d	d
�Zdd�dd
d
d�dd�Zdddd�dd�Zdd�dd�Zddd�ddddd�dd�Z	e
jddddd �d!d"��ZdS)#�	Tokenizerz�Context-sensitive token parsing.

    Provides methods to examine the input stream to check whether the next token
    matches.
    r	r?r)r�rulesrcCs*||_dd�|��D�|_d|_d|_dS)NcSsi|]\}}|t�|��qSr)�re�compile)�.0r
�patternrrr�
<dictcomp>hsz&Tokenizer.__init__.<locals>.<dictcomp>r)r�itemsrB�
next_tokenr
)rrrBrrrras�zTokenizer.__init__)r
rcCs|�|�r|��dS)z8Move beyond provided token name, if at current position.N)�check�read)rr
rrr�consumens
zTokenizer.consumeF)�peek�bool)r
rMrcCsz|jdus Jd|�d|j����||jvs8Jd|����|j|}|�|j|j�}|dur^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)rIrB�matchrr
r)rr
rM�
expressionrOrrrrJss��
zTokenizer.checkr)r
�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.expectrcCs0|j}|dusJ�|jt|j�7_d|_|S)z%Consume the next token and return it.N)rIr
�lenr)r�tokenrrrrK�s
zTokenizer.readN)�
span_start�span_endz
int | Noner)rrVrWrcCs8|dur|jn||dur|jn|f}t||j|d��dS)z.Raise ParserSyntaxError at the given position.N)rr)r
rr)rrrVrWrrrrrR�s	��zTokenizer.raise_syntax_errorzIterator[None])�
open_token�close_token�aroundrccsf|�|�r|j}|��nd}dV|dur0dS|�|�sZ|jd|�d|�d|��|d�|��dS)NzExpected matching z for z, after )rV)rJr
rKrR)rrXrYrZ�
open_positionrrr�enclosing_tokens�s


�zTokenizer.enclosing_tokens)
rrrr&rrLrJrSrKrR�
contextlib�contextmanagerr\rrrrrAZs
	�rA)�
__future__rr]rC�dataclassesr�typingrr�
specifiersrr�	ExceptionrrD�VERBOSE�_operator_regex_str�_version_regex_str�
IGNORECASEr@rrArrrr�<module>sN�

�

��3