Your IP : 18.223.195.30


Current Path : /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/
Upload File :
Current File : //usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyo

�
��abc@`s�ddlmZmZmZddlmZddlmZddl	m
Z
ddl	mZddl	mZm
Z
ddl	mZmZmZdd	l	mZmZdd
l	mZddlmZddlmZee�Zd
efd��YZdS(i(tabsolute_importtdivisiontunicode_literals(tunichr(tdequei(tspaceCharacters(tentities(tasciiLetterstasciiUpper2Lower(tdigitst	hexDigitstEOF(t
tokenTypest
tagTokenTypes(treplacementCharacters(tHTMLInputStream(tTriet
HTMLTokenizercB`s�eZdZdJd�Zd�Zd�ZdJed�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d(�Z,d)�Z-d*�Z.d+�Z/d,�Z0d-�Z1d.�Z2d/�Z3d0�Z4d1�Z5d2�Z6d3�Z7d4�Z8d5�Z9d6�Z:d7�Z;d8�Z<d9�Z=d:�Z>d;�Z?d<�Z@d=�ZAd>�ZBd?�ZCd@�ZDdA�ZEdB�ZFdC�ZGdD�ZHdE�ZIdF�ZJdG�ZKdH�ZLdI�ZMRS(Ku	 This class takes care of tokenizing HTML.

    * self.currentToken
      Holds the token that is currently being processed.

    * self.state
      Holds a reference to the method to be invoked... XXX

    * self.stream
      Points to HTMLInputStream object.
    cK`sbt||�|_||_t|_g|_|j|_t|_d|_
tt|�j
�dS(N(RtstreamtparsertFalset
escapeFlagt
lastFourCharst	dataStatetstatetescapetNonetcurrentTokentsuperRt__init__(tselfRRtkwargs((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR"s					cc`s}tg�|_xg|j�rxx6|jjrVitdd6|jjjd�d6Vq!Wx|jrt|jj�VqZWqWdS(u� This is where the magic happens.

        We do our usually processing through the states and when we have a token
        to return we yield the token which pauses processing until the next token
        is requested.
        u
ParseErrorutypeiudataN(Rt
tokenQueueRRterrorsRtpoptpopleft(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyt__iter__1s*c	%C`s�t}d}|r!t}d}ng}|jj�}x8||krp|tk	rp|j|�|jj�}q9Wtdj|�|�}|tkr�t|}|j	jit
dd6dd6i|d6d	6�n�d
|ko�dkns�|dkr3d
}|j	jit
dd6dd6i|d6d	6�nrd|koJdknsd|kofdknsd|ko�dknsd|ko�dkns|tddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7dg#�krQ|j	jit
dd6dd6i|d6d	6�nyt|�}WnAt
k
r�|d8}td
|d?B�td9|d:@B�}nX|d;kr�|j	jit
dd6d<d6�|jj|�n|S(=u�This function returns either U+FFFD or the character based on the
        decimal or hexadecimal representation. It also discards ";" if present.
        If not present self.tokenQueue.append({"type": tokenTypes["ParseError"]}) is invoked.
        i
iuu
ParseErrorutypeu$illegal-codepoint-for-numeric-entityudatau	charAsIntudatavarsi�i��i��u�iiiiii�i�i�ii��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��	i��	i��
i��
i��i��i��i��i��
i��
i��i��i��i��i��ii�i�u;u numeric-entity-without-semicolon(R	R
RtcharRtappendtinttjoinRR Rt	frozensettchrt
ValueErrortunget(	RtisHextallowedtradixt	charStacktct	charAsIntR%tv((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytconsumeNumberEntityAs`	



*c	C`s�d}|jj�g}|dtks]|dtddfks]|dk	rt||dkrt|jj|d�n�|ddkrpt}|j|jj��|ddkr�t}|j|jj��n|r�|dt	ks�|r"|dt
kr"|jj|d�|j|�}q7|jjit
dd	6d
d6�|jj|j��ddj|�}n�xF|dtk	r�tjdj|��s�Pn|j|jj��qsWy,tjdj|d ��}t|�}Wntk
r�d}nX|dk	r�|dd
kr@|jjit
dd	6dd6�n|dd
kr�|r�||tks�||t
ks�||dkr�|jj|j��ddj|�}q7t|}|jj|j��|dj||�7}nK|jjit
dd	6dd6�|jj|j��ddj|�}|r[|jdddc|7<n=|tkrpd}nd}|jjit
|d	6|d6�dS(Nu&iu<u#i����uxuXu
ParseErrorutypeuexpected-numeric-entityudatauu;unamed-entity-without-semicolonu=uexpected-named-entityiuSpaceCharactersu
Characters(uxuX(RR%RRRR,RR&tTrueR
R	R4R RR"R(tentitiesTriethas_keys_with_prefixtlongest_prefixtlentKeyErrorRRR(	RtallowedChart
fromAttributetoutputR0thext
entityNametentityLengtht	tokenType((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyt
consumeEntity�sf)


	cC`s|jd|dt�dS(uIThis method replaces the need for "entityInAttributeValueState".
        R;R<N(RBR5(RR;((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytprocessEntityInAttribute�scC`s�|j}|dtkr�|djt�|d<|dtdkr�|drs|jjitdd6dd6�n|dr�|jjitdd6dd6�q�q�n|jj|�|j|_d	S(
u�This method is a generic handler for emitting the tags. It also sets
        the state to "data" because that's what's needed after a token has been
        emitted.
        utypeunameuEndTagudatau
ParseErroruattributes-in-end-taguselfClosinguself-closing-flag-on-end-tagN(	RR
t	translateRRR R&RR(Rttoken((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytemitCurrentToken�s	

cC`s(|jj�}|dkr*|j|_n�|dkrE|j|_n�|dkr�|jjitdd6dd6�|jjitdd6dd6�n�|tkr�t	S|t
kr�|jjitd	d6||jjt
t�d6�n8|jjd
�}|jjitdd6||d6�tS(Nu&u<uu
ParseErrorutypeuinvalid-codepointudatau
CharactersuSpaceCharacters(u&u<u(
RR%tentityDataStateRttagOpenStateR R&RRRRt
charsUntilR5(Rtdatatchars((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�s&!cC`s|j�|j|_tS(N(RBRRR5(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRGs
cC`s(|jj�}|dkr*|j|_n�|dkrE|j|_n�|tkrUtS|dkr�|jjit	dd6dd6�|jjit	dd6d	d6�n||t
kr�|jjit	d
d6||jjt
t�d6�n8|jjd�}|jjit	dd6||d6�tS(Nu&u<uu
ParseErrorutypeuinvalid-codepointudatau
Charactersu�uSpaceCharacters(u&u<u(
RR%tcharacterReferenceInRcdataRtrcdataLessThanSignStateRRR R&RRRIR5(RRJRK((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytrcdataStates&!cC`s|j�|j|_tS(N(RBRNRR5(R((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRL1s
cC`s�|jj�}|dkr*|j|_n�|dkr}|jjitdd6dd6�|jjitdd6dd6�nH|tkr�tS|jj	d	�}|jjitdd6||d6�t
S(
Nu<uu
ParseErrorutypeuinvalid-codepointudatau
Charactersu�(u<u(RR%trawtextLessThanSignStateRR R&RRRRIR5(RRJRK((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytrawtextState6scC`s�|jj�}|dkr*|j|_n�|dkr}|jjitdd6dd6�|jjitdd6dd6�nH|tkr�tS|jj	d	�}|jjitdd6||d6�t
S(
Nu<uu
ParseErrorutypeuinvalid-codepointudatau
Charactersu�(u<u(RR%tscriptDataLessThanSignStateRR R&RRRRIR5(RRJRK((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytscriptDataStateHscC`s�|jj�}|tkrtS|dkrr|jjitdd6dd6�|jjitdd6dd6�n2|jjitdd6||jjd�d6�tS(Nuu
ParseErrorutypeuinvalid-codepointudatau
Charactersu�(	RR%RRR R&RRIR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytplaintextStateZscC`s�|jj�}|dkr*|j|_nr|dkrE|j|_nW|tkr�itdd6|d6gd6td6td6|_|j	|_n|d	kr�|j
jitd
d6dd6�|j
jitdd6d
d6�|j|_n�|dkr<|j
jitd
d6dd6�|jj
|�|j|_n`|j
jitd
d6dd6�|j
jitdd6dd6�|jj
|�|j|_tS(Nu!u/uStartTagutypeunameudatauselfClosinguselfClosingAcknowledgedu>u
ParseErroru'expected-tag-name-but-got-right-bracketu
Charactersu<>u?u'expected-tag-name-but-got-question-markuexpected-tag-nameu<(RR%tmarkupDeclarationOpenStateRtcloseTagOpenStateRRRRttagNameStateR R&RR,tbogusCommentStateR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRHis6
""cC`s?|jj�}|tkrSitdd6|d6gd6td6|_|j|_n�|dkr�|jj	itdd6dd6�|j
|_n�|tkr�|jj	itdd6d	d6�|jj	itd
d6dd6�|j
|_nL|jj	itdd6dd6i|d6d
6�|jj|�|j
|_tS(NuEndTagutypeunameudatauselfClosingu>u
ParseErroru*expected-closing-tag-but-got-right-bracketu expected-closing-tag-but-got-eofu
Charactersu</u!expected-closing-tag-but-got-charudatavars(RR%RRRRRVRR R&RRR,RWR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRU�s("cC`s�|jj�}|tkr*|j|_n�|dkrC|j�n�|tkr�|jjit	dd6dd6�|j
|_nr|dkr�|j|_nW|dkr�|jjit	dd6dd6�|jd	cd
7<n|jd	c|7<t
S(Nu>u
ParseErrorutypeueof-in-tag-nameudatau/uuinvalid-codepointunameu�(RR%RtbeforeAttributeNameStateRRFRR R&RRtselfClosingStartTagStateRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRV�s"
cC`su|jj�}|dkr3d|_|j|_n>|jjitdd6dd6�|jj|�|j	|_t
S(Nu/uu
Charactersutypeu<udata(RR%ttemporaryBuffertrcdataEndTagOpenStateRR R&RR,RNR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRM�s	"cC`s{|jj�}|tkr9|j|7_|j|_n>|jjitdd6dd6�|jj	|�|j
|_tS(Nu
Charactersutypeu</udata(RR%RRZtrcdataEndTagNameStateRR R&RR,RNR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR[�s"cC`s�|jo(|jdj�|jj�k}|jj�}|tkr�|r�itdd6|jd6gd6td6|_|j|_	n|dkr�|r�itdd6|jd6gd6td6|_|j
|_	n�|dkr+|r+itdd6|jd6gd6td6|_|j�|j|_	nc|t
krI|j|7_nE|jjitdd6d	|jd6�|jj|�|j|_	tS(
NunameuEndTagutypeudatauselfClosingu/u>u
Charactersu</(RtlowerRZRR%RRRRXRRYRFRRR R&R,RNR5(RtappropriateRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR\�s2+



cC`su|jj�}|dkr3d|_|j|_n>|jjitdd6dd6�|jj|�|j	|_t
S(Nu/uu
Charactersutypeu<udata(RR%RZtrawtextEndTagOpenStateRR R&RR,RPR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRO�s	"cC`s{|jj�}|tkr9|j|7_|j|_n>|jjitdd6dd6�|jj	|�|j
|_tS(Nu
Charactersutypeu</udata(RR%RRZtrawtextEndTagNameStateRR R&RR,RPR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR_�s"cC`s�|jo(|jdj�|jj�k}|jj�}|tkr�|r�itdd6|jd6gd6td6|_|j|_	n|dkr�|r�itdd6|jd6gd6td6|_|j
|_	n�|dkr+|r+itdd6|jd6gd6td6|_|j�|j|_	nc|t
krI|j|7_nE|jjitdd6d	|jd6�|jj|�|j|_	tS(
NunameuEndTagutypeudatauselfClosingu/u>u
Charactersu</(RR]RZRR%RRRRXRRYRFRRR R&R,RPR5(RR^RJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR`s2+



cC`s�|jj�}|dkr3d|_|j|_n{|dkrp|jjitdd6dd6�|j|_n>|jjitdd6dd6�|jj	|�|j
|_tS(	Nu/uu!u
Charactersutypeu<!udatau<(RR%RZtscriptDataEndTagOpenStateRR R&RtscriptDataEscapeStartStateR,RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRQs	""cC`s{|jj�}|tkr9|j|7_|j|_n>|jjitdd6dd6�|jj	|�|j
|_tS(Nu
Charactersutypeu</udata(RR%RRZtscriptDataEndTagNameStateRR R&RR,RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRa,s"cC`s�|jo(|jdj�|jj�k}|jj�}|tkr�|r�itdd6|jd6gd6td6|_|j|_	n|dkr�|r�itdd6|jd6gd6td6|_|j
|_	n�|dkr+|r+itdd6|jd6gd6td6|_|j�|j|_	nc|t
krI|j|7_nE|jjitdd6d	|jd6�|jj|�|j|_	tS(
NunameuEndTagutypeudatauselfClosingu/u>u
Charactersu</(RR]RZRR%RRRRXRRYRFRRR R&R,RRR5(RR^RJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRc7s2+



cC`sl|jj�}|dkrL|jjitdd6dd6�|j|_n|jj|�|j|_t	S(Nu-u
Charactersutypeudata(
RR%R R&RtscriptDataEscapeStartDashStateRR,RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRbSs"cC`sl|jj�}|dkrL|jjitdd6dd6�|j|_n|jj|�|j|_t	S(Nu-u
Charactersutypeudata(
RR%R R&RtscriptDataEscapedDashDashStateRR,RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRd]s"cC`s|jj�}|dkrL|jjitdd6dd6�|j|_n�|dkrg|j|_n�|dkr�|jjitdd6dd6�|jjitdd6d	d6�nS|tkr�|j	|_n8|jj
d
�}|jjitdd6||d6�tS(Nu-u
Charactersutypeudatau<uu
ParseErroruinvalid-codepointu�(u<u-u(RR%R R&RtscriptDataEscapedDashStateRt"scriptDataEscapedLessThanSignStateRRRIR5(RRJRK((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pytscriptDataEscapedStategs""cC`s|jj�}|dkrL|jjitdd6dd6�|j|_n�|dkrg|j|_n�|dkr�|jjitdd6dd6�|jjitdd6d	d6�|j|_nI|t	kr�|j
|_n.|jjitdd6|d6�|j|_tS(
Nu-u
Charactersutypeudatau<uu
ParseErroruinvalid-codepointu�(RR%R R&RReRRgRhRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRf{s"""cC`sD|jj�}|dkr@|jjitdd6dd6�n|dkr[|j|_n�|dkr�|jjitdd6dd6�|j|_n�|dkr�|jjitdd6d	d6�|jjitdd6d
d6�|j|_nI|t	kr|j
|_n.|jjitdd6|d6�|j|_tS(Nu-u
Charactersutypeudatau<u>uu
ParseErroruinvalid-codepointu�(RR%R R&RRgRRRRhRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRe�s&%""cC`s�|jj�}|dkr3d|_|j|_n�|tkr}|jjitdd6d|d6�||_|j	|_n>|jjitdd6dd6�|jj
|�|j|_tS(Nu/uu
Charactersutypeu<udata(
RR%RZt scriptDataEscapedEndTagOpenStateRRR R&Rt scriptDataDoubleEscapeStartStateR,RhR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRg�s	&	"cC`su|jj�}|tkr3||_|j|_n>|jjitdd6dd6�|jj	|�|j
|_tS(Nu
Charactersutypeu</udata(RR%RRZt scriptDataEscapedEndTagNameStateRR R&RR,RhR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRi�s	"cC`s�|jo(|jdj�|jj�k}|jj�}|tkr�|r�itdd6|jd6gd6td6|_|j|_	n|dkr�|r�itdd6|jd6gd6td6|_|j
|_	n�|dkr+|r+itdd6|jd6gd6td6|_|j�|j|_	nc|t
krI|j|7_nE|jjitdd6d	|jd6�|jj|�|j|_	tS(
NunameuEndTagutypeudatauselfClosingu/u>u
Charactersu</(RR]RZRR%RRRRXRRYRFRRR R&R,RhR5(RR^RJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRk�s2+



cC`s�|jj�}|ttd�Bkrz|jjitdd6|d6�|jj�dkrk|j	|_
q�|j|_
n\|tkr�|jjitdd6|d6�|j|7_n|jj
|�|j|_
tS(Nu/u>u
Charactersutypeudatauscript(u/u>(RR%RR)R R&RRZR]tscriptDataDoubleEscapedStateRRhRR,R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRj�s""cC`s?|jj�}|dkrL|jjitdd6dd6�|j|_n�|dkr�|jjitdd6dd6�|j|_n�|dkr�|jjitdd6dd6�|jjitdd6d	d6�n_|tkr|jjitdd6d
d6�|j	|_n"|jjitdd6|d6�t
S(Nu-u
Charactersutypeudatau<uu
ParseErroruinvalid-codepointu�ueof-in-script-in-script(RR%R R&Rt scriptDataDoubleEscapedDashStateRt(scriptDataDoubleEscapedLessThanSignStateRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRl�s$"""cC`sW|jj�}|dkrL|jjitdd6dd6�|j|_n|dkr�|jjitdd6dd6�|j|_n�|dkr�|jjitdd6dd6�|jjitdd6d	d6�|j|_nk|t	kr%|jjitdd6d
d6�|j
|_n.|jjitdd6|d6�|j|_tS(Nu-u
Charactersutypeudatau<uu
ParseErroruinvalid-codepointu�ueof-in-script-in-script(RR%R R&Rt$scriptDataDoubleEscapedDashDashStateRRnRlRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRms("""cC`s�|jj�}|dkr@|jjitdd6dd6�nD|dkr}|jjitdd6dd6�|j|_n|dkr�|jjitdd6dd6�|j|_n�|dkr|jjitdd6d	d6�|jjitdd6d
d6�|j|_nk|t	krV|jjitdd6dd6�|j
|_n.|jjitdd6|d6�|j|_tS(Nu-u
Charactersutypeudatau<u>uu
ParseErroruinvalid-codepointu�ueof-in-script-in-script(RR%R R&RRnRRRRlRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRos,%"""cC`su|jj�}|dkrU|jjitdd6dd6�d|_|j|_n|jj|�|j	|_t
S(Nu/u
Charactersutypeudatau(RR%R R&RRZtscriptDataDoubleEscapeEndStateRR,RlR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRn0s"	cC`s�|jj�}|ttd�Bkrz|jjitdd6|d6�|jj�dkrk|j	|_
q�|j|_
n\|tkr�|jjitdd6|d6�|j|7_n|jj
|�|j|_
tS(Nu/u>u
Charactersutypeudatauscript(u/u>(RR%RR)R R&RRZR]RhRRlRR,R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRp;s""cC`s�|jj�}|tkr1|jjtt�nz|tkrf|jdj|dg�|j|_	nE|dkr|j
�n,|dkr�|j|_	n|dkr�|jjit
d	d
6dd6�|jdj|dg�|j|_	n�|dkrH|jjit
d	d
6d
d6�|jdjddg�|j|_	nc|tkr�|jjit
d	d
6dd6�|j|_	n&|jdj|dg�|j|_	tS(Nudatauu>u/u'u"u=u<u
ParseErrorutypeu#invalid-character-in-attribute-nameuuinvalid-codepointu�u#expected-attribute-name-but-got-eof(u'u"u=u<(RR%RRIR5RRR&tattributeNameStateRRFRYR RRR(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRXKs6
cC`sv|jj�}t}t}|dkr6|j|_n�|tkry|jdddc||jjtt�7<t}nM|dkr�t}n8|t	kr�|j
|_n|dkr�|j|_n|dkr|jj
itdd	6d
d6�|jdddcd7<t}n�|dkrh|jj
itdd	6dd6�|jdddc|7<t}n^|tkr�|jj
itdd	6dd6�|j|_n!|jdddc|7<t}|rr|jdddjt�|jddd<x`|jdd D]M\}}|jddd|kr|jj
itdd	6dd6�PqqW|rr|j�qrntS(Nu=udatai����iu>u/uu
ParseErrorutypeuinvalid-codepointu�u'u"u<u#invalid-character-in-attribute-nameueof-in-attribute-nameuduplicate-attribute(u'u"u<(RR%R5RtbeforeAttributeValueStateRRRRIRtafterAttributeNameStateRYR R&RRRRDRRF(RRJtleavingThisStatet	emitTokentnamet_((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRqisR				-cC`s�|jj�}|tkr1|jjtt�n�|dkrL|j|_nz|dkre|j�na|tkr�|j	dj
|dg�|j|_n,|dkr�|j|_n|dkr|j
j
itdd6d	d6�|j	dj
d
dg�|j|_n�|dkrc|j
j
itdd6dd6�|j	dj
|dg�|j|_nc|tkr�|j
j
itdd6dd6�|j|_n&|j	dj
|dg�|j|_tS(Nu=u>udatauu/uu
ParseErrorutypeuinvalid-codepointu�u'u"u<u&invalid-character-after-attribute-nameuexpected-end-of-tag-but-got-eof(u'u"u<(RR%RRIR5RrRRFRRR&RqRYR RRR(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRs�s:
cC`s�|jj�}|tkr1|jjtt�n�|dkrL|j|_n�|dkrw|j|_|jj|�nj|dkr�|j	|_nO|dkr�|j
jitdd6dd6�|j
�n|d	kr%|j
jitdd6d
d6�|jdddcd
7<|j|_n�|dkr}|j
jitdd6dd6�|jdddc|7<|j|_nd|tkr�|j
jitdd6dd6�|j|_n'|jdddc|7<|j|_tS(Nu"u&u'u>u
ParseErrorutypeu.expected-attribute-value-but-got-right-bracketudatauuinvalid-codepointi����iu�u=u<u`u"equals-in-unquoted-attribute-valueu$expected-attribute-value-but-got-eof(u=u<u`(RR%RRIR5tattributeValueDoubleQuotedStateRtattributeValueUnQuotedStateR,tattributeValueSingleQuotedStateR R&RRFRRR(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRr�s>
cC`s�|jj�}|dkr*|j|_n�|dkrF|jd�n�|dkr�|jjitdd6dd6�|jddd	cd
7<nh|t	kr�|jjitdd6dd6�|j
|_n+|jddd	c||jjd�7<tS(
Nu"u&uu
ParseErrorutypeuinvalid-codepointudatai����iu�u#eof-in-attribute-value-double-quote(u"u&u(
RR%tafterAttributeValueStateRRCR R&RRRRRIR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRx�s cC`s�|jj�}|dkr*|j|_n�|dkrF|jd�n�|dkr�|jjitdd6dd6�|jddd	cd
7<nh|t	kr�|jjitdd6dd6�|j
|_n+|jddd	c||jjd�7<tS(
Nu'u&uu
ParseErrorutypeuinvalid-codepointudatai����iu�u#eof-in-attribute-value-single-quote(u'u&u(
RR%R{RRCR R&RRRRRIR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRz�s cC`sm|jj�}|tkr*|j|_n?|dkrF|jd�n#|dkr_|j�n
|dkr�|jjit	dd	6d
d6�|j
ddd
c|7<n�|dkr�|jjit	dd	6dd6�|j
ddd
cd7<nr|tkr4|jjit	dd	6dd6�|j|_n5|j
ddd
c||jj
td�tB�7<tS(Nu&u>u"u'u=u<u`u
ParseErrorutypeu0unexpected-character-in-unquoted-attribute-valueudatai����iuuinvalid-codepointu�u eof-in-attribute-value-no-quotes(u"u'u=u<u`(u&u>u"u'u=u<u`u(RR%RRXRRCRFR R&RRRRRIR)R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRys,
!cC`s�|jj�}|tkr*|j|_n�|dkrC|j�n�|dkr^|j|_n�|tkr�|jj	it
dd6dd6�|jj|�|j|_n>|jj	it
dd6dd6�|jj|�|j|_t
S(Nu>u/u
ParseErrorutypeu$unexpected-EOF-after-attribute-valueudatau*unexpected-character-after-attribute-value(RR%RRXRRFRYRR R&RR,RR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR{ s"
cC`s�|jj�}|dkr5t|jd<|j�n�|tkr�|jjitdd6dd6�|jj	|�|j
|_n>|jjitdd6dd6�|jj	|�|j|_tS(Nu>uselfClosingu
ParseErrorutypeu#unexpected-EOF-after-solidus-in-tagudatau)unexpected-character-after-solidus-in-tag(
RR%R5RRFRR R&RR,RRRX(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRY4s

cC`sc|jjd�}|jdd�}|jjitdd6|d6�|jj�|j|_t	S(Nu>uu�uCommentutypeudata(
RRItreplaceR R&RR%RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRWFs	
cC`sB|jj�g}|ddkrv|j|jj��|ddkr�itdd6dd6|_|j|_tSnw|ddkr(t}xPdd d!d"d#d$fD]6}|j|jj��|d|kr�t}Pq�q�W|r�itdd6dd6dd6dd6td6|_|j
|_tSn�|ddkr�|jdk	r�|jjj
r�|jjj
dj|jjjkr�t}xPddddddgD]6}|j|jj��|d|kr�t}Pq�q�W|r�|j|_tSn|jjitdd6dd6�x |r1|jj|j��qW|j|_tS(%Ni����u-uCommentutypeuudatauduDuouOucuCutuTuyuYupuPueuEuDoctypeunameupublicIdusystemIducorrectu[uAu
ParseErroruexpected-dashes-or-doctype(uduD(uouO(ucuC(utuT(uyuY(upuP(ueuE(RR%R&RRtcommentStartStateRR5RRtdoctypeStateRttreetopenElementst	namespacetdefaultNamespacetcdataSectionStateR R,R"RW(RR0tmatchedtexpected((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRTUsR
%	cC`s1|jj�}|dkr*|j|_n|dkrn|jjitdd6dd6�|jdcd7<n�|dkr�|jjitdd6d	d6�|jj|j�|j|_no|t	kr|jjitdd6d
d6�|jj|j�|j|_n|jdc|7<|j
|_tS(Nu-uu
ParseErrorutypeuinvalid-codepointudatau�u>uincorrect-commentueof-in-comment(RR%tcommentStartDashStateRR R&RRRRtcommentStateR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR}�s(cC`s5|jj�}|dkr*|j|_n|dkrn|jjitdd6dd6�|jdcd7<n�|dkr�|jjitdd6d	d6�|jj|j�|j|_ns|t	kr|jjitdd6d
d6�|jj|j�|j|_n#|jdcd|7<|j
|_tS(Nu-uu
ParseErrorutypeuinvalid-codepointudatau-�u>uincorrect-commentueof-in-comment(RR%tcommentEndStateRR R&RRRRR�R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s(cC`s�|jj�}|dkr*|j|_n�|dkrn|jjitdd6dd6�|jdcd7<ns|tkr�|jjitdd6dd6�|jj|j�|j	|_n#|jdc||jj
d	�7<tS(
Nu-uu
ParseErrorutypeuinvalid-codepointudatau�ueof-in-comment(u-u(RR%tcommentEndDashStateRR R&RRRRRIR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��scC`s�|jj�}|dkr*|j|_n�|dkrz|jjitdd6dd6�|jdcd7<|j|_ns|t	kr�|jjitdd6dd6�|jj|j�|j
|_n#|jdcd|7<|j|_tS(	Nu-uu
ParseErrorutypeuinvalid-codepointudatau-�ueof-in-comment-end-dash(RR%R�RR R&RRR�RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s cC`s�|jj�}|dkr=|jj|j�|j|_nf|dkr�|jjitdd6dd6�|jdcd7<|j|_n|dkr�|jjitdd6d	d6�|j	|_n�|d
kr|jjitdd6dd6�|jdc|7<n�|t
kr^|jjitdd6dd6�|jj|j�|j|_nE|jjitdd6d
d6�|jdcd|7<|j|_tS(Nu>uu
ParseErrorutypeuinvalid-codepointudatau--�u!u,unexpected-bang-after-double-dash-in-commentu-u,unexpected-dash-after-double-dash-in-commentueof-in-comment-double-dashuunexpected-char-in-commentu--(RR%R R&RRRRR�tcommentEndBangStateRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s6cC`s2|jj�}|dkr=|jj|j�|j|_n�|dkrk|jdcd7<|j|_n�|dkr�|jjitdd6dd6�|jdcd	7<|j	|_ns|t
kr|jjitdd6d
d6�|jj|j�|j|_n#|jdcd|7<|j	|_tS(Nu>u-udatau--!uu
ParseErrorutypeuinvalid-codepointu--!�ueof-in-comment-end-bang-state(RR%R R&RRRR�RR�RR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s(cC`s�|jj�}|tkr*|j|_n�|tkr�|jjitdd6dd6�t	|j
d<|jj|j
�|j|_n>|jjitdd6dd6�|jj|�|j|_t
S(Nu
ParseErrorutypeu!expected-doctype-name-but-got-eofudataucorrectuneed-space-after-doctype(RR%RtbeforeDoctypeNameStateRRR R&RRRRR,R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR~s
cC`s?|jj�}|tkrn|dkr{|jjitdd6dd6�t|jd<|jj|j�|j|_	n�|dkr�|jjitdd6dd6�d	|jd
<|j
|_	nv|tkr"|jjitdd6dd6�t|jd<|jj|j�|j|_	n||jd
<|j
|_	tS(Nu>u
ParseErrorutypeu+expected-doctype-name-but-got-right-bracketudataucorrectuuinvalid-codepointu�unameu!expected-doctype-name-but-got-eof(
RR%RR R&RRRRRtdoctypeNameStateRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�s.



cC`ss|jj�}|tkrG|jdjt�|jd<|j|_n(|dkr�|jdjt�|jd<|jj	|j�|j
|_n�|dkr�|jj	itdd6dd6�|jdcd7<|j|_n�|t
kr\|jj	itdd6d	d6�t|jd
<|jdjt�|jd<|jj	|j�|j
|_n|jdc|7<tS(Nunameu>uu
ParseErrorutypeuinvalid-codepointudatau�ueof-in-doctype-nameucorrect(RR%RRRDRtafterDoctypeNameStateRR R&RRR�RRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�6s,
cC`s�|jj�}|tkrn�|dkrL|jj|j�|j|_n�|tkr�t	|jd<|jj
|�|jjitdd6dd6�|jj|j�|j|_n9|dkr)t}xBd d!d"d#d$fD]+}|jj�}||kr�t	}Pq�q�W|r�|j
|_tSnp|d%kr�t}xBd&d'd(d)d*fD]+}|jj�}||krQt	}PqQqQW|r�|j|_tSn|jj
|�|jjitdd6dd6i|d6d6�t	|jd<|j|_tS(+Nu>ucorrectu
ParseErrorutypeueof-in-doctypeudataupuPuuuUubuBuluLuiuIucuCusuSuyuYutuTueuEumuMu*expected-space-or-right-bracket-in-doctypeudatavars(upuP(uuuU(ubuB(uluL(uiuI(ucuC(usuS(uyuY(usuS(utuT(ueuE(umuM(RR%RR R&RRRRRR,RR5tafterDoctypePublicKeywordStatetafterDoctypeSystemKeywordStatetbogusDoctypeState(RRJR�R�((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�OsT

cC`s�|jj�}|tkr*|j|_n�|d	krw|jjitdd6dd6�|jj|�|j|_ny|t	kr�|jjitdd6dd6�t
|jd<|jj|j�|j|_n|jj|�|j|_t
S(
Nu'u"u
ParseErrorutypeuunexpected-char-in-doctypeudataueof-in-doctypeucorrect(u'u"(RR%Rt"beforeDoctypePublicIdentifierStateRR R&RR,RRRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s"
cC`sg|jj�}|tkrnE|dkrFd|jd<|j|_n|dkrnd|jd<|j|_n�|dkr�|jjit	dd6dd	6�t
|jd
<|jj|j�|j|_n�|tkr(|jjit	dd6dd	6�t
|jd
<|jj|j�|j|_n;|jjit	dd6dd	6�t
|jd
<|j
|_tS(
Nu"uupublicIdu'u>u
ParseErrorutypeuunexpected-end-of-doctypeudataucorrectueof-in-doctypeuunexpected-char-in-doctype(RR%RRt(doctypePublicIdentifierDoubleQuotedStateRt(doctypePublicIdentifierSingleQuotedStateR R&RRRRR�R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s4




cC`s?|jj�}|dkr*|j|_n|dkrn|jjitdd6dd6�|jdcd7<n�|d	kr�|jjitdd6d
d6�t|jd<|jj|j�|j	|_np|t
kr(|jjitdd6dd6�t|jd<|jj|j�|j	|_n|jdc|7<tS(
Nu"uu
ParseErrorutypeuinvalid-codepointudataupublicIdu�u>uunexpected-end-of-doctypeucorrectueof-in-doctype(RR%t!afterDoctypePublicIdentifierStateRR R&RRRRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s*

cC`s?|jj�}|dkr*|j|_n|dkrn|jjitdd6dd6�|jdcd7<n�|d	kr�|jjitdd6d
d6�t|jd<|jj|j�|j	|_np|t
kr(|jjitdd6dd6�t|jd<|jj|j�|j	|_n|jdc|7<tS(
Nu'uu
ParseErrorutypeuinvalid-codepointudataupublicIdu�u>uunexpected-end-of-doctypeucorrectueof-in-doctype(RR%R�RR R&RRRRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s*

cC`s�|jj�}|tkr*|j|_nZ|dkrX|jj|j�|j|_n,|dkr�|jjit	dd6dd6�d|jd<|j
|_n�|d	kr�|jjit	dd6dd6�d|jd<|j|_n�|tkrI|jjit	dd6d
d6�t
|jd<|jj|j�|j|_n;|jjit	dd6dd6�t
|jd<|j|_tS(Nu>u"u
ParseErrorutypeuunexpected-char-in-doctypeudatauusystemIdu'ueof-in-doctypeucorrect(RR%Rt-betweenDoctypePublicAndSystemIdentifiersStateRR R&RRRt(doctypeSystemIdentifierDoubleQuotedStatet(doctypeSystemIdentifierSingleQuotedStateRRR�R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s6



cC`s8|jj�}|tkrn|dkrL|jj|j�|j|_n�|dkrtd|jd<|j|_n�|dkr�d|jd<|j	|_n�|t
kr�|jjitdd6dd	6�t|jd
<|jj|j�|j|_n;|jjitdd6dd	6�t|jd
<|j
|_tS(Nu>u"uusystemIdu'u
ParseErrorutypeueof-in-doctypeudataucorrectuunexpected-char-in-doctype(RR%RR R&RRRR�R�RRRR�R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�s.



cC`s�|jj�}|tkr*|j|_n�|d	krw|jjitdd6dd6�|jj|�|j|_ny|t	kr�|jjitdd6dd6�t
|jd<|jj|j�|j|_n|jj|�|j|_t
S(
Nu'u"u
ParseErrorutypeuunexpected-char-in-doctypeudataueof-in-doctypeucorrect(u'u"(RR%Rt"beforeDoctypeSystemIdentifierStateRR R&RR,RRRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�s"
cC`sg|jj�}|tkrnE|dkrFd|jd<|j|_n|dkrnd|jd<|j|_n�|dkr�|jjit	dd6dd	6�t
|jd
<|jj|j�|j|_n�|tkr(|jjit	dd6dd	6�t
|jd
<|jj|j�|j|_n;|jjit	dd6dd	6�t
|jd
<|j
|_tS(Nu"uusystemIdu'u>u
ParseErrorutypeuunexpected-char-in-doctypeudataucorrectueof-in-doctype(RR%RRR�RR�R R&RRRRR�R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�/s4




cC`s?|jj�}|dkr*|j|_n|dkrn|jjitdd6dd6�|jdcd7<n�|d	kr�|jjitdd6d
d6�t|jd<|jj|j�|j	|_np|t
kr(|jjitdd6dd6�t|jd<|jj|j�|j	|_n|jdc|7<tS(
Nu"uu
ParseErrorutypeuinvalid-codepointudatausystemIdu�u>uunexpected-end-of-doctypeucorrectueof-in-doctype(RR%t!afterDoctypeSystemIdentifierStateRR R&RRRRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�Ls*

cC`s?|jj�}|dkr*|j|_n|dkrn|jjitdd6dd6�|jdcd7<n�|d	kr�|jjitdd6d
d6�t|jd<|jj|j�|j	|_np|t
kr(|jjitdd6dd6�t|jd<|jj|j�|j	|_n|jdc|7<tS(
Nu'uu
ParseErrorutypeuinvalid-codepointudatausystemIdu�u>uunexpected-end-of-doctypeucorrectueof-in-doctype(RR%R�RR R&RRRRRR5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�ds*

cC`s�|jj�}|tkrn�|dkrL|jj|j�|j|_n�|tkr�|jjit	dd6dd6�t
|jd<|jj|j�|j|_n.|jjit	dd6dd6�|j|_tS(Nu>u
ParseErrorutypeueof-in-doctypeudataucorrectuunexpected-char-in-doctype(
RR%RR R&RRRRRRR�R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR�|s 
cC`s|jj�}|dkr=|jj|j�|j|_n>|tkr{|jj|�|jj|j�|j|_nt	S(Nu>(
RR%R R&RRRRR,R5(RRJ((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��scC`sNg}x�tr�|j|jjd��|j|jjd��|jj�}|tkr`Pq	|dddkr�|dd |d<Pq	|j|�q	Wdj|�}|jd�}|dkrx6t|�D](}|j	jit
d	d
6dd6�q�W|jdd
�}n|r>|j	jit
dd
6|d6�n|j|_
tS(Nu]u>i����i����u]]uuiu
ParseErrorutypeuinvalid-codepointudatau�u
Characters(R5R&RRIR%RR(tcounttrangeR RR|RR(RRJR%t	nullCountRw((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyR��s.	N(Nt__name__t
__module__t__doc__RRR$R4RRBRCRFRRGRNRLRPRRRSRHRURVRMR[R\ROR_R`RQRaRcRbRdRhRfReRgRiRkRjRlRmRoRnRpRXRqRsRrRxRzRyR{RYRWRTR}R�R�R�R�R�R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyRs�		HP										#												
	
														6	 	"							-										3												N(t
__future__RRRtpip._vendor.sixRR*tcollectionsRt	constantsRRRRR	R
RRR
Rt_inputstreamRt_trieRR6tobjectR(((sC/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/_tokenizer.pyt<module>s

?>