o av @sdZddlZddlZddlmZddlmZmZmZm Z ddl m Z gdZ GdddeZ Gd d d eZiZed ZGd d d eZdS)z pygments.lexers.special ~~~~~~~~~~~~~~~~~~~~~~~ Special lexers. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)Lexer)TokenErrorTextGeneric)get_choice_opt) TextLexer OutputLexer RawTokenLexerc@s:eZdZdZdZdgZdgZdgZdZddZ d d Z d S) rz3 "Null" lexer, doesn't highlight anything. z Text onlytextz*.txtz text/plaing{Gz?ccsdt|fVdSNr)rselfr r9/usr/lib/python3/dist-packages/pygments/lexers/special.pyget_tokens_unprocessed sz TextLexer.get_tokens_unprocessedcCstjS)N)rpriority)r rrr analyse_text#szTextLexer.analyse_textN) __name__ __module__ __qualname____doc__namealiases filenames mimetypesrrrrrrrrs rc@s"eZdZdZdZdgZddZdS)r zj Simple lexer that highlights everything as ``Token.Generic.Output``. .. versionadded:: 2.10 z Text outputoutputccsdtj|fVdSr )rOutputr rrrr0sz"OutputLexer.get_tokens_unprocessedN)rrrrrrrrrrrr 's  r z.*? c@s:eZdZdZdZgZgZdgZddZddZ dd Z d S) r a Recreate a token stream formatted with the `RawTokenFormatter`. Additional options accepted: `compress` If set to ``"gz"`` or ``"bz2"``, decompress the token stream with the given compression algorithm before lexing (default: ``""``). zRaw token datazapplication/x-pygments-tokenscKs*t|dgdd|_tj|fi|dS)Ncompress)nonegzbz2r)rrr__init__)roptionsrrrr#HszRawTokenLexer.__init__ccs|jr?t|tr|d}z|jdkrddl}||}n|jdkr,ddl}||}Wnty>t| dfVYnwt|t rI| d}| dd}| |D] \}}}||fVqUdS)Nlatin1r!rr" ) r isinstancestrencodegzip decompressr"OSErrorrdecodebytesstripr)rr r*r"itvrrr get_tokensMs*          zRawTokenLexer.get_tokensc csd}t|D]h}zH|dd\}}t|}|sCt}|ddd}|D]}|r5|ds9t dt ||}q+|t|<t |}t |tsQt dWntt fyc|}t}Ynw|||fV|t|7}qdS)Nr .zmalformed token namez expected str)line_refinditergrouprstripsplit _ttype_cachegetrisupper ValueErrorgetattrast literal_evalr'r( SyntaxErrorrlen) rr lengthmatchttypestrvalttypettypesttype_rrrrbs2     z$RawTokenLexer.get_tokens_unprocessedN) rrrrrrrrr#r3rrrrrr 9s  r )rrArepygments.lexerrpygments.tokenrrrr pygments.utilr__all__rr r<compiler7r rrrrs