a
    ;@b%  ã                   @   s„   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„ deƒZG dd	„ d	eƒZG d
d„ deƒZdS )zË
    pygments.lexers.diff
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for diff/patch formats.

    :copyright: Copyright 2006-2021 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                   @   s¤   e Zd ZdZdZddgZddgZddg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	fgiZdd„ ZdS )r   z>
    Lexer for unified or context-style diffs or patches.
    ZDiffÚdiffZudiffz*.diffz*.patchztext/x-diffztext/x-patchÚrootz( )(.*)(\n)z
(\+.*)(\n)z	(-.*)(\n)z	(!.*)(\n)z	(@.*)(\n)z((?:[Ii]ndex|diff).*)(\n)z	(=.*)(\n)ú(.*)(\n)c                 C   s@   | 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ÍÌÌÌÌÌì?© )Útextr   r   ú3lib/python3.9/site-packages/pygments/lexers/diff.pyÚanalyse_text+   s    zDiffLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesr   r   r   r
   ÚInsertedÚDeletedZStrongZ
SubheadingÚHeadingÚtokensr   r   r   r   r   r      s"   øÿr   c                   @   s   e Zd ZdZdZdgZddg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``.

    .. versionadded:: 0.10
    zDarcs PatchZdpatchz*.dpatchz*.darcspatch)ZhunkZaddfileZadddirZ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*)(%s)(.*)(\n)ú|z\+Úinsertú-Údeleter   z	[^\]].*\nz\]ú#popz\nz
\[_[^_]*_]ÚspecialTextz\[z[^\n\[]+)r   r+   r1   r-   r/   N)r   r   r   r   r   r   r    ZDPATCH_KEYWORDSr   r   r   r	   r   r   ZDater
   r$   Újoinr   r"   r#   r   r   r%   r   r   r   r   r   4   sZ   ÿÿÿþÿ

îþþýýÞr   c                	   @   sà   e Zd ZdZdZdgZdgZg Zej	ej
B 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   a3  
    A `wdiff <https://www.gnu.org/software/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.

    .. versionadded:: 2.2
    ZWDiffZwdiffz*.wdiffz\{\+z\+\}z\[\-z\-\]z[^{}[\]+-]+ÚinsertedÚdeletedÚ.z#pushr0   )r   r3   r4   N)r   r   r   r   r   r   r    r!   ÚreÚ	MULTILINEÚDOTALLÚflagsZins_opZins_clZdel_opZdel_clZnormalr
   r"   r#   r   r%   r   r   r   r   r   n   s>   

ü



ù




ùðr   )r   r6   Zpygments.lexerr   r   r   Zpygments.tokenr   r   r   r   r	   r
   r   r   Ú__all__r   r   r   r   r   r   r   Ú<module>   s   
( :