U
    YSh(                     @   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 dddg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dddgZdgZd	Z	e
jZd
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.h%Zd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMhZdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\dRhZd]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddFd*dddddddddddddddddddddddhZdZdd Zdefdejfdeejeeefedgde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dXe dZ 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dejfgdej(dfdej(fgdedfdej.fdefdefd efgd!Z/d"S (#  r   z!
    For the Dylan language.
    Dylanhttp://www.opendylan.org/dylanz*.dylanz*.dylz*.intrztext/x-dylanz0.7subclassZabstractblockZconcreteZconstantclasszcompiler-openzcompiler-sidewaysdomainZdynamiczeach-subclass	exceptionexcludefunctionZgenerichandlerZ	inheritedinlinezinline-onlyinstanceZ	interfaceimportkeywordlibrarymacromethodmoduleopenprimaryrequiredZsealedZsidewaysZ	singletonZslotthreadvariableZvirtualZaboveZ
afterwardsbeginZbelowZbycasecleanupcreateZdefineelseZelseifendZexportfinallyforfromifinZletlocalZ	otherwiserenameselectsignalZthentoZunlessZuntilZusewhenwhile~+-*|^=z==z~=z~==<z<=>z>=&abortabsaddzadd!z
add-methodzadd-newzadd-new!zall-superclassesalwayszany?zapplicable-method?applyZarefzaref-setteraszas-lowercasezas-lowercase!zas-uppercasezas-uppercase!Zashzbackward-iteration-protocolbreakZceilingzceiling/Zcerrorz
check-typechoosez	choose-byZ
complementZcomposeZconcatenatezconcatenate-aszcondition-format-argumentszcondition-format-stringZconjoinzcopy-sequencecurryzdefault-handler	dimension
dimensionszdirect-subclasseszdirect-superclassesZdisjoindozdo-handlerselementzelement-setterzempty?errorzeven?zevery?zfalse-orzfill!zfind-keyzfind-methodfirstzfirst-setterfloorzfloor/zforward-iteration-protocolzfunction-argumentszfunction-return-valueszfunction-specializersgcdz#generic-function-mandatory-keywordszgeneric-function-methodsheadzhead-setteridentityZ
initializez	instance?z	integral?intersectionzkey-sequencezkey-testlastzlast-setterZlcmZlimitedlistZlogandzlogbit?ZlogiorZlognotZlogxormakemapzmap-aszmap-intomaxzmember?zmerge-hash-codesminZmodulonegativez	negative?znext-methodzobject-classzobject-hashzodd?zone-ofpairpopzpop-lastz	positive?pushz	push-lastrangeZrankZrcurryreduceZreduce1	remainderremovezremove!zremove-duplicateszremove-duplicates!zremove-key!zremove-methodzreplace-elements!zreplace-subsequence!zrestart-queryzreturn-allowed?zreturn-descriptionzreturn-queryreversezreverse!roundzround/zrow-major-indexsecondzsecond-setterzshallow-copysizezsize-setterzslot-initialized?sortzsort!zsorted-applicable-methodszsubsequence-positionzsubtype?ztable-protocoltailztail-setterthirdzthird-settertruncatez	truncate/ztype-error-expected-typeztype-error-valueztype-for-copyz
type-unionunionvaluesZvectorzzero?z\\?[\w!&*<>|^$%@\-+~?/=]+c                 c   s   t | |D ]\}}}|tkr| }|| jkr@|tj|fV  q|| jkrX|t|fV  q|| jkrr|tj|fV  q|| j	k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   H/root/rtd-docs/venv/lib/python3.8/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#"z#[a-z0-9-]+: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      sd  
                              
                                                                                                                                                                    $





E



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    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 f | j}d}g }t|D ]}| }| j|}|d k	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matchr2   appendlenr   Promptr   ru   startOutput)	r|   r}   ZdylexerZcurcode
insertionsr   linemr2   r   r   r   ru     s.    

z(DylanConsoleLexer.get_tokens_unprocessedN)r   r   r   r   r   r   r   r   r   r   _exampler   compiler   ru   r   r   r   r   r      s   
)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