
    ,h&                         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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 G d de      Zy)z
    pygments.lexers.algebra
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for computer algebra systems.

    :copyright: Copyright 2006-2025 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                       e Zd ZdZdZdZdgZg dZdZdde	j                  fd	efd
efdefdej                  fdej                   fdefdej$                  fdej&                  fdefdefdefgiZd Zy)r   z
    For GAP source code.
    GAPhttps://www.gap-system.orggap)z*.gz*.gdz*.giz*.gap2.0rootz#.*$"(?:[^"\\]|\\.)*"\(|\)|\[|\]|\{|\}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+|`[^`]*`)*[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?\.[0-9]+(?:e[0-9]+)?.c                     d}t        j                  d|       r|dz  }t        j                  d|       r|dz  }t        |d      S )N        zl(InstallTrueMethod|Declare(Attribute|Category|Filter|Operation|GlobalFunction|Synonym|SynonymAttr|Property))gffffff?zm(DeclareRepresentation|Install(GlobalFunction|Method|ImmediateMethod|OtherMethod)|New(Family|Type)|Objectify)g      ?)researchmin)textscores     Y/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pygments/lexers/algebra.pyanalyse_textzGAPLexer.analyse_textG   sV     99>?C
 SLE 99HIM
 SLE5#    N)__name__
__module____qualname____doc__nameurlaliases	filenamesversion_addedr	   Singler   r   r   r   ConstantBuiltinr
   WordVariabler   r   tokensr*    r+   r)   r   r      s     D
&CgG0IM 	gnn%!6*!;/  ]] \\	
 -h7 ]]$%)]]4 08$f-4LG$
&FPr+   r   c                   :    e Zd ZdZdZddgZdgZdZdZdZ	d	 Z
d
 Zy)r   zD
    For GAP console sessions. Modeled after JuliaConsoleLexer.
    zGAP sessionzgap-consolezgap-replz*.tstr   z2.14zgap-repl/euclidean.tstc           	   #     K   t        di | j                  }d}d}g }d}d}|j                  d      D ])  }|j                  d      s|j                  d      r>|j	                  t        |      dt        j                  |d d fgf       ||dd  z  }d}d}n|sK|j                  d	      r:|j	                  t        |      dt        j                  |d d
 fgf       ||d
d  z  }nk|r't        ||j                  |            E d {    d}g }|j                  d      s|r|t        j                  |f d}n|t        j                  |f d}|t        |      z  }, |r$t        ||j                  |            E d {    y y 7 7 w)Nr    FT)keependszgap> zbrk>    z>    zError, r;   )r   options
splitlines
startswithappendlenr   Promptr   get_tokens_unprocessedErrorOutput)	selfr'   gaplexerstartcurcode
insertionsoutputerrorlines	            r)   rH   z&GAPConsoleLexer.get_tokens_unprocessedf   s    +dll+
OOTO2 	Dw'4??7+C!!3w<1gnnd2Ah2O1P"QR48# 5!!3w<1gnnd2Ah2O1P"QR48#,"H$C$CG$L N N N G!#J??9-44 E55SYE+	. $H;;GDF F F NFs%   DFFA;FF
F
Fc                 2    t        j                  d|       ryy)Nz^gap> g?r#   )r$   r%   )r'   s    r)   r*   zGAPConsoleLexer.analyse_text   s    
 99Y%r+   N)r,   r-   r.   r/   r0   r2   r3   r1   r4   _examplerH   r*   r;   r+   r)   r   r   [   s:     Dj)G	I
&CM'H!FHr+   r   c                   6   e Zd ZdZdZdZg dZg dZg dZdZ	dZ
d	Zd
 Zddefdej                  fdej                   fdej                   fdefdej$                  fdej$                  fdej&                  f ee
      ef ee      efdefdej2                  fgiZy)r   z,
    Lexer for Mathematica source code.
    Mathematicaz#http://www.wolfram.com/mathematica/)mathematicammanb)z*.nbz*.cdfz*.nbpz*.ma)zapplication/mathematicaz#application/vnd.wolfram.mathematicaz+application/vnd.wolfram.mathematica.packagezapplication/vnd.wolfram.cdfr   ) z;;=z=.z!===z:=z->z:>z/.+-*/^z&&z||!z<>|z/;?@z//z/@z@@z@@@z~~z===&<>z<=z>=),;()[]{}c                 P    dj                  dj                  d | D                    S )Nz({})ra   c              3   F   K   | ]  }t        j                  |        y w)N)r$   escape).0entrys     r)   	<genexpr>z1MathematicaLexer._multi_escape.<locals>.<genexpr>   s     %L5bii&6%Ls   !)formatjoin)entriess    r)   _multi_escapezMathematicaLexer._multi_escape   s     }}SXX%LG%LLMMr+   r   z(?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/   r0   r1   r2   r3   	mimetypesr4   	operatorspunctuationrx   r	   r   	Namespacer9   r   FloatIntegerr   r
   r   r   r   r   r:   r;   r+   r)   r   r      s     D
/C*G2I0I MI ;KN 	)($..9,dmm<dmm$'.FLL)FLL)v~~&9x(;-vT__%
Fr+   r   c                      e Zd ZdZdZdZdgZdgZdZde	j                  fde	j                  d	fd
efdefdefdej                   fdej"                  fdej$                  j&                  fdefdej*                  fdefd eej0                  ee      fdej4                  fdefdefdefdefgde	j                  fde	j                  dfde	j                  dfde	j                  fgdZy) r   z[
    A MuPAD lexer.
    Contributed by Christopher Creutzig <christopher@creutzig.de>.
    MuPADzhttp://www.mupad.commupadz*.muz0.8z//.*?$/\*commentr   r   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#]*|`[^`]*`)*r   r    ry   r!   z[^/*]+z#push\*/#pop[*/]r   r   N)r,   r-   r.   r/   r0   r1   r2   r3   r4   r	   r5   	Multiliner   r   r   r   Classr6   r7   Pseudor
   r8   r   r   Functionr   r9   r   r:   r;   r+   r)   r   r      sc    D
 CiGIM 'W&&	2!6*!;/
 

 jj"
 ]] %dll&9&9:=xH ]] 1&9< dmmT;79126--A 08$f-Z 4Lc2
h ))*W&&0W&&/g''(	
i:Fr+   r   c            	           e Zd ZdZdZdZdgZdgZdZde	j                  dfd	efd
ef edd      efdefdefdefdefgde	j                  fde	j                  dfde	j                  fgdZy)r   z
    A BC lexer.
    BCz https://www.gnu.org/software/bc/bcz*.bcz2.1r   r   r   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]+r!   z[^*/]+r   r   r   r   N)r,   r-   r.   r/   r0   r1   r2   r3   r4   r	   r   r   r   r   r   r
   r   r   r:   r;   r+   r)   r   r     s     D
,CfGIM W&&	2!6*+&   )./ 189"#+- "6*&!4L
  ))*W&&/g''(
!Fr+   r   )r/   r$   pygments.lexerr   r   r   r   r   pygments.tokenr   r	   r
   r   r   r   r   r   r   r   __all__r   r   r   r   r   r;   r+   r)   <module>r      so    
 L L- - -Cz CL7e 7t,z ,^E EPj r+   