grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 ”qc9ã@s}dZddlZejdƒjZejdƒjZejdƒZejdƒZejdƒ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 ddd„Z ddd„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/python35/lib64/python3.5/_markupbase.pyÚ__init__szParserBase.__init__cCstdƒ‚dS)Nz.subclasses of ParserBase must override error())ÚNotImplementedError)rÚmessagerrrÚerror szParserBase.errorcCsd|_d|_dS)Nér)ÚlinenoÚoffset)rrrrÚreset$s zParserBase.resetcCs|j|jfS)z&Return current line number and offset.)r r)rrrrÚgetpos(szParserBase.getposcCs…||kr|S|j}|jd||ƒ}|rm|j||_|jd||ƒ}||d|_n|j|||_|S)NÚ r )ÚrawdataÚcountr Úrindexr)rÚiÚjrZnlinesÚposrrrÚ updatepos0s  zParserBase.updateposÚc Csq|j}|d}|||…dks5tdƒ‚|||d…dkrW|dS|||d…dkrudSt|ƒ}|||d…dkr¨|j|ƒS||d krÅ|j|ƒS|j||ƒ\}}|d krí|S|d krd|_xh||krl||}|dkrl||d|…}|d krW|j|ƒn |j|ƒ|dS|d kr t ||ƒ}|s‘dS|j ƒ}n¹|d krÇ|j||ƒ\} }n’||jkrã|d}nv|d krD|d kr|j |d|ƒ}qY|dkr4|j d|ƒqY|j dƒn|j d||ƒ|d kr|SqWdS)Nézú-rz--ú[rZdoctypez"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZÚattlistÚlinktypeÚlinkÚelementz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)rréÿÿÿÿr">r r!rrr") rÚAssertionErrorÚlenÚ parse_commentÚparse_marked_sectionÚ _scan_nameÚ_decl_othercharsZ handle_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ƒ‚|j|d|ƒ\}}|dkr[|S|dkr€tj||dƒ}nD|dkr¥tj||dƒ}n|jd ||d|…ƒ|sÎdS|rþ|jdƒ}|j||d|…ƒ|j dƒS)Nézr4r5r6r7r8>r9r:r;r") rr#r'Ú_markedsectioncloseÚsearchÚ_msmarkedsectioncloser Ústartr)r+)rrÚreportrZsectNamerÚmatchrrrr&’s  &   zParserBase.parse_marked_sectioncCs�|j}|||d…dkr0|jdƒtj||dƒ}|sPdS|r€|jdƒ}|j||d|…ƒ|jdƒS)Néz