3

V'íc‘&ã@sºdZddlZddlmZmZmZmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddddd	gZGd
d„deƒZGdd„deƒZGdd„deƒZGd
d„deƒZGdd	„d	eƒZdS)z×
    pygments.lexers.algebra
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for computer algebra systems.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
éN)ÚLexerÚ
RegexLexerÚbygroupsÚ
do_insertionsÚwords)
ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚGenericÚ
WhitespaceÚGAPLexerÚGAPConsoleLexerÚMathematicaLexerÚ
MuPADLexerÚBCLexerc@sŒeZdZdZdZdZdgZddddgZd	d
ej	fde
fdefd
efde
jfde
jfdefdejfde
jfdefdefdefgiZdd„ZdS)rz9
    For GAP source code.

    .. versionadded:: 2.0
    ZGAPzhttp://www.gap-system.orgZgapz*.gz*.gdz*.giz*.gapÚrootz#.*$z"(?:[^"\\]|\\.)*"z\(|\)|\[|\]|\{|\}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\.|,|:=|;|=|\+|-|\*|/|\^|>|<z=(?x)\b(?:
                and|or|not|mod|in
              )\bzC(?x)
              (?:\w+|`[^`]*`)
              (?:::\w+|`[^`]*`)*z[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?z\.[0-9]+(?:e[0-9]+)?Ú.cCs6d}tjd|ƒr|d7}tjd	|ƒr,|d7}t|dƒS)
Ngz>(InstallTrueMethod|Declare(Attribute|Category|Filter|Operationz.|GlobalFunction|Synonym|SynonymAttr|Property))gffffffæ?z5(DeclareRepresentation|Install(GlobalFunction|Method|z8ImmediateMethod|OtherMethod)|New(Family|Type)|Objectify)gð?zl(InstallTrueMethod|Declare(Attribute|Category|Filter|Operation|GlobalFunction|Synonym|SynonymAttr|Property))zm(DeclareRepresentation|Install(GlobalFunction|Method|ImmediateMethod|OtherMethod)|New(Family|Type)|Objectify))ÚreÚsearchÚmin)ÚtextZscore©rú;/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/algebra.pyÚanalyse_textHszGAPLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ	filenamesrÚSinglerrr
rÚConstantÚBuiltinr	ÚWordÚVariabler
rÚtokensrrrrrrs,c@s2eZdZdZdZddgZdgZdd„Zdd	„Zd
S)rz`
    For GAP console sessions. Modeled after JuliaConsoleLexer.

    .. versionadded:: 2.14
    zGAP sessionzgap-consolezgap-replz*.tstc	csVtf|jŽ}d}d}g}d}d}x|jddD]}|jdƒsJ|jdƒrˆ|jt|ƒdtj|dd…fgfƒ||dd…7}d}d}nž|rÎ|jd	ƒrÎ|jt|ƒdtj|dd
…fgfƒ||d
d…7}nX|rðt||j	|ƒƒEdHd}g}|jdƒpü|r|tj
|fVd}n|tj|fVd}|t|ƒ7}q0W|rRt||j	|ƒƒEdHdS)NrÚFT)Úkeependszgap> zbrk> éz> ézError, )rÚoptionsÚ
splitlinesÚ
startswithÚappendÚlenrZPromptrÚget_tokens_unprocessedÚErrorZOutput)	ÚselfrZgaplexerÚstartZcurcodeZ
insertionsÚoutputÚerrorÚlinerrrr6fs:$$z&GAPConsoleLexer.get_tokens_unprocessedcCstjd|ƒrdSdSdS)Nz^gap> gÍÌÌÌÌÌì?g)rr)rrrrrŠszGAPConsoleLexer.analyse_textN)	rr r!r"r#r%r&r6rrrrrr\s$c @s°eZdZdZdZdZdddgZddd	d
gZddd
dgZdEZ	dFZ
d7d8„Zd9d:efd;e
jfd<e
jfd=e
jfd>e
fd?ejfd@ejfdAejfee	ƒefee
ƒefdBefdCejfgiZdDS)GrzG
    Lexer for Mathematica source code.

    .. versionadded:: 2.0
    ZMathematicaz#http://www.wolfram.com/mathematica/ZmathematicaZmmaÚnbz*.nbz*.cdfz*.nbpz*.mazapplication/mathematicaz#application/vnd.wolfram.mathematicaz+application/vnd.wolfram.mathematica.packagezapplication/vnd.wolfram.cdfú;;ú=ú=.ú!===ú:=ú->ú:>ú/.ú+ú-Ú*ú/ú^ú&&ú||ú!ú<>ú|ú/;ú?ú@ú//ú/@ú@@ú@@@ú~~ú===ú&ú<ú>ú<=ú>=ú,ú;ú(ú)ú[ú]Ú{Ú}cCsddjdd„|DƒƒS)Nz(%s)rOcss|]}tj|ƒVqdS)N)rÚescape)Ú.0Úentryrrrú	<genexpr>®sz1MathematicaLexer._multi_escape.<locals>.<genexpr>)Újoin)ÚentriesrrrÚ
_multi_escape­szMathematicaLexer._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".*?"z\s+N) r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r])r^r_r`rarbrcrdre)rr r!r"r#r$r%r&Ú	mimetypesÚ	operatorsÚpunctuationrlrrÚ	Namespacer+r
ZFloatZIntegerrr	rrrrr,rrrrr•s6


c@sÔeZdZdZdZdZdgZdgZdej	fdej
dfd	efd
efde
fdejfd
ejfdejjfdefdejfdefdeejeeƒfdejfdefdefdefdefgdej
fdej
dfdej
dfdej
fgdœZdS)rzv
    A MuPAD lexer.
    Contributed by Christopher Creutzig <christopher@creutzig.de>.

    .. versionadded:: 0.8
    ZMuPADzhttp://www.mupad.comZmupadz*.muz//.*?$z/\*Úcommentz"(?:[^"\\]|\\.)*"z\(|\)|\[|\]|\{|\}a¹(?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#]*|`[^`]*`)*z[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?z\.[0-9]+(?:e[0-9]+)?z\s+rz[^/*]+z#pushz\*/z#popz[*/])rrqN)rr r!r"r#r$r%r&rr'Ú	Multilinerrr
rZClassr(r)ZPseudor	r*r
rZFunctionrr+rr,rrrrrÅs:



c@s„eZdZdZdZdZdgZdgZdej	dfde
fd	efed(dde
fdefdefd efd!efgd"ej	fd#ej	d$fd%ej	fgd&œZd'S))rz0
    A BC lexer.

    .. versionadded:: 2.1
    ZBCz https://www.gnu.org/software/bc/Zbcz*.bcz/\*rqz"(?:[^"\\]|\\.)*"z[{}();,]ÚifÚelseÚwhileÚforÚbreakÚcontinueÚhaltÚreturnÚdefineÚautoÚprintÚreadÚlengthÚscaleÚsqrtÚlimitsÚquitÚwarrantyz\b)Úsuffixz!\+\+|--|\|\||&&|([-<>+*%\^/!=])=?z[0-9]+(\.[0-9]*)?z\.[0-9]+rz[^*/]+z\*/z#popz[*/])rrqN)rsrtrurvrwrxryrzr{r|r}r~rr€rr‚rƒr„)rr r!r"r#r$r%r&rrrrrrr
r	r
rr,rrrrrs(

)r"rZpygments.lexerrrrrrZpygments.tokenrrr	r
rrr
rrrÚ__all__rrrrrrrrrÚ<module>	s0G90I