U
    ]gz!                     @   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.
    ZLeanz,https://leanprover-community.github.io/lean3ZleanZ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assumeZsufficesletifelsetheninwithcalcmatchdo\bprefixsuffixZsorryZ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   ZomitrI   rH   exportopen	attribute)(lemmatheoremdefZ
definitionexampleaxiomZaxiomsZconstant	constantsuniverseZ	universes	inductiveZcoinductive	structureextendsclassinstanceZabbreviationznoncomputable theorynoncomputablemutualmetarL   Z	parameter
parametersvariable	variablesZreserve
precedencepostfixr)   notationinfixinfixlinfixrbeginbyend
set_optionZrun_cmd@\[rL   )#eval#check#reduce#exit#print#help)r*   
expression\]#pop[^/-]+#push-/[/-][^\\"]+z9(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4}))rp   rootrL   r   r   r?   c                 C   s   t d| t jrdS d S )Nz^import [a-z]皙?research	MULTILINEtext r   8/tmp/pip-unpacked-wheel-zak7uw41/pygments/lexers/lean.pyanalyse_text   s    zLean3Lexer.analyse_textN)'__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesversion_added_name_segment_namer   r	   Docr   Singler   r   r   Errorr.   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.
    ZLean4z#https://github.com/leanprover/lean4Zlean4r   ztext/x-lean4z2.18u   (?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟](?:(?![λΠΣ])[_a-zA-Zα-ωΑ-Ωϊ-ϻἀ-῾℀-⅏𝒜-𝖟0-9'ⁿ-₉ₐ-ₜᵢ-ᵪ!?])*r   r   )6rB   Z	unif_hintrC   inlinerD   rM   r]   rN   rQ   rT   rU   rS   aliasro   r_   r`   r)   rb   rc   rd   ra   rj   rk   rl   rm   rg   rG   ZusingrE   rX   rI   rH   rJ   rh   rV   rK   rP   rn   opaquerO   macroZelabZsyntaxZmacro_rulesrl   whereZabbrevrY   rW   rL   z#synthrZ   scopedrF   )r   r   obtainr   r   r   r   r   r   r    r!   rf   r"   r#   r$   r%   Znomatchr&   at)r.   r-   r,   )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   ≡r6   r7   u   ↦)r/   r0   r1   r2   r3   r4   r5   r8   r9   r:   r;   r   r   r   r   r   z--.*$r'   r(   r+   r<   z
(?<=\.)\d+z(\d+\.\d*)([eE][+-]?[0-9]+)?r=   r>   r?   r@   rA   ri   rL   rp   rq   rr   rs   rt   ru   rv   rw   z
\\[n"\\\n]rx   c                 C   s   t d| t jrdS d S )Nz^import [A-Z]rz   r{   r   r   r   r   r      s    zLean4Lexer.analyse_textN),r   r   r   r   r   r   r   r   r   r   r   r   Z	keywords1Z	keywords2Z	keywords3	operatorspunctuationr   r	   r   r   r   r   r   r.   r   r   r   r   r   r   r   r
   ZFloatr   r   r   r   r   r   r   r   r   r   r   r   r   r   r      sn   	









0)r   r|   Zpygments.lexerr   r   r   Zpygments.tokenr   r   r   r   r	   r
   r   r   __all__r   Z	LeanLexerr   r   r   r   r   <module>   s   
(q