B
    `aù[	  ã               @   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 dddg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-2017 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=.*\nz.*\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   ú3lib/python3.7/site-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   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ú-Údeletez.*\nz	[^\]].*\nz\]z#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   sB   



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   a'  
    A `wdiff <https://www.gnu.org/software/wdiff/>`_ lexer.

    Note that:

    * only to normal output (without option like -l).
    * if target files of wdiff contain "[-", "-]", "{+", "+}",
      especially they are unbalanced, this lexer will get confusing.

    .. versionadded:: 2.2
    ZWDiffZwdiffz*.wdiffz\{\+z\+\}z\[\-z\-\]z[^{}[\]+-]+ÚinsertedÚdeletedÚ.z#pushz#pop)r   r.   r/   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   s6   










)r   r1   Zpygments.lexerr   r   r   Zpygments.tokenr   r   r   r   r	   r
   r   Ú__all__r   r   r   r   r   r   r   Ú<module>
   s   $
 :