a
    êÑT_  ã                   @   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 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-2020 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú
RegexLexerÚincludeÚbygroups)ÚTextÚCommentÚOperatorÚKeywordÚNameÚGenericÚLiteral)Ú	DiffLexerÚDarcsPatchLexerÚ
WDiffLexerc                
   @   sx   e Zd ZdZdZddgZddgZddgZd	d
efde	j
fde	jfde	jfde	jfde	jfde	jfdefgiZdd„ ZdS )r   z>
    Lexer for unified or context-style diffs or patches.
    ZDiffZdiffZudiffz*.diffz*.patchztext/x-diffztext/x-patchÚrootz .*\nz\+.*\nz-.*\nz!.*\nz@.*\nz([Ii]ndex|diff).*\nz=.*\nú.*\nc                 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   ú6/usr/lib/python3/dist-packages/pygments/lexers/diff.pyÚanalyse_text,   s    zDiffLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesr   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ƒfdejdfdejdfd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ÚrmdirZ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(   r.   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   5   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#pushr-   )r   r0   r1   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   o   s>   

ü



ù




ùðr   )r   r3   Zpygments.lexerr   r   r   Zpygments.tokenr   r   r   r   r	   r
   r   Ú__all__r   r   r   r   r   r   r   Ú<module>   s   
$ :