%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/pygments/formatters/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/pygments/formatters/__pycache__/groff.cpython-312.pyc

�

|�e���H�dZddlZddlmZddlmZmZdgZGd�de�Zy)z�
    pygments.formatters.groff
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Formatter for groff output.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�	Formatter)�get_bool_opt�get_int_opt�GroffFormatterc�J�eZdZdZdZgd�ZgZd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
y)ra
    Format tokens with groff escapes to change their color and font style.

    .. versionadded:: 2.11

    Additional options accepted:

    `style`
        The style to use, can be a string or a Style subclass (default:
        ``'default'``).

    `monospaced`
        If set to true, monospace font will be used (default: ``true``).

    `linenos`
        If set to true, print the line numbers (default: ``false``).

    `wrap`
        Wrap lines to the specified number of characters. Disabled if set to 0
        (default: ``0``).
    �groff)r�troff�roffc���tj|fi|��t|dd�|_t|dd�|_d|_t
|dd�|_d|_i|_	|j�y)N�
monospacedT�linenosFr�wrap)r�__init__rrr
�_linenorr�_linelen�styles�_make_styles)�self�optionss  �;/usr/lib/python3/dist-packages/pygments/formatters/groff.pyrzGroffFormatter.__init__-sf�����4�+�7�+�&�w��d�C���#�G�Y��>����������3��	���
��������c�F�|jrdnd}|jrdnd}|jrdnd}|jD]b\}}dx}}|dr|d	|dzz
}d
|z}|dr
||z
}||z}|dr
||z
}||z}|d
r|d|d
zz
}d|z}||f|j|<�dy)Nz\f[CR]z\f[R]z\f[CB]z\f[B]z\f[CI]z\f[I]��colorz\m[%s]z\m[]�bold�italic�bgcolorz\M[%s]z\M[])r�styler)r�regularrr�ttype�ndef�start�ends        rrzGroffFormatter._make_styles:s���#���)�H�� �O�O�y���"�o�o��8���:�:�	,�K�E�4���E�C��G�}���T�'�]�2�2����m���F�|���
����m���H�~�������m���I����T�)�_�4�4����m��!&���D�K�K���	,rc���t�}|jD]\}}|d��|j|d��!t|�D]}|j	d|zdz|zdz��!y)Nrz
.defcolor z rgb #�
)�setr�add�sorted�write)r�outfile�colors�_r!rs      r�_define_colorszGroffFormatter._define_colorsQsq������z�z�	*�G�A�t��G�}�(��
�
�4��=�)�	*��F�^�	J�E��M�M�,��.��9�E�A�D�H�I�	Jrc��|xjdz
c_|jd|jdk7xrdxsd|jfz�y)N�z%s% 4d r%r)rr))rr*s  r�
_write_linenozGroffFormatter._write_lineno[s=���������
�
�i�4�<�<�1�#4�#=��#C��T�\�\�"R�R�Src�&�t|jd��}|jrdnd}d}||jkDr�t	dtj||jz��D]9}|||jz||jz|jz}||dz|zz
}�;||jz}|dkDr|||dz
dz
}||_|S|j|z|jkDrd|z|z}||_|S|}|xj|z
c_|S)Nr%z     rrr/)�len�rstripr
r�range�math�floorr)r�line�length�space�newline�i�chunk�	remainders        r�
_wrap_linezGroffFormatter._wrap_line`s���T�[�[��&�'���<�<��R�����D�I�I���1�d�j�j��$�)�)�);�<�=�
2���Q�t�y�y�[��4�9�9��T�Y�Y�)>�?���E�D�L�5�0�1��
2�����*�I��1�}��4��
�1��
�.�.�� )��
����]�]�V�
#�d�i�i�
/��e�|�t�+�G�"�D�M�
���G��M�M�V�#�M��rc��|jdd�jdd�jdd�jdd�jd	d
�}|}|D]�}t|�t|j��k7s�)|jd�j�ddjd
d�j	�}|j|d|ddzdz�}��|S)N�\z\[u005C]�.z	\[char46]�'z\[u0027]�`z\[u0060]�~z\[u007E]�unicode_escaper/�x�u00z\[u�])�replacer2�encode�decode�upper)r�text�copy�char�unis     r�
_escape_charszGroffFormatter._escape_charsws����|�|�D�+�.��G�C��.��G�D�+�.��G�C��-��G�C��-�		
�
���	B�D��4�y�C����
�.�.��k�k�"2�3��V�X�a�b�"��W�S�%�(��U�W���|�|�D�&�3�q�r�7�*:�S�*@�A��
	B��rc	�4�|j|�|jd�|jr|j|�|D�]B\}}||jvr|j
}||jvr�|j|\}}|j
d�D]�}|jdkDr|j|�}|rK|rI|j|jd��}|dk7rS|jdj|||f��n/|j|j|jd���|jd�s��|jr|j|�d|_
��|jd�d|_
����E|jd�y)Nz.nf
\f[CR]
Trr%rz
.fi)r-r)r
r0r�parent�
splitlinesrr>rQr3�join�endswithr)	r�tokensourcer*r �valuer"r#r7rMs	         r�format_unencodedzGroffFormatter.format_unencoded�sW�����G�$��
�
�&�'��<�<����w�'�'�	*�L�E�5��t�{�{�*������t�{�{�*����U�+�J�E�3��(�(��.�
*���9�9�q�=��?�?�4�0�D��S��-�-�d�k�k�$�.?�@�D��r�z��
�
�b�g�g�u�d�C�.@�&A�B��M�M�$�"4�"4�T�[�[��5F�"G�H��=�=��&��|�|��*�*�7�3�()��
��
�
�d�+�()��
�#
*�	*�0	�
�
�g�rN)�__name__�
__module__�__qualname__�__doc__�name�aliases�	filenamesrrr-r0r>rQrY�rrrrs=���,�D�&�G��I�
�,�.J�T�
�.�& r)	r]r5�pygments.formatterr�
pygments.utilrr�__all__rrarr�<module>res+����(�3��
��X�Y�Xr

Zerion Mini Shell 1.0