403Webshell
Server IP : 107.13.46.68  /  Your IP : 216.73.216.232
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux mariOS 6.8.0-51-generic #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/tinycss2/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/tinycss2/__pycache__/parser.cpython-312.pyc
�

m�c�5��~�ddlmZmZmZmZddlmZdd�Zd�Zdd�Z	dd�Z
d�Zd�Zdd	�Z
dd
�Zdd�Zdd�Zd
�Zd�Zy)�)�AtRule�Declaration�
ParseError�
QualifiedRule)�parse_component_value_listc�P�t|t�rt||�}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  �1/usr/lib/python3/dist-packages/tinycss2/parser.py�_to_token_iteratorrs$���%���*�5�-�@����;��c�6�|D]}|jdvs�|cSy)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_significantrs%������:�:�6�6��L�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`.

    r�empty�Input is empty�extra-inputzGot more than one token)rrr�source_line�
source_column)rr
r�first�seconds     r�parse_one_component_valuer!"sk�� ��}�
5�F��f�%�E�
�v�
&�F��}��!�Q��)9�:�:�
������� 4� 4�m�%�'�	'��rc�h�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.

    rrr)rrr�_parse_declaration)rr
r�first_tokens    r�parse_one_declarationr%>s?��" ��}�
5�F�#�F�+�K����!�Q��)9�:�:��k�6�2�2rc	��|}|jdk7r/t|j|jdd|jz�St	|�}|�"t|j|jdd�S|dk7r/t|j|jdd|jz�Sg}d}t|�D][\}}|dk(r
|d	k(rd
}|}n6|d
k(r!|jdk(r|jdk(rd}n|jdvrd}|j|��]|dk(r|d�=t|j|j|j|j||dk(�S)
a�Parse 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`.
    :returns:
        A :class:`~tinycss2.ast.Declaration`
        or :class:`~tinycss2.ast.ParseError`.

    �ident�invalidz.Expected <ident> for declaration name, got %s.Nz,Expected ':' after declaration name, got EOF�:z,Expected ':' after declaration name, got %s.�value�!�bang�	importantr)
rrrrr�	enumerate�lower_value�appendrr*)	r$r�name�colonr*�state�ir�
bang_positions	         rr#r#Vsw���D��y�y�G���$�*�*�D�,>�,>�	�J� �I�I�&�'�	'�
�f�%�E��}��$�*�*�D�,>�,>�	�H�J�	J�	�#���%�+�+�U�-@�-@�)�H�!�J�J�'�(�	(�
�E��E��f�%�	���5��G������E��M�
�f�_����w�!6��%�%��4��E�
�Z�Z�8�
8��E�
���U��	�
����-�.�!��t�'�'��);�);�T�Z�Z��'�'����0D�F�Frc�n�g}|D]}|dk(rn|j|��t|t|��S)z=Like :func:`_parse_declaration`, but stop at the first ``;``.�;)r0r#r)r$r�other_declaration_tokensrs    r�_consume_declaration_in_listr9�sD��!���/���C�<�� �'�'��.�/��k�4�0H�+I�J�Jrc�X�t||�}g}|D]�}|jdk(r|r�|j|��'|jdk(r|r�9|j|��K|jdk(r|jt||���v|dk7s�||jt	||����|S)uMParse a :diagram:`declaration list` (which may also contain at-rules).

    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

    rr�
at-keywordr7)rrr0�_consume_at_ruler9�rr
�skip_whitespacer�resultrs      r�parse_declaration_listr@�s���D ��}�
5�F�
�F��
G���:�:��%�"��
�
�e�$�
�Z�Z�9�
$� ��
�
�e�$�
�Z�Z�<�
'��M�M�*�5�&�9�:�
�c�\��M�M�6�u�f�E�F�
G��Mrc���t||�}t|�}|�tdddd�St||�}t|�}|�/t|j|j
dd|jz�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.

    rrrrz4Expected a single rule, got %s after the first rule.)rrr�
_consume_rulerrr)rr
rr�rule�nexts      r�parse_one_rulerE�s���( ��}�
5�F��f�%�E��}��!�Q��)9�:�:����'�D��V�$�D�������d�0�0�-�B�T�Y�Y�N�P�	P��Krc��t||�}g}|D]e}|jdk(r|r�|j|��'|jdk(r|r�9|j|��K|jt||���g|S)a�Parse a non-top-level :diagram:`rule list`.

    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�rrr0rBr=s      r�parse_rule_listrH�st��< ��}�
5�F�
�F��8���:�:��%�"��
�
�e�$�
�Z�Z�9�
$� ��
�
�e�$��M�M�-��v�6�7�8��Mrc��t||�}g}|D]j}|jdk(r|r�|j|��'|jdk(r|r�9|j|��K|dvs�P|jt||���l|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-->rGr=s      r�parse_stylesheetrJs|��> ��}�
5�F�
�F��8���:�:��%�"��
�
�e�$�
�Z�Z�9�
$� ��
�
�e�$�
�/�
)��M�M�-��v�6�7�8��Mrc�d�|jdk(rt||�S|jdk(rg}|}nV|g}|D]&}|jdk(r|}n;|j|��(t|dj|dj
dd�St
|j|j
||j�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`.

    r;�{} block���r(z1EOF reached before {} block for a qualified rule.)rr<r0rrrr�content)r$r�prelude�blockrs     rrBrB>s������<�'���V�4�4����:�%������-���	E�E��z�z�Z�'�����N�N�5�!�		E�����'�'����)B�)B�I�C�E�
E���0�0�+�2K�2K� �%�-�-�1�1rc���g}d}|D]7}|jdk(r|j}n|dk(rn|j|��9t|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`.
    :returns:
        A :class:`~tinycss2.ast.QualifiedRule`,
        or :class:`~tinycss2.ast.ParseError`.

    NrLr7)rrNr0rrrr*r/)�
at_keywordrrOrNrs     rr<r<as����G��G�����:�:��#��m�m�G��
�c�\�����u��
��*�(�(�*�*B�*B��"�"�J�$:�$:�G�W�N�NrN)F)FF)�astrrrr�	tokenizerrrrr!r%r#r9r@rErHrJrBr<�rr�<module>rVsS��?�?�1�
� 
��83�0.F�bK�/�d�D)�X*�Z 1�FNr

Youez - 2016 - github.com/yon3zu
LinuXploit