a
    Df(                     @   s   d Z ddlZddlmZmZmZ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mZmZ g dZG dd deZG dd	 d	eZG d
d deZdS )z
    pygments.lexers.dylan
    ~~~~~~~~~~~~~~~~~~~~~

    Lexers for the Dylan language.

    :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)Lexer
RegexLexerbygroupsdo_insertionsdefaultline_re)
CommentOperatorKeywordNameStringNumberPunctuationGenericLiteral
Whitespace)
DylanLexerDylanConsoleLexerDylanLidLexerc                   @   s  e Zd ZdZdZdZdgZg dZdgZdZ	e
jZh dZh d	Zh d
Zh dZdZdd Zdefdejfdeejeeefedgdefdeejefdejdfdedfdejfdejfdej fdej!fdej"fdej#fde d eej$eej%fd eej$eej%fd!e ej$fd"e&fd#efd$e'fd%ej(d&fd'e)fed( e)fd)e d* ej*fd+e d+ ej+j,fd,e ej-feefgd-ejfdejd.fd/ejd0fd1ejfgdej(d0fd2ej(fgded0fd3ej.fd4efd5efd6efgd7Z/d8S )9r   z!
    For the Dylan language.
    ZDylanhttp://www.opendylan.org/Zdylan)z*.dylanz*.dylz*.intrztext/x-dylanz0.7>%   Z	inheritedhandlervariableopensubclassZconstantZ	interfaceexcludemoduleZsidewaysdomainZgenerickeywordfunctionmacroZconcreteZsealedZabstract	singletonrequiredzeach-subclass	exceptionZprimaryzcompiler-sidewaysinlineZslotZvirtualimportthreadZdynamiczcompiler-openmethodZlibraryblockzinline-onlyclassinstance>   ZthenbegincleanupselectwhileZ	otherwiseZuntilZaboveforwhenZcaseendfromZuseZunlesstoZletZdefineexportifelseZelseifcreateZbelowlocalfinallyrenameinsignalZ
afterwardsZby>   <>z~==^&z==~z~=+z<=z>=*-|=>   zthird-setteraddbreakzsubsequence-positionminfloorz
add-methodzreverse!zas-uppercaseZmodulopushZlognotzmerge-hash-codeszgeneric-function-methodszmap-intolcmintersectionzany?zempty?Zlimitedzsize-setterapplyzadd-new!zfunction-argumentszobject-hashidentityzfalse-orr;   ztype-error-expected-typetruncatezmap-asunionzslot-initialized?zsort!zsubtype?zfind-keyzdo-handlerszround/astailzceiling/zconcatenate-aszremove-methodZlogiorZdisjoinz#generic-function-mandatory-keywordsz	truncate/zreturn-allowed?zhead-setterZcomposeZconjoinzadd-newzelement-setterzdirect-subclassesztable-protocolz	push-lastreversezdirect-superclassesnegativeZ	dimensionsizezcondition-format-argumentsroundztail-setterpairmaxzmember?zodd?valueszreturn-descriptionZrankzreturn-queryZceilingremovelistZconcatenateZreduce1Z
complementz	integral?abortzrow-major-indexzevery?popz	positive?z	instance?Zvectorzpop-lastlastzreplace-subsequence!zfloor/secondzremove-key!zcopy-sequencefirstzobject-classZlogandZdoabszfunction-return-valuesr    sortzsecond-setterzremove-duplicates!zas-lowercaseZlogxoralwayszremove-duplicatesgcdZ
dimensionszzero?z
type-unionZ
initializeZashreducezforward-iteration-protocolzas-lowercase!zfind-methodz	choose-byzlast-setter	remainderzreplace-elements!mapZcurryzapplicable-method?Zcerrorerrorzone-ofzshallow-copyzadd!zkey-testzall-superclassesZarefrangezas-uppercase!z
check-typezsorted-applicable-methodsz	negative?Zrcurrythirdztype-error-valueznext-methodzeven?ztype-for-copyzlogbit?choosezbackward-iteration-protocolzkey-sequencezremove!elementzdefault-handlerzfirst-setterheadzrestart-querymakezaref-setterzfunction-specializerszcondition-format-stringzfill!z\\?[\w!&*<>|^$%@\-+~?/=]+c                 c   s   t | |D ]\}}}|tu r| }|| jv r@|tj|fV  q|| jv rX|t|fV  q|| jv rr|tj|fV  q|| j	v r|t
|fV  q|||fV  qd S )N)r   get_tokens_unprocessedr   lowerbuiltinsBuiltinkeywordsr
   	functions	operatorsr	   )selftextindextokenvalueZlowercase_value r{   b/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/pygments/lexers/dylan.pyro   ]   s     



z!DylanLexer.get_tokens_unprocessed\s+z//.*?\nz)([a-z0-9-]+)(:)([ \t]*)(.*(?:\n[ \t].+)*)code(//.*?)(\n)z/\*comment"stringz/'(\\.|\\[0-7]{1,3}|\\x[a-f0-9]{1,2}|[^\\\'\n])'z#b[01]+z#o[0-7]+z0[-+]?(\d*\.\d+(e[-+]?\d+)?|\d+(\.\d*)?e[-+]?\d+)z[-+]?\d+z#x[0-9a-f]+z(\?z6)(:)(token|name|variable|expression|body|case-body|\*)z9(\?)(:)(token|name|variable|expression|body|case-body|\*)z\?z,(=>|::|#\(|#\[|##|\?\?|\?=|\?|[(){}\[\],.;])z:=z#[tf]z#"r   z#[a-z0-9-]+:r<   r=   z\*z\$z[^*/]+z#pushz\*/z#popz[*/]z[^\\"]+z,\\([\\abfnrtv"\']|x[a-f0-9]{2,4}|[0-7]{1,3})z	[^\\"\n]+z\\\nz\\)rootr~   r   r   r   N)0__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesversion_addedre
IGNORECASEflagsrq   rs   ru   rt   Z
valid_namero   r   r   Singler   r   	Attributer	   r   r   Z	MultilineCharr   ZBinOctZFloatZIntegerZHexTagrr   r   r   ZSymbolr
   ZClassVariableGlobalConstantZEscapetokensr{   r{   r{   r|   r      s   	$



E


r   c                	   @   sf   e Zd ZdZdZddgZddgZdgZdZd	Z	e
jZd
defdeejefdeejeeefgiZdS )r   z?
    For Dylan LID (Library Interchange Definition) files.
    ZDylanLIDz	dylan-lidZlidz*.lidz*.hdpztext/x-dylan-lidr   1.6r   r}   r   z"(.*?)(:)([ \t]*)(.*(?:\n[ \t].+)*)N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r   r{   r{   r{   r|   r      s    r   c                   @   sF   e Zd ZdZdZddgZdgZdgZdZdZ	d	Z
ed
Zdd ZdS )r   ze
    For Dylan interactive console output.

    This is based on a copy of the RubyConsoleLexer.
    zDylan sessionzdylan-consolez
dylan-replz*.dylan-consoleztext/x-dylan-consoler   r   zdylan-console/consolez\?| c           	   	   c   s   t f i | j}d}g }t|D ]}| }| j|}|d ur| }|t	|dt
j|d | fgf |||d  7 }q"|rt|||E d H  d}g }| t
j|fV  q"|rt|||E d H  d S )N r   )r   optionsr   finditergroup
_prompt_rematchr0   appendlenr   ZPromptr   ro   startZOutput)	rv   rw   ZdylexerZcurcodeZ
insertionsr   linemr0   r{   r{   r|   ro     s.    

z(DylanConsoleLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   r   r   Z_exampler   compiler   ro   r{   r{   r{   r|   r      s   
r   )r   r   Zpygments.lexerr   r   r   r   r   r   Zpygments.tokenr   r	   r
   r   r   r   r   r   r   r   __all__r   r   r   r{   r{   r{   r|   <module>   s   
 0 A