MINI MINI MANI MO

Path : /usr/lib64/python3.6/__pycache__/
File Upload :
Current File : //usr/lib64/python3.6/__pycache__/shlex.cpython-36.pyc

3


 \2@sdZddlZddlZddlZddlmZddlmZdddgZGdddZ	dddZ
ejdejj
Zd
dZddZedkreejdkree	n,ejdZeeZee	eeWdQRXdS)z8A lexical analyzer class for simple shell-like syntaxes.N)deque)StringIOshlexsplitquotec@sfeZdZdZdddZddZddd	Zd
dZdd
ZddZ	ddZ
dddZddZddZ
dS)rz8A lexical analyzer class for simple shell-like syntaxes.NFcCst|trt|}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t|_d|_d|_d|_t|_d|_|sd}n|d
krd}||_|rt|_|j
d7_
|j
jtj|}|j
j||_
dS)N#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"\" rTz();<>|&z~-./*?=)
isinstancestrrinstreaminfilesysstdinposixeof
commenters	wordchars
whitespacewhitespace_splitquotesescape
escapedquotesstaterpushbacklinenodebugtoken	filestacksourcepunctuation_chars_pushback_chars	maketransdictfromkeys	translate)selfrrrr#tr+/usr/lib64/python3.6/shlex.py__init__sJ
zshlex.__init__cCs*|jdkrtdt||jj|dS)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)rprintreprr
appendleft)r)tokr+r+r,
push_tokenDs
zshlex.push_tokencCspt|trt|}|jj|j|j|jf||_||_d|_|jrl|dk	r\t	d|jfnt	d|jfdS)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file %szshlex: pushing to stream %s)
r
rrr!r0rrrrr.)r)	newstreamnewfiler+r+r,push_sourceJs
zshlex.push_sourcecCsD|jj|jj\|_|_|_|jr:td|j|jfd|_dS)zPop the input source stack.zshlex: popping to %s, line %drN)	rcloser!popleftrrrr.r)r)r+r+r,
pop_sourceXs
zshlex.pop_sourcecCs|jr.|jj}|jdkr*tdt||S|j}|jdk	r~x<||jkr||j|j}|rr|\}}|j|||j	}qBWx*||j
kr|js|j
S|j|j	}qW|jdkr||j
krtdt|ntd|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token Nz
shlex: token=zshlex: token=EOF)
rr7rr.r/
read_tokenr"
sourcehookr5	get_tokenrr!r8)r)r1rawspecr4r3r+r+r,r;as.




zshlex.get_tokencCsd}d}x\|jr$|jr$|jj}n|jjd}|dkrF|jd7_|jdkrbtd|j|f|jdkrvd|_	Pq|jdkr|sd|_Pqd||j
kr|jdkrtd	|j	s|jr|rPnqn||jkr|jj
|jd7_n|jo||jkrd
}||_n||jkr"||_	d
|_np||jkr<||_	d|_nV||jkr^|jsV||_	||_n4|jrt||_	d
|_n||_	|j	s|jr|rPnqq|j|jkr<d}|s|jdkrtd
td||jkr|js|j	|7_	d|_Pnd
|_n>|jr,||jkr,|j|jkr,|j}||_n|j	|7_	q|j|jkr|sl|jdkrdtdtd||jkr||jkr||kr|j	|j7_	|j	|7_	||_q|jdkr|sd|_Pq||j
kr|jdkrtdd|_|j	s|jr|rPnqq||jkrZ|jj
|jd7_|jrdd|_|j	sR|jr|rPnqq|jdkr||jkr|j	|7_	n ||j
kr|jj|d|_Pq|jr||jkr||_q|jr||jkrd
}||_q||jks||jks|jr|j	|7_	q|jr&|jj|n|jj||jdkrFtdd|_|j	s^|jr|rPqqqW|j	}d|_	|jr|r|dkrd}|jdkr|rtdt|ntd|S)NFrr
z&shlex: in state %r I see character: %rrz+shlex: I see whitespace in whitespace stateacTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped characterz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)rArB)r#r$poprreadrrr.rr rrrreadlinerrrr
ValueErrorrappendrr0r/)r)ZquotedZescapedstateZnextcharresultr+r+r,r9s









zshlex.read_tokencCsX|ddkr|dd}t|jtrJtjj|rJtjjtjj|j|}|t|dfS)z(Hook called on a filename to be sourced.rr
rr)	r
rrospathisabsjoindirnameopen)r)r4r+r+r,r:s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.Nz"%s", line %d: )rr)r)rrr+r+r,error_leaders
zshlex.error_leadercCs|S)Nr+)r)r+r+r,__iter__#szshlex.__iter__cCs|j}||jkrt|S)N)r;r
StopIteration)r)r r+r+r,__next__&s
zshlex.__next__)NNFF)N)NN)__name__
__module____qualname____doc__r-r2r5r8r;r9r:rQrRrTr+r+r+r,rs
.
	 	
FTcCs$t||d}d|_|sd|_t|S)N)rTr)rrrlist)sZcommentsrZlexr+r+r,r,s
z[^\w@%+=:,./-]cCs,|sdSt|dkr|Sd|jdddS)z1Return a shell-escaped version of the string *s*.z''N'z'"'"')_find_unsafereplace)rZr+r+r,r6s
cCs(x"|j}|sPtdt|qWdS)NzToken: )r;r.r/)ZlexerZttr+r+r,
_print_tokensBs
r^__main__r)FT)rXrKrercollectionsrior__all__rrcompileASCIIsearchr\rr^rUlenargvfnrPfr+r+r+r,<module>s&	





OHA YOOOO