U
    luf(                     @   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.
    Z	Brainfuckz'http://www.muppetlabs.com/~breadbox/bf/Z	brainfuckZbfz*.bfz*.bzapplication/x-brainfuckz[.,]+z[+-]+z[<>]+z[^.,+\-<>\[\]]+z\[loopz\]commonz#pushz#pop)r   rootr   c                 C   s   d}d}t dt| }| d| D ]4}|dks6|dkr>|d7 }|dksN|dkr"|d7 }q"|d	| krhd
S |d	| krxd
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#   </tmp/pip-unpacked-wheel-7eq1ciah/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
    ZBefungez$http://en.wikipedia.org/wiki/BefungeZ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]\s+N)r&   r'   r(   r)   r*   r+   r,   r-   r.   r   r   r	   r1   r0   r   r/   r
   DoubleSingler   r   r2   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
    ZCAmkESzhttps://sel4.systems/CAmkES/ZcamkesZidl4z*.camkesz*.idl4r   ^(\s*)(#.*)(\n)r3   /\*(.|\n)*?\*/z//.*$z[\[(){},.;\]]z[~!%^&*+=|?:<>/-])"Zassembly	attribute	componentZcompositionconfiguration
connectionZ	connectorZconsumescontrolZdataportZDataportZ	DataportsZemitseventEventZEventsexportfromgroupZhardwareZhasZ	interfaceZ	InterfacemaybeZ	procedureZ	ProcedureZ
ProceduresprovidestemplatethreadthreadstoZuseswith\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+)((?:<[^>]*>|"[^"]*");)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,   r-   r   r   r   Preprocr   r   r   r   TypeReservedr   HexZFloatr
   r	   r0   r2   r#   r#   r#   r$   r   j   sT   
		
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
    ZCapDLzMhttps://ssrg.nicta.com.au/publications/nictaabstracts/Kuz_KLW_10.abstract.pmlZcapdlz*.cdlr   r6   r3   r7   z
(//|--).*$z[<>\[(){},:;=\]]z\.\.)archZarm11ZcapsZchild_ofZia32ZirqmapsZobjectsrI   rJ   )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domainIDZelfZfault_epGZguardZ
guard_sizeinitippriospRZRGZRXZRWZRWGZRWXWZWGZWXlevelZmaskedZmaster_replyZpaddrZportsZreplyZuncachedr\   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,   r-   r   r   r   r]   r   r   r   r^   r_   r   r`   r	   r2   r#   r#   r#   r$   r      sP   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
    ZRedcodeZ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   r3   z;.*$z\b(%s)\b|z[A-Za-z_]\w+z[-+*/%]z[#$@<>]z[.,]z[-+]?\d+N)r&   r'   r(   r)   r*   r,   r-   Zopcodes	modifiersr   r   r5   joinr	   ZFunctionZ	Decoratorr   r   r   ZIntegerr2   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.
    ZAheuizhttp://aheui.github.io/Zaheuiz*.aheuir   u  [나-낳냐-냫너-넣녀-녛노-놓뇨-눟뉴-닇다-닿댜-댷더-덯뎌-뎧도-돟됴-둫듀-딓따-땋땨-떃떠-떻뗘-뗳또-똫뚀-뚷뜌-띟라-랗랴-럏러-렇려-렿로-롷료-뤃류-릫마-맣먀-먛머-멓며-몋모-뫃묘-뭏뮤-믷바-밯뱌-뱧버-벟벼-볗보-봏뵤-붛뷰-빃빠-빻뺘-뺳뻐-뻫뼈-뼣뽀-뽛뾰-뿧쀼-삏사-샇샤-샿서-섷셔-셯소-솧쇼-숳슈-싛싸-쌓쌰-썋써-쎃쎠-쎻쏘-쏳쑈-쑿쓔-씧자-잫쟈-쟣저-젛져-졓조-좋죠-줗쥬-즿차-챃챠-챻처-첳쳐-쳫초-촣쵸-춯츄-칗카-캏캬-컇커-컿켜-켷코-콯쿄-쿻큐-킣타-탛탸-턓터-텋텨-톃토-톻툐-퉇튜-틯파-팧퍄-퍟퍼-펗펴-폏포-퐇표-풓퓨-픻하-핳햐-햫허-헣혀-혛호-홓효-훟휴-힇].N)r&   r'   r(   r)   r*   r+   r,   r-   r   r   r2   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<$