
    Mhz!                         d Z ddlZddl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 ddgZ G d de          ZeZ G d de          ZdS )	z
    pygments.lexers.lean
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for the Lean theorem prover.

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerwordsinclude)CommentOperatorKeywordNameStringNumberGeneric
Whitespace
Lean3Lexer
Lean4Lexerc                      e Zd ZdZdZdZddgZdgZddgZd	Z	d
Z
e
dz   e
z   dz   Zdefdej        dfdedfdej        f eddd          ef eddd          ej        f eddd          ej        f ed          efeefdez   ej        fdej        fdej        fdej        fdej        dfdej        fd ej        fd!ej        j        fg ed"dd          ej         f ed#dd          ej!        fd$ej!        d%f ed&d'          ef e"d(          gd)ej!        d*f e"d(          gd+ej#        fdej#        d,fd-ej#        d*fd.ej#        fgd+ej        fd-ej        d*fd.ej        fgd/ej        fd0ej$        fdej        d*fgd1Z%d2 Z&d3S )4r   z(
    For the Lean 3 theorem prover.
    Leanz,https://leanprover-community.github.io/lean3leanlean3*.leanztext/x-leanztext/x-lean3z2.0u   (?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟](?:(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟0-9'ⁿ-₉ₐ-ₜᵢ-ᵪ])*(\.)*\s+/--	docstring/-commentz--.*?$)forallfunPifromhaveshowassumesufficesletifelsetheninwithcalcmatchdo\bprefixsuffixsorryadmit)SortPropType)():{}[]   ⟨   ⟩u   ‹u   ›   ⦃   ⦄:=,``?z0x[A-Za-z0-9]+z0b[01]+\d+"stringz='(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})|.)'[~?][a-z][\w\']*:\S)importrenaminghiding	namespacelocalprivate	protectedsectionr   omitrQ   rP   exportopen	attribute)(lemmatheoremdef
definitionexampleaxiomaxiomsconstant	constantsuniverse	universes	inductivecoinductive	structureextendsclassinstanceabbreviationznoncomputable theorynoncomputablemutualmetarU   	parameter
parametersvariable	variablesreserve
precedencepostfixr/   notationinfixinfixlinfixrbeginbyend
set_optionrun_cmd@\[rU   )#eval#check#reduce#exit#print#help)r0   
expression\]#pop[^/-]+#push-/[/-][^\\"]+z9(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4}))r   rootrU   r   r   rG   c                 J    t          j        d| t           j                  rdS d S )Nz^import [a-z]皙?research	MULTILINEtexts    T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pygments/lexers/lean.pyanalyse_textzLean3Lexer.analyse_text   *    9%tR\:: 	3	 	    N)'__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesversion_added_name_segment_namer   r
   Docr   Singler   r   r   Errorr6   r   r	   Symbolr   IntegerDoubleCharVariableBuiltinPseudo	NamespaceDeclarationr   	MultilineEscapetokensr    r   r   r   r      s         D
8CwG
I/IM	d  F"]2U:E Z VZ-GY''U   	/ / / 18	9
 U%eEBBBGMRU+E%HHH',WU    DMe^V]+/(V^$6=(+Mv{[!4=1DL'(/
4 U 	 E	+ 	+ 	+ -4,=	? U 0 E1+ + +0 -4,?1A2 W(+6U     &' GL!!S*
X G'0GL!!

 )*G%w/G%v.g'(	
 
#FJ'fj!
 'I6=Y&-(
iY YFv    r   c                      e Zd ZdZdZdZdgZdgZdgZdZ	dZ
e
d	z   e
z   d
z   ZdZdZdZdZdZdefdej        dfdedfdej        f eedd          ej        f eddd          ej        f ee          ej        j        f ee          efe
efdez   ej        fde fde j!        fde j"        fdej#        dfdej$        fd ej        j        fg eedd          ej%        f eedd          efd!ej&        d"f e'd#          gd$ej&        d%f e'd#          gd&ej(        fdej(        d'fd(ej(        d%fd)ej(        fgd&ej        fd(ej        d%fd)ej        fgd*ej#        fd+ej)        fdej#        d%fgd,Z*d- Z+d.S )/r   z(
    For the Lean 4 theorem prover.
    Lean4z#https://github.com/leanprover/lean4lean4r   ztext/x-lean4z2.18u   (?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟](?:(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟0-9'ⁿ-₉ₐ-ₜᵢ-ᵪ!?])*r   r   )6rJ   	unif_hintrK   inlinerL   rV   rm   rW   r[   ra   rc   r_   aliasr   rp   rq   r/   rs   rt   ru   rr   r|   r}   r~   r   rx   rO   usingrM   rf   rQ   rP   rS   ry   rd   rT   rZ   r   opaquerX   macroelabsyntaxmacro_rulesr~   whereabbrevrh   re   rU   z#synthri   scopedrN   )r   r   obtainr   r    r!   r"   r$   r%   r&   r'   rw   r(   r)   r*   r+   nomatchr,   at)r6   r5   r4   )8z!=#&z&&*+-/@!z-.z->.z..z...z::z:>;z;;<z<-=z==>_|z||~z=>z<=z>=z/\z\/u   ∀u   Πu   λu   ↔u   ∧u   ∨u   ≠u   ≤u   ≥   ¬u   ⁻¹u   ⬝u   ▸u   →u   ∃u   ≈   ×u   ⌞u   ⌟u   ≡r>   r?   u   ↦)r7   r8   r9   r:   r;   r<   r=   r@   rA   rB   rC   r   r   r   r   r   z--.*$r-   r.   r1   rD   z
(?<=\.)\d+z(\d+\.\d*)([eE][+-]?[0-9]+)?rE   rF   rG   rH   rI   r{   rU   r   r   r   r   r   r   r   r   z
\\[n"\\\n]r   c                 J    t          j        d| t           j                  rdS d S )Nz^import [A-Z]r   r   r   s    r   r   zLean4Lexer.analyse_text   r   r   N),r   r   r   r   r   r   r   r   r   r   r   r   	keywords1	keywords2	keywords3	operatorspunctuationr   r
   r   r   r   r   r   r6   r   r   r	   r   r   r   r   r   Floatr   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s         D
/CiG
I IM	f  F"]2U:EIII
IK
 Z VZ-GY'w~&U9U59997<HU%eEBBBGMRU9t|23U;*D!e^V]+F#,fl;V^$6=(+!4=1DL'(!
& U9U59997;LMU9U59997CW(+6GL!!	
 G'0GL!!
 )*G%w/G%v.g'(
 
#FJ'fj!
 'FM*&-(
S. .F`    r   )r   r   pygments.lexerr   r   r   pygments.tokenr   r   r   r	   r
   r   r   r   __all__r   	LeanLexerr   r   r   r   <module>r      s     
			 5 5 5 5 5 5 5 5 5 5                                        
&n n n n n n n nb 	j j j j j j j j j jr   