AlkantarClanX12

Your IP : 18.226.214.91


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/shlex.cpython-312.opt-1.pyc

�

�Q�f)4���dZddlZddlZddlZddlmZddlmZgd�ZGd�d�Z	dd�Z
d	�Zejd
ej�jZd�Zd�Zed
k(rSeej(�dk(ree	��yej(dZee�5Zee	ee��ddd�yy#1swYyxYw)�8A lexical analyzer class for simple shell-like syntaxes.�N)�deque)�StringIO)�shlex�split�quote�joinc�f�eZdZdZ		dd�Zed��Zd�Zdd�Zd�Z	d�Z
d	�Zd
�Zdd�Z
d�Zd
�Zy)rrNc��t|t�rt|�}|�||_||_nt
j|_d|_||_|rd|_nd|_d|_	d|_
|jr|xjdz
c_
d|_d|_d|_
d|_d	|_d
|_t#�|_d|_d|_d|_t#�|_d|_|sd}n|d
urd}||_|rst#�|_|xjdz
c_
|jj5t6j9|��}|jj;|�|_
yy)N��#�?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�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)�selfrrr�punctuation_chars�ts      �,/opt/alt/python312/lib64/python3.12/shlex.py�__init__zshlex.__init__sN���h��$���)�H���$�D�M� �D�K��I�I�D�M��D�K���
���D�H��D�H����B����:�:��N�N� ^�
_�N�#��� %��������� �����
����
������
���
�������� � "��
�$�
&� )��"3����#(�7�D� ��N�N�i�'�N����(�(����7H�)I�J�A�!�^�^�5�5�a�8�D�N��c��|jS�N)r)�r/s r2r0zshlex.punctuation_charsDs���&�&�&r4c��|jdk\rtdt|�z�|jj	|�y)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)r%�print�reprr#�
appendleft)r/�toks  r2�
push_tokenzshlex.push_tokenHs1���:�:��?��)�D��I�5�6��
�
� � ��%r4c�\�t|t�rt|�}|jj	|j
|j|jf�||_||_d|_|jr4|�td|j
���ytd|j���yy)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file zshlex: pushing to stream )
rrrr'r;rrr$r%r9)r/�	newstream�newfiles   r2�push_sourcezshlex.push_sourceNs����i��%� ��+�I����!�!�4�;�;��
�
�t�{�{�"K�L����!��
�����:�:��"��T�[�[�B�C��t�}�}�F�G�	r4c��|jj�|jj�\|_|_|_|jr$td|j|j
fz�d|_y)zPop the input source stack.zshlex: popping to %s, line %drN)	r�closer'�popleftrr$r%r9r"r7s r2�
pop_sourcezshlex.pop_source\s_���
�
����48�N�N�4J�4J�4L�1���d�m�T�[��:�:��1��]�]�D�K�K�0�1�
2���
r4c���|jrB|jj�}|jdk\rtdt	|�z�|S|j�}|j�g||jk(rX|j|j��}|r|\}}|j||�|j�}||jk(r�X||jk(rH|js|jS|j�|j�}||jk(r�H|jdk\r3||jk7rtdt	|�z�|Std�|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token z
shlex: token=zshlex: token=EOF)
r#rDr%r9r:�
read_tokenr(�
sourcehookrA�	get_tokenrr'rE)r/r<�raw�specr@r?s      r2rIzshlex.get_tokenes+���=�=��-�-�'�'�)�C��z�z�Q���-��S�	�9�:��J��o�o����;�;�"�����$����t���'8�9���+/�(�W�i��$�$�Y��8��n�n�&������$��T�X�X�o��>�>��x�x�����!��n�n�&���T�X�X�o��:�:��?��d�h�h���o��S�	�1�2��
��(�)��
r4c��d}d}	|jr'|jr|jj�}n|jj	d�}|dk(r|xj
dz
c_|jdk\rtd|j�d|���|j�	d	|_	�n<|jdk(�r\|s	d|_�n!||jvr8|jd
k\rtd�|js|jr|r�nݐ�	||jvr1|jj�|xj
dz
c_�n�|jr||jvrd}||_�nu||jvr||_	d|_�nW||jvr||_	d
|_�n9||j vr|js||_	||_�n|j"r||_	d|_�n�||_	|js|jr|r�nҐ�|j|j vr�d}|s%|jd
k\rtd�t%d��||jk(r3|js|xj|z
c_	d|_�nVd|_�nK|jr;||jvr-|j|j&vr|j}||_�n|xj|z
c_	�n�|j|jvr�|s%|jd
k\rtd�t%d��||j vr3||jk7r$||k7r|xj|jz
c_	|xj|z
c_	||_�nO|jdv�r@|s	d|_�n7||jvr?|jd
k\rtd�d|_|js|jr|r�n���||jvra|jj�|xj
dz
c_|j�r�d|_|js|jr|r�n}��i|jd
k(rW||jvr|xj|z
c_	�nE||jvr|jj)|�d|_�n|jr||j vr||_n�|jr||jvr
d}||_n�||jvs(||j vs|j"r$||jvr|xj|z
c_	n�|jr|jj)|�n|j*j-|�|jd
k\rtd�d|_|js|jr|rn�����|j}d	|_	|jr	|s|d	k(rd}|jdkDr&|rtdt/|�z�|Std�|S)NFrTr�
�zshlex: in state z I see character: r�z+shlex: I see whitespace in whitespace state�a�cz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rPrQz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r0r*�popr�readr$r%r9r"r&rrr�readliner rrr�
ValueErrorr!�appendr#r;r:)r/�quoted�escapedstate�nextchar�results     r2rGzshlex.read_token�s	��������%�%�$�*>�*>��/�/�3�3�5���=�=�-�-�a�0���4�����q� ���z�z�Q���$�*�*�BJ�L�M��z�z�!���
�����s�"��!%�D�J������0��z�z�Q���K�L��z�z�d�j�j�V�� �����0��M�M�*�*�,��K�K�1�$�K��Z�Z�H����$;�#&�L�!)�D�J�����/�!)�D�J�!$�D�J���!7�!7�7�!)�D�J�!$�D�J�����,��:�:�%-��
�!)�D�J��*�*�!)�D�J�!$�D�J�!)�D�J��z�z�d�j�j�V�� ����t�{�{�*�����z�z�Q���@�A�$�%;�<�<��t�z�z�)��:�:��
�
�h�.�
�%(��
��%(��
��j�j�X����%<�����+�+�B,�#'�:�:�L�!)�D�J��J�J�(�*�J����t�{�{�*���z�z�Q���@�A�$�%;�<�<�!�D�K�K�/� �D�J�J�.�8�|�3K��J�J�$�*�*�,�J��
�
�h�&�
�)��
����z�)��!%�D�J������0��z�z�Q���E�F�!$�D�J��z�z�d�j�j�V�� �����0��M�M�*�*�,��K�K�1�$�K��z�z�%(��
��:�:�$�*�*��!�$��Z�Z�3�&��4�#9�#9�9��
�
�h�.�
�#�4�?�?�:� �0�0�7�7��A�%(��
���Z�Z�H����$;�!)�D�J��Z�Z�H����$;�#&�L�!)�D�J��$�.�.�0�H����4K��/�/�"�$�*@�*@�@��J�J�(�*�J��-�-��,�,�3�3�H�=��
�
�0�0��:��z�z�Q���F�G�!$�D�J��z�z�d�j�j�V�� �G�H������
��:�:�f��2���F��:�:��>���)�D��L�8�9��
��,�-��
r4c�8�|ddk(r|dd}t|jt�rftjj|�sGtjj
tjj|j�|�}|t|d�fS)z(Hook called on a filename to be sourced.rrr����r)	rrr�os�path�isabsr	�dirname�open)r/r@s  r2rHzshlex.sourcehooksm���1�:����a��m�G��d�k�k�3�'����
�
�g�0F��g�g�l�l�2�7�7�?�?�4�;�;�#?��I�G���g�s�+�,�,r4c�H�|�|j}|�|j}d||fzS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.z"%s", line %d: )rr$)r/rr$s   r2�error_leaderzshlex.error_leader s.���>��[�[�F��>��[�[�F�"�f�f�%5�5�5r4c��|Sr6�r7s r2�__iter__zshlex.__iter__(s���r4c�P�|j�}||jk(rt�|Sr6)rIr�
StopIteration)r/r&s  r2�__next__zshlex.__next__+s%����� ���D�H�H�����r4)NNFFr6)NN)�__name__�
__module__�__qualname__�__doc__r3�propertyr0r=rArErIrGrHrdrgrjrfr4r2rrsV��>�9>�#(�-9�^�'��'�&�H���@P�d-�6��r4rc�l�|�td��t||��}d|_|sd|_t	|�S)z-Split the string *s* using shell-like syntax.zs argument must not be None)rTr)rUrrr�list)�s�commentsr�lexs    r2rr1s;���y��6�7�7�
���
�C��C��������9�r4c�2�djd�|D��S)z3Return a shell-escaped string from *split_command*.rc3�2K�|]}t|����y�wr6)r)�.0�args  r2�	<genexpr>zjoin.<locals>.<genexpr>>s����8�-�3�E�#�J�-�s�)r	)�
split_commands r2r	r	<s���8�8�8�-�8�8�8r4z[^\w@%+=:,./-]c�R�|syt|��|Sd|jdd�zdzS)z1Return a shell-escaped version of the string *s*.z''�'z'"'"')�_find_unsafe�replace)rrs r2rrCs4�����A���������3�	�*�*�S�0�0r4c�~�|j�x}r+tdt|�z�|j�x}r�*yy)NzToken: )rIr9r:)�lexer�tts  r2�
_print_tokensr�Os9�����!�
!�"�
!�
�i�$�r�(�"�#����!�
!�"�
!r4�__main__r)FT)rnr^�rer�collectionsr�ior�__all__rrr	�compile�ASCII�searchr}rr�rk�len�argv�fnrb�frfr4r2�<module>r�s���>�
�	�
���
-��\�\�|�9�
�r�z�z�+�R�X�X�6�=�=��	1�$��z��
�3�8�8�}����e�g��
�X�X�a�[��
�"�X���%��2�,�'��X��
�X�s�B6�6B?