HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/argcomplete/__pycache__/my_shlex.cpython-39.opt-1.pyc
a

��]�3�@s�dZddlZddlZddlmZzddlmZWneyNddlmZYn0zeWne	yne
ZYn0Gdd�d�ZdS)�8A lexical analyzer class for simple shell-like syntaxes.�N)�deque)�StringIOc@sjeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
ddd�Zdd�Zdd�Z
e
ZdS)�shlexrNFcCst|t�rt|�}|dur(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
d|_d|_d|_
d|_d|_d	|_t�|_d
|_d|_d|_t�|_d|_|s�d}n|dur�d
}||_|r�t�|_|j
d7_
|j
�t�|��}|j
�|�|_
d|_d|_dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_z 	
Fz'"�\�"� �rTz();<>|&z~-./*?=) �
isinstance�
basestringr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate�last_wordbreak_pos�
wordbreaks)�selfrrrr"�t�r,�8/usr/lib/python3.9/site-packages/argcomplete/my_shlex.py�__init__"sJ
zshlex.__init__cCs*|jdkrtdt|��|j�|�dS)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)r�print�reprr�
appendleft)r*�tokr,r,r-�
push_tokenWs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dur\t	d|jf�nt	d|jf�dS)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file %szshlex: pushing to stream %s)
rr
rr r1rrrrr/)r*�	newstream�newfiler,r,r-�push_source]s
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)zPop the input source stack.zshlex: popping to %s, line %dr
N)	r�closer �popleftrrrr/r�r*r,r,r-�
pop_sourcels

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdurz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token Nz
shlex: token=zshlex: token=EOF)
rr8rr/r0�
read_tokenr!�
sourcehookr6�	get_tokenrr r:)r*r2�raw�specr5r4r,r,r-r=us.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdurtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
vr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jvr�|j�
�|jd7_n�|j�r||jv�rd
}||_n�||jv�r&||_	d
|_nr||jv�r@||_	d|_nX||jv�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jv�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jv�r4|j|jv�r4|j}||_n|j	|7_	q|j|jv�r�|�st|jdk�rltd�td��||jv�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdvr|�s�d|_�q�q||j
v�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jv�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|j�r�||jv�r�||_q|j�r�||jv�r�d
}||_q|jdk�r�||jv�r�|j	|7_	n"||j
v�r�|j�|�d|_�q�q||jv�s||jv�s|j�r<|j	|7_	||jv�r�t|j	�d|_q|j�rR|j�|�n|j�|�|jdk�rrtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|jdk�r�d|_|S)NFr
r�
�z&shlex: in state %r I see character: %rr�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rCrDz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r"r#�popr�readrrr/rrrrr�readlinerrrr�
ValueErrorr�appendr)�lenr(rr1r0)r*ZquotedZescapedstateZnextchar�resultr,r,r-r;�s
�




���

�zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)z(Hook called on a filename to be sourced.rr	r����r)	rrr
�os�path�isabs�join�dirname�open)r*r5r,r,r-r<,s
zshlex.sourcehookcCs(|dur|j}|dur|j}d||fS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.Nz"%s", line %d: )rr)r*rrr,r,r-�error_leader6s
zshlex.error_leadercCs|S�Nr,r9r,r,r-�__iter__>szshlex.__iter__cCs|��}||jkrt�|SrU)r=r�
StopIteration)r*rr,r,r-�__next__As
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__�__doc__r.r3r6r:r=r;r<rTrVrX�nextr,r,r,r-r s�
5
	 

r)r\rNr�collectionsrr�ImportError�ior
�	NameError�strrr,r,r,r-�<module>s