o
    \hz!                     @   sx   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 deZeZG d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                   @   s  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 e
 d Zdefdejdfdedfdejfeddddefeddddejfeddddejfedefeefde 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dej fed#dddej!fd$ej!d%fed&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%d2d3 Z&d4S )5r   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   omitrO   rN   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metarS   	parameter
parametersvariable	variablesreserve
precedencepostfixr-   notationinfixinfixlinfixrbeginbyend
set_optionrun_cmd@\[rS   )#eval#check#reduce#exit#print#help)r.   
expression\]#pop[^/-]+#push-/[/-][^\\"]+z9(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4}))r   rootrS   r   r   rE   c                 C      t d| t jr
dS d S )Nz^import [a-z]皙?research	MULTILINEtext r   W/home/air/segue/gemini/backup/venv/lib/python3.10/site-packages/pygments/lexers/lean.pyanalyse_text      zLean3Lexer.analyse_textN)'__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesversion_added_name_segment_namer   r	   Docr   Singler   r   r   Errorr4   r   r   Symbolr
   IntegerDoubleCharVariableBuiltinPseudo	NamespaceDeclarationr   	MultilineEscapetokensr   r   r   r   r   r      s    


		


,



[c                   @   s  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	 e
 d
 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dejfeddddejfeeejjfeeefe
efde 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dej%feed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-d. Z+d/S )0r   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   )6rH   	unif_hintrI   inlinerJ   rT   rk   rU   rY   r_   ra   r]   aliasr   rn   ro   r-   rq   rr   rs   rp   rz   r{   r|   r}   rv   rM   usingrK   rd   rO   rN   rQ   rw   rb   rR   rX   r~   opaquerV   macroelabsyntaxmacro_rulesr|   whereabbrevrf   rc   rS   z#synthrg   scopedrL   )r   r   obtainr   r   r   r    r"   r#   r$   r%   ru   r&   r'   r(   r)   nomatchr*   at)r4   r3   r2   )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   ↦)r5   r6   r7   r8   r9   r:   r;   r>   r?   r@   rA   r   r   r   r   r   z--.*$r+   r,   r/   rB   z
(?<=\.)\d+z(\d+\.\d*)([eE][+-]?[0-9]+)?rC   rD   rE   rF   rG   ry   rS   r   r   r   r   r   r   r   r   z
\\[n"\\\n]r   c                 C   r   )Nz^import [A-Z]r   r   r   r   r   r   r      r   zLean4Lexer.analyse_textN),r   r   r   r   r   r   r   r   r   r   r   r   	keywords1	keywords2	keywords3	operatorspunctuationr   r	   r   r   r   r   r   r4   r   r   r   r   r   r   r   r
   Floatr   r   r   r   r   r   r   r   r   r   r   r   r   r   r      sp    	









0)r   r   pygments.lexerr   r   r   pygments.tokenr   r   r   r   r	   r
   r   r   __all__r   	LeanLexerr   r   r   r   r   <module>   s    
(q