Your IP : 18.119.19.206


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/_markupbase.cpython-33.pyc

�
��f9c@s}dZddlZejd�jZejd�jZejd�Zejd�Zejd�Z[Gdd	�d	�Z	dS(
u�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.

iNu[a-zA-Z][-_.a-zA-Z0-9]*\s*u(\'[^\']*\'|"[^"]*")\s*u--\s*>u	]\s*]\s*>u]\s*>cBs�|EeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
ddd�Zddd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S(#u
ParserBaseuiParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs"|jtkrtd��ndS(Nu)_markupbase.ParserBase must be subclassed(u	__class__u
ParserBaseuRuntimeError(uself((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu__init__suParserBase.__init__cCstd��dS(Nu.subclasses of ParserBase must override error()(uNotImplementedError(uselfumessage((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyuerror suParserBase.errorcCsd|_d|_dS(Nii(ulinenouoffset(uself((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyureset$s	uParserBase.resetcCs|j|jfS(u&Return current line number and offset.(ulinenouoffset(uself((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyugetpos(suParserBase.getposcCs�||kr|S|j}|jd||�}|rm|j||_|jd||�}||d|_n|j|||_|S(Nu
i(urawdataucountulinenourindexuoffset(uselfuiujurawdataunlinesupos((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu	updatepos0s	uParserBase.updateposuc
Cst|j}|d}|||�dks5td��|||d�dkrW|dS|||d�dkrudSt|�}|||d�dkr�|j|�S||d	kr�|j|�S|j||�\}}|d
kr�|S|dkrd|_nxh||kro||}|dkro||d|�}|dkrZ|j|�n
|j|�|dS|dkr�t	||�}|s�dS|j
�}n�|d
kr�|j||�\}	}n�||jkr�|d}nv|d	krG|dkr|j|d|�}q\|dkr7|jd|�q\|jd�n|jd||�|d
kr|SqWdS(Niu<!u$unexpected call to parse_declarationiu>u-uu--u[iudoctypeu"'u4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZuattlistulinktypeulinkuelementu&unsupported '[' char in %s declarationu"unexpected '[' char in declarationu!unexpected %r char in declaration(u-ui����i����>ulinktypeuelementuattlistulinki����(
urawdatauAssertionErrorulenu
parse_commentuparse_marked_sectionu
_scan_nameu_decl_othercharsuhandle_decluunknown_declu_declstringlit_matchuendu_parse_doctype_subsetuerror(
uselfuiurawdataujunudecltypeucudataumuname((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyuparse_declaration@sZ	
"




uParserBase.parse_declarationicCs|j}|||d�dks/td��|j|d|�\}}|dkr[|S|dkr�tj||d�}nD|dkr�tj||d�}n|jd
||d|��|s�dS|r|jd�}|j||d|��n|j	d�S(Niu<![u)unexpected call to parse_marked_section()iutempucdatauignoreuincludeurcdatauifuelseuendifu+unknown status keyword %r in marked sectioni>uincludeurcdatauignoreutempucdata>uelseuifuendifi����(
urawdatauAssertionErroru
_scan_nameu_markedsectioncloseusearchu_msmarkedsectioncloseuerrorustartuunknown_decluend(uselfuiureporturawdatausectNameujumatch((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyuparse_marked_section�s 	&uParserBase.parse_marked_sectioncCs�|j}|||d�dkr3|jd�ntj||d�}|sSdS|r�|jd�}|j||d|��n|jd�S(Niu<!--u"unexpected call to parse_comment()iii����(urawdatauerroru
_commentcloseusearchustartuhandle_commentuend(uselfuiureporturawdataumatchuj((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu
parse_comment�s	uParserBase.parse_commentc
Cs�|j}t|�}|}x�||kr�||}|dkr�|||d�}|dkrddS|dkr�|j||d�|jd|�n|d|kr�dS|d|kr�dS|||d�dkr|j|dd	�}|d	kr|Sqn|j|d|�\}}|dkr1dS|dkre|j||d�|jd|�nt|d|�}	|	||�}|d	kr�|Sq|dkr|d|kr�dS|j|d|�\}}|d	kr�|S||dkr�|d}q�q|dkr�|d}x*||krH||j�rH|d}qW||kr�||dkri|S|j||�|jd�q�dSq|j�r�|d}q|j||�|jd|�qWdS(Nu<iiu<!u*unexpected char in internal subset (in %r)iu<!--ureportiuattlistuelementuentityunotationu)unknown declaration %r in internal subsetu_parse_doctype_u%u;u]u>u%unexpected char after internal subsetu%unexpected char %r in internal subseti����i����i����i����i����>uentityuelementuattlistunotationi����i����i����(urawdataulenu	updateposuerroru
parse_commentu
_scan_nameugetattruisspace(
uselfuiudeclstartposurawdataunujucusunameumeth((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu_parse_doctype_subset�sn	


u ParserBase._parse_doctype_subsetcCs_|j||�\}}|dkr(dS|j}d||d�kr[|jd|�dSdS(Niu>i����i����i����(u
_scan_nameurawdataufind(uselfuiudeclstartposunameujurawdata((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu_parse_doctype_element�s	u!ParserBase._parse_doctype_elementcCsB|j}|j||�\}}|||d�}|dkrEd	S|dkrY|dSx�|j||�\}}|dkr�|S|||d�}|dkr�d
S|dkr)d||d�kr�|jd|�d}ndSx(|||d�j�r|d}q�W||d�sAdSn|j||�\}}|||d�}|s_d
S|dkr�t||�}|r�|j�}ndS|||d�}|s�dSn|dkr'||d�dkr�dS|j|d|�\}}|dkr|S|||d�}|s'dSn|dkr\|dSq\dS(Niuu>iu(u)u'"u#i����i����i����i����i����i����i����i����i����(urawdatau
_scan_nameufinduisspaceu_declstringlit_matchuend(uselfuiudeclstartposurawdataunameujucum((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu_parse_doctype_attlistsZ	u!ParserBase._parse_doctype_attlistcCs�|j||�\}}|dkr(|S|j}x�|||d�}|sRdS|dkrf|dS|dkr�t||�}|s�dS|j�}q4|j||�\}}|dkr4|Sq4dS(Niiu>u'"i����i����(u
_scan_nameurawdatau_declstringlit_matchuend(uselfuiudeclstartposunameujurawdataucum((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu_parse_doctype_notation=s$	u"ParserBase._parse_doctype_notationcCs:|j}|||d�dkrn|d}xD|||d�}|sNdS|j�rg|d}q0Pq0n|}|j||�\}}|dkr�|Sx�|j||d�}|s�dS|dkr�t||�}|r�|j�}q3dSq�|dkr|dS|j||�\}}|dkr�|Sq�dS(	Niu%iu'"u>i����i����i����(urawdatauisspaceu
_scan_nameu_declstringlit_matchuend(uselfuiudeclstartposurawdataujucunameum((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu_parse_doctype_entityTs8	

u ParserBase._parse_doctype_entitycCs�|j}t|�}||kr%dSt||�}|r�|j�}|j�}|t|�|krldS|j�|j�fS|j||�|j	d|||d��dS(Niuexpected name token at %rii����(Ni����i����(Ni����(
urawdataulenuNoneu_declname_matchugroupustripuloweruendu	updateposuerror(uselfuiudeclstartposurawdataunumusuname((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu
_scan_namexs		uParserBase._scan_namecCsdS(N((uselfudata((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyuunknown_decl�suParserBase.unknown_declN(u__name__u
__module__u__qualname__u__doc__u__init__uerroruresetugetposu	updateposu_decl_othercharsuparse_declarationuparse_marked_sectionu
parse_commentu_parse_doctype_subsetu_parse_doctype_elementu_parse_doctype_attlistu_parse_doctype_notationu_parse_doctype_entityu
_scan_nameuunknown_decl(u
__locals__((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu
ParserBases"
RC9$u
ParserBase(
u__doc__ureucompileumatchu_declname_matchu_declstringlit_matchu
_commentcloseu_markedsectioncloseu_msmarkedsectioncloseu
ParserBase(((u0/opt/alt/python33/lib64/python3.3/_markupbase.pyu<module>s

?>