a
    €˜ëjŒ!  ã                   @   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-present 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�   úS/mnt/bigstor/www/usecases/.venv/lib/python3.9/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   Ú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;   z]'z]?z]!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