B
    (‹dœ(  ã               @   s¼   d Z ddl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dddd	gZG d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZdS )zÓ
    pygments.lexers.esoteric
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for esoteric languages.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    )Ú
RegexLexerÚincludeÚwordsÚbygroups)	ÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚPunctuationÚErrorÚ
WhitespaceÚBrainfuckLexerÚBefungeLexerÚRedcodeLexerÚCAmkESLexerÚ
CapDLLexerÚ
AheuiLexerc               @   sŠ   e Zd ZdZdZdZddgZddgZdgZd	e	j
fd
e	jfde	jfdefgdedfdefedƒgdedfdedfedƒgdœZdd„ ZdS )r   z4
    Lexer for the esoteric BrainFuck language.
    Ú	Brainfuckz'http://www.muppetlabs.com/~breadbox/bf/Ú	brainfuckÚbfz*.bfz*.bzapplication/x-brainfuckz[.,]+z[+-]+z[<>]+z[^.,+\-<>\[\]]+z\[Úloopz\]Úcommonz#pushz#pop)r   Úrootr   c             C   s”   d}d}t dt| ƒƒ}xD| d|… D ]4}|dks8|dkr@|d7 }|dksP|dkr$|d7 }q$W |d	| krld
S |d	| kr|d
S d}d| kr|d7 }|S )z]It's safe to assume that a program which mostly consists of + -
        and < > is brainfuck.r   é   Nú+ú-é   ú<ú>g      Ð?g      ð?z[-]g      à?)ÚmaxÚlen)ÚtextZplus_minus_countZgreater_less_countZrange_to_checkÚcÚresult© r&   úe/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/pygments/lexers/esoteric.pyÚanalyse_text2   s     zBrainfuckLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ	filenamesÚ	mimetypesr	   ÚTagÚBuiltinÚVariabler   r   r   r   Útokensr(   r&   r&   r&   r'   r      s"   c               @   s„   e Zd ZdZdZdZdgZdgZdgZdde	fd	e
fd
ejfdejfdefdejfdejfdejfdefdefdefdefgiZdS )r   zM
    Lexer for the esoteric Befunge language.

    .. versionadded:: 0.7
    ÚBefungez$http://en.wikipedia.org/wiki/BefungeÚbefungez	*.befungezapplication/x-befunger   z[0-9a-f]z	[+*/%!`-]z[<>^v?\[\]rxjk]z	[:\\$.,n]z[|_mw]z[{}]z".*?"z\'.z[#;]z[pg&~=@iotsy]z[()A-Z]z\s+N)r)   r*   r+   r,   r-   r.   r/   r0   r1   r   r   r	   r4   r3   r   r2   r
   ÚDoubleÚSingler   r   r5   r&   r&   r&   r'   r   L   s&   c               @   sâ   e Zd ZdZdZdZddgZddgZdd	ee	e
je	ƒfd
e	fde
fde
fdefdefedddefedddejfdejfedddejfdee
je	e
jƒfdee
je	e
jƒfdejfdefdejfdefdejfdefgiZdS )r   zj
    Basic lexer for the input language for the CAmkES component platform.

    .. versionadded:: 2.1
    ÚCAmkESzhttps://sel4.systems/CAmkES/ÚcamkesÚidl4z*.camkesz*.idl4r   z^(\s*)(#.*)(\n)z\s+z/\*(.|\n)*?\*/z//.*$z[\[(){},.;\]]z[~!%^&*+=|?:<>/-])"ZassemblyÚ	attributeÚ	componentZcompositionÚconfigurationÚ
connectionZ	connectorZconsumesÚcontrolZdataportZDataportZ	DataportsZemitsÚeventÚEventZEventsZexportÚfromÚgroupZhardwareÚhasZ	interfaceZ	InterfaceÚmaybeZ	procedureZ	ProcedureZ
ProceduresÚprovidesÚtemplateÚthreadÚthreadsÚtoZusesÚwithz\b)Úsuffix)ÚboolÚbooleanZBufÚcharÚ	characterÚdoubleÚfloatÚinZinoutÚintZint16_6Zint32_tZint64_tZint8_tÚintegerÚmutexÚoutÚrealZrefinZ	semaphoreÚsignedÚstringÚstructZuint16_tZuint32_tZuint64_tZuint8_tZ	uintptr_tZunsignedÚvoidz%[a-zA-Z_]\w*_(priority|domain|buffer))Zdma_poolZfrom_accessZ	to_accessz#(import)(\s+)((?:<[^>]*>|"[^"]*");)z$(include)(\s+)((?:<[^>]*>|"[^"]*");)z0[xX][\da-fA-F]+z-?[\d]+z-?[\d]+\.[\d]+z"[^"]*"z[Tt]rue|[Ff]alsez[a-zA-Z_]\w*N)r)   r*   r+   r,   r-   r.   r/   r0   r   r   r   ÚPreprocr   r   r   r   ÚTypeÚReservedr   ÚHexÚFloatr
   r	   r3   r5   r&   r&   r&   r'   r   j   s<   


c               @   s¸   e Zd ZdZdZdZdgZdgZddee	e
je	ƒfde	fd	e
fd
e
fdefdefedddefedddejfedddejfdejfdefedddefedddefdefgiZdS )r   aæ  
    Basic lexer for CapDL.

    The source of the primary tool that reads such specifications is available
    at https://github.com/seL4/capdl/tree/master/capDL-tool. Note that this
    lexer only supports a subset of the grammar. For example, identifiers can
    shadow type names, but these instances are currently incorrectly
    highlighted as types. Supporting this would need a stateful lexer that is
    considered unnecessarily complex for now.

    .. versionadded:: 2.2
    ÚCapDLzMhttps://ssrg.nicta.com.au/publications/nictaabstracts/Kuz_KLW_10.abstract.pmlÚcapdlz*.cdlr   z^(\s*)(#.*)(\n)z\s+z/\*(.|\n)*?\*/z
(//|--).*$z[<>\[(){},:;=\]]z\.\.)ÚarchZarm11ZcapsZchild_ofZia32ZirqÚmapsÚobjectsz\b)rN   )ZaepZ	asid_poolZcnodeÚepÚframeZ	io_deviceZio_portsZio_ptZnotificationÚpdÚptZtcbÚutZvcpu)ZasidÚaddrZbadgeÚcachedÚdomZdomainIDÚelfZfault_epÚGÚguardZ
guard_sizeÚinitÚipÚprioÚspÚRZRGZRXZRWZRWGZRWXÚWZWGZWXÚlevelZmaskedZmaster_replyZpaddrZportsZreplyZuncachedz0[xX][\da-fA-F]+z\d+(\.\d+)?(k|M)?)Úbits)ZcspaceZvspaceZ
reply_slotZcaller_slotZipc_buffer_slotz[a-zA-Z_][-@\.\w]*N)r)   r*   r+   r,   r-   r.   r/   r0   r   r   r   r_   r   r   r   r`   ra   r   rb   r	   r5   r&   r&   r&   r'   r   ®   s4   

c               @   s‚   e Zd ZdZdZdgZdgZdZdZdde	fd	e
jfd
d e¡ ejfd
d e¡ ejfdefdefdefdefdejfg	iZdS )r   z‚
    A simple Redcode lexer based on ICWS'94.
    Contributed by Adam Blinkinsop <blinks@acm.org>.

    .. versionadded:: 0.8
    ÚRedcodeÚredcodez*.cw)ZDATZMOVZADDZSUBZMULZDIVZMODZJMPZJMZZJMNZDJNZCMPZSLTZSPLZORGZEQUZEND)ÚAÚBZABZBAÚFÚXÚIr   z\s+z;.*$z\b(%s)\bú|z[A-Za-z_]\w+z[-+*/%]z[#$@<>]z[.,]z[-+]?\d+N)r)   r*   r+   r,   r-   r/   r0   ZopcodesÚ	modifiersr   r   r9   Újoinr	   ÚFunctionÚ	Decoratorr   r   r   ÚIntegerr5   r&   r&   r&   r'   r   ê   s    c               @   s8   e Zd ZdZdZdZdgZdgZddefde	fgiZ
d	S )
r   z?
    Aheui is esoteric language based on Korean alphabets.
    ÚAheuizhttp://aheui.github.io/Úaheuiz*.aheuir   uá  [ë‚˜-ë‚³ëƒ-ëƒ«ë„ˆ-ë„£ë…€-ë…›ë…¸-ë†“ë‡¨-ëˆŸë‰´-ë‹‡ë‹¤-ë‹¿ëŒœ-ëŒ·ë”-ë¯ëŽŒ-ëŽ§ë„-ëŸë´-ë‘«ë“€-ë”“ë”°-ë•‹ë•¨-ë–ƒë– -ë–»ë—˜-ë—³ë˜-ë˜«ëš€-ëš·ëœŒ-ëŸë¼-ëž—ëž´-ëŸëŸ¬-ë ‡ë ¤-ë ¿ë¡œ-ë¡·ë£Œ-ë¤ƒë¥˜-ë¦«ë§ˆ-ë§£ë¨€-ë¨›ë¨¸-ë©“ë©°-ëª‹ëª¨-ë«ƒë¬˜-ë­ë®¤-ë¯·ë°”-ë°¯ë±Œ-ë±§ë²„-ë²Ÿë²¼-ë³—ë³´-ë´ëµ¤-ë¶›ë·°-ë¹ƒë¹ -ë¹»ëº˜-ëº³ë»-ë»«ë¼ˆ-ë¼£ë½€-ë½›ë¾°-ë¿§ì€¼-ì‚ì‚¬-ìƒ‡ìƒ¤-ìƒ¿ì„œ-ì„·ì…”-ì…¯ì†Œ-ì†§ì‡¼-ìˆ³ìŠˆ-ì‹›ì‹¸-ìŒ“ìŒ°-ì‹ì¨-ìŽƒìŽ -ìŽ»ì˜-ì³ì‘ˆ-ì‘¿ì“”-ì”§ìž-ìž«ìŸˆ-ìŸ£ì €-ì ›ì ¸-ì¡“ì¡°-ì¢‹ì£ -ì¤—ì¥¬-ì¦¿ì°¨-ì±ƒì± -ì±»ì²˜-ì²³ì³-ì³«ì´ˆ-ì´£ìµ¸-ì¶¯ì¸„-ì¹—ì¹´-ìºìº¬-ì»‡ì»¤-ì»¿ì¼œ-ì¼·ì½”-ì½¯ì¿„-ì¿»í-í‚£íƒ€-íƒ›íƒ¸-í„“í„°-í…‹í…¨-í†ƒí† -í†»íˆ-í‰‡íŠœ-í‹¯íŒŒ-íŒ§í„-íŸí¼-íŽ—íŽ´-íí¬-í‡í‘œ-í’“í“¨-í”»í•˜-í•³í–-í–«í—ˆ-í—£í˜€-í˜›í˜¸-í™“íš¨-í›Ÿíœ´-íž‡]Ú.N)r)   r*   r+   r,   r-   r.   r/   r0   r   r   r5   r&   r&   r&   r'   r     s   N)r,   Zpygments.lexerr   r   r   r   Zpygments.tokenr   r   r   r	   r
   r   r   r   r   Ú__all__r   r   r   r   r   r   r&   r&   r&   r'   Ú<module>	   s   ,9D<$