o
    ZhO(                     @   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-2023 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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d/fd0ejfgdej'd/fd1ej'fgded/fd2ej-fd3efd4efd5efgd6Z.d7S )8r   z<
    For the Dylan language.

    .. versionadded:: 0.7
    Dylanzhttp://www.opendylan.org/dylan)z*.dylanz*.dylz*.intrztext/x-dylan>%   keyword	exceptionZsealedZgenericthreadfunctionrequiredblockinlineZdynamicmacro	singletonslotZsidewayssubclassZvirtualimport	interfacehandlermodulevariableclass	inheritedinstanceZabstractprimaryZlibraryexcludedomainopenZconcretezcompiler-sidewayszcompiler-openmethodzeach-subclassZconstantzinline-only>   ZaboveZusebegincleanupiftoZexportendcreateZ
afterwardsfromdefineforZthenZuntilZelseiflocalZ	otherwiserenamefinallyZunlesswhileZbycaseselectwhenZbelowelsesignalinZlet>   ^~<z<=z~=|z>=->z==z~===&*+>   zpop-lastzfalse-orasreverseabszfloor/z	choose-byztype-for-copyr   zround/zfunction-specializersZdisjoinzsorted-applicable-methodszconcatenate-aszreturn-allowed?zkey-sequencezdefault-handlerreducezreplace-elements!zmerge-hash-codeszsubsequence-positionZceilingZconcatenaterangezfind-keyz
check-typemakezdo-handlerszas-lowercase!zreverse!z
type-uniontruncateZlogxorz
add-method	dimensionztail-setterzsort!Zrcurryfloorzdirect-superclasseszapplicable-method?zone-ofz	negative?headzsubtype?Z
complementZlogiorlistzmap-intozmap-aszany?zhead-setterzfirst-setterzadd-new!zslot-initialized?zfind-methodzlogbit?lastlcmzobject-hashzcondition-format-argumentszkey-testztype-error-valueminvalueszreturn-queryZconjoinzremove-duplicateszas-uppercase!zfunction-return-valueszas-lowercasecurryzreturn-descriptionzsize-setterz	instance?unionZvectorZranksecondfirstzreplace-subsequence!sortzall-superclasseszzero?zempty?breakzelement-setterZcerrorpoppushtail
dimensionszadd-newZ
initializeZlogandzthird-setterabortgcdZlimitedmaxznext-methodz#generic-function-mandatory-keywordszgeneric-function-methodselementz	truncate/zshallow-copyz	integral?zfunction-argumentsZreduce1zadd!ztype-error-expected-typezfill!ztable-protocolZcomposeZashzmember?zforward-iteration-protocolZmodulozrow-major-indexadddor@   identityapplyZarefzcondition-format-stringerrorremovezdirect-subclassespairzcopy-sequencesizezevery?zeven?mapzbackward-iteration-protocolzceiling/Zlognotzremove!alwaysroundzremove-key!zas-uppercasenegativezremove-methodzobject-classthirdzremove-duplicates!zlast-setterz	positive?	remainderzsecond-setterzaref-setterzrestart-queryZchoosezodd?z	push-lastintersectionz\\?[\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   L/var/www/html/lang_env/lib/python3.10/site-packages/pygments/lexers/dylan.pyrx   ^   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   rG   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)/__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesre
IGNORECASEflagsrz   r|   r~   r}   Z
valid_namerx   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                	   @   s^   e Zd ZdZdZddgZddgZdg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   zZ
    For Dylan LID (Library Interchange Definition) files.

    .. versionadded:: 1.6
    DylanLIDz	dylan-lidlidz*.lidz*.hdpztext/x-dylan-lidr   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      s    r   c                   @   s>   e Zd ZdZdZddgZdgZdgZdZe	
dZd	d
 ZdS )r   z
    For Dylan interactive console output.

    This is based on a copy of the RubyConsoleLexer.

    .. versionadded:: 1.6
    zDylan sessionzdylan-consolez
dylan-replz*.dylan-consoleztext/x-dylan-consolez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matchr3   appendlenr   Promptr   rx   startOutput)	r   r   ZdylexerZcurcode
insertionsr   linemr3   r   r   r   rx     s2   

z(DylanConsoleLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   _exampler   compiler   rx   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 B