3 ��X � @ s� d Z ddlZddlmZmZmZ ddlmZmZm Z m Z mZmZm Z dddgZG dd� de�ZG d d� de�ZG d d� de�ZdS )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 Zd ZdZdZddgZddgZddgZd d efde j fde jfd e jfde j fde jfde jfdefgiZdd� ZdS )r z> Lexer for unified or context-style diffs or patches. ZDiffZdiffZudiffz*.diffz*.patchztext/x-diffztext/x-patch�rootz .*\nz\+.*\nz-.*\nz!.*\nz@.*\nz([Ii]ndex|diff).*\nz=.*\nz.*\nc C s@ | d d� dkrdS | d d� dkr(dS | d d� dkr<dS d S ) N� zIndex: T� zdiff � z--- g�������?� )�textr r �/usr/lib/python3.6/diff.py�analyse_text, s zDiffLexer.analyse_textN)�__name__� __module__�__qualname__�__doc__�name�aliases� filenames� mimetypesr r �Inserted�DeletedZStrongZ Subheading�Heading�tokensr r r r r r s c @ s e Zd ZdZdZdgZddgZd(Zd efdefdefdefde ee eeeee jee� fde ee eeeee je�dfdejfdejfdejfddje� e ee e�fdejdfdejdfdefg defded fgd!ed fd"efged#�d$ejfd%ejfged#�d$ejfd%ejfgd&�Zd'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 zDarcs PatchZdpatchz*.dpatchz*.darcspatch�hunk�addfile�adddir�rmfile�rmdir�move�replace�<�>z\{z\}z/(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)(\])z+(\[)((?:TAG )?)(.*)(\n)(.*)(\*\*)(\d+)(\s?)�commentzNew patches:zContext:zPatch bundle hash:z(\s*)(%s)(.*\n)�|z\+�insert�-�deletez.*\nz [^\]].*\nz\]z#popz\nz \[_[^_]*_]�specialTextz\[z[^\n\[]+)r r, r1 r. r0 N)r# r$ r% r&