3
.ßL]N4  ã               @   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G dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG dd
„ d
eƒZdS )zÓ
    pygments.lexers.modeling
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for modeling languages.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú
RegexLexerÚincludeÚbygroupsÚusingÚdefault)	ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚ
Whitespace)Ú	HtmlLexer)Ú_stan_builtinsÚModelicaLexerÚ	BugsLexerÚ	JagsLexerÚ	StanLexerc               @   s$  e Zd ZdZdZdgZdgZdgZej	ej
B ZdZdefdejfd	ejfge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ed
ƒdejfdejdfeejdfe dƒged
ƒeej!dfe dƒgdejdfdej"fde#e$ƒfdejfgdœZ%d S )!r   z\
    For `Modelica <http://www.modelica.org/>`_ source code.

    .. versionadded:: 1.1
    ZModelicaZmodelicaz*.moztext/x-modelicaz"(?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)u   [\sï»¿]+z//[^\n]*\n?z	/\*.*?\*/Ú
whitespaceú"Ústringz[()\[\]{},;]+z\.?[*^/+-]|\.|<>|[<>:=]=?z\d+(\.?\d*[eE][-+]?\d+|\.\d*)z\d+al  (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)\baX  (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)\bz(and|not|or)\bzI(block|class|connector|end|function|model|operator|package|record|type)\bÚclassz(false|true)\bzwithin\bzpackage-prefixz(function|record)\bz(if|for|when|while)\bz#popz\\[\'"?\\abfnrtv]z6(?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))z<|\\?[^"\\<]+)r   Úrootr   zpackage-prefixr   N)&Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesÚreÚDOTALLÚ	MULTILINEÚflagsÚ_namer   r   ÚSingleÚ	Multiliner   r   ÚDoubler   r	   r   ÚFloatÚIntegerr   ÚBuiltinr
   ÚReservedÚWordÚConstantZClassr   Ú	NamespaceZEscaper   r   Útokens© r3   r3   ú>/tmp/pip-install-5sebvq2j/pygments/pygments/lexers/modeling.pyr      sN   







c            >   @   s¬   e Zd ZdZdZdddgZdgZdtZduZdbe	fgdce
jfgeddƒedeƒdfeeje	eƒfdgejfdhdijee ƒ ejfdjefdkefdlefdmefdnefdoefgdpœZdqdr„ ZdsS )vr   zv
    Pygments Lexer for `OpenBugs <http://www.openbugs.net/>`_ and WinBugs
    models.

    .. versionadded:: 1.6
    ZBUGSZbugsZwinbugsZopenbugsz*.bugÚabsÚarccosÚarccoshÚarcsinÚarcsinhÚarctanÚarctanhÚcloglogÚcosÚcoshÚ
cumulativeÚcutÚdensityÚdevianceÚequalsÚexprÚgammapÚilogitÚicloglogÚintegralÚlogÚlogfactÚloggamÚlogitÚmaxÚminÚphiúpost.p.valueÚpowúprior.p.valueÚprobitúreplicate.postúreplicate.priorÚroundÚsinÚsinhÚsolutionÚsqrtÚstepÚtanÚtanhÚtruncÚinprodú
interp.linÚinverseÚlogdetÚmeanú
eigen.valsÚodeÚprodúp.valueMÚrankÚrankedúreplicate.postMÚsdÚsortÚsumÚDÚIÚFÚTÚCÚdbernÚdbinÚdcatÚdnegbinÚdpoisÚdhyperÚdbetaÚdchisqrÚddexpÚdexpÚdflatÚdgammaÚdgevÚdfÚdggammaÚdgparÚdloglikÚdlnormÚdlogisÚdnormÚdparÚdtÚdunifÚdweibÚdmultiÚddirchÚdmnormÚdmtÚdwishz\s+z#.*$Úcommentsr   z(model)(\s+)(\{)z(for|in)(?![\w.])z(%s)(?=\s*\()ú|z[A-Za-z][\w.]*z&[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?z\[|\]|\(|\)|:|,|;z<-|~z	\+|-|\*|/z[{}])r   r�   r   c             C   s   t jd| t jƒrdS dS d S )Nz^\s*model\s*{gffffffæ?g        )r#   ÚsearchÚM)Útextr3   r3   r4   Úanalyse_text¼   s    zBugsLexer.analyse_textN)>r5   r6   r7   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   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   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   r   r   r   r   r    r!   Ú
_FUNCTIONSÚ_DISTRIBUTIONSr   r   r(   r   r   r
   r1   r   r.   Újoinr   r-   r   r	   r2   r•   r3   r3   r3   r4   r   c   sL   
               	
c            2   @   sØ   e Zd ZdZdZdgZddgZdpZed8d9„ dqD ƒƒZ	drZ
d[efgd\efgd]ejfd^ejfged_ƒed`ƒdaeejeeƒfdbejfdcejfdddejee	 e
 ƒ ejfedfƒdgefdhefdiefdjefdkefgdlœZdmdn„ ZdoS )sr   z=
    Pygments Lexer for JAGS.

    .. versionadded:: 1.6
    ZJAGSZjagsz*.jagz*.bugr5   r6   r7   r8   r9   r:   r;   r=   r>   r<   rC   ÚexprG   ÚifelserF   rI   rJ   rK   rL   rO   rQ   rS   rV   rW   rX   rZ   r[   r\   r]   r^   r_   ú
interp.linrb   rM   rc   rN   rf   rm   rk   ra   rh   rl   ÚtÚacosÚacoshÚasinÚasinhÚatanrq   ro   c             c   s   | ]}d | V  qdS )z[dpq]%sNr3   )Ú.0Úxr3   r3   r4   ú	<genexpr>Ú   s    zJagsLexer.<genexpr>ÚbernÚbetaÚdchiqsqrr{   r|   r€   Úgammaú	gen.gammaÚlogisÚlnormÚnegbinÚnchisqrÚnormÚparÚpoisÚweibrˆ   r‰   Údbetabinrs   rt   ru   rx   rŒ   r�   r�   rŽ   r‹   ÚdbinomÚdchisqÚdnbinomÚdweibullÚddirichz\s+z[a-zA-Z][\w.]*\bz(?s)/\*.*?\*/z#.*$r�   r   z(model|data)(\s+)(\{)zvar(?![\w.])z(for|in)(?![\w.])z(%s)(?=\s*\()r‘   Únamesz&[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?z\[|\]|\(|\)|:|,|;z<-|~z&\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%z[{}])r   r¸   r�   r   c             C   sF   t jd| t jƒr>t jd| t jƒr$dS t jd| t jƒr8dS dS ndS d S )Nz^\s*model\s*\{z^\s*data\s*\{gÍÌÌÌÌÌì?z^\s*varg333333Ó?r   )r#   r’   r“   )r”   r3   r3   r4   r•     s    zJagsLexer.analyse_textN)2r5   r6   r7   r8   r9   r:   r;   r=   r>   r<   rC   r™   rG   rš   rF   rI   rJ   rK   rL   rO   rQ   rS   rV   rW   rX   rZ   r[   r\   r]   r^   r_   r›   rb   rM   rc   rN   rf   rm   rk   ra   rh   rl   rœ   r�   rž   rŸ   r    r¡   rq   ro   )r¥   r¦   r§   r{   r|   r€   r¨   r©   rª   r«   r¬   r­   r®   r¯   r°   r±   )rˆ   r‰   r²   rs   rt   ru   rx   rŒ   r�   r�   rŽ   r‹   r³   r´   rµ   r¶   r·   )r   r   r   r   r   r    r!   r–   Útupler—   Z_OTHER_DISTRIBUTIONSr   r   r   r)   r(   r   r   r
   r1   r   ZDeclarationr.   r˜   r-   r   r	   r2   r•   r3   r3   r3   r4   r   Ã   sN            
  
c               @   s^  e Zd ZdZdZdgZdgZdefgdej	fdej
fgd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&œZ#d'd(„ Z$d)S )+r   a   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
    ZStanZstanz*.stanz\s+z(?s)/\*.*?\*/z	(//|#).*$z"[^"]*"r�   r   z(%s)(\s*)(\{)r‘   Ú	functionsÚdataútransformed\s+?dataÚ
parametersútransformed\s+parametersÚmodelúgenerated\s+quantitiesztarget\s*\+=z(%s)\bz
T(?=\s*\[)z(<)(\s*)(upper|lower)(\s*)(=)z(,)(\s*)(upper)(\s*)(=)z
[;,\[\]()]z(%s)(?=\s*\()z(~)(\s*)(%s)(?=\s*\()z[A-Za-z]\w*__\bz[A-Za-z]\w*(?=\s*\()]z[A-Za-z]\w*\bz#[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?z\.[0-9]+([eE][+-]?[0-9]+)?z[0-9]+z<-|(?:\+|-|\.?/|\.?\*|=)?=|~z2\+|-|\.?\*|\.?/|\\|'|\^|!=?|<=?|>=?|\|\||&&|%|\?|:z[{}]z\|)r   r�   r   c             C   s   t jd| t jƒrdS dS d S )Nz^\s*parameters\s*\{g      ð?g        )r#   r’   r“   )r”   r3   r3   r4   r•   j  s    zStanLexer.analyse_textN)rº   r»   r¼   r½   r¾   r¿   rÀ   )%r   r   r   r   r   r    r!   r   r   r)   r(   r   r   r˜   r   r
   r1   r   r   ZKEYWORDSÚTYPESÚTyper	   r   Z	FUNCTIONSr   r-   ZDISTRIBUTIONSZPseudoZRESERVEDr.   ZFunctionr   r+   r,   r2   r•   r3   r3   r3   r4   r     sN   
 
)r   r#   Zpygments.lexerr   r   r   r   r   Zpygments.tokenr   r   r	   r
   r   r   r   r   r   Zpygments.lexers.htmlr   Zpygments.lexersr   Ú__all__r   r   r   r   r3   r3   r3   r4   Ú<module>
   s   ,K`X