python (3.12.0)

(root)/
lib/
python3.12/
html/
__pycache__/
parser.cpython-312.opt-1.pyc

̑eBdZddlZddlZddlmZdgZejdZejdZejdZ	ejdZ
ejd	Zejd
ZejdZ
ejdZejd
Zejdej Zejd
ZejdZGddej(Zy)zA parser for HTML and XHTML.N)unescape
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]>z--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*aF
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>ceZdZdZdZddfd
ZfdZdZdZd	Z	d
Z
dZdZd
Z
dZddZdZdZdZdZdZdZdZdZdZdZdZdZdZdZxZS)raEFind tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    )scriptstyleT)convert_charrefscPt|||_|jy)zInitialize and reset this instance.

        If convert_charrefs is True (the default), all character references
        are automatically converted to the corresponding Unicode characters.
        N)super__init__r	reset)selfr		__class__s  ?/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/html/parser.pyrzHTMLParser.__init__Vs!	 0

cbd|_d|_t|_d|_t
|y)z1Reset this instance.  Loses all unprocessed data.z???N)rawdatalasttaginteresting_normalinteresting
cdata_elemrr
)rrs rr
zHTMLParser.reset`s)-

rcN|j|z|_|jdy)zFeed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        rN)rgoaheadrdatas  rfeedzHTMLParser.feedhs||d*Qrc&|jdy)zHandle any buffered data.N)rrs rclosezHTMLParser.closeqs
QrNc|jS)z)Return full source of start tag: '<...>'.)_HTMLParser__starttag_textr s rget_starttag_textzHTMLParser.get_starttag_textws###rc|j|_tjd|jztj|_y)Nz</\s*%s\s*>)lowerrrecompileIr)relems  rset_cdata_modezHTMLParser.set_cdata_mode{s/**,::nt&FMrc(t|_d|_yN)rrrr s rclear_cdata_modezHTMLParser.clear_cdata_modes-rc	|j}d}t|}||krP|jrq|jse|j	d|}|dkr|jdt
||dz
}|dk\r'tjdj||sn|}n?|jj||}|r|j}n|jrn|}||krJ|jr*|js|jt|||n|j||||j||}||k(rn,|j}|d|r[t j#||r|j%|}	n|d|r|j'|}	nr|d|r|j)|}	nW|d|r|j+|}	n<|d	|r|j-|}	n!|d
z|kr|jd|d
z}	nna|	dkr|snX|j	d|d
z}	|	dkr |j	d|d
z}	|	dkr|d
z}	n|	d
z
}	|jr*|js|jt|||	n|j|||	|j||	}n|d|rt.j#||}|rY|j1d
d}
|j3|
|j5}	|d|	d
z
s|	d
z
}	|j||	}d||dvr,|j|||d
z|j||d
z}n|d|rt6j#||}|rW|j1d
}
|j9|
|j5}	|d|	d
z
s|	d
z
}	|j||	}t:j#||}|rE|rB|j1||dk(r,|j5}	|	|kr|}	|j||d
z}n7|d
z|kr'|jd|j||d
z}nn||krP|rm||krh|js\|jr*|js|jt|||n|j||||j||}||d|_y)Nr<&"z[\s;]z</<!--z<?z<!rrz&#;)rlenr	rfindrfindmaxr'r(searchrstarthandle_datar	updatepos
startswithstarttagopenmatchparse_starttagparse_endtag
parse_commentparse_piparse_html_declarationcharrefgrouphandle_charrefend	entityrefhandle_entityref
incomplete)rrJrinjampposrAr?knames           rrzHTMLParser.goaheads,,
L!e$$T__LLa(q5%]]3Aqt=F!JJx077HA((//;
AA1u(($$Xgal%;<$$WQq\2q!$AAvu ++J#q!%%gq1++A.Aa())!,A***1-Aa(

a(Aa(33A6A!eq[$$S)AAq5S!a%0A1u#LLa!e4q5 !AAQ,,T__(('!A,)?@((16NN1a(D!$

gq1 ;;=2.D''-		A%c1Q3/Eq!,Agabk)((1Q38 NN1ac2C#!3 ;;q>D))$/		A%c1Q3/Eq!,A"((!4u{{};!IIK6 !A NN1a!e4!eq[$$S)q!a%0AO!eV1q5$$T__  '!A,!78  1.q!$Aqr{rcL|j}|||dzdk(r|j|S|||dzdk(r|j|S|||dzjdk(r7|j	d|dz}|dk(ry|j||d	z||d
zS|j
|S)Nr3z<![	z	<!doctyperr5r4r)rrDparse_marked_sectionr&r8handle_declparse_bogus_comment)rrNrgtposs    rrFz!HTMLParser.parse_html_declarations,,1QqS>V#%%a((
Qqs^u
$,,Q//
Qqs^
!
!
#{
2LLac*E{WQqS/07N++A..rc|j}|jd|dz}|dk(ry|r|j||dz||dzS)Nrr4r5r)rr8handle_comment)rrNreportrposs     rrZzHTMLParser.parse_bogus_commentsP,,ll3!$"9!C 01Qwrc|j}tj||dz}|sy|j}|j	||dz||j}|S)Nr4r5)rpicloser;r<	handle_pirJ)rrNrrArPs     rrEzHTMLParser.parse_pi!sV,,w!,KKMwqsA'IIKrcld|_|j|}|dkr|S|j}||||_g}tj	||dz}|j}|j
djx|_}||krtj	||}|sn|j
ddd\}	}
}|
sd}n,|dddcxk(r|ddk(sn|dddcxk(r|ddk(rnn|dd}|rt|}|j|	j|f|j}||kr|||j}|dvr|j||||S|jd	r|j|||S|j!||||j"vr|j%||S)
Nrrr4rV'r5")r/>rf)r#check_for_whole_start_tagrtagfind_tolerantrArJrHr&rattrfind_tolerantrappendstripr=endswithhandle_startendtaghandle_starttagCDATA_CONTENT_ELEMENTSr+)
rrNendposrattrsrArRtagmattrnamerest	attrvaluerJs
             rrBzHTMLParser.parse_starttag-s#//2A:M,,&q0 &&w!4IIK"[[^1133s&j!''3A()1a(8%HdI 	2A$8)BC.82A#7237%aO	$Y/	LL(..*I67A&ja%%'k!WQv./M<<##C/


  e,d111##C(
rcH|j}tj||}|rt|j}|||dz}|dk(r|dzS|dk(r6|j	d|r|dzS|j	d|ry||kDr|S|dzS|dk(ry|dvry||kDr|S|dzStd	)
Nrr/rfr4r5rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)rlocatestarttagend_tolerantrArJr?AssertionError)rrNrrsrPnexts      rrgz$HTMLParser.check_for_whole_start_tagYs,,&,,Wa8A1QqS>Ds{1us{%%dA.q5L%%c1-q5Hq5Lrz561u1u677rc|j}tj||dz}|sy|j}tj||}|s|j|j||||Stj||dz}|s!|||dzdk(r|dzS|j|S|jdj}|jd|j}|j||dzS|jdj}|j%||jk7r|j||||S|j||j|S)Nrr5r4rVz</>r)r	endendtagr;rJ
endtagfindrArr=rhrZrHr&r8
handle_endtagr.)rrNrrAr[	namematchtagnamer*s        rrCzHTMLParser.parse_endtag{s[,,  !A#.		  !,*  5!12(..w!<I1QqS>U*Q3J33A66ooa(..0G
LLimmo6Ew'7N{{1~##%??&t&  5!124 rcJ|j|||j|yr-)rnrrrrrqs   rrmzHTMLParser.handle_startendtags S%(3rcyr-rs   rrnzHTMLParser.handle_starttagrcyr-r)rrrs  rrzHTMLParser.handle_endtagrrcyr-rrrSs  rrIzHTMLParser.handle_charrefrrcyr-rrs  rrLzHTMLParser.handle_entityrefrrcyr-rrs  rr=zHTMLParser.handle_datarrcyr-rrs  rr]zHTMLParser.handle_commentrrcyr-r)rdecls  rrYzHTMLParser.handle_declrrcyr-rrs  rrbzHTMLParser.handle_pirrcyr-rrs  runknown_declzHTMLParser.unknown_declrr)r)__name__
__module____qualname____doc__rorr
rr!r#r$r+r.rrFrZrErBrgrCrmrnrrIrLr=r]rYrbr
__classcell__)rs@rrr>s*1+/O$Nu#t/*		(X8D%P 









r)rr'_markupbasehtmlr__all__r(rrMrKrGr@racommentcloserhriVERBOSEryr}r~
ParserBaserrrr<module>rs"
. RZZ'
RZZ
%
BJJ>?	
"**@
Arzz+&
"**S/rzz)$2::LMBJJ=>(RZZ)ZZ
BJJsO	RZZ>
?
J
''J
r