Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/_markupbase.cpython-37.pyc

B

� f9�@sVdZddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd	�d	�Z	dS)
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@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
d#dd�Zd$dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)%�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError)�self�r�0/opt/alt/python37/lib64/python3.7/_markupbase.py�__init__s
zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error szParserBase.errorcCsd|_d|_dS)N�r)�lineno�offset)rrrr�reset$szParserBase.resetcCs|j|jfS)z&Return current line number and offset.)r
r)rrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r)�rawdata�countr
�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||�dks&td��|||d�dkrB|dS|||d�dkrZdSt|�}|||d�dkr�|�|�S||d	kr�|�|�S|�||�\}}|d
kr�|S|dkr�d|_�x||k�r�||}|dk�r||d|�}|dk�r|�|�n
|�|�|dS|d
k�r@t	||�}|�s6dS|�
�}n�|dk�r\|�||�\}	}nt||jk�rr|d}n^|d	k�r�|dk�r�|�|d|�}n$|dk�r�|�d|�n
|�d�n|�d||�|d
kr�|Sq�WdS)N�z<!z$unexpected call to parse_declarationr�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�attlist�linktype�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)
r�AssertionError�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@sZ












zParserBase.parse_declarationrcCs�|j}|||d�dks"td��|�|d|�\}}|dkrB|S|dkr\t�||d�}n4|dkrvt�||d�}n|�d||d|��|s�dS|r�|�d�}|�||d|��|�	d�S)	N�z<![z)unexpected call to parse_marked_section()r>�include�rcdata�ignore�cdata�temp>�if�endif�elsez+unknown status keyword %r in marked sectionr)
rr#r'�_markedsectionclose�search�_msmarkedsectioncloser�startr)r+)rr�reportrZsectNamer�matchrrrr&�s 
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N�z<!--z"unexpected call to parse_comment()rr)rr�
_commentcloser=r?Zhandle_commentr+)rrr@rrArrrrr%�s

zParserBase.parse_commentc
Cs4|j}t|�}|}�x||k�r.||}|dk�r4|||d�}|dkrNdS|dkrt|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r,|Sq|dk�r�|d|k�rPdS|�|d|�\}}|d	k�rr|S||dk�r,|d}q|dk�r�|d}x&||k�r�||���r�|d}�q�W||k�r�||dk�r�|S|�||�|�d�ndSq|���r|d}q|�||�|�d|�qWdS)N�<rrz<!rz*unexpected char in internal subset (in %r)rBz<!--r)r@>rr!�entity�notationz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr$rrr%r'�getattr�isspace)
rr�declstartposrr-rr.�sr1Zmethrrrr,�sn











z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nrrr)r'r�find)rrrLr1rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS�xv|�||�\}}|dkrb|S|||d�}|dkr~dS|dkr�d||d�kr�|�d|�d}ndSx |||d���r�|d}q�W||d�s�dSn|�||�\}}|||d�}|�s
dS|dk�rLt||�}|�r.|��}ndS|||d�}|�sLdS|d	k�r�||d�d	k�rldS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrF|dSqFWdS)
Nrrrrr�(�)z'"�#)rr'rNrKr*r+)rrrLrr1rr.r0rrr�_parse_doctype_attlistsZ




z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}xl|||d�}|s<dS|dkrL|dS|dkrpt||�}|sfdS|��}q$|�||�\}}|dkr$|Sq$WdS)Nrrrrz'")r'rr*r+)rrrLr1rrr.r0rrr�_parse_doctype_notation=s$

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrV|d}x6|||d�}|s<dS|��rN|d}q$Pq$Wn|}|�||�\}}|dkrv|Sxp|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqx|dkr�|dS|�||�\}}|dkrx|SqxWdS)NrrGrrz'"r)rrKr'r*r+)rrrLrrr.r1r0rrr�_parse_doctype_entityTs8


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nrzexpected name token at %r�)	rr$�_declname_match�group�strip�lowerr+rr)rrrLrr-r0rMr1rrrr'xs
zParserBase._scan_namecCsdS)Nr)rr/rrrr)�szParserBase.unknown_declN)r)r)�__name__�
__module__�__qualname__�__doc__rrrrrr(r2r&r%r,rOrSrTrUr'r)rrrrrs"
R

C9$r)
r^�re�compilerArWr*rCr<r>rrrrr�<module>s




Hacked By AnonymousFox1.0, Coded By AnonymousFox