HOME


Mini Shell 1.0
DIR: /usr/lib/python3/dist-packages/pygments/lexers/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/pygments/lexers/__pycache__/algebra.cpython-312.pyc
�

|�e�&����dZddlZddlmZmZmZmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZgd�ZGd�de�ZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�Zy)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�
RegexLexer�bygroups�
do_insertions�words)
�Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Generic�
Whitespace)�GAPLexer�GAPConsoleLexer�MathematicaLexer�
MuPADLexer�BCLexerc���eZdZdZdZdZdgZgd�Zddejfde
fd	efd
efde
jfde
jfd
efdej"fde
j$fdefdefdefgiZd�Zy)rz9
    For GAP source code.

    .. versionadded:: 2.0
    �GAPzhttps://www.gap-system.org�gap)z*.gz*.gdz*.giz*.gap�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}tjd|�r|dz
}tjd|�r|dz
}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  �9/usr/lib/python3/dist-packages/pygments/lexers/algebra.py�analyse_textzGAPLexer.analyse_textHsV�����9�9�
>�?C�
�
�S�L�E��9�9�
H�IM�
�
�S�L�E��5�#���N)�__name__�
__module__�__qualname__�__doc__�name�url�aliases�	filenamesr	�Singler
rrr�Constant�Builtinr
�Word�Variablerr�tokensr(�r)r'rrs����
�D�
&�C��g�G�0�I�	�
�g�n�n�%�
!�6�*�
!�;�/���
���]�]�
���\�\�	
�
-�h�7���]�]�
�$�%)�]�]�
4�0��8�
$�f�-�
�4�L�G$
�&�F�Pr)rc�.�eZdZdZdZddgZdgZd�Zd�Zy)	rz`
    For GAP console sessions. Modeled after JuliaConsoleLexer.

    .. versionadded:: 2.14
    zGAP sessionzgap-consolezgap-replz*.tstc	#�K�tdi|j��}d}d}g}d}d}|jd��D�])}|jd�s|jd�r>|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|f��d}n|tj|f��d}|t|�z
}��,|r$t||j|��Ed{���yy7��7��w)
Nr�FT)�keependszgap> zbrk> �z> �zError, r8)r�options�
splitlines�
startswith�append�lenr�Promptr�get_tokens_unprocessed�Error�Output)	�selfr%�gaplexer�start�curcode�
insertions�output�error�lines	         r'rEz&GAPConsoleLexer.get_tokens_unprocessedfs������+�d�l�l�+�������
������O�O�T�O�2�	�D����w�'�4�?�?�7�+C��!�!�3�w�<�1�g�n�n�d�2�A�h�2O�1P�"Q�R��4���8�#����������� 5��!�!�3�w�<�1�g�n�n�d�2�A�h�2O�1P�"Q�R��4���8�#���,�"�H�$C�$C�G�$L� N�N�N� �G�!#�J��?�?�9�-�������4�4� �E������5�5����S��Y��E�+	�.�$��H�;�;�G�D�F�
F�
F��N��
F�s%�DF�F�A;F�F
�F�
Fc�2�tjd|�ryy)Nz^gap> g�������?r!)r"r#)r%s r'r(zGAPConsoleLexer.analyse_text�s��
�9�9�Y��%��r)N)	r*r+r,r-r.r0r1rEr(r8r)r'rr\s+���
�D��j�)�G��	�I�!F�Hr)rc�2�eZdZdZdZdZgd�Zgd�Zgd�ZdZ	dZ
d	�Zd
de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/)�mathematica�mma�nb)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>=)�,�;�(�)�[�]�{�}c�8�ddjd�|D��zS)Nz(%s)r]c3�FK�|]}tj|����y�w)N)r"�escape)�.0�entrys  r'�	<genexpr>z1MathematicaLexer._multi_escape.<locals>.<genexpr>�s����!H�u�"�)�)�E�"2�!H�s�!)�join)�entriess r'�
_multi_escapezMathematicaLexer._multi_escape�s������!H��!H�H�I�Ir)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�	Namespacer6r�Float�Integerrr
rr
rrr7r8r)r'rr�s����
�D�
/�C�*�G�2�I�0�I��I�;�K�J�	�
��)�
(�$�.�.�9�
,�d�m�m�<�
�d�m�m�$�
'��.�
�F�L�L�)�
�F�L�L�)�
�v�~�~�&�
�9�
�x�(�
�;�
��-�
�v��
�T�_�_�%�
��Fr)rc���eZdZdZdZdZdgZdgZdejfdejdfd	efd
efde
fdejfd
ej fdej"j$fdefdej(fdefdeej.ee�fdej2fdefdefdefdefgdejfdejdfdejdfdejfgd�Zy)rzv
    A MuPAD lexer.
    Contributed by Christopher Creutzig <christopher@creutzig.de>.

    .. versionadded:: 0.8
    �MuPADzhttp://www.mupad.com�mupadz*.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
rrr�Classr3r4�Pseudor
r5rr�Functionrr6rr7r8r)r'rr�s^����D�
 �C��i�G���I�����'�
�W�&�&�	�2�
!�6�*�
!�;�/�
��

��
�j�j�
"��
�]�]�
�%�d�l�l�&9�&9�:�
=�x�H���]�]�

�1�&�9�<��d�m�m�T�;�
7�
9�1�26�-�-�
A�0��8�
$�f�-�
�Z� �
�4�L�c2
�h��)�)�*�
�W�&�&��0�
�W�&�&��/�
�g�'�'�(�	
�i:�Fr)rc	���eZdZdZdZdZdgZdgZdejdfde
fd	efed
d��e
fd
efdefdefdefgdejfdejdfdejfgd�Zy)rz0
    A BC lexer.

    .. versionadded:: 2.1
    �BCz https://www.gnu.org/software/bc/�bcz*.bcr~rrz[{}();,])�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[^*/]+r�r�r�r�N)r*r+r,r-r.r/r0r1r	r�r
rrrr
rrr7r8r)r'rrs����
�D�
,�C��f�G���I��W�&�&�	�2�
!�6�*�
�+�&�
� �).�/�18�
9�"�#+�
-�"�6�*�
�&�!�
�4�L�
� ��)�)�*�
�W�&�&��/�
�g�'�'�(�
�!�Fr)r)r-r"�pygments.lexerrrrrr�pygments.tokenrr	r
rrr
rrrr�__all__rrrrrr8r)r'�<module>r�so���
�L�L�-�-�-���D�z�D�N6�e�6�r-�z�-�`F��F�R �j� r)