ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/gsl/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/gsl/__pycache__/SpecNodes.cpython-311.pyc

�

�܋f�I�� �ddlTGd�d��ZGd�d��ZGd�d��ZGd�d	��ZGd
�de��ZGd�d
e��ZGd�de��ZGd�de��Z	Gd�d��Z
Gd�d��Zd�ZdS)�)�*c��eZdZd�ZdS)�
SpecObjectc��||_dS�N)�mod��selfrs  �f/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/guppy/gsl/SpecNodes.py�__init__zSpecObject.__init__(s
�������N��__name__�
__module__�__qualname__r�r
rrr's#����������r
rc�&�eZdZd�Zd�Zd�Zd�ZdS)�SpecEnvc�0�||_g|_g|_dSr)r�
unknown_nodes�filesr	s  rrzSpecEnv.__init__2s����������
�
�
r
c�d�td|j��|j�|��dS)N�add_unknown)�print�tagr�append�r
�nodes  r�
visit_defaultzSpecEnv.visit_default7s1��
�m�T�X�&�&�&���!�!�$�'�'�'�'�'r
c�x�td��t||��}|j�|��dS)N�
visit_file)r�FileEnvrr)r
r�files   rr!zSpecEnv.visit_file;s;��
�l�����t�T�"�"���
���$�����r
c�"�t|��fSr��
GuppyWorld�r
�envs  r�get_predefined_subjectszSpecEnv.get_predefined_subjects@s���3���!�!r
N)rrrrrr!r)rr
rrr1sP���������
(�(�(� � � �
"�"�"�"�"r
rc�@�eZdZd�Zd�Zd�Zd
d�Zd�Zd�Zd�Z	d	�Z
dS)r"c��|j}||_|jx|_|_i|_|�|��D]}||j|j<�t
|||j��}|�|��dSr)r�arg�name�filename�subjectsr)�Subject�children_accept)r
r(rr�sr#s      rrzFileEnv.__init__Es����g�����$(�H�,��	�D�M���
��,�,�T�2�2�	&�	&�A�$%�D�M�!�&�!�!��t�T�4�9�-�-�����T�"�"�"�"�"r
c�j�|j}|�||��}|�|��dSr)r,�find_subject�add_aspects�r
rr-�subjects    r�visit_aspects_ofzFileEnv.visit_aspects_ofQs8���x���#�#�D�$�/�/�����D�!�!�!�!�!r
c��||jvrD|�|d|z��|�|j|jd|z��dS||j|<dS)NzRedefinition of %r.zPrevious definition of %r.)r/�
error_noderr6s    r�def_subjectzFileEnv.def_subjectVsv���4�=� � ��O�O�D�"7�$�">�?�?�?��O�O�D�M�$�/�4�8�4�?�
A�
A�
A�
A�
A�#*�D�M�$���r
Nc���|j}|dz}t|j�d|�d���td|�|��z��td|z��t��dS)N��:z    %r�    %s)�indexrr.�get_line)r
r�msg�	exceptionr@�linenos      rr:zFileEnv.error_node^sm���
������
�$�-�-�-����0�1�1�1�
�h����u�-�-�-�.�.�.�
�h��n����
�����r
c�p�|j�|��}|�|�|d|z��|S)NzNo such subject: %r.)r/�getr:r6s    rr4zFileEnv.find_subjectfs;���-�#�#�D�)�)���?��O�O�D�"8�4�"?�@�@�@��r
c��	t|j��5}t|�����|���}ddd��n#1swxYwYn#t
$rd}YnwxYw|Sr)�openr.�list�	readlines�rstrip�	Exception)r
r@�f�texts    rrAzFileEnv.get_linels���	��d�m�$�$�
;���A�K�K�M�M�*�*�5�1�8�8�:�:��
;�
;�
;�
;�
;�
;�
;�
;�
;�
;�
;����
;�
;�
;�
;����	�	�	��D�D�D�	�����s4�A(�:A�A(�A � A(�#A �$A(�(A7�6A7c�r�|j�|��}|�t||��x}|j|<|Sr)r/rFr0)r
r-r7s   r�get_subjectzFileEnv.get_subjectts<���-�#�#�D�)�)���?�,3�D�$�,?�,?�?�G�d�m�D�)��r
c�P�|jdz|jz}|�|��S)Nz::)r-rrP)r
r(rr-s    r�get_aspect_subjectzFileEnv.get_aspect_subjectzs(���x��}�T�X�%������%�%�%r
r)rrrrr8r;r:r4rArPrRrr
rr"r"Ds�������
#�
#�
#�"�"�"�
*�*�*��������������&�&�&�&�&r
r"c� �eZdZd�Zd�Zd�ZdS)r0c�>�||_||_||_g|_dSr)r#rr-�aspects)r
r#rr-s    rrzSubject.__init__�s"����	���	���	�����r
c��|j�d��}|j}|�d��}|r9|r|j�|d��|dd����}|r2|j�||��}|�||��}n4t|j||��}|r|j�
|||��|j�|��|�
|��dS)N�_ofr>zBoth 'of' and '::'.r=)r�endswithr,�
startswithr#r:�stripr4�new_subject_ofr0r;rUrr1)r
r�ofr-�define�	ofsubjectr7s       rrzSubject.visit_default�s��
�X�
�
�u�
%�
%���x������%�%���	$��
B��	�$�$�T�+@�A�A�A�����8�>�>�#�#�D�
�	;��	�.�.�t�T�:�:�I��)�)�$�	�:�:�G�G��d�i��t�4�4�G��
;��	�%�%�d�D�'�:�:�:�����G�$�$�$����W�%�%�%�%�%r
c�t�|j}|dkrt|j||��St|j||��S)N�
aspects_of)r�	AspectsOfr#�	SubjectOf)r
rr\rs    rr[zSubject.new_subject_of�s<���h���,����T�Y��b�1�1�1��T�Y��b�1�1�1r
N)rrrrrr[rr
rr0r0sA���������&�&�&�&2�2�2�2�2r
r0c��eZdZd�Zd�ZdS)rac�0�||_||_g|_dSr�rr\rU�r
r#rr\s    rrzAspectsOf.__init__������	��������r
c�:�|j�|��dSr)r\rrs  rrzAspectsOf.visit_default�s������d�#�#�#�#�#r
N)rrrrrrr
rrara�s2���������
$�$�$�$�$r
rac��eZdZd�ZdS)rbc�0�||_||_g|_dSrrerfs    rrzSubjectOf.__init__�rgr
Nrrr
rrbrb�s#����������r
rbc��eZdZd�ZdS)r&c�>�||_d|_d|_g|_dS)NzGuppy World)r#r-rrUr's  rrzGuppyWorld.__init__�s"����	�!��	���	�����r
Nrrr
rr&r&�s#����������r
r&c��eZdZdZdd�Zd�Zd�Zdd	�Zdd
�Zdd�Z	dd�Z
dd
�Zd�Zd�Z
d�Zd�Zdd�Zd�Zd�Zdd�ZdS)�SpecNode)rr,�childrenr@�srcrrNc�f�||_||_t|��|_||_||_dSr)rr,�tupleror@rp�r
rr,ror@rps      rrzSpecNode.__init__�s/���������h����
���
�����r
c�P�|jj�d|j�d|j�d|j�d�S)N�(�,�))�	__class__rrr,ro�r
s r�__repr__zSpecNode.__repr__�s4���N�#�#�#�T�X�X�X�t�x�x�x�����H�	Hr
c��|jj�d|j�d|j�ddd�d�|jD����z�d�S)Nrurvz(%s)c�,�g|]}t|����Sr)�str)�.0�cs  r�
<listcomp>z$SpecNode.__str__.<locals>.<listcomp>�s��>�>�>�1��A���>�>�>r
rw)rxrrr,�joinrorys r�__str__zSpecNode.__str__�sW���N�#�#�#�T�X�X�X�t�x�x�x��c�h�h�>�>��
�>�>�>�?�?�@�@�@�B�	Br
�visit_c��|jr2td|jd|j��}|�||��|�||��dS�NrNr)r,rnr@�acceptr1)r
�visitor�prefixrs    r�
arg_acceptzSpecNode.arg_accept�sS���8�	)��F�D�H�b�$�*�=�=�D��K�K���(�(�(����W�f�-�-�-�-�-r
c��|�|j}|�|j}|�|j}|�|j}|�|j}|�|||||��Sr)rr,ror@rprxrss      r�copyz
SpecNode.copy�sY���;��(�C��;��(�C����}�H��=��J�E��;��(�C��~�~�c�3��%��=�=�=r
c�F�|jD]}|�||���dSr)ror�)r
r�r�rs    rr1zSpecNode.children_accept�s4����	&�	&�A�
�H�H�W�f�%�%�%�%�	&�	&r
c���t|||jzd��}|�Dt||dzd��}|�.d|�d|j�d|��}t|��t|���||��dS)N�defaultzaccept: unknown: z, z  in )�getattrrr�
ValueError)r
r�r��mrBs     rr�zSpecNode.accept�s}���G�f�T�X�o��5�5���9���&��"2�T�:�:�A��y�y��F�F�D�H�H�H�g�g�/���c�
�
�
� ��o�o�%�	��$�����r
c�D�|�|}|j�||��dSr)rp�error)r
rBrs   rr�zSpecNode.errors(���<��D�����s�D�!�!�!�!�!r
c���g}|jD]V}|jdkrI|�|j��|j�d��s|�d���Wd�|��S)zI Get the total text of all text children, joined with and ended with '
' rN�
�)rorrr,rXr�)r
rNrs   r�get_textzSpecNode.get_textsp������	&�	&�A��u�������A�E�"�"�"��u�~�~�d�+�+�&��K�K��%�%�%���w�w�t�}�}�r
c��|j���}|�d��r|dd����}|S)Nr>r=)r,rZrY)r
r,s  r�get_argzSpecNode.get_argsA���h�n�n�����>�>�#���	"��a�b�b�'�-�-�/�/�C��
r
c��|j}|�d��r
|dd�}d�|�d��D��}|dgkrg}|S)Nr>r=c�6�g|]}|�����Sr)rZ)r~�xs  rr�z(SpecNode.get_arglist.<locals>.<listcomp>s ��3�3�3�q������3�3�3r
rvr�)r,rY�split)r
r,�namess   r�get_arglistzSpecNode.get_arglists\���h���>�>�#���	��a�b�b�'�C�3�3�C�I�I�c�N�N�3�3�3���R�D�=�=��E��r
c��|jr>td|jd|j|j��g}|�|j��n|j}|Sr�)r,rnr@rp�extendro)r
ros  r�get_arg_childrenzSpecNode.get_arg_childrensM���8�	%� ����2�t�z�4�8�L�L�M�H��O�O�D�M�*�*�*�*��}�H��r
c�N�|j}|s|���}||jfSr)r,rZro)r
�nostripr,s   r�get_arg_restzSpecNode.get_arg_rest&s+���h���	��)�)�+�+�C��D�M�!�!r
c�f�|jrtd|z���|j���S)z_ Get the arg as by self.arg,
            but make sure there are no more children.
            z&No children nodes expected in node: %s)ro�SyntaxErrorr,rZrys r�get_arg_norestzSpecNode.get_arg_norest,s5���=�	O��F��M�N�N�N��x�~�~���r
c�t�|j���}d|vsd|vsd|vrtd|z���|S)z� Get the argument in the form of a name
            It is the argument stripped.
            And not allowed to contain : or , or new line.
        r�r>rvzInvalid name: %r)r,rZr�)r
r-s  r�get_nameargzSpecNode.get_namearg4sG��
�x�~�~�����4�<�<�3�$�;�;�#��+�+��0�4�7�8�8�8��r
Fc��	�|�|j}|ri�	�	fd�}ng�	�	fd�}g}|jD]�}|jdkrq|jD]h}|jr|j}n|�d|��|jr!|�d|jd��|jr||j||���i�~|jdd�dkr ||jdd�|j|����|�|����t|��t|j��kr|}n(|�||j||j|j��}|�	fS)	Nc�N��|�vr|�d|z��dS|�|<dS)NzDuplicate attribute: %s)r��r�attrr�attrss   �r�addattrz%SpecNode.split_attrs.<locals>.addattrDs7����%�<�<��J�J�8�4�?�@�@�@�@�@�!%�E�#�J�J�Jr
c�6����||f��dSr)rr�s   �rr�z%SpecNode.split_attrs.<locals>.addattrLs������c�4�[�)�)�)�)�)r
�withzBad attribute, no argument.z"Expected no children to attribute.r����=)	rror,r�r�lenrxr@rp)
r
r�attrdictr�ro�ch�optr,rr�s
         @r�split_attrszSpecNode.split_attrs>s�����;��(�C��	*��E�
&�
&�
&�
&�
&�
&��E�
*�
*�
*�
*�
*����-�	$�	$�B��v�����;�	3�	3�C��w�G�!�g����
�
�#@�#�F�F�F��|�S��
�
�@�#�,�q�/�S�S�S��w�3������c�2�2�2��	3��������#�#�����s��s��R�V�R�0�0�0�0�����#�#�#�#��x�=�=�C��
�.�.�.�.��D�D��>�>��T�X�x���T�X�?�?�D��U�{�r
�rrN)r�)NNNNNr�r)NF)rrr�	__slots__rrzr�r�r�r1r�r�r�r�r�r�r�r�r�r�rr
rrnrn�s7������8�I�����H�H�H�B�B�B�
.�.�.�.�>�>�>�>�&�&�&�&�
�
�
�
�"�"�"�"�
������������"�"�"�"� � � ����&�&�&�&�&�&r
rnc�*�eZdZd	d�Zd�Zd
d�Zd�ZdS)�SourceNr�
c��||_||_||_||_||_g|_||_d|_d|_dS)Nr)	r.�lines�stringr��debug�
error_reports�
max_errors�num_warnings�
num_errors)r
r-r�r�r�r�r�s       rrzSource.__init__hsG����
���
���������
����$����������r
c��d}d}|�pt|d��r|j}|j}n|}|}|�|j}|�|���}t|�d|dz�d���|rtd|z��dSdSdS)Nr�z<unknown file>r@)r@r>r=r?)�hasattrr@rpr.rAr)r
�context�linetextr.r@rps      r�errmsg_contextzSource.errmsg_contextss�����#�����w��(�(�
��
���k����������<���<�<�e�<�4�4���h�h�h��a����0�1�1�1��
+��h��)�*�*�*�*�*���
+�
+r
rc� �|j�|||||f��|r|xjdz
c_n|xjdz
c_|�|��|rtd|z��ntd|z��t��|D]:\}}|�|��td|z��t���;|jrddl}|���dS|j|j	krtd���|�|�dS)Nr=z*   %sz*** %sr?rzToo many errors, giving up)r�rr�r�r�rr��pdb�	set_tracer��
TooManyErrors)	r
�messager�rC�more�harmlessrB�ctxr�s	         rr�zSource.error�sA����!�!�
�g�y�$��9�	;�	;�	;��	!�����"�����O�O�q� �O�O����G�$�$�$��	&��(�W�$�%�%�%�%��(�W�$�%�%�%�
�����	�	�H�C������$�$�$��(�S�.�!�!�!��G�G�G�G��:�	 ��J�J�J��M�M�O�O�O�O�O���$�/�1�1�#�$@�A�A�A��$���%�$r
c�8�|j��|j�a|jrX	t|j��5}|���|_ddd��n#1swxYwYn#t
$rYdSwxYwdS|j�d��|_|j|S)Nr�r�)r�r�r.rH�readrLr�)r
r@rMs   rrAzSource.get_line�s����:���{�"��=��"�!�$�-�0�0�3�A�*+�&�&�(�(�D�K�3�3�3�3�3�3�3�3�3�3�3����3�3�3�3���$�"�"�"�!�r�r�"�����2���*�*�4�0�0�D�J��z�%� � s4�A�A�A�A�A�A�A�
A+�*A+)NNrrr�)NNrr)rrrrr�r�rArr
rr�r�gsZ������	�	�	�	�+�+�+�" � � � �:!�!�!�!�!r
r�c�z�eZdZdZdZdZd�Zd�Zd�Zd�Z	dd	�Z
dd�Zd�Zd
�Z
d�Zdd�Zd�Zd�Zd�Zd�Zd�ZdS)�_GLUECLAMP_)�nodemaprn)z_parent:DottedTreez_root:rez_root:os))r��	attribute)r�comment)�cond�	condition)�d�description)�dwh�description_with_header)�eg�example)�fop�function_operator)�iop�inplace_operator)�ka�key_arg)�op�operator)�rop�reverse_operator)�trNc�*�t|j��Sr��dict�node_aliases_defsrys r�_get_node_aliasesz_GLUECLAMP_._get_node_aliases�s���D�*�+�+�+r
c�>�td�|jD����S)Nc��g|]	\}}||f��
Srr)r~�k�vs   rr�z9_GLUECLAMP_._get_reverse_node_aliases.<locals>.<listcomp>�s ��?�?�?���1�a��V�?�?�?r
r�rys r�_get_reverse_node_aliasesz%_GLUECLAMP_._get_reverse_node_aliases�s"���?�?��(>�?�?�?�@�@�@r
c�Z�|j�td����jS)Nzu"[\u0080-\uffff]")�re�compile�eval�searchrys r�_get_is_not_asciiz_GLUECLAMP_._get_is_not_ascii�s"���w���t�$9�:�:�;�;�B�Br
c�"�t|��fSrr%rys rr)z#_GLUECLAMP_.get_predefined_subjects�s���4� � �"�"r
rc��t||���}|j�||��}d}|}|j���}|�|j|��}|j}	|�|||||	|��S)N)r-r�r#)	r��
DottedTree�
parse_filerrZ�nodes_of_dforestror@�
node_of_tatci)
r
r#r�rp�dtreerr,rNror@s
          r�node_of_filez_GLUECLAMP_.node_of_file�s����$��0�0�0����*�*�4��5�5�������y��� � ���(�(����=�=������!�!�#�s�D�(�E�3�G�G�Gr
�<string>c��|j�|��}d}|}t|||���}|j���}|j}	|�|j|��}
|�||||
|	|��S)Nr�)r-r�r�)	r�parse_stringr�rrZr@rror)r
r�r-r�rrr,rprNr@ros           r�node_of_stringz_GLUECLAMP_.node_of_string�s�����,�,�V�4�4�������$�v�w�?�?�?���y��� � ������(�(����=�=���!�!�#�s�D�(�E�3�G�G�Gr
c�X�|j}|�d��}|dkrt|��}|�dd|��}|�dd|��}|dkrK|dks||kr?|d|����dz||dzd����}}nu|dkrFd|d|�vs%|t|�����kr|}ntd|z���|d|����||dzd�}}||jvr
|j|}|�dd	��}|d
kr|js|���}|�	|j
|��}|�||||j|��S)Nr�r�r�rr>r=� z!No colon in spaced tag in node %s�_rN)
r�findr�rZrKr��node_aliases�replacer�rro�node_of_tacir@)	r
rrpr�textpos�equpos�colonposr,ros	         r�
node_of_dtreez_GLUECLAMP_.node_of_dtree�s����i���(�(�4�.�.���b�=�=��#�h�h�G����#�q�'�*�*���8�8�C��G�,�,���R�<�<�X��^�^�v��/@�/@��G�V�G��*�*�,�,�S�0��F�1�H�I�I��,�,�.�.��C�C��2�~�~��c�(�7�(�m�+�+�w�#�c�j�j�l�l�:K�:K�/K�/K�&�H�H�%�;�e�C�E�E�E��I�X�I��,�,�.�.��H�Q�J�K�K�(��C��$�#�#�#��#�C�(�C��k�k�#�s�#�#���&�=�=���=��)�)�+�+�C��(�(����=�=��� � ��c�8�U�[�#�F�F�Fr
c������fd�|D��}g}|D]�}|jdkr|�|���#|j���}�jj��jj��j��|��}��	|�j
���}|�|j����t|��S)Nc�<��g|]}��|�����Sr)r)r~rr
rps  ��rr�z0_GLUECLAMP_.nodes_of_dforest.<locals>.<listcomp>s)���>�>�>��$�$�$�Q��,�,�>�>�>r
�include)r�)rrr,rZ�os�pathr��dirnamer.rr�r�rorr)r
�dforestrp�onodes�nodesrr.s` `    rrz_GLUECLAMP_.nodes_of_dforests�����>�>�>�>�>�g�>�>�>�����	(�	(�D��x�9�$�$����T�"�"�"���x�~�~�'�'�H��w�|�(�(����)=�)=�c�l�)K�)K�)1�3�3�H��$�$�X�s�{�$�C�C�D��L�L���'�'�'�'��U�|�|�r
c��tSr)rnrys r�_get_node_of_taciz_GLUECLAMP_._get_node_of_taci"s���r
rNc��|r1|dkr|r	|dz|z}n |}n|�d|d||��f|z}|�|||||��S)NrNr�r)r)r
rr,rNror@rps       rrz_GLUECLAMP_.node_of_tatci%s{���	?��f�}�}�����*�t�+�C�C��C�C� �-�-��D�"�e�S�2�2�4�6>�?��� � ��c�8�U�C�@�@�@r
c��|�|��}t|��dkr|dS|�dd|��S)Nr=r�blockr�)�
nodes_of_textr�r)r
rNrs   r�node_of_textz_GLUECLAMP_.node_of_text1sG���"�"�4�(�(���u�:�:��?�?���8�O��$�$�W�b�%�8�8�8r
c	�T�g}|�|��r�g}|D]�}t|��}|dkr|�|���-|r>|�|�dd�|������g}|�|�dt|��������|r<|�|�dd�|������n)|�|�d|����|S)N�rNr��char)�is_not_ascii�ordrrr�r})r
rNr�charsr(�nos      rr$z_GLUECLAMP_.nodes_of_text=s�������T�"�"�	:��E��
E�
E����Y�Y����8�8��L�L��&�&�&�&��#����T�%6�%6�v�r�w�w�u�~�~�%N�%N�O�O�O� "���L�L��!2�!2�6�3�r�7�7�!C�!C�D�D�D�D��
H����T�.�.�v�r�w�w�u�~�~�F�F�G�G�G���L�L��*�*�6�4�8�8�9�9�9��r
c��|j}|jj�|jj�|jj�t����d��}|jj�|d��}|jj�|��std|z��dS|�	|��}|�
|��}|�|��dS)Nz../../specszdocexample.gslz %s does not exist, skipping test)�_rootrrr�r�realpath�__file__�existsrrrr�)r
�root�specdir�main_dt_namer(rs      r�mainz_GLUECLAMP_.mainQs����z���'�,�#�#��G�L� � ����!6�!6�x�!@�!@�A�A������w�|�(�(��2B�C�C���w�|�"�"�<�0�0�	��4�|�C�D�D�D��F��l�l�4� � ��� � ��.�.�����C�����r
c�.�|���dSr)�	print_doc)r
�dts  rr7z_GLUECLAMP_.print_docas���������r
c�h�|}|r|dz|z}|r|dz|z}|j�||��}|S)Nz: r�)r�unparse_tag)r
�levelrr,rN�heads      r�unparse_headz_GLUECLAMP_.unparse_headdsO�����	%��$�;��$�D��	&��$�;��%�D��o�)�)�%��6�6���
r
r�)rrr�)rrr�	_chgable_�	_imports_r�r�r�r�r)rr
rrr rr%r$r5r7r=rr
rr�r��s-������%�I��I�
��,�,�,�A�A�A�C�C�C�#�#�#�H�H�H�H�H�H�H�H�G�G�G�<������
A�
A�
A�
A�
9�
9�
9����(��� �������r
r�c�l�ddlm}|��}|jjj���dS)Nr)�Root)�guppyrA�gsl�	SpecNodesr5)rAr2s  r�	test_mainrEns>���������4�6�6�D��J�N��!�!�#�#�#�#�#r
N)
�guppy.gsl.Exceptionsrrr"r0rarbr&�objectrnr�r�rErr
r�<module>rHs���H#�"�"�"���������"�"�"�"�"�"�"�"�&8&�8&�8&�8&�8&�8&�8&�8&�v2�2�2�2�2�2�2�2�D$�$�$�$�$��$�$�$�������������������0Z�Z�Z�Z�Z�v�Z�Z�Z�zF!�F!�F!�F!�F!�F!�F!�F!�R{�{�{�{�{�{�{�{�|$�$�$�$�$r

Zerion Mini Shell 1.0