o
    Si(                     @   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>%   ZconcreteinlineprimaryZgenericvariableZsealedexcludethreadblockclassmoduledomainzcompiler-sidewaysinstancehandlerZdynamicZlibraryfunctionkeyword	exception	singletonmethodZsidewaysZ	interfacemacrozinline-onlyzcompiler-openZvirtualZslotZconstantsubclassopenZ	inheritedZabstractimportrequiredzeach-subclass>   casecreateZdefinefrombeginfinallytoinrenameZ
afterwardsZuseZaboveZbelowZ	otherwiseifendwhileZletselectZexportZunlessforlocalZuntilwhenelseZbyZthenZelseifcleanupsignal>   z<=z~==z>=z==*~-<=+^z~=>&|>   breakzodd?z	positive?zas-uppercase!zkey-sequenceZlognotzceiling/z	choose-byrangeZcomposezthird-setterZlogandreversezbackward-iteration-protocolapplyr&   zshallow-copyztype-error-valuezone-ofzdirect-superclasseszdo-handlerszreplace-elements!zsubsequence-positionzevery?zremove!zmap-asZ
complementz	negative?roundreducezcondition-format-argumentszhead-setterzapplicable-method?zfind-methodzempty?pairzfalse-orzany?headsortzfloor/negativezremove-duplicates!zmerge-hash-codeselementzreturn-queryzeven?unionzfunction-return-valuespopmakezsort!z
check-typezpop-lastfloorabs	remainderz
type-unionlcmZrankr>   aszdefault-handlerzreplace-subsequence!zas-lowercasezobject-hashzfunction-argumentsZconjoinzgeneric-function-methodszslot-initialized?zforward-iteration-protocolZlogxorztype-error-expected-typeZvectorzreverse!tailminzdirect-subclassesmapZchoosez	integral?Zreduce1	dimensionzlogbit?pushzsecond-setterZmodulofirstzsubtype?listzzero?zremove-key!maxzadd!Zrcurryzsize-setterzelement-setterz	instance?zadd-new!zfunction-specializerszreturn-descriptionzreturn-allowed?ztable-protocolintersectiondothirdz	push-lastZlimitedZashZdisjoinZconcatenatezcondition-format-stringzmember?Z
initializezrestart-query
dimensionszconcatenate-aszaref-setterzfind-keyz	truncate/alwaysZceilingzcopy-sequenceZlogiorzfill!ztype-for-copyzremove-methodsecondzround/Zcerroridentitylastz#generic-function-mandatory-keywordszremove-duplicatesztail-settersizezobject-classabortvalueszas-lowercase!zmap-intozall-superclassesgcdZareferrorz
add-methodzas-uppercaseremovezadd-newzlast-setterzsorted-applicable-methodscurryzfirst-settertruncatezrow-major-indexaddzkey-testznext-methodz\\?[\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/home/app/Keep/.python/lib/python3.10/site-packages/pygments/lexers/dylan.pyru   ]   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-]+:rB   rF   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flagsrw   ry   r{   rz   Z
valid_nameru   r   r   Singler   r   	Attributer	   r   r   	MultilineCharr   BinOctFloatIntegerHexTagrx   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matchr6   appendlenr   Promptr   ru   startOutput)	r|   r}   ZdylexerZcurcode
insertionsr   linemr6   r   r   r   ru     s2   

z(DylanConsoleLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   r   r   Z_exampler   compiler   ru   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