o
    *i(                     @   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-2025 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>%   excludesubclass	singletonZconcreteinlinezeach-subclass	inheritedZsealedmethod	exceptionblockabstractzcompiler-sidewaysinstancelibraryzinline-onlyprimaryfunctionmodulekeywordmacroZsidewaysimportvariablezcompiler-openthreaddomainZgenericclassZvirtualhandlerslotZdynamicZ	interfacerequiredZconstantopen>   whenfromZunlessZbelowsignalcleanupZaboveZ	otherwiseforselectZuseinelseZelseifZuntilwhilecasetoZbyendZthendefineZ
afterwardsrenameZletfinallyZexportifbeginlocalcreate>   z~==-^z<=<=z~=&z==+>|~z>=*>   Z
initializelastzfunction-return-valuesz	positive?zremove-methodZlognotzall-superclassesz	push-lastr3   Zcerrorzelement-setterpairunionzmember?zdo-handlerszone-ofztype-for-copylistZrcurryzsubtype?zadd-new!tailzevery?zaref-setterz#generic-function-mandatory-keywordszany?
dimensionszdirect-superclassesabortzfill!zremove-duplicates!zas-uppercasezempty?zreplace-elements!zrow-major-indexzcopy-sequencezremove-duplicatesapplyzsort!zeven?dosecondztable-protocolr   head	dimensionnegativeZrankzbackward-iteration-protocolZdisjoinZmodulofloorzforward-iteration-protocolzreturn-allowed?Zceilingreducezconcatenate-asZcomposezfind-keyzmerge-hash-codeszremove-key!zfirst-setterlcmasz
add-methodzkey-testzreplace-subsequence!Zconcatenatethirdzpop-lastz	negative?ztail-setterztype-error-valuezfunction-specializersznext-methodZ
complementzreturn-descriptionzobject-classZlogandzcondition-format-stringpushzsubsequence-positionbreakmapZlogiorzremove!reversezzero?gcdz	integral?maxzlogbit?zlast-setteralwayszas-uppercase!z	instance?Zlogxorsortzfloor/zshallow-copyzfalse-orrangez
type-unionZarefpopzfunction-argumentszgeneric-function-methodszreturn-queryzreverse!truncatesizeZashzcondition-format-argumentszas-lowercaseremoveabszmap-aszkey-sequenceZlimitedminzceiling/zdefault-handlerzadd!z	choose-byzfind-methodzobject-hashzround/	remaindercurryzrestart-queryz	truncate/zas-lowercase!makeztype-error-expected-typez
check-typeerrorzsize-setterintersectionzhead-setterZvectoraddzmap-intofirstroundzapplicable-method?elementzadd-newvalueszsorted-applicable-methodszthird-setterZchoosezodd?Zreduce1zsecond-setterZconjoinzslot-initialized?zdirect-subclassesidentityz\\?[\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   O/home/kim/smarthome/.venv/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-]+:rF   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   zi
    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/console.dylan-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matchr<   appendlenr   Promptr   rz   startOutput)	r   r   ZdylexerZcurcode
insertionsr   linemr<   r   r   r   rz     s2   

z(DylanConsoleLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   r   r   _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