U
    luf,                     @   s~   d Z ddlmZ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 ddlmZmZ dgZG dd deZdS )z
    pygments.lexers.arturo
    ~~~~~~~~~~~~~~~~~~~~~~

    Lexer for the Arturo language.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    )
RegexLexerbygroupsdo_insertionsincludethisusingwords)	CommentErrorKeywordNameNumberOperatorPunctuationStringText)ClassNotFoundget_bool_optArturoLexerc                   @   s  e Zd ZdZdZddgZdgZdZdd Zd	d
 Z	de
jfde
jfedddejfeddddejj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jfdejfdejfdeeee efdej!dfdejd fd!ej!d"fd#ejd$fd%ej!d&fd'e	fd(ejd)fd*ejd+fe"d,d-efed.ej#fed/e$fd0efd1e%j&fd2e'fgd3ej(d4fd5ee fgd6ej(d4fd5ee fged7ej)fge"d8d3ej(d9fd:ej(d;fdej!d4fd<efge"d8d3ej(d9fd:ej(d;fd=ejd4fd>efge"d8d3ej(d9fd:ej(d;fd?ej!d4fd@efgdAej)fd3ej(d9fd:ej(d;fdBejd4fdCej*fge"d8d3ej(d9fd:ej(d;fdDej!d4fdEefge"d8d3ej(d9fd:ej(d;fdFejd4fdGefge"d8d3ej(d9fd:ej(d;fdHejd4fdIefgedJddKdejfedLdddejfgdMZ+dNS )Or   z
    For Arturo source code.

    See `Arturo's Github <https://github.com/arturo-lang/arturo>`_
    and `Arturo's Website <https://arturo-lang.io/>`_.

    .. versionadded:: 2.14.0
    ZArturoZarturoZartz*.artzhttps://arturo-lang.io/c                 K   s    t |dd| _tj| f| d S )Nhandle_annotatedsT)r   r   r   __init__)selfoptions r   :/tmp/pip-unpacked-wheel-7eq1ciah/pygments/lexers/arturo.pyr   $   s    zArturoLexer.__init__c                 c   s  ddl m} |dtj|dfV  |dtj|dfV  |dtj|dfV  |dtj|dfV  d}| j	rz||d
 }W n tk
r   Y nX |d}|dkr|dt|fV  ntg ||E dH  |d	tj|d	fV  dS )
zAdds syntax from another languages inside annotated strings

        match args:
            1:open_string,
            2:exclamation_mark,
            3:lang_name,
            4:space_or_newline,
            5:code,
            6:close_string
        r   )get_lexer_by_name            N      )Zpygments.lexersr   startr   DoublegroupInterpolr   
Whitespacer   stripr   r   Zget_tokens_unprocessed)r   matchr   lexercoder   r   r   handle_annotated_strings)   s     
z$ArturoLexer.handle_annotated_stringsz;.*?$z^((\s#!)|(#!)).*?$)falsetruemaybez\b)suffix)r   initz\b\??:?)prefixr/   z`.`z\\\w+\b\??:?z#\w+z\b[0-9]+\.[0-9]+z\b[0-9]+z	\w+\b\??:z\'(?:\w+\b\??:?)z\:\w+z
\.\w+\??:?z(\()(.*?)(\)\?)"inside-simple-string   »inside-smart-stringu   «««inside-safe-stringz\{\/inside-regex-stringz\{\:inside-curly-verb-stringz#(\{)(\!)(\w+)(\s|\n)([\w\W]*?)(^\})z\{inside-curly-stringz\-{3,}inside-eof-stringbuiltin-functionsz[()[\],])z->==>|z::@#$&!z!!z./)$z<:z:>z:<z>:z<\z<><>   øu   ∞+-*~=^%/z//r<   z<=>z<==>z=>>z<<=>>z<<==>>z-->z<->z<-->z=|z|=z-:z:-_.z..\z\b\w+z\s+z.+$z\|z#popz[^|]+z\|\|\>)z\\\nz\tz\"string-escapeinside-interpolz\<\|\|inside-templatez[^|"]+rQ   z[^|\n]+u   »»»u   [^|»]+z\\[sSwWdDbBZApPxucItnvfr0]+z\/\}z[^|\/]+z\:\}z[^|<:]+z\}z[^|<}]+z\Zz[^|<]+)Fallandanyasciiattr	attributeZattributeLabelbinaryZ	blockcharcontainsZdatabasedate
dictionaryemptyequalZevenZeveryexistsr,   ZfloatinfunctionZgreaterZgreaterOrEqualifininlineintegeriskeylabelZleapZlessZlessOrEqualliterallogicallowernandnegativenornotZnotEqualnullnumericZoddorpathZ	pathLabelZpositiver1   primesetZsomesorted
standalonestringZsubsetr/   ZsupersetZymbolr-   trytypeunlessupperwhen
whitespacewordxnorxorZzeroz\b\?)absacosacoshZacsecZacsechZactanZactanhaddafteralphabetrV   ZangleappendargargsarityarrayasZasecZasechasinasinhatanatan2atanhrY   attrsZaveragebeforeZ	benchmarkZblendbreakZ	builtins1Z	builtins2call
capitalizeZcaseceilZchopchunkclearcloseZclustercolorcombineZconjcontinuecopycoscoshZcoupleZcsecZcsechZctanZctanhcursorZdarkendecdecodeZdecoupleZdefinedeleteZ
desaturateZ	deviationr^   
differencedigestdigitsdivZdodownloadZdropdupeelser_   encodeZensureenvepsilonescapeexecuteexitexpextendextractZfactorsr,   Zfdivfilterfirstflattenfloorfoldfromrb   gammagcdgetgotohashhelphypotrc   rd   incindentindexZinfinityinfoinputinsertinspectintersectioninvertjoinkeysZkurtosislastZletZlevenshteinZlightenlistlnlogZlooprl   mailmapr(   maxr.   Zmedianminmodmodulemulrm   negnewro   	normalizerp   nowrq   openrs   Zoutdentpadpanicrt   pausepermissionsZ	permutatepipoppowZpowersetZpowmodr1   printZprintsprocessproductqueryrandomrangereadrelativeremoverenamerenderrepeatreplacerequestreturnreverseroundsampleZsaturatescriptsecZsechselectZserverv   ZshlZshrshufflesinsinhsizeZskewnessslicesortsplitsqrtZsqueezestackr'   subr/   sumswitchsymbolssymlinksysZtaketantanhZterminaltor-   truncaterz   r{   unionuniquer|   ZuntilZunzipr}   valuesvarZvariancevolumeZwebviewwhilewithZwordwrapwriter   r   zip)rootrS   rT   rR   r3   r5   r6   r7   r8   r9   r:   r;   N),__name__
__module____qualname____doc__namealiases	filenamesurlr   r+   r	   SingleZHashbangr   r   ConstantZBuiltinZPseudor   CharZPropertyr   ZFloatZIntegerZLabelr   ZDeclarationType	Attributer   r   r   r   r#   r   Z	Decoratorr   r   r&   r
   r%   ZEscapeRegextokensr   r   r   r   r      s   	$ 






	:
























	 % %N)r  Zpygments.lexerr   r   r   r   r   r   r   Zpygments.tokenr	   r
   r   r   r   r   r   r   r   Zpygments.utilr   r   __all__r   r   r   r   r   <module>   s
   
$,