o
    sdf(                     @   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.
    Dylanhttp://www.opendylan.org/dylan)z*.dylanz*.dylz*.intrztext/x-dylanz0.7>%   threadsubclassmoduleinlineinstanceZconcreteZvirtualclassmethodzeach-subclassimportslotZdynamic	exceptionvariableZconstantlibraryzcompiler-sidewayszinline-onlykeywordmacroZgenericdomainZabstractZsidewayszcompiler-openopen	interfaceZsealed	singleton	inheritedrequiredhandlerblockprimaryfunctionexclude>   begintolocaldefinerenameZ	otherwisecreateZletwhenZthenZuseselectsignalelseZuntilZelseifZbelowZ
afterwardsfinallyiffromforZbywhileZaboveinZunlesscasecleanupZexportend>   z==<~z~=z<=&-^+>|z~==z>=*=>   Zlogiorcurryzremove-duplicateszfind-keyz#generic-function-mandatory-keywordsz
add-methodzsort!identityfloorzrestart-queryzlogbit?zadd-new!zobject-hashvalueszone-ofzremove!ZlogandZrankrangezdirect-subclassesz	choose-byabsZconjoinztype-for-copyr)   Zreduce1alwayspushmapzfloor/listzeven?zremove-key!zdirect-superclasseszreturn-descriptionznext-methodpairremovezany?zsorted-applicable-methodsz
type-unionztail-setterZvectorzas-uppercasez	integral?zrow-major-indexsizesortzreverse!reducezfunction-argumentszcondition-format-stringZarefzfind-methodzsubtype?addr9   gcdbreaksecondZchooseZlogxorzaref-setterzfill!error	dimensionzsecond-setterzmember?intersectionZlognotzas-lowercase!unionfirstzelement-setterdo	remainderzconcatenate-aszshallow-copyzceiling/Zrcurryzodd?zsubsequence-positionmaxzempty?negativezall-superclasseszremove-duplicates!zevery?zfunction-specializerszslot-initialized?Zdisjoinzreturn-allowed?thirdZ
complementztype-error-valueaszadd!zdefault-handlerzfalse-orZmoduloroundzcondition-format-argumentszapplicable-method?zas-lowercaseZceilingzremove-methodzkey-sequenceminzzero?
dimensionsz	instance?Z
initializezas-uppercase!zround/zcopy-sequencezdo-handlersztable-protocolzobject-classZconcatenatelcmZlimitedztype-error-expected-typezfunction-return-valuesz	push-lastz	positive?makezreturn-queryzpop-lastzhead-setterz	truncate/zbackward-iteration-protocolreversezforward-iteration-protocollastheadz	negative?tailzkey-testz
check-typezmap-intozmerge-hash-codeszsize-setterzgeneric-function-methodsZashtruncatezadd-newpopabortZcomposezfirst-setterZcerrorapplyzreplace-elements!zmap-aszreplace-subsequence!zlast-setterelementzthird-setterz\\?[\w!&*<>|^$%@\-+~?/=]+c                 c   s    t | |D ]E\}}}|tu rF| }|| jv r!|tj|fV  q|| jv r-|t|fV  q|| jv r:|tj|fV  q|| j	v rF|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   ^/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/pygments/lexers/dylan.pyrz   ]   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-]+:rD   rJ   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flagsr|   r~   r   r   Z
valid_namerz   r   r   Singler   r   	Attributer	   r   r   	MultilineCharr   BinOctFloatIntegerHexTagr}   r   r   Symbolr
   ClassVariableGlobalConstant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.
    DylanLIDz	dylan-lid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 di | j}d}g }t|D ]I}| }| j|}|d urA| }|t	|dt
j|d | fgf |||d  7 }q|rRt|||E d H  d}g }| t
j|fV  q|rkt|||E d H  d S d S )N r   r   )r   optionsr   finditergroup
_prompt_rematchrC   appendlenr   Promptr   rz   startOutput)	r   r   ZdylexerZcurcode
insertionsr   linemrC   r   r   r   rz     s2   

z(DylanConsoleLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   r   r   Z_exampler   compiler   rz   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