U
    YShz!                     @   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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omitrL   rK   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metarO   Z	parameter
parametersvariable	variablesZreserve
precedencepostfixr,   notationinfixinfixlinfixrbeginbyend
set_optionZrun_cmd@\[rO   )#eval#check#reduce#exit#print#help)r-   
expression\]#pop[^/-]+#push-/[/-][^\\"]+z9(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4}))rs   rootrO   r   r   rB   c                 C   s   t d| t jrdS d S )Nz^import [a-z]皙?research	MULTILINEtext r   G/root/rtd-docs/venv/lib/python3.8/site-packages/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   Errorr1   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   )6rE   Z	unif_hintrF   inlinerG   rP   r`   rQ   rT   rW   rX   rV   aliasrr   rb   rc   r,   re   rf   rg   rd   rm   rn   ro   rp   rj   rJ   usingrH   r[   rL   rK   rM   rk   rY   rN   rS   rq   opaquerR   macroZelabsyntaxZmacro_rulesro   whereZabbrevr\   rZ   rO   z#synthr]   ZscopedrI   )r   r   obtainr   r   r   r    r!   r"   r#   r$   ri   r%   r&   r'   r(   Znomatchr)   at)r1   r0   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   ≡r9   r:   u   ↦)r2   r3   r4   r5   r6   r7   r8   r;   r<   r=   r>   r   r   r   r   r   z--.*$r*   r+   r.   r?   z
(?<=\.)\d+z(\d+\.\d*)([eE][+-]?[0-9]+)?r@   rA   rB   rC   rD   rl   rO   rs   rt   ru   rv   rw   rx   ry   rz   z
\\[n"\\\n]r{   c                 C   s   t d| t jrdS d S )Nz^import [A-Z]r}   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   r1   r   r   r   r   r   r   r   r
   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   	LeanLexerr   r   r   r   r   <module>   s   
(q