mň %U˛Ic@szdZdkZeidƒiZeidƒiZeidƒZeidƒZeidƒZ[dfd„ƒYZ dS( süShared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the HTMLParser and sgmllib modules (indirectly, for htmllib as well). It has no documented public API and should not be used directly. Ns[a-zA-Z][-_.a-zA-Z0-9]*\s*s(\'[^\']*\'|"[^"]*")\s*s--\s*>s ]\s*]\s*>s]\s*>t ParserBasecBsĄtZdZd„Zd„Zd„Zd„Zd„ZdZd„Z dd „Z dd „Z d „Z d „Z d „Zd„Zd„Zd„Zd„ZRS(siParser base class which provides some common support methods used by the SGML/HTML and XHTML parsers.cCs$|itjotdƒ‚ndS(Ns(markupbase.ParserBase must be subclassed(tselft __class__Rt RuntimeError(R((t'/data/zmath/lib/python2.4/markupbase.pyt__init__scCstdƒ‚dS(Ns.subclasses of ParserBase must override error()(tNotImplementedError(Rtmessage((Rterror!scCsd|_d|_dS(Nii(Rtlinenotoffset(R((Rtreset%s cCs|i|ifS(s&Return current line number and offset.N(RR R (R((Rtgetpos)scCsŒ||jo|Sn|i}|id||ƒ}|o:|i||_|id||ƒ}||d|_ n|i |||_ |S(Ns i( titjRtrawdatatcounttnlinesR trindextposR (RR RRRR((Rt updatepos1s  tc Csz|i}|d}|||!djp td‚|||d!djodSnt|ƒ}|||d!djo|i|ƒSn;||d jo|i|ƒSn|i ||ƒ\}}|d jo|Sn|d jo d|_ nx„||jov||}|d joH||d|!} |d jo|i| ƒn|i| ƒ|dSn|d jo.t||ƒ}|pdSn|iƒ}nÄ|djo|i ||ƒ\}}n›||i jo|d}n}|d joZ|d jo|i|d|ƒ}q\|djo|id|ƒq\|idƒn|id||ƒ|d jo|SqňqňWdS(Niss"'t4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZtattlisttlinktypetlinktelements&unsupported '[' char in %s declarations"unexpected '[' char in declarations!unexpected %r char in declaration(RR(RRslinkR(RRR RtAssertionErrortlentnt parse_commenttparse_marked_sectiont _scan_nametdecltypet_decl_othercharstctdatat handle_declt unknown_declt_declstringlit_matchtmtendtnamet_parse_doctype_subsetR( RR R'R%R.RR,R!RR(((Rtparse_declarationAsV                   icCs|i}|||d!djp td‚|i|d|ƒ\}}|djo|Sn|djoti||dƒ}nD|djot i||dƒ}n|i d ||d|!ƒ|pdSn|o+|i dƒ}|i||d|!ƒn|idƒS(NisR9RRR<((RR#Œs  "   cCs–|i}|||d!djo|idƒnti||dƒ}|pdSn|o+|idƒ}|i ||d|!ƒn|i dƒS(Nis