
    Mhs5                         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	e          Z G d
 de          Z G d de          Z G d de          ZdS )z
    pygments.lexers.modeling
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for modeling languages.

    :copyright: Copyright 2006-2025 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                   $   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        z  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     X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/modeling.pyr   r      s         D
$ClGI"#IMI$E1E T"W^,7,-
 GL!!6=(+{+)84-v|<V^$
* ,0<
9=  . ' 0'; 01'*,<=DM=
B GL!!#W%56%w'7@DJ'GFOO
 GL!!DNF+GFOO
 6=&)!6=1FU9v}-
e9 9FFFr=   r   c                   D   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
z                       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 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                 J    t          j        d| t           j                  rdS dS )Nz^\s*model\s*{gffffff?        r*   searchMtexts    r>   analyse_textzBugsLexer.analyse_text   s%    9%tRT22 	33r=   N)r    r!   r"   r#   r$   r&   r'   r%   r)   
_FUNCTIONS_DISTRIBUTIONSr   r	   r/   r   r   r   r9   r   r5   formatjoinr   r4   r   r
   r;   r   r<   r=   r>   r   r   b   s>        
 D---G	I
@CM!J&N TN

 gn%
 GJGL!! Xg'{;;= "7#34$$TYYzN/J%K%KLL\ %6?!;/ h8$k"1
" "FH    r=   r   c                      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                       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z   ez                       ej        f ed          defdefdefdefdefgdZd ZdS ) r   z"
    Pygments Lexer for JAGS.
    JAGSjagsz*.jagrD   z https://mcmc-jags.sourceforge.iorE   )2rF   rG   rH   rI   rJ   rK   rL   rN   rO   rM   rT   exprX   ifelserW   rZ   r[   r\   r]   r`   ra   rb   rc   rd   re   rg   rh   ri   rj   rk   rl   rm   ro   r^   rp   r_   rr   rw   ru   rn   rs   rv   tacosacoshasinasinhatanr{   ry   c              #       K   | ]	}d | V  
dS )z[dpq]Nr<   ).0xs     r>   	<genexpr>zJagsLexer.<genexpr>   s@       Q Q1;1;; Q Q Q Q Q Qr=   )bernbetadchiqsqrr   r   r   gammaz	gen.gammalogislnormnegbinnchisqrnormparpoisweib)r   r   dbetabinr}   r~   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                     t          j        d| t           j                  rFt          j        d| t           j                  rdS t          j        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   s    r>   r   zJagsLexer.analyse_text  s`    9&bd33 	y)466 s:tRT22 ss1r=   N) r    r!   r"   r#   r$   r&   r'   r%   r)   r   tupler   _OTHER_DISTRIBUTIONSr   r   r	   r0   r/   r   r   r   r9   r   Declarationr5   r   r   r4   r   r
   r;   r   r<   r=   r>   r   r      s         DhG'"I
,CM	J U Q QPQ Q Q Q QN
* TN

 !$'
 w01gn%	
 GJGL!!%Xg'{;;=g12!7#34 $$TYYz,:0;,@0A &B &B C C \
 GG6?!;/h6Ak"3
) )FV	 	 	 	 	r=   r   c                      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                    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& 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.orgrE   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({})\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                 J    t          j        d| t           j                  rdS dS )Nz^\s*parameters\s*\{g      ?r   r   r   s    r>   r   zStanLexer.analyse_textj  s%    9+T2488 	33r=   N)(r    r!   r"   r#   r$   r&   r'   r%   r)   r   r	   r0   r/   r   r   r   r   r   r   r9   r   r   KEYWORDSTYPESTyper
   r   	FUNCTIONSr   r4   DISTRIBUTIONSPseudoRESERVEDr5   Functionr   r2   r3   r;   r   r<   r=   r>   r   r     s         DhG
I
CM TN
 w017>*
  GJGL!!%%dii 1< '= '= > > Xg'{;;=
 g&dii(?@@AA7KG$dii(<==>>M @Xh
GZMMO'Xk:w
KPPR K($$SXXn.F%G%GHH$,W%,,SXXn6R-S-STT:t|<<>  !45dii(?@@AA7CST%t}54flC+V\:&3V\B*FL9't$,h7KXVk"K m7
A AFF    r=   r   )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>   <module>r      s    
			 H H H H H H H H H H H H H H$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ + * * * * * * * * * * *
B
B
BH H H H HJ H H HV\ \ \ \ \
 \ \ \~U U U U U
 U U UpU U U U U
 U U U U Ur=   