�
|�e� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ g d�Z G d� de� Z
G d � d
e� ZdZdZ
G d
� de� Zy)z�
pygments.formatters.other
~~~~~~~~~~~~~~~~~~~~~~~~~
Other formatters: NullFormatter, RawTokenFormatter.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
� )� Formatter)�get_choice_opt)�Token)�colorize)�
NullFormatter�RawTokenFormatter�TestcaseFormatterc �( � e Zd ZdZdZddgZdgZd� Zy)r z;
Output the text unchanged without any formatting.
z Text only�text�nullz*.txtc � � | j }|D ]9 \ }}|r!|j |j |� � �)|j |� �; y �N)�encoding�write�encode)�self�tokensource�outfile�enc�ttype�values �;/usr/lib/python3/dist-packages/pygments/formatters/other.py�formatzNullFormatter.format sB � ��m�m��'� %�L�E�5���
�
�e�l�l�3�/�0��
�
�e�$� %� N)�__name__�
__module__�__qualname__�__doc__�name�aliases� filenamesr � r r r r s$ � �� �D��v��G�� �I�%r r c �2 � e Zd ZdZdZddgZdgZdZd� Zd� Z y )
r a}
Format tokens as a raw representation for storing token streams.
The format is ``tokentype<TAB>repr(tokenstring)\n``. The output can later
be converted to a token stream with the `RawTokenLexer`, described in the
:doc:`lexer list <lexers>`.
Only two options are accepted:
`compress`
If set to ``'gz'`` or ``'bz2'``, compress the output with the given
compression algorithm after encoding (default: ``''``).
`error_color`
If set to a color name, highlight error tokens using that color. If
set but with no value, defaults to ``'red'``.
.. versionadded:: 0.11
z
Raw tokens�raw�tokensz*.rawFc �R � t j | fi |�� d| _ t |dg d�d� | _ |j dd � | _ | j du rd| _ | j � t | j d� y y # t $ r t d| j z � �w xY w) N�ascii�compress)� �none�gz�bz2r) �error_colorT�redzInvalid color %r specified)
r �__init__r r r( �getr- r �KeyError�
ValueError�r �optionss r r/ zRawTokenFormatter.__init__> |