
xi\c           @   s  d  Z  d d l Z d d l 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 m Z d d l m Z d d l m Z d d d	 d
 g Z d e f d     YZ d e f d     YZ d	 e f d     YZ d
 e f d     YZ d S(   s   
    pygments.lexers.modeling
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for modeling languages.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iN(   t
   RegexLexert   includet   bygroupst   usingt   default(	   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Numbert   Punctuationt
   Whitespace(   t	   HtmlLexer(   t   _stan_builtinst   ModelicaLexert	   BugsLexert	   JagsLexert	   StanLexerc           B   s  e  Z d  Z d Z d g Z d g Z d g Z e j e j	 BZ
 d Z i d e f d e j f d e j f g d	 6e d	  d
 e j d f d e f 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 d f d e j f d e j d f e e f g d 6e d	  d e j f d e j d f e e j d f e d  g d 6e d	  e e j  d f e d  g d 6d
 e j d f d e j! f d e" e#  f d e j f g d 6Z$ RS(   s\   
    For `Modelica <http://www.modelica.org/>`_ source code.

    .. versionadded:: 1.1
    t   Modelicat   modelicas   *.mos   text/x-modelicas"   (?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)u   [\s﻿]+s   //[^\n]*\n?s	   /\*.*?\*/t
   whitespacet   "t   strings   [()\[\]{},;]+s   \.?[*^/+-]|\.|<>|[<>:=]=?s   \d+(\.?\d*[eE][-+]?\d+|\.\d*)s   \d+sl  (abs|acos|actualStream|array|asin|assert|AssertionLevel|atan|atan2|backSample|Boolean|cardinality|cat|ceil|change|Clock|Connections|cos|cosh|cross|delay|diagonal|div|edge|exp|ExternalObject|fill|floor|getInstanceName|hold|homotopy|identity|inStream|integer|Integer|interval|inverse|isPresent|linspace|log|log10|matrix|max|min|mod|ndims|noClock|noEvent|ones|outerProduct|pre|previous|product|Real|reinit|rem|rooted|sample|scalar|semiLinear|shiftSample|sign|sin|sinh|size|skew|smooth|spatialDistribution|sqrt|StateSelect|String|subSample|sum|superSample|symmetric|tan|tanh|terminal|terminate|time|transpose|vector|zeros)\bsX  (algorithm|annotation|break|connect|constant|constrainedby|der|discrete|each|else|elseif|elsewhen|encapsulated|enumeration|equation|exit|expandable|extends|external|final|flow|for|if|import|impure|in|initial|inner|input|loop|nondiscrete|outer|output|parameter|partial|protected|public|pure|redeclare|replaceable|return|stream|then|when|while)\bs   (and|not|or)\bsI   (block|class|connector|end|function|model|operator|package|record|type)\bt   classs   (false|true)\bs   within\bs   package-prefixt   roots   (function|record)\bs   (if|for|when|while)\bs   #pops   \\[\'"?\\abfnrtv]s6   (?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))s   <|\\?[^"\\<]+(%   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypest   ret   DOTALLt	   MULTILINEt   flagst   _nameR   R   t   Singlet	   MultilineR   R
   t   DoubleR   R   R   t   Floatt   IntegerR	   t   BuiltinR   t   Reservedt   Wordt   Constantt   ClassR   t	   Namespacet   EscapeR   R   t   tokens(    (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyR      sP   							
				c        >   B   s   e  Z d  Z d Z d d d g Z d g Z dq Z dr Z i da e f g db 6dc e	 j
 f g dd 6e dd  e db  de e e j e e  f df e j f dg dh j e e  e j f di e f dj e f dk e f dl e f dm e f dn e f g do 6Z dp   Z RS(s   sv   
    Pygments Lexer for `OpenBugs <http://www.openbugs.net/>`_ and WinBugs
    models.

    .. versionadded:: 1.6
    t   BUGSt   bugst   winbugst   openbugss   *.bugt   abst   arccost   arccosht   arcsint   arcsinht   arctant   arctanht   cloglogt   cost   cosht
   cumulativet   cutt   densityt   deviancet   equalst   exprt   gammapt   ilogitt   icloglogt   integralt   logt   logfactt   loggamt   logitt   maxt   mint   phis   post.p.valuet   pows   prior.p.valuet   probits   replicate.posts   replicate.priort   roundt   sint   sinht   solutiont   sqrtt   stept   tant   tanht   trunct   inprods
   interp.lint   inverset   logdett   means
   eigen.valst   odet   prods   p.valueMt   rankt   rankeds   replicate.postMt   sdt   sortt   sumt   Dt   It   Ft   Tt   Ct   dbernt   dbint   dcatt   dnegbint   dpoist   dhypert   dbetat   dchisqrt   ddexpt   dexpt   dflatt   dgammat   dgevt   dft   dggammat   dgpart   dloglikt   dlnormt   dlogist   dnormt   dpart   dtt   dunift   dweibt   dmultit   ddircht   dmnormt   dmtt   dwishs   \s+R   s   #.*$t   commentss   (model)(\s+)(\{)s   (for|in)(?![\w.])s   (%s)(?=\s*\()t   |s   [A-Za-z][\w.]*s&   [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?s   \[|\]|\(|\)|:|,|;s   <-|~s	   \+|-|\*|/s   [{}]R   c         C   s$   t  j d |  t  j  r d Sd Sd  S(   Ns   ^\s*model\s*{gffffff?g        (   R"   t   searcht   M(   t   text(    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyt   analyse_text   s    (>   R8   R9   R:   R;   R<   R=   R>   R?   R@   RA   RB   RC   RD   RE   RF   RG   RH   RI   RJ   RK   RL   RM   RN   RO   RP   RQ   RR   s   post.p.valueRS   s   prior.p.valueRT   s   replicate.posts   replicate.priorRU   RV   RW   RX   RY   RZ   R[   R\   R]   R^   s
   interp.linR_   R`   Ra   s
   eigen.valsRb   Rc   s   p.valueMRd   Re   s   replicate.postMRf   Rg   Rh   Ri   Rj   Rk   Rl   Rm   (   Rn   Ro   Rp   Rq   Rr   Rs   Rt   Ru   Rv   Rw   Rx   Ry   Rz   R{   R|   R}   R~   R   R   R   R   R   R   R   R   R   R   R   R   (   R   R   R   R   R   R    t
   _FUNCTIONSt   _DISTRIBUTIONSR   R   R'   R   R   R   R1   R   R-   t   joinR	   R,   R   R   R3   R   (    (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyR   c   sN   	               								c        2   B   s9  e  Z d  Z d Z d g Z d d g Z dl Z e d7   dm D  Z dn Z	 i dY e
 f g dZ 6d[ e f g d\ 6d] e j f d^ e j f g d_ 6e d_  e dZ  d` e e j e
 e  f da e j f db e j f dc dd j e e e	  e j f e d\  de e f df e f dg e f dh e f di e f g dj 6Z dk   Z RS(o   s=   
    Pygments Lexer for JAGS.

    .. versionadded:: 1.6
    t   JAGSt   jagss   *.jags   *.bugR8   R9   R:   R;   R<   R=   R>   R@   RA   R?   RF   t   expRJ   t   ifelseRI   RL   RM   RN   RO   RR   RS   RT   RU   RV   RW   RY   RZ   R[   R\   R]   R^   s
   interp.linR`   RP   Ra   RQ   Rc   Rh   Rf   R_   Rd   Rg   t   tt   acost   acosht   asint   asinht   atanRl   Rj   c         c   s   |  ] } d  | Vq d S(   s   [dpq]%sN(    (   t   .0t   x(    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pys	   <genexpr>   s    t   bernt   betat   dchiqsqrRv   Rw   R{   t   gammas	   gen.gammat   logist   lnormt   negbint   nchisqrt   normt   part   poist   weibR   R   t   dbetabinRn   Ro   Rp   Rs   R   R   R   R   R   t   dbinomt   dchisqt   dnbinomt   dweibullt   ddirichs   \s+R   s   [a-zA-Z][\w.]*\bt   namess   (?s)/\*.*?\*/s   #.*$R   s   (model|data)(\s+)(\{)s   var(?![\w.])s   (for|in)(?![\w.])s   (%s)(?=\s*\()R   s&   [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?s   \[|\]|\(|\)|:|,|;s   <-|~s&   \+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%s   [{}]R   c         C   s_   t  j d |  t  j  rW t  j d |  t  j  r4 d St  j d |  t  j  rP d Sd Sn d Sd  S(   Ns   ^\s*model\s*\{s   ^\s*data\s*\{g?s   ^\s*varg333333?i    (   R"   R   R   (   R   (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyR     s    (2   R8   R9   R:   R;   R<   R=   R>   R@   RA   R?   RF   R   RJ   R   RI   RL   RM   RN   RO   RR   RS   RT   RU   RV   RW   RY   RZ   R[   R\   R]   R^   s
   interp.linR`   RP   Ra   RQ   Rc   Rh   Rf   R_   Rd   Rg   R   R   R   R   R   R   Rl   Rj   (   R   R   R   Rv   Rw   R{   R   s	   gen.gammaR   R   R   R   R   R   R   R   (   R   R   R   Rn   Ro   Rp   Rs   R   R   R   R   R   R   R   R   R   R   (   R   R   R   R   R   R    R   t   tupleR   t   _OTHER_DISTRIBUTIONSR   R	   R   R(   R'   R   R   R   R1   R   t   DeclarationR-   R   R,   R   R   R3   R   (    (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyR      sP   	       	    									c           B   s  e  Z d  Z d Z d g Z d g Z i d e f g d 6d e j f d e j	 f g d 6d	 e
 f e d  e d  d
 d j d'  e e j e e  f d e f d d j e j  e f d e f d d j e j  e j f d e e e e e e  f d e e e e e e  f d e f d d j e j  e j f d d j e j  e e e e j  f d e j j f d d j e j  e j f d e j f d e f d e j  f d e j  f d  e j! f d! e f d" e f d# e f d$ e f g d% 6Z" d&   Z# RS((   s   Pygments Lexer for Stan models.

    The Stan modeling language is specified in the *Stan Modeling Language
    User's Guide and Reference Manual, v2.17.0*,
    `pdf <https://github.com/stan-dev/stan/releases/download/v2.17.0/stan-reference-2.17.0.pdf>`__.

    .. versionadded:: 1.6
    t   Stant   stans   *.stans   \s+R   s   (?s)/\*.*?\*/s	   (//|#).*$R   s   "[^"]*"s   (%s)(\s*)(\{)R   t	   functionst   datas   transformed\s+?datat
   parameterss   transformed\s+parameterst   models   generated\s+quantitiess   target\s*\+=s   (%s)\bs
   T(?=\s*\[)s   (<)(\s*)(upper|lower)(\s*)(=)s   (,)(\s*)(upper)(\s*)(=)s
   [;,\[\]()]s   (%s)(?=\s*\()s   (~)(\s*)(%s)(?=\s*\()s   [A-Za-z]\w*__\bs   [A-Za-z]\w*(?=\s*\()]s   [A-Za-z]\w*\bs#   [0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?s   \.[0-9]+([eE][+-]?[0-9]+)?s   [0-9]+s   <-|(?:\+|-|\.?/|\.?\*|=)?=|~s2   \+|-|\.?\*|\.?/|\\|'|\^|!=?|<=?|>=?|\|\||&&|%|\?|:s   [{}]s   \|R   c         C   s$   t  j d |  t  j  r d Sd Sd  S(   Ns   ^\s*parameters\s*\{g      ?g        (   R"   R   R   (   R   (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyR   j  s    (   R   R   s   transformed\s+?dataR   s   transformed\s+parametersR   s   generated\s+quantities($   R   R   R   R   R   R    R   R   R(   R'   R
   R   R   R   R   R1   R   R   t   KEYWORDSt   TYPESt   TypeR   R   t	   FUNCTIONSR	   R,   t   DISTRIBUTIONSt   Pseudot   RESERVEDR-   t   FunctionR   R*   R+   R3   R   (    (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyR     sP   					 							(   R   R"   t   pygments.lexerR    R   R   R   R   t   pygments.tokenR   R   R   R   R	   R
   R   R   R   t   pygments.lexers.htmlR   t   pygments.lexersR   t   __all__R   R   R   R   (    (    (    s7   lib/python2.7/site-packages/pygments/lexers/modeling.pyt   <module>
   s   (@K`X