
    Mh                         d Z ddlZddlmZmZmZ ddlmZmZm	Z	m
Z
mZmZmZmZ g dZ G d de          Z G d d	e          Z G d
 de          ZdS )z
    pygments.lexers.diff
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for diff/patch formats.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerincludebygroups)TextCommentOperatorKeywordNameGenericLiteral
Whitespace)	DiffLexerDarcsPatchLexer
WDiffLexerc                   R   e Zd ZdZdZddgZddgZddgZd	Zd
Z	dd e
eee          fd e
ej        e          fd e
ej        e          fd e
ej        e          fd e
ej        e          fd e
ej        e          fd e
ej        e          fd e
ee          fgiZd ZdS )r   z>
    Lexer for unified or context-style diffs or patches.
    Diffdiffudiffz*.diffz*.patchztext/x-diffztext/x-patchz"https://en.wikipedia.org/wiki/Diff rootz( )(.*)(\n)z(!.*|---)(\n)z((?:< |-).*)(\n)z((?:> |\+).*)(\n)z*(@.*|\d(?:,\d+)?(?:a|c|d)\d+(?:,\d+)?)(\n)z((?:[Ii]ndex|diff).*)(\n)z	(=.*)(\n)(.*)(\n)c                 f    | d d         dk    rdS | d d         dk    rdS | d d         dk    rdS d S )	N   zIndex: T   zdiff    z--- g? )texts    T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/diff.pyanalyse_textzDiffLexer.analyse_text0   sR    8y  48w48v3     N)__name__
__module____qualname____doc__namealiases	filenames	mimetypesurlversion_addedr   r   r   r   StrongDeletedInserted
SubheadingHeadingtokensr   r   r    r   r   r      s"         DwG9%I/I
.CM 	XXj$
CCDxx
CCD ((7?J"G"GH!88G,<j#I#IJ=+Z88 *88GOZ+P+PQ88GOZ@@A((4445
F     r    r   c                      e Zd ZdZdZdgZddgZdZdZdZ	d	e
fd
e
fde
fde
fd ee
eeeee
ej        ee
	  	        fd ee
eeeee
ej        e          dfdej        fdej        fdej        fd                    d                    e	                     eeeee          fdej        dfdej        dfd eee          fgdefde
dfgdedfde
fg ed          d ej        fd!ej        fg ed          d ej        fd!ej        fgd"Zd#S )$r   z
    DarcsPatchLexer is a lexer for the various versions of the darcs patch
    format.  Examples of this format are derived by commands such as
    ``darcs annotate --patch`` and ``darcs send``.
    zDarcs Patchdpatchz*.dpatchz*.darcspatchzhttps://darcs.netz0.10)hunkaddfileadddirrmfilermdirmovereplace<>z\{z\}z/(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)(\])z+(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)commentzNew patches:zContext:zPatch bundle hash:z(\s*)({})(.*)(\n)|z\+insert-deleter   z	[^\]].*\nz\]#popz\nz
\[_[^_]*_]specialTextz\[z[^\n\[]+)r   r<   rB   r>   r@   N)r!   r"   r#   r$   r%   r&   r'   r)   r*   DPATCH_KEYWORDSr   r   r	   r
   r   r   Dater   r/   formatjoinr   r-   r,   r   r   r0   r   r    r   r   r   9   s         DjG^,I
CM"O
 88HH?Xhz4lJ: :; <Xhz4lJ0 01:< go.'/*"GO4!((/)B)BCCWdJ??AG$h/7?H-((4445%
* 7#Hf%

 J'H%

 GM""G$%'*+
 GM""GO$'/*
E' 'FFFr    r   c            	       l   e Zd ZdZdZdZdgZdgZg ZdZ	e
j        e
j        z  ZdZdZd	Zd
ZdZeej        dfeej        dfeefdefgeej        dfeej        dfeej        dfeej        dfeej        fdej        fgeej        dfeej        dfeej        dfeej        dfeej        fdej        fgdZdS )r   z
    A wdiff lexer.

    Note that:

    * It only works with normal output (without options like ``-l``).
    * If the target files contain "[-", "-]", "{+", or "+}",
      especially they are unbalanced, the lexer will get confused.
    WDiffz#https://www.gnu.org/software/wdiff/wdiffz*.wdiffz2.2z\{\+z\+\}z\[\-z\-\]z[^{}[\]+-]+inserteddeleted.z#pushrA   )r   rJ   rK   N)r!   r"   r#   r$   r%   r)   r&   r'   r(   r*   re	MULTILINEDOTALLflagsins_opins_cldel_opdel_clnormalr   r-   r,   r   r0   r   r    r   r   r   s   s;         D
/CiGIIML29$E FFFFF W%z2W_i0TN4L	
 W%w/W%w/W%v.W%v.W%&7#$
 W_g.W_g.W_f-W_f-W_%7?#
! FFFr    r   )r$   rM   pygments.lexerr   r   r   pygments.tokenr   r   r   r	   r
   r   r   r   __all__r   r   r   r   r    r   <module>rY      s3    
			 8 8 8 8 8 8 8 8 8 8                    9
8
8" " " " "
 " " "J7 7 7 7 7j 7 7 7t6 6 6 6 6 6 6 6 6 6r    