o
    ůh                     @   s*  d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZmZ ddlmZ ddlmZ dgZi edededejd	ed
ejd	e
jdejd	ejdejdejdejd	ejdejdejdejd	ejdede	d
ej dej!dej"dej#dej$dejdedi	Z%G dd deZ&dS )z
    pygments.formatters.terminal
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Formatter for terminal output with ANSI sequences.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    )	Formatter)
KeywordNameCommentStringErrorNumberOperatorGenericToken
Whitespace)
ansiformat)get_choice_optTerminalFormatter) r   )graybrightblack)cyan
brightcyan)blue
brightblue)magentabrightmagenta)greenbrightgreen)_cyan__brightcyan_)_green__brightgreen_)r   r   )red	brightred)r   r   )yellowr!   )r    r    )**r"   )z	*magenta*z*brightmagenta*)_brightred_r#   c                   @   sH   e Zd ZdZdZddgZg Zdd Zdd Zd	d
 Z	dd Z
dd ZdS )r   a  
    Format tokens with ANSI color sequences, for output in a text console.
    Color sequences are terminated at newlines, so that paging the output
    works correctly.

    The `get_style_defs()` method doesn't do anything special since there is
    no support for common styles.

    Options accepted:

    `bg`
        Set to ``"light"`` or ``"dark"`` depending on the terminal's background
        (default: ``"light"``).

    `colorscheme`
        A dictionary mapping token types to (lightbg, darkbg) color names or
        ``None`` (default: ``None`` = use builtin colorscheme).

    `linenos`
        Set to ``True`` to have line numbers on the terminal output as well
        (default: ``False`` = no line numbers).
    Terminalterminalconsolec                 K   sT   t j| fi | t|dddgddk| _|dd pt| _|dd| _d| _d S )NbglightdarkcolorschemelinenosFr   )	r   __init__r   darkbggetTERMINAL_COLORSr*   r+   _lineno)selfoptions r3   Y/var/www/Befach/backend/venv/lib/python3.10/site-packages/pygments/formatters/terminal.pyr,   S   s   
zTerminalFormatter.__init__c                 C   s   t | ||S N)r   format)r1   tokensourceoutfiler3   r3   r4   r6   [   s   zTerminalFormatter.formatc                 C   s4   |  j d7  _ |d| j dkrdpd| j f  d S )N   z%s%04d: 
r   )r0   write)r1   r8   r3   r3   r4   _write_lineno^   s   &zTerminalFormatter._write_linenoc                 C   s8   | j |}|d u r|j}| j |}|d u s
|| j S r5   )r*   r.   parentr-   )r1   ttypecolorsr3   r3   r4   
_get_colorb   s   
zTerminalFormatter._get_colorc              	   C   s   | j r| | |D ]:\}}| |}|dD ]+}|r(|t||d n||d |drC| j r>| | q|d qq
| j rO|d d S d S )NTr:   )r+   r<   r@   
splitlinesr;   r   rstripendswith)r1   r7   r8   r>   valuecolorliner3   r3   r4   format_unencodedl   s"   



z"TerminalFormatter.format_unencodedN)__name__
__module____qualname____doc__namealiases	filenamesr,   r6   r<   r@   rG   r3   r3   r3   r4   r   8   s    
N)'rK   pygments.formatterr   pygments.tokenr   r   r   r   r   r   r	   r
   r   r   pygments.consoler   pygments.utilr   __all__PreprocTypeWordBuiltinFunction	NamespaceClass	Exception	DecoratorVariableConstant	AttributeTagDeletedInsertedHeading
SubheadingPromptr/   r   r3   r3   r3   r4   <module>   sh    
0	
!