File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/guppy/gsl/__pycache__/Gsml.cpython-311.pyc
�
    � h�
  �                   �:   �  G d � d�  �        Z  G d� d�  �        ZdS )c                   �D   � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z	d� Z
d	� Zd
S )�GsmlHandlerc                 �2  � | j         �                    | j        �  �         g | _        |rng }|D ]3\  }}|�                    | j        �                    ||�  �        �  �         �4| j        �                    | j        �                    dd|�  �        �  �         d S d S )N�with� )�stack�append�out�mod�node_of_taci)�self�tag�attrs�at�k�vs         �C/opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/gsl/Gsml.py�handle_starttagzGsmlHandler.handle_starttag   s�   � ��
���$�(�#�#�#����� 	C��B�� 
7� 
7���1��	�	�$�(�/�/��1�5�5�6�6�6�6��H�O�O�D�H�1�1�&�"�b�A�A�B�B�B�B�B�		C� 	C�    c                 �   � | j         �                    |d| j        �  �        }| j        �                    �   �         | _        | j        �                    |�  �         d S )Nr   )r
   r   r	   r   �popr   )r   r
   �nodes      r   �
handle_endtagzGsmlHandler.handle_endtag
   sJ   � ��x�$�$�S�"�d�h�7�7���:�>�>�#�#������������r   c                 �N  � |d d�         dk    rt          |dd �         d�  �        }d|z   }nt          |�  �        }d|cxk    rdk     r)n n&t          |�  �        }| �                    |�  �         d S | j        �                    | j        �                    d|�  �        �  �         d S )N�   �x�   �0�    �   �char)�int�chr�handle_datar	   r   r
   r   )r   �namer    s      r   �handle_charrefzGsmlHandler.handle_charref   s�   � �����8�s�?�?��t�A�B�B�x��$�$�D��t�8�D�D��t�9�9�D���?�?�?�?�s�?�?�?�?�?��t�9�9�D����T�"�"�"�"�"��H�O�O�D�H�1�1�&�$�?�?�@�@�@�@�@r   c                 �   � || j         j        vr| �                    |�  �         | j        �                    | j         �                    d|�  �        �  �         d S )Nr    )r
   �
entitydefs�unknown_entityrefr	   r   r   �r   r$   s     r   �handle_entityrefzGsmlHandler.handle_entityref   sR   � ��t�x�*�*�*��"�"�4�(�(�(�������-�-�f�d�;�;�<�<�<�<�<r   c                 �&