403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/3951580/cwd/tmp/calpy/tinycss2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/3951580/cwd/tmp/calpy/tinycss2/__pycache__/parser.cpython-311.pyc
�

Υ=jJ���ddlmZddlmZmZmZmZddlmZdd�Z	d�Z
dd�Zdd	�Zd
�Z
dd�Zd
�Zd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd�Zd�Zd�Z		dd�ZdS)�)�chain�)�AtRule�Declaration�
ParseError�
QualifiedRule)�parse_component_value_listFc�j�t|t��rt||��}t|��S)aqIterate component values out of string or component values iterable.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments: If the input is a string, ignore all CSS comments.
    :returns: An iterator yielding :term:`component values`.

    )�
isinstance�strr	�iter)�input�
skip_commentss  �B/tmp/claude-1015/pip-target-jmvfl800/lib/python/tinycss2/parser.py�_to_token_iteratorrs2���%����A�*�5�-�@�@����;�;��c�*�|D]}|jdvr|cS�dS)z�Return the next significant (neither whitespace or comment) token.

    :type tokens: :term:`iterator`
    :param tokens: An iterator yielding :term:`component values`.
    :returns: A :term:`component value`, or :obj:`None`.

    ��
whitespace�commentN)�type)�tokens�tokens  r�_next_significantrs9�������:�6�6�6��L�L�L�7��rc���t||��}t|��}t|��}|�tdddd��S|�t|j|jdd��S|S)a�Parse a single :diagram:`component value`.

    This is used e.g. for an attribute value
    referred to by ``attr(foo length)``.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments: If the input is a string, ignore all CSS comments.
    :returns:
        A :term:`component value` (that is neither whitespace or comment),
        or a :class:`~tinycss2.ast.ParseError`.

    Nr�empty�Input is empty�extra-inputzGot more than one token)rrr�source_line�
source_column)rrr�first�seconds     r�parse_one_component_valuer##sv�� ��}�
5�
5�F��f�%�%�E�
�v�
&�
&�F��}��!�Q��)9�:�:�:�
������ 4�m�%�'�'�	'��rc��t||��}t|��}|�tdddd��St||��S)a?Parse a single :diagram:`declaration`.

    This is used e.g. for a declaration in an `@supports
    <https://drafts.csswg.org/css-conditional/#at-supports>`_ test.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments: If the input is a string, ignore all CSS comments.
    :returns:
        A :class:`~tinycss2.ast.Declaration`
        or :class:`~tinycss2.ast.ParseError`.

    Any whitespace or comment before the ``:`` colon is dropped.

    Nrrr)rrr�_parse_declaration)rrr�first_tokens    r�parse_one_declarationr'?sK��" ��}�
5�
5�F�#�F�+�+�K����!�Q��)9�:�:�:��k�6�2�2�2rc�8�|D]}|dkrdS|r	|dkrdS�dS)N�;�}�)r�nestedrs   r�_consume_remnantsr-WsC�������C�<�<��F�F�
�	������F�F��	�rTc	��|}|jdkr5t||��t|j|jdd|j�d���St|��}|�,t||��t|j|jdd��S|dkr,t||��t|j|jdd��Sg}d	}d
}d
}t
|��D]j\}	}
|d	kr|
dkrd}|	}n?|dkr|
jdkr|
jd
krd
}n |
jdvrd	}|
jdkr|rd}nd}nd}|�|
���k|d
kr||d�=|r|rt|j|jdd��St|j|j|j
|j||d
k��S)aParse a declaration.

    Consume :obj:`tokens` until the end of the declaration or the first error.

    :type first_token: :term:`component value`
    :param first_token: The first component value of the rule.
    :type tokens: :term:`iterator`
    :param tokens: An iterator yielding :term:`component values`.
    :type nested: :obj:`bool`
    :param nested: Whether the declaration is nested or top-level.
    :returns:
        A :class:`~tinycss2.ast.Declaration`
        or :class:`~tinycss2.ast.ParseError`.

    �ident�invalidz+Expected <ident> for declaration name, got �.Nz,Expected ':' after declaration name, got EOF�:z6Expected ':' after declaration name, got {colon.type}.�valueF�!�bang�	importantr�{} blockTzDeclaration contains {} block)rr-rrr r�	enumerate�lower_value�appendrr3)r&rr,�name�colonr3�state�contains_non_whitespace�contains_simple_block�ir�
bang_positions            rr%r%_s,�� �D��y�G����&�&�)�)�)����d�0�)�F�$�)�F�F�F�H�H�	H�
�f�%�%�E��}��&�&�)�)�)����d�0�)�:�<�<�	<�
�#����&�&�)�)�)����u�2�I�D�F�F�	F�
�E��E�#��!���f�%�%�����5��G��������E��M�M��v�o�o�%�*��"7�"7��%��4�4��E�E�
�Z�8�
8�
8��E��z�Z�'�'�*�3�,0�)�)�.2�+�+�*.�'�
���U����������-�.�.�!��-�!8�-����u�2�I�+�-�-�	-����$�,�d�j�$�:J�
�u��#�%�%�%rc�T�g}g}|dkrO|jdkrD|D]A}|dkr|�|��n#|�|��|jdkrn�Bt|t|��d���}|jdkr|St	|||��}t||dd���S)z#Consume declaration or nested rule.r)r7T)r,�declaration)�
stop_tokenr,)rr:r%r
r�_consume_qualified_rule)r&r�declaration_tokens�semicolon_tokenrrCs      r�_consume_blocks_contentrH�s������O��c���k�.�*�<�<��	�	�E���|�|��&�&�u�-�-�-����%�%�e�,�,�,��z�Z�'�'���(�$��T�,�-�-�d�<�<�<�K���=�(�(����)�?�F�C�C��&�{�F�s�SW�X�X�X�Xrc��g}|D]}|dkrn|�|��� t|t|����S)z�Like :func:`_parse_declaration`, but stop at the first ``;``.

    Deprecated, use :func:`_consume_blocks_content` instead.

    r))r:r%r
)r&r�other_declaration_tokensrs    r�_consume_declaration_in_listrK�sW�� "���/�/���C�<�<��E� �'�'��.�.�.�.��k�4�0H�+I�+I�J�J�Jrc�p�t||��}g}|D]�}|jdkr|s|�|���%|jdkr|s|�|���H|jdkr$|�t||�����w|dkr#|�t	||������|S)u�Parse a block’s contents.

    This is used e.g. for the :attr:`~tinycss2.ast.QualifiedRule.content`
    of a style rule or ``@page`` rule, or for the ``style`` attribute of an
    HTML element.

    In contexts that don’t expect any at-rule and/or qualified rule,
    all :class:`~tinycss2.ast.AtRule` and/or
    :class:`~tinycss2.ast.QualifiedRule` objects should simply be rejected as
    invalid.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments:
        Ignore CSS comments at the top-level of the list.
        If the input is a string, ignore all comments.
    :type skip_whitespace: :obj:`bool`
    :param skip_whitespace:
        Ignore whitespace at the top-level of the list.
        Whitespace is still preserved
        in the :attr:`~tinycss2.ast.Declaration.value` of declarations
        and the :attr:`~tinycss2.ast.AtRule.prelude`
        and :attr:`~tinycss2.ast.AtRule.content` of at-rules.
    :returns:
        A list of
        :class:`~tinycss2.ast.Declaration`,
        :class:`~tinycss2.ast.AtRule`,
        :class:`~tinycss2.ast.QualifiedRule`,
        :class:`~tinycss2.ast.Comment` (if ``skip_comments`` is false),
        :class:`~tinycss2.ast.WhitespaceToken`
        (if ``skip_whitespace`` is false),
        and :class:`~tinycss2.ast.ParseError` objects

    rr�
at-keywordr))rrr:�_consume_at_rulerH�rr�skip_whitespacer�resultrs      r�parse_blocks_contentsrR�s���H ��}�
5�
5�F�
�F��
B�
B���:��%�%�"�
%��
�
�e�$�$�$��
�Z�9�
$�
$� �
%��
�
�e�$�$�$��
�Z�<�
'�
'��M�M�*�5�&�9�9�:�:�:�:�
�c�\�\��M�M�1�%��@�@�A�A�A���Mrc�p�t||��}g}|D]�}|jdkr|s|�|���%|jdkr|s|�|���H|jdkr$|�t||�����w|dkr#|�t	||������|S)u�Parse a :diagram:`declaration list` (which may also contain at-rules).

    Deprecated and removed from CSS Syntax Level 3. Use
    :func:`parse_blocks_contents` instead.

    This is used e.g. for the :attr:`~tinycss2.ast.QualifiedRule.content`
    of a style rule or ``@page`` rule, or for the ``style`` attribute of an
    HTML element.

    In contexts that don’t expect any at-rule, all
    :class:`~tinycss2.ast.AtRule` objects should simply be rejected as invalid.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments:
        Ignore CSS comments at the top-level of the list.
        If the input is a string, ignore all comments.
    :type skip_whitespace: :obj:`bool`
    :param skip_whitespace:
        Ignore whitespace at the top-level of the list.
        Whitespace is still preserved
        in the :attr:`~tinycss2.ast.Declaration.value` of declarations
        and the :attr:`~tinycss2.ast.AtRule.prelude`
        and :attr:`~tinycss2.ast.AtRule.content` of at-rules.
    :returns:
        A list of
        :class:`~tinycss2.ast.Declaration`,
        :class:`~tinycss2.ast.AtRule`,
        :class:`~tinycss2.ast.Comment` (if ``skip_comments`` is false),
        :class:`~tinycss2.ast.WhitespaceToken`
        (if ``skip_whitespace`` is false),
        and :class:`~tinycss2.ast.ParseError` objects

    rrrMr))rrr:rNrKrOs      r�parse_declaration_listrTs���H ��}�
5�
5�F�
�F��
G�
G���:��%�%�"�
%��
�
�e�$�$�$��
�Z�9�
$�
$� �
%��
�
�e�$�$�$��
�Z�<�
'�
'��M�M�*�5�&�9�9�:�:�:�:�
�c�\�\��M�M�6�u�f�E�E�F�F�F���Mrc��t||��}t|��}|�tdddd��St||��}t|��}|�$t|j|jdd|jz��S|S)a�Parse a single :diagram:`qualified rule` or :diagram:`at-rule`.

    This would be used e.g. by `insertRule()
    <https://drafts.csswg.org/cssom/#dom-cssstylesheet-insertrule>`_
    in an implementation of CSSOM.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments:
        If the input is a string, ignore all CSS comments.
    :returns:
        A :class:`~tinycss2.ast.QualifiedRule`,
        :class:`~tinycss2.ast.AtRule`,
        or :class:`~tinycss2.ast.ParseError` objects.

    Any whitespace or comment before or after the rule is dropped.

    Nrrrrz4Expected a single rule, got %s after the first rule.)rrr�
_consume_rulerr r)rrrr!�rule�nexts      r�parse_one_rulerY4s���( ��}�
5�
5�F��f�%�%�E��}��!�Q��)9�:�:�:����'�'�D��V�$�$�D������d�0�-�B�T�Y�N�P�P�	P��Krc��t||��}g}|D]k}|jdkr|s|�|���%|jdkr|s|�|���H|�t||�����l|S)aParse a non-top-level :diagram:`rule list`.

    Deprecated and removed from CSS Syntax. Use :func:`parse_blocks_contents`
    instead.

    This is used for parsing the :attr:`~tinycss2.ast.AtRule.content`
    of nested rules like ``@media``.
    This differs from :func:`parse_stylesheet` in that
    top-level ``<!--`` and ``-->`` tokens are not ignored.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments:
        Ignore CSS comments at the top-level of the list.
        If the input is a string, ignore all comments.
    :type skip_whitespace: :obj:`bool`
    :param skip_whitespace:
        Ignore whitespace at the top-level of the list.
        Whitespace is still preserved
        in the :attr:`~tinycss2.ast.QualifiedRule.prelude`
        and the :attr:`~tinycss2.ast.QualifiedRule.content` of rules.
    :returns:
        A list of
        :class:`~tinycss2.ast.QualifiedRule`,
        :class:`~tinycss2.ast.AtRule`,
        :class:`~tinycss2.ast.Comment` (if ``skip_comments`` is false),
        :class:`~tinycss2.ast.WhitespaceToken`
        (if ``skip_whitespace`` is false),
        and :class:`~tinycss2.ast.ParseError` objects.

    rr�rrr:rVrOs      r�parse_rule_listr\Vs���B ��}�
5�
5�F�
�F��8�8���:��%�%�"�
%��
�
�e�$�$�$��
�Z�9�
$�
$� �
%��
�
�e�$�$�$���M�M�-��v�6�6�7�7�7�7��Mrc��t||��}g}|D]o}|jdkr|s|�|���%|jdkr|s|�|���H|dvr#|�t||�����p|S)a�Parse :diagram:`stylesheet` from text.

    This is used e.g. for a ``<style>`` HTML element.

    This differs from :func:`parse_rule_list` in that
    top-level ``<!--`` and ``-->`` tokens are ignored.
    This is a legacy quirk for the ``<style>`` HTML element.

    :type input: :obj:`str` or :term:`iterable`
    :param input: A string or an iterable of :term:`component values`.
    :type skip_comments: :obj:`bool`
    :param skip_comments:
        Ignore CSS comments at the top-level of the stylesheet.
        If the input is a string, ignore all comments.
    :type skip_whitespace: :obj:`bool`
    :param skip_whitespace:
        Ignore whitespace at the top-level of the stylesheet.
        Whitespace is still preserved
        in the :attr:`~tinycss2.ast.QualifiedRule.prelude`
        and the :attr:`~tinycss2.ast.QualifiedRule.content` of rules.
    :returns:
        A list of
        :class:`~tinycss2.ast.QualifiedRule`,
        :class:`~tinycss2.ast.AtRule`,
        :class:`~tinycss2.ast.Comment` (if ``skip_comments`` is false),
        :class:`~tinycss2.ast.WhitespaceToken`
        (if ``skip_whitespace`` is false),
        and :class:`~tinycss2.ast.ParseError` objects.

    rr)z<!--z-->r[rOs      r�parse_stylesheetr^�s���> ��}�
5�
5�F�
�F��8�8���:��%�%�"�
%��
�
�e�$�$�$��
�Z�9�
$�
$� �
%��
�
�e�$�$�$��
�/�
)�
)��M�M�-��v�6�6�7�7�7���Mrc�X�|jdkrt||��St||��S)a�Parse a qualified rule or at-rule.

    Consume just enough of :obj:`tokens` for this rule.

    :type first_token: :term:`component value`
    :param first_token: The first component value of the rule.
    :type tokens: :term:`iterator`
    :param tokens: An iterator yielding :term:`component values`.
    :returns:
        A :class:`~tinycss2.ast.QualifiedRule`,
        :class:`~tinycss2.ast.AtRule`,
        or :class:`~tinycss2.ast.ParseError`.

    rM)rrNrE)r&rs  rrVrV�s2����<�'�'���V�4�4�4�"�;��7�7�7rc���g}d}|D]3}|jdkr	|j}n|dkrn|�|���4t|j|j|j|j||��S)a�Parse an at-rule.

    Consume just enough of :obj:`tokens` for this rule.

    :type at_keyword: :class:`AtKeywordToken`
    :param at_keyword: The at-rule keyword token starting this rule.
    :type tokens: :term:`iterator`
    :param tokens: An iterator yielding :term:`component values`.
    :type nested: :obj:`bool`
    :param nested: Whether the at-rule is nested or top-level.
    :returns:
        A :class:`~tinycss2.ast.QualifiedRule`,
        or :class:`~tinycss2.ast.ParseError`.

    Nr7r))r�contentr:rrr r3r9)�
at_keywordr�preluderars     rrNrN�s��� �G��G������:��#�#��m�G��E�
�c�\�\��E����u��������
� 8�*�:J�����2�2�2rc�@�t|j|jd|�d���S)z6Create rule parse error raised because of given token.r0z. reached before {} block for a qualified rule.)rrr )rr;s  r�_rule_errorre�s0���
��5�.�	��A�A�A�C�C�CrNc�D�||krt|d��S|jdkrg}|}nZ|g}|D]>}||krt|d��cS|jdkr|}n,|�|���?t|dd��St|j|j||j��S)a�Consume a qualified rule.

    Consume just enough of :obj:`tokens` for this rule.

    :type first_token: :term:`component value`
    :param first_token: The first component value of the rule.
    :type tokens: :term:`iterator`
    :param tokens: An iterator yielding :term:`component values`.
    :type nested: :obj:`bool`
    :param nested: Whether the rule is nested or top-level.
    :type stop_token: :class:`~tinycss2.ast.Node`
    :param stop_token: A token that ends rule parsing when met.

    z
Stop tokenr7����EOF)rerr:rrr ra)r&rr,rDrc�blockrs       rrErE�s��� �j� � ��;��5�5�5���:�%�%�������-���
	3�
	3�E��
�"�"�"�5�,�7�7�7�7�7��z�Z�'�'������N�N�5�!�!�!�!��w�r�{�E�2�2�2�����!:�G�U�]�T�T�Tr)F)T)FF)FN)�	itertoolsr�astrrrr�	tokenizerr	rrr#r'r-r%rHrKrRrTrYr\r^rVrNrerEr+rr�<module>rms���������?�?�?�?�?�?�?�?�?�?�?�?�1�1�1�1�1�1�����
�
�
�����83�3�3�3�0���G%�G%�G%�G%�TY�Y�Y�*K�K�K�1�1�1�1�h1�1�1�1�h����D,�,�,�,�^*�*�*�*�Z8�8�8�(2�2�2�@C�C�C�9>�'+�#T�#T�#T�#T�#T�#Tr

Youez - 2016 - github.com/yon3zu
LinuXploit