|e&dZddlZddlmZmZmZmZmZddlm Z m Z m Z m Z m Z mZmZmZmZmZgdZGddeZGdd eZGd d eZGd d eZGddeZy)z pygments.lexers.algebra ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for computer algebra systems. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer RegexLexerbygroups do_insertionswords) TextCommentOperatorKeywordNameStringNumber PunctuationGeneric Whitespace)GAPLexerGAPConsoleLexerMathematicaLexer MuPADLexerBCLexerceZdZdZdZdZdgZgdZddejfde fd e fd e fd e jfd e jfd efdej"fde j$fdefdefdefg iZdZy)rz9 For GAP source code. .. versionadded:: 2.0 GAPzhttps://www.gap-system.orggap)z*.gz*.gdz*.giz*.gaprootz#.*$"(?:[^"\\]|\\.)*"\(|\)|\[|\]|\{|\}aV(?x)\b(?: if|then|elif|else|fi| for|while|do|od| repeat|until| break|continue| function|local|return|end| rec| quit|QUIT| IsBound|Unbind| TryNextMethod| Info|Assert )\bzD(?x)\b(?: true|false|fail|infinity )\bzx(?x)\b(?: (Declare|Install)([A-Z][A-Za-z]+)| BindGlobal|BIND_GLOBAL )\bz\.|,|:=|;|=|\+|-|\*|/|\^|>|?C  SLE 99 HIM  SLE5#N)__name__ __module__ __qualname____doc__nameurlaliases filenamesr Singler rr r ConstantBuiltinr WordVariablerrtokensr(r)r'rrs D &CgG0I  gnn % !6 * !; /  ]] \\   -h 7]] $%)]] 40 8 $f - 4LG$ &FPr)rc.eZdZdZdZddgZdgZdZdZy) rz` For GAP console sessions. Modeled after JuliaConsoleLexer. .. versionadded:: 2.14 z GAP sessionz gap-consolezgap-replz*.tstc #Ktd i|j}d}d}g}d}d}|jdD])}|jds|jdr>|j t |dt j|ddfgf||ddz }d}d}n|sK|jd r:|j t |dt j|dd fgf||d dz }nk|r't||j|Ed{d}g}|jd s|r|t j|fd}n|t j|fd}|t |z },|r$t||j|Ed{yy77w) NrFT)keependszgap> zbrk> z> zError, r8) roptions splitlines startswithappendlenrPromptrget_tokens_unprocessedErrorOutput) selfr%gaplexerstartcurcode insertionsoutputerrorlines r'rEz&GAPConsoleLexer.get_tokens_unprocessedfs+dll+ OOTO2 Dw'4??7+C!!3w<1gnnd2Ah2O1P"QR48# 5!!3w<1gnnd2Ah2O1P"QR48#,"H$C$CG$L NNN G!#J??9-44 E55 SY E+ . $H;;GDF F F N Fs%DF FA;F F F  F c2tjd|ryy)Nz^gap> g?r!)r"r#)r%s r'r(zGAPConsoleLexer.analyse_texts 99Y %r)N) r*r+r,r-r.r0r1rEr(r8r)r'rr\s+ Dj)G I!FHr)rc2eZdZdZdZdZgdZgdZgdZdZ dZ d Z d d e fd e jfd e jfde jfde fdej"fdej"fdej$fee efee efdefdej0fg iZy)rzG Lexer for Mathematica source code. .. versionadded:: 2.0 Mathematicaz#http://www.wolfram.com/mathematica/) mathematicammanb)z*.nbz*.cdfz*.nbpz*.ma)zapplication/mathematicaz#application/vnd.wolfram.mathematicaz+application/vnd.wolfram.mathematica.packagezapplication/vnd.wolfram.cdf) z;;=z=.z!===z:=z->z:>z/.+-*/^z&&z||!z<>|z/;?@z//z/@z@@z@@@z~~z===&<>z<=z>=),;()[]{}c8ddjd|DzS)Nz(%s)r]c3FK|]}tj|yw)N)r"escape).0entrys r' z1MathematicaLexer._multi_escape..s!Hu"))E"2!Hs!)join)entriess r' _multi_escapezMathematicaLexer._multi_escapes!H!HHIIr)rz(?s)\(\*.*?\*\)z([a-zA-Z]+[A-Za-z0-9]*`)z([A-Za-z0-9]*_+[A-Za-z0-9]*)z#\d*z([a-zA-Z]+[a-zA-Z0-9]*)z -?\d+\.\d*z -?\d*\.\d+z-?\d+z".*?"\s+N)r*r+r,r-r.r/r0r1 mimetypes operators punctuationrsr r Namespacer6rFloatIntegerrr rr rrr7r8r)r'rrs D /C*G2I0I I ;KJ   ) ($.. 9 ,dmm < dmm $ ' . FLL ) FLL ) v~~ & 9 x ( ;  - v  T__ % Fr)rceZdZdZdZdZdgZdgZdejfdejdfd e fd e fd e fd ejfd ej fdej"j$fdefdej(fdefdeej.ee fdej2fdefdefdefdefgdejfdejdfdejdfdejfgdZy)rzv A MuPAD lexer. Contributed by Christopher Creutzig . .. versionadded:: 0.8 MuPADzhttp://www.mupad.commupadz*.muz//.*?$/\*commentrra(?x)\b(?: next|break|end| axiom|end_axiom|category|end_category|domain|end_domain|inherits| if|%if|then|elif|else|end_if| case|of|do|otherwise|end_case| while|end_while| repeat|until|end_repeat| for|from|to|downto|step|end_for| proc|local|option|save|begin|end_proc| delete|frame )\baU(?x)\b(?: DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR| DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT| DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC| DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR )\bz(?x)\b(?: PI|EULER|E|CATALAN| NIL|FAIL|undefined|infinity| TRUE|FALSE|UNKNOWN )\bz\b(?:dom|procname)\bz-\.|,|:|;|=|\+|-|\*|/|\^|@|>|<|\$|\||!|\'|%|~=z(?x)\b(?: and|or|not|xor| assuming| div|mod| union|minus|intersect|in|subset )\bz \b(?:I|RDN_INF|RD_NINF|RD_NAN)\bzi(?x) ((?:[a-zA-Z_#][\w#]*|`[^`]*`) (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*)(\s*)([(])z](?x) (?:[a-zA-Z_#][\w#]*|`[^`]*`) (?:::[a-zA-Z_#][\w#]*|`[^`]*`)*rrrtrz[^/*]+z#push\*/#pop[*/]rrN)r*r+r,r-r.r/r0r1r r2 Multiliner rr r Classr3r4Pseudor r5rrFunctionrr6rr7r8r)r'rrs^ D CiGI ' W&& 2 !6 * !; /   jj  "  ]]   %dll&9&9 : =x H ]]  1& 9<dmmT; 7 9126-- A0 8 $f - Z 4Lc2 h)) * W&& 0 W&& / g'' (  i:Fr)rc eZdZdZdZdZdgZdgZdejdfde fd e fe d d e fd efdefdefdefgdejfdejdfdejfgdZy)rz0 A BC lexer. .. versionadded:: 2.1 BCz https://www.gnu.org/software/bc/bcz*.bcr~rrz[{}();,])ifelsewhileforbreakcontinuehaltreturndefineautoprintreadlengthscalesqrtlimitsquitwarrantyz\b)suffixz!\+\+|--|\|\||&&|([-<>+*%\^/!=])=?z[0-9]+(\.[0-9]*)?z\.[0-9]+rz[^*/]+rrrrN)r*r+r,r-r.r/r0r1r rr rrr r rrr7r8r)r'rrs D ,CfGIW&& 2 !6 * + &  )./18 9"#+ -"6 * & ! 4L )) * W&& / g'' ( !Fr)r)r-r"pygments.lexerrrrrrpygments.tokenrr r r r r rrrr__all__rrrrrr8r)r'rso LL--- DzDN6e6r-z-`FFR j r)