ó
xiù\c           @   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 d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d e f d
 „  ƒ  YZ d S(   sË   
    pygments.lexers.diff
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for diff/patch formats.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iÿÿÿÿN(   t
   RegexLexert   includet   bygroups(   t   Textt   Commentt   Operatort   Keywordt   Namet   Generict   Literalt	   DiffLexert   DarcsPatchLexert
   WDiffLexerc        
   B   s¨   e  Z d  Z d Z d d g Z d d g Z d d g Z i 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 d 6Z d „  Z RS(   s>   
    Lexer for unified or context-style diffs or patches.
    t   Difft   difft   udiffs   *.diffs   *.patchs   text/x-diffs   text/x-patchs    .*\ns   \+.*\ns   -.*\ns   !.*\ns   @.*\ns   ([Ii]ndex|diff).*\ns   =.*\ns   .*\nt   rootc         C   s@   |  d  d k r t  S|  d  d k r( t  S|  d  d k r< d Sd  S(   Ni   s   Index: i   s   diff i   s   --- gÍÌÌÌÌÌì?(   t   True(   t   text(    (    s3   lib/python2.7/site-packages/pygments/lexers/diff.pyt   analyse_text,   s    (   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypesR   R   t   Insertedt   Deletedt   Strongt
   Subheadingt   Headingt   tokensR   (    (    (    s3   lib/python2.7/site-packages/pygments/lexers/diff.pyR
      s   	c           B   s©  e  Z d  Z d Z d g Z d d g Z d& Z i 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 j e ƒ e e e	 e ƒ f d e j d f d e j d f d e f g d 6d e f d e d  f g d 6d! e d  f d" e f g d# 6e d# ƒ d$ e j f d% e j f g d 6e d# ƒ d$ e j f d% e j f g d 6Z RS('   sä   
    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
    s   Darcs Patcht   dpatchs   *.dpatchs   *.darcspatcht   hunkt   addfilet   adddirt   rmfilet   rmdirt   movet   replacet   <t   >s   \{s   \}s/   (\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)(\])s+   (\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)t   comments   New patches:s   Context:s   Patch bundle hash:s   (\s*)(%s)(.*\n)t   |s   \+t   insertt   -t   deletes   .*\nR   s	   [^\]].*\ns   \]s   #pops   \ns
   \[_[^_]*_]t   specialTexts   \[s   [^\n\[]+(   R"   R#   R$   R%   R&   R'   R(   (   R   R   R   R   R   R   t   DPATCH_KEYWORDSR   R   R   R   R   R	   t   DateR   R   t   joinR   R   R   R   R    (    (    (    s3   lib/python2.7/site-packages/pygments/lexers/diff.pyR   5   sF   	 							c           B   sM  e  Z d  Z d Z d g Z d g Z g  Z e j e j	 BZ
 d Z d Z d Z d Z d Z i e e j d	 f e e j d
 f e e f d e f g d 6e 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	 6e 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
 6Z RS(   s'  
    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
    t   WDifft   wdiffs   *.wdiffs   \{\+s   \+\}s   \[\-s   \-\]s   [^{}[\]+-]+t   insertedt   deletedt   .R   s   #pushs   #pop(   R   R   R   R   R   R   R   t   ret	   MULTILINEt   DOTALLt   flagst   ins_opt   ins_clt   del_opt   del_clt   normalR   R   R   R   R    (    (    (    s3   lib/python2.7/site-packages/pygments/lexers/diff.pyR   o   s8   			(   R   R9   t   pygments.lexerR    R   R   t   pygments.tokenR   R   R   R   R   R   R	   t   __all__R
   R   R   (    (    (    s3   lib/python2.7/site-packages/pygments/lexers/diff.pyt   <module>
   s   4 :