a
    €˜ëjH9  ã                   @   s¼   d Z ddl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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Úwords)	ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚ
Whitespace)Ú	HtmlLexer)Ú_stan_builtins)ÚModelicaLexerÚ	BugsLexerÚ	JagsLexerÚ	StanLexerc                   @   sD  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eddd�ejfeddd�ejfdej fedd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.
    ZModelicazhttp://www.modelica.org/Z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+)SÚabsÚacosZactualStreamÚarrayÚasinÚassertZAssertionLevelÚatanÚatan2Z
backSampleÚBooleanZcardinalityÚcatÚceilZchangeZClockZConnectionsÚcosÚcoshZcrossÚdelayZdiagonalÚdivZedgeÚexpZExternalObjectÚfillÚfloorZgetInstanceNameZholdZhomotopyÚidentityZinStreamÚintegerÚIntegerÚintervalÚinverseZ	isPresentZlinspaceÚlogÚlog10ZmatrixÚmaxÚminÚmodZndimsZnoClockZnoEventZonesZouterProductÚpreÚpreviousÚproductÚRealÚreinitÚremZrootedÚsampleZscalarZ
semiLinearZshiftSampleÚsignÚsinÚsinhÚsizeZskewZsmoothZspatialDistributionÚsqrtZStateSelectr   Z	subSampleÚsumZsuperSampleZ	symmetricÚtanÚtanhZterminalÚ	terminateÚtimeZ	transposeZvectorÚzerosz\b)Úsuffix)/Ú	algorithmÚ
annotationÚbreakÚconnectZconstantZconstrainedbyZderZdiscreteZeachÚelseZelseifZelsewhenZencapsulatedÚenumerationZequationÚexitZ
expandableZextendsZexternalZ	firstTickÚfinalZflowÚforÚifÚimportZimpureÚinÚinitialÚinnerÚinputr.   ZloopZnondiscreteÚouterÚoutputZ	parameterÚpartialZ	protectedÚpublicZpureZ	redeclareZreplaceableÚreturnÚstreamZthenÚwhenÚwhilez(and|not|or)\b)
ÚblockÚclassZ	connectorÚendÚfunctionÚmodelÚoperatorÚpackageÚrecordÚtyper`   z(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`   rh   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   ÚFloatr-   r   r   ÚBuiltinr   ÚReservedÚWordÚConstantZClassr   Ú	NamespaceZEscaper   r   Útokens© rƒ   rƒ   úW/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/pygments/lexers/modeling.pyr      sr   ý
êêôóÿÿ
Ï4

û
ý
ÿû»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.
    ZBUGS)ZbugsZwinbugsZopenbugsú*.bugz4https://www.mrc-bsu.cam.ac.uk/software/bugs/openbugsú1.6)>r   ÚarccosÚarccoshÚarcsinÚarcsinhÚarctanÚarctanhÚcloglogr$   r%   Z
cumulativeZcutZdensityZdevianceÚequalsÚexprZgammapÚilogitÚicloglogZintegralr0   ÚlogfactÚloggamÚlogitr2   r3   Úphizpost.p.valueÚpowzprior.p.valueÚprobitzreplicate.postzreplicate.priorÚroundr=   r>   Zsolutionr@   ÚsteprB   rC   ÚtruncÚinprodú
interp.linr/   ÚlogdetÚmeanz
eigen.valsZodeÚprodzp.valueMÚrankZrankedzreplicate.postMÚsdÚsortrA   ÚDÚIÚFÚTÚC)ÚdbernÚdbinÚdcatZdnegbinZdpoisÚdhyperZdbetaZdchisqrÚddexpÚdexpZdflatZdgammaZdgevÚdfZdggammaZdgparZdloglikZdlnormZdlogisZdnormZdparÚdtÚdunifZ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¸   ri   c                 C   s   t  d| t j¡rdS dS d S )Nz^\s*model\s*{gffffffæ?ç        ©rt   ÚsearchÚM©Útextrƒ   rƒ   r„   Úanalyse_textÍ   s    zBugsLexer.analyse_textN)rj   rk   rl   rm   rn   rp   rq   ro   rs   Ú
_FUNCTIONSÚ_DISTRIBUTIONSr   r	   ry   r   r   r   r�   r   r~   ÚformatÚjoinr   r}   r   r
   r‚   rÇ   rƒ   rƒ   rƒ   r„   r   u   s<   ÿþÿÿèø$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.
    ZJAGSZjagsz*.jagr…   z https://mcmc-jags.sourceforge.ior†   )2r   r‡   rˆ   r‰   rŠ   r‹   rŒ   r$   r%   r�   rŽ   r(   r‘   Zifelser�   r0   r’   r“   r”   r•   r–   r—   r˜   r=   r>   r@   r™   rB   rC   rš   r›   rœ   r�   r2   rž   r3   rŸ   rA   r¡   r/   r    r¢   Útr   Úacoshr   Úasinhr   r¦   r¤   c                 c   s   | ]}d |› �V  qdS )z[dpq]Nrƒ   )Ú.0Úxrƒ   rƒ   r„   Ú	<genexpr>ë   ó    zJagsLexer.<genexpr>)ZbernÚbetaZdchiqsqrr¬   r­   r®   Úgammaz	gen.gammaZlogisZlnormZnegbinZnchisqrZnormÚparZpoisZweib)r¯   r°   Zdbetabinr¨   r©   rª   r«   r²   r³   rµ   r´   r±   ZdbinomZdchisqZdnbinomZdweibullZ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¸   ri   c                 C   sF   t  d| t j¡r>t  d| t j¡r$dS t  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ƒ   r„   rÇ      s    zJagsLexer.analyse_textN) rj   rk   rl   rm   rn   rp   rq   ro   rs   rÈ   ÚtuplerÉ   Z_OTHER_DISTRIBUTIONSr   r   r	   rz   ry   r   r   r   r�   r   ZDeclarationr~   rÊ   rË   r}   r   r
   r‚   rÇ   rƒ   rƒ   rƒ   r„   r   Ô   sR   ÿÿþüÿ
ÿþýçò+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>`__.
    ZStanZstanz*.stanzhttps://mc-stan.orgr†   r¶   rÖ   z	(//|#).*$z"[^"]*"r¸   r   z({})(\s*)(\{{)r»   )Z	functionsÚdataztransformed\s+?dataÚ
parametersztransformed\s+parametersrc   z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   s   t  d| t j¡rdS dS d S )Nz^\s*parameters\s*\{g      ð?rÁ   rÂ   rÅ   rƒ   rƒ   r„   rÇ     s    zStanLexer.analyse_textN)(rj   rk   rl   rm   rn   rp   rq   ro   rs   r   r	   rz   ry   r   r   rÊ   rË   r   r   r�   r   r   ZKEYWORDSÚTYPESÚTyper
   r   Z	FUNCTIONSr   r}   ZDISTRIBUTIONSZPseudoZRESERVEDr~   ZFunctionr   r|   r-   r‚   rÇ   rƒ   rƒ   rƒ   r„   r   ,  sd   ÿýýÿÿÿ
È÷Er   )rm   rt   Zpygments.lexerr   r   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   rƒ   rƒ   rƒ   r„   Ú<module>   s   
 ,^_X