ó
j[Tc           @   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 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.algebra
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for computer algebra systems.

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
i˙˙˙˙N(   t
   RegexLexert   bygroupst   words(   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Numbert   Punctuationt   GAPLexert   MathematicaLexert
   MuPADLexerc           B   sˇ   e  Z d  Z d Z d g Z d d d d g Z i d e j f d e f d	 e	 f d
 e
 f d e j f d e j f d e f d e j f d e j f d e f d e f d e f g d 6Z RS(   sX   
    For `GAP <http://www.gap-system.org>`_ source code.

    .. versionadded:: 2.0
    t   GAPt   gaps   *.gs   *.gds   *.gis   *.gaps   #.*$s   "(?:[^"\\]|\\.)*"s   \(|\)|\[|\]|\{|\}sV  (?x)\b(?:
                if|then|elif|else|fi|
                for|while|do|od|
                repeat|until|
                break|continue|
                function|local|return|end|
                rec|
                quit|QUIT|
                IsBound|Unbind|
                TryNextMethod|
                Info|Assert
              )\bsD   (?x)\b(?:
                true|false|fail|infinity
              )\bsx   (?x)\b(?:
                (Declare|Install)([A-Z][A-Za-z]+)|
                   BindGlobal|BIND_GLOBAL
              )\bs   \.|,|:=|;|=|\+|-|\*|/|\^|>|<s=   (?x)\b(?:
                and|or|not|mod|in
              )\bsC   (?x)
              (?:\w+|`[^`]*`)
              (?:::\w+|`[^`]*`)*s   [0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?s   \.[0-9]+(?:e[0-9]+)?t   .t   root(   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamesR   t   SingleR   R
   R   R   t   Constantt   BuiltinR   t   Wordt   VariableR	   R   t   tokens(    (    (    s;   /usr/lib/python2.7/dist-packages/pygments/lexers/algebra.pyR      s(   										c            B   sö   e  Z d  Z d Z d d d g Z d d d d g Z d	 d
 d d g Z dA Z dB Z d5   Z	 i d6 e
 f d7 e j f d8 e j f d9 e j f d: e f d; e j f d< e j f d= e j f e e  e f e e  e f d> e f d? e j f g d@ 6Z RS(C   sp   
    Lexer for `Mathematica <http://www.wolfram.com/mathematica/>`_ source code.

    .. versionadded:: 2.0
    t   Mathematicat   mathematicat   mmat   nbs   *.nbs   *.cdfs   *.nbps   *.mas   application/mathematicas#   application/vnd.wolfram.mathematicas+   application/vnd.wolfram.mathematica.packages   application/vnd.wolfram.cdfs   ;;t   =s   =.s   !===s   :=s   ->s   :>s   /.t   +t   -t   *t   /t   ^s   &&s   ||t   !s   <>t   |s   /;t   ?t   @s   //s   /@s   @@s   @@@s   ~~s   ===t   &t   <t   >s   <=s   >=t   ,t   ;t   (t   )t   [t   ]t   {t   }c         C   s   d d j  d   |  D  S(   Ns   (%s)R)   c         s   s   |  ] } t  j |  Vq d  S(   N(   t   ret   escape(   t   .0t   entry(    (    s;   /usr/lib/python2.7/dist-packages/pygments/lexers/algebra.pys	   <genexpr>`   s    (   t   join(   t   entries(    (    s;   /usr/lib/python2.7/dist-packages/pygments/lexers/algebra.pyt   _multi_escape_   s    s   (?s)\(\*.*?\*\)s   ([a-zA-Z]+[A-Za-z0-9]*`)s   ([A-Za-z0-9]*_+[A-Za-z0-9]*)s   #\d*s   ([a-zA-Z]+[a-zA-Z0-9]*)s   -?[0-9]+\.[0-9]*s   -?[0-9]*\.[0-9]+s   -?[0-9]+s   ".*?"s   \s+R   (    s   ;;R"   s   =.s   !===s   :=s   ->s   :>s   /.R#   R$   R%   R&   R'   s   &&s   ||R(   s   <>R)   s   /;R*   R+   s   //s   /@s   @@s   @@@s   ~~s   ===R,   R-   R.   s   <=s   >=(   R/   R0   R1   R2   R3   R4   R5   R6   (   R   R   R   R   R   R   t	   mimetypest	   operatorst   punctuationR=   R   R   t	   NamespaceR   R	   t   Floatt   IntegerR   R   R
   R   R   t
   WhitespaceR   (    (    (    s;   /usr/lib/python2.7/dist-packages/pygments/lexers/algebra.pyR   H   s4   	  				c           B   s*  e  Z d  Z d Z d g Z d g Z i d e j f d e j d f d e	 f d e
 f d	 e f d
 e j f d e j f d e j j f d e f d e j f d e f d e e j e e
  f d e j f d e f d e f d e f g d 6d e j f d e j d f d e j d f d e j f g d 6Z RS(   s   
    A `MuPAD <http://www.mupad.com>`_ lexer.
    Contributed by Christopher Creutzig <christopher@creutzig.de>.

    .. versionadded:: 0.8
    t   MuPADt   mupads   *.mus   //.*?$s   /\*t   comments   "(?:[^"\\]|\\.)*"s   \(|\)|\[|\]|\{|\}sš  (?x)\b(?:
                next|break|end|
                axiom|end_axiom|category|end_category|domain|end_domain|inherits|
                if|%if|then|elif|else|end_if|
                case|of|do|otherwise|end_case|
                while|end_while|
                repeat|until|end_repeat|
                for|from|to|downto|step|end_for|
                proc|local|option|save|begin|end_proc|
                delete|frame
              )\bsU  (?x)\b(?:
                DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR|
                DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT|
                DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC|
                DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR
              )\bs   (?x)\b(?:
                PI|EULER|E|CATALAN|
                NIL|FAIL|undefined|infinity|
                TRUE|FALSE|UNKNOWN
              )\bs   \b(?:dom|procname)\bs-   \.|,|:|;|=|\+|-|\*|/|\^|@|>|<|\$|\||!|\'|%|~=s   (?x)\b(?:
                and|or|not|xor|
                assuming|
                div|mod|
                union|minus|intersect|in|subset
              )\bs    \b(?:I|RDN_INF|RD_NINF|RD_NAN)\bsi   (?x)
              ((?:[a-zA-Z_#][\w#]*|`[^`]*`)
              (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*)(\s*)([(])s]   (?x)
              (?:[a-zA-Z_#][\w#]*|`[^`]*`)
              (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*s   [0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?s   \.[0-9]+(?:e[0-9]+)?R   R   s   [^*/]s   #pushs   \*/s   #pops   [*/](   R   R   R   R   R   R   R   R   t	   MultilineR   R
   R   R   t   ClassR   R   t   PseudoR   R   R	   R   t   FunctionR   R   R   (    (    (    s;   /usr/lib/python2.7/dist-packages/pygments/lexers/algebra.pyR   w   s8   											(   R   R7   t   pygments.lexerR    R   R   t   pygments.tokenR   R   R   R   R   R   R	   R
   t   __all__R   R   R   (    (    (    s;   /usr/lib/python2.7/dist-packages/pygments/lexers/algebra.pyt   <module>
   s   :3/