Your IP : 18.222.182.226
U
e5d9 � @ sR d dl Z e �d�jZe �d�jZe �d�Ze �d�Ze �d�Z[ G dd� d�ZdS ) � Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z ]\s*]\s*>z]\s*>c @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� ZdZdd
� Z d"dd�Z
d#dd�Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!S )$�
ParserBasec C s | j tkrtd��d S )Nz)_markupbase.ParserBase must be subclassed)� __class__r �RuntimeError��self� r �#/usr/lib64/python3.8/_markupbase.py�__init__ s
�zParserBase.__init__c C s t d��d S )Nz.subclasses of ParserBase must override error())�NotImplementedError)r �messager r r �error s �zParserBase.errorc C s d| _ d| _d S )N� r ��lineno�offsetr r r r �reset$ s zParserBase.resetc C s | j | jfS �Nr r r r r �getpos( s zParserBase.getposc C sb ||kr|S | j }|�d||�}|rN| j| | _|�d||�}||d | _n| j| | | _|S )N�
r
)�rawdata�countr �rindexr )r �i�jr Znlines�posr r r � updatepos0 s zParserBase.updatepos� c
C s� | j }|d }|||d � dkr*|d S |||d � dkrBdS t|�}|||d � dkrh| �|�S || dkr~| �|�S | �||�\}}|dk r�|S |d kr�d
| _||k �r�|| }|dkr�||d |� }|d kr�| �|� n
| �|� |d S |dk�r t||�}|�sdS |� � }n�|dk�r<| �||�\} }nt|| jk�rR|d }n^|dk�r�|d k�rx| �
|d |�}n$|d
k�r�| �d| � n
| �d� n| �d|| � |dk r�|S q�dS )N� r
�>)�-r ���z--�[r Zdoctyper z"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ> �linktype�attlist�element�linkz&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_subsetr )
r r r r �nZdecltype�c�data�m�namer r r �parse_declaration@ sZ
�zParserBase.parse_declarationr
c C s� | j }| �|d |�\}}|dk r&|S |dkr@t�||d �}n4|dkrZt�||d �}n| �d||d |� � |s|dS |r�|�d�}| �||d |� � |�d�S )N� r > �rcdata�temp�ignore�cdata�include> �endif�else�ifz+unknown status keyword %r in marked sectionr ) r r) �_markedsectionclose�search�_msmarkedsectioncloser �startr+ r- )r r �reportr ZsectNamer �matchr r r r( � s
zParserBase.parse_marked_sectionc C sj | j }|||d � dkr$| �d� t�||d �}|s<dS |r`|�d�}| �||d |� � |�d�S )N� �<!--z"unexpected call to parse_comment()r r )r r �
_commentcloser? rA Zhandle_commentr- )r r rB r rC r r r r r'