Your IP : 18.218.5.216


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/_markupbase.cpython-310.opt-2.pyc

o

6��f=9�@sT	ddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd�d�ZdS)	�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZ	dd�Zdd�Zdd�Zdd�Zd	Zd
d�Zd d
d�Z	d dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)!�
ParserBasecCs|jtur	td��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�2/opt/alt/python310/lib64/python3.10/_markupbase.py�__init__s

��zParserBase.__init__cCsd|_d|_dS)N�r��lineno�offsetrrrr�reset s
zParserBase.resetcCs	|j|jfS�Nrrrrr�getpos$szParserBase.getposcCsd||kr|S|j}|�d||�}|r(|j||_|�d||�}||d|_|S|j|||_|S)N�
r
)�rawdata�countr�rindexr
)r�i�jrZnlines�posrrr�	updatepos,s�zParserBase.updatepos�c
Cs�|j}|d}|||d�dkr|dS|||d�dvr!dSt|�}|||d�dkr4|�|�S||dkr?|�|�S|�||�\}}|dkrM|S|d	krTd
|_||kr�||}|dkr~||d|�}|d	kru|�|�|dS|�|�|dS|dvr�t||�}|s�dS|�	�}n>|dvr�|�||�\}	}n1||jvr�|d}n'|dkr�|d	kr�|�
|d|�}n|d
vr�td|��td��td||��|dkr�|S||ksXdS)N�r
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>Zlinktype�element�link�attlistz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subset�AssertionError)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration<sZ



�



�'zParserBase.parse_declarationr
cCs�|j}|�|d|�\}}|dkr|S|dvr t�||d�}n|dvr-t�||d�}ntd||d|���|s=dS|rO|�d�}|�||d|��|�d�S)N�r>�ignoreZcdataZrcdataZtempZinclude>Zendif�if�elsez+unknown status keyword %r in marked sectionr)	rr%�_markedsectionclose�search�_msmarkedsectioncloser+�startr'r))rr�reportrZsectNamer�matchrrrr$�s"�

zParserBase.parse_marked_sectioncCsh|j}|||d�dkrtd��t�||d�}|sdS|r/|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()rr)rr+�
_commentcloser7r9Zhandle_commentr))rrr:rr;rrrrr#�s

zParserBase.parse_commentc
Cs|j}t|�}|}||k�r||}|dkr�|||d�}|dkr$dS|dkr6|�||d�td|��|d|kr>dS|d|krFdS|||d�dkr^|j|d	d
�}|d	kr]|Sq	|�|d|�\}}|dkrndS|dvr�|�||d�td|��t|d
|�}	|	||�}|d	kr�|Snt|dkr�|d|kr�dS|�|d|�\}}|d	kr�|S||dkr�|d}nM|dkr�|d}||kr�||��r�|d}||kr�||��s�||kr�||dkr�|S|�||�td��dS|��r�|d}n|�||�td|��||ksdS)N�<rrz<!r
z*unexpected char in internal subset (in %r)r<r=r)r:>ZentityrZnotationr!z)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr"rr+r#r%�getattr�isspace)
rr�declstartposrr,rr-�sr0Zmethrrrr*�s|
��
���
�?z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�vr!|�d|�dSdS)Nrrr
)r%r�find)rrrEr0rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkrdS|dkr!|dS	|�||�\}}|dkr0|S|||d�}|dkr>dS|dkrvd||d�vrS|�d|�d}ndS|||d���rm|d}|||d���s_||d�sudSn|�||�\}}|||d�}|s�dS|dvr�t||�}|r�|��}ndS|||d�}|s�dS|d	kr�||d�d	kr�dS|�|d|�\}}|dkr�|S|||d�}|s�dS|dkr�|dSq")
Nr
rrrr�(�)�'"�#)rr%rGrDr(r))rrrErr0rr-r/rrr�_parse_doctype_attlists`��

�z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}	|||d�}|sdS|dkr&|dS|dvr8t||�}|s3dS|��}n|�||�\}}|dkrF|Sq)Nrr
rrrK)r%rr(r))rrrEr0rrr-r/rrr�_parse_doctype_notation=s&

�z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkr*|d}	|||d�}|sdS|��r'|d}nnqn|}|�||�\}}|dkr:|S	|j||d�}|sHdS|dvrZt||�}|rX|��}ndS|dkrb|dS|�||�\}}|dkrp|Sq;)Nr
r@rrrKr)rrDr%r(r))rrrErrr-r0r/rrr�_parse_doctype_entityTs>
�

�z ParserBase._parse_doctype_entitycCs�|j}t|�}||kr
dSt||�}|r.|��}|��}|t|�|kr&dS|��|��fS|�||�td|||d���)N)Nrzexpected name token at %r�)	rr"�_declname_match�group�strip�lowerr)rr+)rrrErr,r/rFr0rrrr%xs
�zParserBase._scan_namecCsdSrr)rr.rrrr'�szParserBase.unknown_declN)r
)�__name__�
__module__�__qualname__r	rrrr&r1r$r#r*rHrMrNrOr%r'rrrrrs"

Q
F9$r)	�re�compiler;rQr(r>r6r8rrrrr�<module>s




?>