Your IP : 52.14.7.103


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/_markupbase.cpython-312.opt-1.pyc

�

�Q�f=9���dZddlZejd�jZejd�jZejd�Zejd�Zejd�Z[Gd�d	�Z	y)
z�Shared support for scanning document type declarations in HTML and XHTML.

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c�l�eZdZdZd�Zd�Zd�Zd�ZdZd�Z	dd�Z
dd	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zy)�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.c�>�|jturtd��y)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��selfs �2/opt/alt/python312/lib64/python3.12/_markupbase.py�__init__zParserBase.__init__s#���>�>�Z�'��;�=�
=�(�c� �d|_d|_y)N�r��lineno�offsetrs r
�resetzParserBase.reset s�������rc�2�|j|jfS)z&Return current line number and offset.rrs r
�getposzParserBase.getpos$s���{�{�D�K�K�'�'rc���||k\r|S|j}|jd||�}|r6|j|z|_|jd||�}||dzz
|_|S|j|z|z
|_|S)N�
r)�rawdata�countr�rindexr)r	�i�jr�nlines�poss      r
�	updateposzParserBase.updatepos,s����6��H��,�,�����t�Q��*����+�+��.�D�K��.�.��q�!�,�C��S��U�)�D�K����+�+��/�!�+�D�K��r�c��|j}|dz}|||dzdk(r|dzS|||dzdvryt|�}|||dzdk(r|j|�S||dk(r|j|�S|j	||�\}}|dkr|S|d	k(rd
|_||kr�||}|dk(r9||dz|}|d	k(r|j
|�|dzS|j|�|dzS|dvr t||�}|sy|j�}n||dvr|j	||�\}	}nb||j
vr|dz}nN|dk(r8|d	k(r|j|dz|�}n.|d
vrtd|z��td��td||z��|dkr|S||kr��y)N�r�>)�-r���z--�[r�doctyperz"'�4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�link�attlist�element�linktypez&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_otherchars�handle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subset�AssertionError)
r	rrr�n�decltype�c�data�m�names
          r
�parse_declarationzParserBase.parse_declaration<s����,�,��
��E���1�Q�q�S�>�S� ��q�5�L��1�Q�q�S�>�Y�&����L���1�Q�q�S�>�T�!��%�%�a�(�(�
�Q�Z�3�
�
�,�,�Q�/�/��/�/�!�Q�/�K�H�a��q�5��H��y� �$&�D�!��!�e���
�A��C�x��q��s�1�~���y�(��$�$�T�*��1�u���%�%�d�+��1�u���E�z�(��!�4�����E�E�G���L�L��/�/�!�Q�/���a��d�+�+�+���E���c���y�(��2�2�1�q�5�!�<�A��!K�K�
)�)Q�T\�)\�]�]�(�)M�N�N�$�%H�7�ST�:�%U�V�V��1�u���M�!�e�Nrc�t�|j}|j|dz|�\}}|dkr|S|dvrtj||dz�}n2|dvrtj||dz�}ntd||dz|z��|sy|r(|j
d�}|j||dz|�|jd�S)N�r>�temp�cdata�ignore�rcdata�include>�if�else�endifz+unknown status keyword %r in marked sectionr$)	rr/�_markedsectionclose�search�_msmarkedsectioncloser6�startr2r4)r	r�reportr�sectNamer�matchs       r
r.zParserBase.parse_marked_section�s��������o�o�q��s�A�/���!��q�5��H��G�G�&�-�-�g�q��s�;�E�
�0�
0�(�/�/���1��=�E� �=���!��A��N��
�������A��A����g�a��c�1�o�.��y�y��|�rc���|j}|||dzdk7rtd��tj||dz�}|sy|r(|j	d�}|j||dz|�|j
d�S)N��<!--z"unexpected call to parse_comment()r$r)rr6�
_commentcloserIrK�handle_commentr4)r	rrLrrNrs      r
r-zParserBase.parse_comment�s{���,�,���1�Q�q�S�>�V�#� �!E�F�F��$�$�W�a��c�2��������A��A������!��Q��0��y�y��|�rc���|j}t|�}|}||k�r�||}|dk(r�|||dz}|dk(ry|dk7r#|j||dz�td|z��|dz|k(ry|dz|kDry|||dzdk(r|j	|d	�
�}|d	kr|S�~|j|dz|�\}}|dk(ry|dvr#|j||dz�td|z��t
|d
|z�}	|	||�}|d	kr�|S|dk(r6|dz|k(ry|j|dz|�\}}|d	kr|S||dk(r�|dz}n�|dk(rh|dz}||kr1||j�r|dz}||kr||j�r�||kr'||dk(r|S|j||�td��y|j�r|dz}n |j||�td|z��||kr���y)N�<r!r$z<!rz*unexpected char in internal subset (in %r)rPrQr)rL>�entityr)r*�notationz)unknown declaration %r in internal subset�_parse_doctype_�%�;�]r"z%unexpected char after internal subsetz%unexpected char %r in internal subset)rr,rr6r-r/�getattr�isspace)
r	r�declstartposrr7rr9�sr<�meths
          r
r5z ParserBase._parse_doctype_subset�sT���,�,����L��
���!�e���
�A��C�x��A�a��c�N����8����9��N�N�<��Q��7�(�D�q�H�����E�a�<����E�Q�;���1�Q�q�S�>�V�+��*�*�1�Q�*�7�A��1�u� ����/�/�!�a�%��>���a���7���K�K��N�N�<��Q��7�(�C�d�J����t�%6��%=�>����L�)���q�5��H��c����E�a�<�����q�1�u�l�;���1��q�5��H��1�:��$��A��A��c����E���!�e���
� 2� 2� 4��A��A��!�e���
� 2� 2� 4��q�5��q�z�S�(� ���N�N�<��3�(�)P�Q�Q��������E�����|�Q�/�$�%L�q�%P�Q�Q�{�!�e�~rc��|j||�\}}|dk(ry|j}d||dvr|jd|�dzSy)Nr$r"r)r/r�find)r	rr^r<rrs      r
�_parse_doctype_elementz!ParserBase._parse_doctype_element�sP���/�/�!�\�2���a���7���,�,���'�!�"�+���<�<��Q�'�!�+�+�rc��|j}|j||�\}}|||dz}|dk(ry|dk(r|dzS	|j||�\}}|dkr|S|||dz}|dk(ry|dk(rVd||dvr|jd|�dz}ny|||dzj�r|dz}|||dzj�r�||dsy|j||�\}}|||dz}|sy|dvr+t	||�}|r|j�}ny|||dz}|sy|d	k(r3||dd	k(ry|j|dz|�\}}|dkr|S|||dz}|sy|dk(r|dzS��)
Nrrr$r"r�(�)�'"�#)rr/rbr]r3r4)r	rr^rr<rr9r;s        r
�_parse_doctype_attlistz!ParserBase._parse_doctype_attlists����,�,���/�/�!�\�2���a��A�a��c�N����7����8��q�5�L���o�o�a��6�G�D�!��1�u�����!�A�#��A��B�w���C�x��'�!�"�+�%����S�!�,�q�0�A���a��!��n�,�,�.��A��A��a��!��n�,�,�.��q�r�{���/�/�!�\�:���a���!�A�#��A����E�z�(��!�4�������A���A�a��c�N�����C�x��1�2�;�#�%���/�/�!�a�%��>���a��q�5��H��A�a��c�N�����C�x��1�u��]rc��|j||�\}}|dkr|S|j}	|||dz}|sy|dk(r|dzS|dvr t||�}|sy|j�}n|j||�\}}|dkr|S�V)Nrrr$r"rg)r/rr3r4)r	rr^r<rrr9r;s        r
�_parse_doctype_notationz"ParserBase._parse_doctype_notation=s����/�/�!�\�2���a��q�5��H��,�,�����!�A�#��A����C�x��1�u���E�z�(��!�4�����E�E�G���/�/�!�\�:���a��q�5��H�rc��|j}|||dzdk(r)|dz}	|||dz}|sy|j�r|dz}nn�#|}|j||�\}}|dkr|S	|j||dz}|sy|dvr t||�}|r|j	�}n'y|dk(r|dzS|j||�\}}|dkr|S�`)NrrYr$rrgr")rr]r/r3r4)r	rr^rrr9r<r;s        r
�_parse_doctype_entityz ParserBase._parse_doctype_entityTs����,�,���1�Q�q�S�>�S� ��A��A���A�a��c�N�����9�9�;��A��A����A��/�/�!�\�2���a��q�5��H�����Q�q��s�#�A����E�z�(��!�4�������A���c���1�u���/�/�!�\�:���a��q�5��H�rc�H�|j}t|�}||k(ryt||�}|rR|j�}|j	�}|t|�z|k(ry|j�|j
�fS|j||�td|||dzz��)N)Nr$zexpected name token at %r�)	rr,�_declname_match�group�strip�lowerr4rr6)r	rr^rr7r;r_r<s        r
r/zParserBase._scan_namexs����,�,����L����6���G�Q�'������	�A��7�7�9�D��C��F�
�q� ���:�:�<�����(�(��N�N�<��+� �+�g�l�<�PR�?�.S�S��
rc��y)N�)r	r:s  r
r2zParserBase.unknown_decl�s��rN)r)�__name__�
__module__�__qualname__�__doc__rrrrr0r=r.r-r5rcrirkrmr/r2rurr
rrs[��+�=�
�(����M�b�0
�C�L�6�r�. �H�&
rr)
ry�re�compilerNrpr3rRrHrJrrurr
�<module>r|s����
��"�*�*�:�;�A�A��!�r�z�z�"<�=�C�C����
�
�9�%�
� �b�j�j��.��
#��
�
�8�,���u
�u
r

?>