o aa@sdZddlZddlmZmZmZddlmZmZm Z m Z m Z m Z m Z mZmZgdZGdddeZGdd d eZGd d d eZGd d d eZdS)z pygments.lexers.algebra ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for computer algebra systems. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N) RegexLexerbygroupswords) TextCommentOperatorKeywordNameStringNumber Punctuation Whitespace)GAPLexerMathematicaLexer MuPADLexerBCLexerc@seZdZdZdZdgZgdZddejfde fde fd e fd e j fd e jfd efd ejfde jfdefdefdefg iZddZdS)rzX For `GAP `_ source code. .. versionadded:: 2.0 GAPgap)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\.|,|:=|;|=|\+|-|\*|/|\^|>|   (rc@seZdZdZdZgdZgdZgdZdZdZ dd Z d d e fd e j fd e jfde jfde fdejfdejfdejfeeefee efdefdejfg iZdS)rzp Lexer for `Mathematica `_ source code. .. versionadded:: 2.0 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>=),;()[]{}cCsdddd|DS)Nz(%s)r:css|]}t|VqdS)N)rescape).0entryrrr rsz1MathematicaLexer._multi_escape..)join)entriesrrr _multi_escapeqszMathematicaLexer._multi_escaperz(?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'r( mimetypes operators punctuationrNrr Namespacer-r FloatIntegerrrr r rr r.rrrr rZs0  rc@seZdZdZdZdgZdgZdejfdej dfde fd e fd e fd e jfd e jfd e jjfdefdejfdefdee jee fde jfdefdefdefdefgdej fdej dfdej dfdej fgdZdS)rz A `MuPAD `_ lexer. Contributed by Christopher Creutzig . .. versionadded:: 0.8 MuPADmupadz*.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#]*|`[^`]*`)*rrrOrz[^/*]+z#push\*/#pop[*/]rrYN)r"r#r$r%r&r'r(rr) Multiliner r rr Classr*r+Pseudorr,r rFunctionrr-r r.rrrr rsR     4   rc @seZdZdZdZdgZdgZdejdfde fde fe d d d e fd e fd efdefdefgdejfdejdfdejfgdZdS)rzV A `BC `_ lexer. .. versionadded:: 2.1 BCbcz*.bcrXrYrz[{}();,])ifelsewhileforbreakcontinuehaltreturndefineautoprintreadlengthscalesqrtlimitsquitwarrantyz\b)suffixz!\+\+|--|\|\||&&|([-<>+*%\^/!=])=?z[0-9]+(\.[0-9]*)?z\.[0-9]+rz[^*/]+rZr[r\r]N)r"r#r$r%r&r'r(rr^r r rrrr rr.rrrr rs2   r)r%rpygments.lexerrrrpygments.tokenrrrrr r r r r __all__rrrrrrrr s ,F/H