3
V'íc( ã @ s¼ d Z ddlmZmZmZmZ ddlmZmZm Z m
Z
mZmZm
Z
mZmZ dddddd gZG d
d deZG dd deZG dd deZG d
d deZG dd deZG dd d eZdS )zÓ
pygments.lexers.esoteric
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for esoteric languages.
:copyright: Copyright 2006-2022 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 Zd ZdZdZdZddgZddgZdgZd e j
fd
e jfde jfde
fgd
edfdefedgd
edfdedfedgdZdd ZdS )r z4
Lexer for the esoteric BrainFuck language.
Z Brainfuckz'http://www.muppetlabs.com/~breadbox/bf/Z brainfuckZbfz*.bfz*.bzapplication/x-brainfuckz[.,]+z[+-]+z[<>]+z[^.,+\-<>\[\]]+z\[Úloopz\]Úcommonz#pushz#pop)r Úrootr c C s d}d}t dt| }xD| d|
D ]4}|dks8|dkr@|d7 }|dksP|dkr$|d7 }q$W |d | krld
S |d | kr|d
S d}d| kr|d7 }|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)ÚtextZplus_minus_countZgreater_less_countZrange_to_checkÚcÚresult© r# ú</tmp/pip-build-gk9425m9/Pygments/pygments/lexers/esoteric.pyÚanalyse_text2 s zBrainfuckLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ filenamesÚ mimetypesr ÚTagÚBuiltinÚVariabler r r