ó
8D[Tc           @   sÖ   d  Z  d d l Z d d l m Z d d l m Z m Z m Z 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 d d l m Z d d g Z d e f d	     YZ d e f d
     YZ d S(   så   
    pygments.lexers.textedit
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for languages related to text processing.

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i’’’’N(   t   bisect(   t
   RegexLexert   includet   defaultt   bygroupst   usingt   this(   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Numbert   Punctuation(   t   PythonLexert   AwkLexert   VimLexerc           B   sY  e  Z d  Z d Z d d d d g Z d g Z d g Z i d e f d	 e j	 f g d
 6e
 d
  d e j d f d e d  f e d  g d 6d e d f g d 6d e d f e
 d
  d e d f d e d f d e f d e d f d e j d 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 j f d e j	 f g d 6Z RS(!   s5   
    For Awk scripts.

    .. versionadded:: 1.5
    t   Awkt   awkt   gawkt   mawkt   nawks   *.awks   application/x-awks   \s+s   #.*$t   commentsandwhitespaces(   /(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/\Bs   #pops   (?=/)t   badregext   slashstartsregexs   \ns	   ^(?=\s|/)s3   \+\+|--|\|\||&&|in\b|\$|!?~|(\*\*|[-<>+*%\^/!=|])=?s   [{(\[;,]s   [})\].]s3   (break|continue|do|while|exit|for|if|else|return)\bs
   function\bsÄ   (atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|length|match|split|sprintf|sub|substr|tolower|toupper|close|fflush|getline|next|nextfile|print|printf|strftime|systime|delete|system)\bs   (ARGC|ARGIND|ARGV|BEGIN|CONVFMT|ENVIRON|END|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|RSTART|RT|SUBSEP)\bs   [$a-zA-Z_]\w*s%   [0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?s   0x[0-9a-fA-F]+s   [0-9]+s   "(\\\\|\\"|[^"])*"s   '(\\\\|\\'|[^'])*'t   root(   s   #popR   (   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypesR   R   t   SingleR   R   t   RegexR   R	   R   R
   t   Declarationt   ReservedR   t   Builtint   OtherR   t   Floatt   Hext   Integert   Doublet   tokens(    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/textedit.pyR      sB   										c           B   sr  e  Z d  Z d Z d g Z d d d d d d d	 d
 d g	 Z d g Z e j Z	 d Z
 i d e
 d e e e  e e e e e e e  e  f d e
 d e e e  e e e e   f d e f d e f d e j f d e j f d e j f d e f d e f d e j f d e f d e f d e f d e j f d e j f d e f g d 6Z d    Z d!   Z d"   Z  RS(#   sA   
    Lexer for VimL script files.

    .. versionadded:: 0.8
    t   VimLt   vims   *.vims   .vimrcs   .exrcs   .gvimrct   _vimrct   _exrct   _gvimrct   vimrct   gvimrcs
   text/x-vims   py(?:t(?:h(?:o(?:n)?)?)?)?s   ^([ \t:]*)(s(   )([ \t]*)(<<)([ \t]*)(.*)((?:\n|.)*)(\6)s   )([ \t])(.*)s   ^\s*".*s   [ \t]+s   /(\\\\|\\/|[^\n/])*/s   "(\\\\|\\"|[^\n"])*"s   '(''|[^\n'])*'s   (?<=\s)"[^\-:.%#=*].*s   -?\d+s   #[0-9a-f]{6}s   ^:s   [()<>+=!|,~-]s7   \b(let|if|else|endif|elseif|fun|function|endfunction)\bs+   \b(NONE|bold|italic|underline|dark|light)\bs   \b\w+\bt   .R   c         K   sK   d d l  m } m } m } | |  _ | |  _ | |  _ t j |  |  d  S(   Ni’’’’(   t   commandt   optiont   auto(	   t   pygments.lexers._vim_builtinsR5   R6   R7   t   _cmdt   _optt   _autR   t   __init__(   t   selft   optionsR5   R6   R7   (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/textedit.pyR<   {   s
    			c         C   sĶ   t  | | f  } | d k ru | | d d | t | | d d   k ru | | d d t |   | k ru t Sn  | t |  k  rÉ | | d | t | | d   k oČ | | d t |   | k St S(   s  
        It's kind of difficult to decide if something might be a keyword
        in VimL because it allows you to abbreviate them.  In fact,
        'ab[breviate]' is a good example.  :ab, :abbre, or :abbreviate are
        valid ways to call it so rather than making really awful regexps
        like::

            \bab(?:b(?:r(?:e(?:v(?:i(?:a(?:t(?:e)?)?)?)?)?)?)?)?\b

        we match `\b\w+\b` and then call is_in() on those tokens.  See
        `scripts/get_vimkw.py` for how the lists are extracted.
        i    i   (   R    t   lent   Truet   False(   R=   t   wt   mappingt   p(    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/textedit.pyt   is_in   s    ."&c         c   s¼   xµ t  j |  |  D]” \ } } } | t j k r¦ |  j | |  j  rW | t | f Vq“ |  j | |  j  s |  j | |  j  r | t j	 | f Vq“ | t
 | f Vq | | | f Vq Wd  S(   N(   R   t   get_tokens_unprocessedR   R'   RE   R9   R
   R:   R;   R&   R   (   R=   t   textt   indext   tokent   value(    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/textedit.pyRF      s    (!   R   R   R   R   R   R    R!   t   ret	   MULTILINEt   flagst   _pythonR   R   R   R
   R   R	   R   R   R   R#   R+   R"   R   R)   R   R   R&   R'   R,   R<   RE   RF   (    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/textedit.pyR   N   s@   			!								(   R   RK   R    t   pygments.lexerR   R   R   R   R   R   t   pygments.tokenR   R   R	   R
   R   R   R   R   t   pygments.lexers.pythonR   t   __all__R   R   (    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/textedit.pyt   <module>
   s   .:6