3
V'íc~ ã @ s d Z ddlZddlmZmZmZmZmZmZ ddl m
Z
mZmZm
Z
mZmZmZmZ ddlmZ dddgZG d d deZG d
d deZG dd deZdS )zÎ
pygments.lexers.make
~~~~~~~~~~~~~~~~~~~~
Lexers for Makefiles and similar.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)ÚLexerÚ
RegexLexerÚincludeÚbygroupsÚ
do_insertionsÚusing)ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚPunctuationÚ
Whitespace)Ú BashLexerÚ
MakefileLexerÚBaseMakefileLexerÚ
CMakeLexerc @ sZ e Zd ZdZdZddddgZddddd d
gZdgZej dZ
ej d
Zdd Zdd Z
dS )r z
Lexer for BSD and GNU make extensions (lenient enough to handle both in
the same file even).
*Rewritten in Pygments 0.10.*
ÚMakefileÚmakeÚmakefileZmfZbsdmakez*.makz*.mkz
Makefile.*ZGNUmakefileztext/x-makefilez¥^(?:\.\s*(include|undef|error|warning|if|else|elif|endif|for|endfor)|\s*(ifeq|ifneq|ifdef|ifndef|else|endif|-?include|define|endef|:|vpath)|\s*(if|else|endif))(?=\s)z^\s*@?#c c s¸ g }|j dd}d}tf | j}d}xx|D ]p}| jj|s>|rj|jt|dtj|fgf |j j
d}q*| jj|r|jt|dt|fgf q*||7 }q*W t||j
|E d H d S )NT)ÚkeependsÚ Fr ú\)Ú
splitlinesr ÚoptionsÚ r_specialÚmatchÚappendÚlenr ZPreprocÚstripÚendswithÚ r_commentr Úget_tokens_unprocessed)ÚselfÚtextZinsÚlinesÚdoneÚlexZ
backslashflagÚline© r* ú8/tmp/pip-build-gk9425m9/Pygments/pygments/lexers/make.pyr# - s
z$MakefileLexer.get_tokens_unprocessedc C s t jd| rdS d S )Nz
\$\([A-Z_]+\)g¹?)ÚreÚsearch)r% r* r* r+ Úanalyse_text= s zMakefileLexer.analyse_textN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ filenamesÚ mimetypesr, Úcompiler r"