o aH4@sdZddlZddlmZmZmZmZmZddlm Z m Z m Z m Z m Z mZmZmZmZddlmZddlmZgdZGdd d eZGd d d eZGd d d eZGdddeZdS)z pygments.lexers.modeling ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for modeling languages. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) RegexLexerincludebygroupsusingdefault) TextCommentOperatorKeywordNameStringNumber Punctuation Whitespace) HtmlLexer)_stan_builtins) ModelicaLexer BugsLexer JagsLexer StanLexerc@s$eZdZdZdZdgZdgZdgZej ej BZ dZ de fdejfd ejfged d ejd fd efdefdejfdejfdejfdejfdejfdejdfdejfdejdfe efg ed dejfdejdfe ejdfe dged e ej!dfe dgd ejdfdej"fde#e$fdejfgdZ%d S)!rz\ For `Modelica `_ source code. .. versionadded:: 1.1 Modelicamodelicaz*.moztext/x-modelicaz"(?:'(?:[^\\']|\\.)+'|[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)\bclassz(false|true)\bzwithin\bpackage-prefixz(function|record)\bz(if|for|when|while)\bz#popz\\[\'"?\\abfnrtv]z6(?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))z <|\\?[^"\\<]+)rrootrrrN)&__name__ __module__ __qualname____doc__namealiases filenames mimetypesreDOTALL MULTILINEflags_namerrSingle Multilinerr Doublerr r FloatIntegerr Builtinr ReservedWordConstantClassr NamespaceEscaperrtokensr8r8:/usr/lib/python3/dist-packages/pygments/lexers/modeling.pyrsd     !     rc@seZdZdZdZgdZdgZdZ dZ de fgde j fge d e d d e eje efd ejfd deeejfdefdefdefdefdefdefg dZddZdS)rzv Pygments Lexer for `OpenBugs `_ and WinBugs models. .. versionadded:: 1.6 BUGS)bugswinbugsopenbugs*.bug)>absarccosarccosharcsinarcsinharctanarctanhcloglogcoscosh cumulativecutdensitydevianceequalsexprgammapilogiticloglogintegralloglogfactloggamlogitmaxminphiz post.p.valuepowz prior.p.valueprobitzreplicate.postzreplicate.priorroundsinsinhsolutionsqrtsteptantanhtruncinprod interp.lininverselogdetmeanz eigen.valsodeprodzp.valueMrankrankedzreplicate.postMsdsortsumDIFTC)dberndbindcatdnegbindpoisdhyperdbetadchisqrddexpdexpdflatdgammadgevdfdggammadgpardloglikdlnormdlogisdnormdpardtdunifdweibdmultiddirchdmnormdmtdwish\s+#.*$commentsrz(model)(\s+)(\{)(for|in)(?![\w.]) (%s)(?=\s*\()|z[A-Za-z][\w.]*&[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?\[|\]|\(|\)|:|,|;<-|~z \+|-|\*|/[{}]rrrcCtd|tjr dSdS)Nz ^\s*model\s*{gffffff?r&searchMtextr8r8r9 analyse_textzBugsLexer.analyse_textN)rrr r!r"r#r$ _FUNCTIONS_DISTRIBUTIONSrrr+rrr r5rr1joinr r0r r r7rr8r8r8r9rbsB    %rc@seZdZdZdZdgZddgZdZeddd DZ d Z d e fgd e fgd e jfde jfgededdeeje efdejfdejfddee e e jfeddefdefdefdefdefg dZddZdS) rz= Pygments Lexer for JAGS. .. versionadded:: 1.6 JAGSjagsz*.jagr>)2r?r@rArBrCrDrErGrHrFrMexprQifelserPrSrTrUrVrYrZr[r\r]r^r`rarbrcrdrerfrhrWrirXrkrprnrgrlrotacosacoshasinasinhatanrtrrccs|]}d|VqdS)z[dpq]%sNr8).0xr8r8r9 szJagsLexer.)bernbetadchiqsqrr~rrgammaz gen.gammalogislnormnegbinnchisqrnormparpoisweib)rrdbetabinrvrwrxr{rrrrrdbinomdchisqdnbinomdweibullddirichrz[a-zA-Z][\w.]*\b (?s)/\*.*?\*/rrrz(model|data)(\s+)(\{)z var(?![\w.])rrrnamesrrrz&\+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%r)rrrrcCs@td|tjrtd|tjrdStd|tjrdSdSdS)Nz^\s*model\s*\{z ^\s*data\s*\{g?z^\s*varg333333?rrrr8r8r9rszJagsLexer.analyse_textN)rrr r!r"r#r$rtupler_OTHER_DISTRIBUTIONSrr rr,r+rrr r5r Declarationr1rr0r r r7rr8r8r8r9rsP   +rc@s^eZdZdZdZdgZdgZdefgdej fdej fgde fe d e d d d d eejeefdefdd ejefdefdd ejejfdeeeeeefdeeeeeefdefdd ejejfdd ejeeeejfdejjfdd ejejfdejfdefde j!fde j!fde j"fdefdefdefdefgd Z#d!d"Z$d#S)$ra 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 `__. .. versionadded:: 1.6 Stanstanz*.stanrrz (//|#).*$z"[^"]*"rrz (%s)(\s*)(\{)r) functionsdataztransformed\s+?data parametersztransformed\s+parametersmodelzgenerated\s+quantitiesz target\s*\+=z(%s)\bz T(?=\s*\[)z(<)(\s*)(upper|lower)(\s*)(=)z(,)(\s*)(upper)(\s*)(=)z [;,\[\]()]rz(~)(\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\+|-|\.?\*|\.?/|\\|'|\^|!=?|<=?|>=?|\|\||&&|%|\?|:rz\|rcCr)Nz^\s*parameters\s*\{g?rrrr8r8r9rirzStanLexer.analyse_textN)%rrr r!r"r#r$rrr,r+r rrrr r5rrKEYWORDSTYPESTyper r FUNCTIONSr r0 DISTRIBUTIONSPseudoRESERVEDr1Functionr r.r/r7rr8r8r8r9rs^     Ar)r!r&pygments.lexerrrrrrpygments.tokenrrr r r r r rrpygments.lexers.htmlrpygments.lexersr__all__rrrrr8r8r8r9s ,  K`X