3 ��X� � @ s� d Z ddlZddlmZmZmZmZmZmZ ddl m Z mZmZm Z mZmZmZ ddlmZ dddgZG d d� de�ZG d d� de�ZG dd� de�ZdS )z� pygments.lexers.make ~~~~~~~~~~~~~~~~~~~~ Lexers for Makefiles and similar. :copyright: Copyright 2006-2017 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)� BashLexer� MakefileLexer�BaseMakefileLexer� CMakeLexerc @ sZ e Zd ZdZdZddddgZddddd d gZdgZej d�Z 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.* �MakefileZmake�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 d�}d}tf | j�}d}xx|D ]p}| jj|�s<|rh|jt|�dtj|fgf� |j � j d�}q(| jj|�r�|jt|�dt|fgf� q(||7 }q(W xt||j |��D ] }|V q�W d S )NT� Fr �\)� splitlinesr Zoptions� r_special�match�append�lenr ZPreproc�strip�endswith� r_commentr �get_tokens_unprocessed) �self�textZins�lines�doneZlexZ backslashflag�line�item� r&