o
    Ñ­jÄ5  ã                   @   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 g d¢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-present 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ZdgZdgZdgZd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 source code.
    ÚModelicazhttp://www.modelica.org/Úmodelicaz*.moztext/x-modelicaz1.1z"(?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)z[\s\ufeff]+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)\bak  (algorithm|annotation|break|connect|constant|constrainedby|der|discrete|each|else|elseif|elsewhen|encapsulated|enumeration|equation|exit|expandable|extends|external|firstTick|final|flow|for|if|import|impure|in|initial|inner|input|interval|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\búpackage-prefixz(function|record)\bz(if|for|when|while)\bz#popz\\[\'"?\\abfnrtv]z6(?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))z<|\\?[^"\\<]+)r   Úrootr   r   r   N)(Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ	filenamesÚ	mimetypesÚversion_addedÚreÚDOTALLÚ	MULTILINEÚflagsÚ_namer   r   ÚSingleÚ	Multiliner   r   ÚDoubler   r	   r   ÚFloatÚIntegerr   ÚBuiltinr
   ÚReservedÚWordÚConstantÚClassr   Ú	NamespaceÚEscaper   r   Útokens© r:   r:   úU/var/www/html/CropPilot/venv/lib/python3.10/site-packages/pygments/lexers/modeling.pyr      sh    ý

öúÿ
â!

û
ý
ÿû
Îr   c                   @   s¸   e Zd ZdZdZg d¢ZdgZdZdZdZ		 dZ
	 d	efgd
ejfgedƒedƒdeejeeƒfdejfd d e	e
 ¡¡ejfdefdefdefdefdefdefgdœZdd„ ZdS )r   z=
    Pygments Lexer for OpenBugs and WinBugs
    models.
    ÚBUGS)ÚbugsÚwinbugsÚopenbugsú*.bugz4https://www.mrc-bsu.cam.ac.uk/software/bugs/openbugsú1.6)>Ú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Úphizpost.p.valueÚpowzprior.p.valueÚprobitzreplicate.postzreplicate.priorÚroundÚsinÚsinhÚsolutionÚsqrtÚstepÚtanÚtanhÚtruncÚinprodú
interp.linÚinverseÚlogdetÚmeanz
eigen.valsÚodeÚprodzp.valueMÚrankÚrankedz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Údwishú\s+ú#.*$Úcommentsr   z(model)(\s+)(\{)ú(for|in)(?![\w.])ú({})(?=\s*\()ú|z[A-Za-z][\w.]*ú&[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?ú\[|\]|\(|\)|:|,|;ú<-|~z	\+|-|\*|/ú[{}]©r   r˜   r   c                 C   ó   t  d| t j¡r
dS dS )Nz^\s*model\s*{gffffffæ?ç        ©r(   ÚsearchÚM©Útextr:   r:   r;   Úanalyse_textº   ó   zBugsLexer.analyse_textN)r   r   r    r!   r"   r$   r%   r#   r'   Ú
_FUNCTIONSÚ_DISTRIBUTIONSr   r   r-   r   r   r
   r7   r   r3   ÚformatÚjoinr   r2   r   r	   r9   r¨   r:   r:   r:   r;   r   b   sB    ÿþÿÿèø$r   c                   @   sâ   e Zd ZdZdZdgZddgZdZdZdZ	e
d	d
„ dD ƒƒZdZdefgdefgdejfdejfgedƒedƒdeejeeƒfdejfdejfd d e	e e ¡¡ejfedƒdefdefdefdefdefgdœZdd „ Zd!S )"r   z"
    Pygments Lexer for JAGS.
    ÚJAGSÚjagsz*.jagr@   z https://mcmc-jags.sourceforge.iorA   )2rB   rC   rD   rE   rF   rG   rH   rJ   rK   rI   rP   ÚexprT   ÚifelserS   rV   rW   rX   rY   r\   r]   r^   r_   r`   ra   rc   rd   re   rf   rg   rh   ri   rk   rZ   rl   r[   rn   rs   rq   rj   ro   rr   ÚtÚacosÚacoshÚasinÚasinhÚatanrw   ru   c                 c   s   � | ]}d |› �V  qdS )z[dpq]Nr:   )Ú.0Úxr:   r:   r;   Ú	<genexpr>Ø   s   € zJagsLexer.<genexpr>)ÚbernÚbetaÚdchiqsqrr�   r‚   r†   Úgammaz	gen.gammaÚlogisÚlnormÚnegbinÚnchisqrÚnormÚparÚpoisÚweib)rŽ   r�   Údbetabinry   rz   r{   r~   r’   r“   r•   r”   r‘   ÚdbinomÚdchisqÚdnbinomÚdweibullÚddirichr–   z[a-zA-Z][\w.]*\bú(?s)/\*.*?\*/r—   r˜   r   z(model|data)(\s+)(\{)zvar(?![\w.])r™   rš   r›   Únamesrœ   r�   rž   z&\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%rŸ   )r   rÎ   r˜   r   c                 C   s@   t  d| t j¡rt  d| t j¡rdS t  d| t j¡rdS dS dS )Nz^\s*model\s*\{z^\s*data\s*\{gÍÌÌÌÌÌì?z^\s*varg333333Ó?r   r£   r¦   r:   r:   r;   r¨     s   zJagsLexer.analyse_textN) r   r   r    r!   r"   r$   r%   r#   r'   rª   Útupler«   Ú_OTHER_DISTRIBUTIONSr   r   r   r.   r-   r   r   r
   r7   r   ÚDeclarationr3   r¬   r­   r2   r   r	   r9   r¨   r:   r:   r:   r;   r   Á   sT    ÿÿþüÿ
ÿþýçò+r   c                   @   s�  e Zd ZdZdZdgZdgZdZdZde	fgde
jfd	e
jfgd
efedƒedƒd d d¡¡eeje	eƒfdefdefd d ej¡¡efdefd d 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 ej¡¡ejfd d ej¡¡eeeejƒfdejjfd d ej ¡¡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d!e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>`__.
    ÚStanÚstanz*.stanzhttps://mc-stan.orgrA   r–   rÍ   z	(//|#).*$z"[^"]*"r˜   r   z({})(\s*)(\{{)r›   )Ú	functionsÚdataztransformed\s+?dataÚ
parametersztransformed\s+parametersÚmodelzgenerated\s+quantitiesztarget\s*\+=zjacobian\s*\+=z({})\bz
T(?=\s*\[)z/(<)(\s*)(upper|lower|offset|multiplier)(\s*)(=)z(,)(\s*)(upper)(\s*)(=)z
[;,\[\]()]rš   z(~)(\s*)({})(?=\s*\()z[A-Za-z]\w*__\bz[A-Za-z]\w*(?=\s*\()]z$[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?iz\.[0-9]+([eE][+-]?[0-9]+)?iz[0-9]+iz#[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?z\.[0-9]+([eE][+-]?[0-9]+)?z[0-9]+z[A-Za-z]\w*\bz<-|(?:\+|-|\.?/|\.?\*|=)?=|~z;\+|-|\.?\*|\.?/|\\|'|\.?\^|!=?|<=?|>=?|\|\||&&|%|\?|:|%/%|!rŸ   z\|r    c                 C   r¡   )Nz^\s*parameters\s*\{g      ð?r¢   r£   r¦   r:   r:   r;   r¨   l  r©   zStanLexer.analyse_textN)(r   r   r    r!   r"   r$   r%   r#   r'   r   r   r.   r-   r   r   r¬   r­   r   r
   r7   r   r   ÚKEYWORDSÚTYPESÚTyper	   r   Ú	FUNCTIONSr   r2   ÚDISTRIBUTIONSÚPseudoÚRESERVEDr3   ÚFunctionr   r0   r1   r9   r¨   r:   r:   r:   r;   r     sf    ÿýýÿÿÿ
È÷Er   )r!   r(   Úpygments.lexerr   r   r   r   r   Úpygments.tokenr   r   r	   r
   r   r   r   r   r   Úpygments.lexers.htmlr   Úpygments.lexersr   Ú__all__r   r   r   r   r:   r:   r:   r;   Ú<module>   s    
,K_X