3 ��X�( � @ sn d Z ddlmZmZmZmZmZmZ ddlm Z m Z mZmZm Z mZmZmZmZmZ dgZG dd� de�ZdS )z� pygments.lexers.clean ~~~~~~~~~~~~~~~~~~~~~ Lexer for the Clean language. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � )�ExtendedRegexLexer�LexerContext�bygroups�words�include�default) �Comment�Keyword�Literal�Name�Number�Operator�Punctuation�String�Text� Whitespace� CleanLexerc @ s< e Zd ZdZdZdgZddgZd�dd�Zd d � Zdd� Z e d d� �Zdd� Zdd� Z dd� Zdd� Zdd� Zd�Zd*ed+fd,ed-fgd.ejfd/ejfd0ejfd1eejejeej�fd2ejd3fd4ejd5feed6d7d8�efeed9d7d8�efd:ed;fd<eeejej ee�d=fd>eee�d?fd@eee�d?fdAe!j"fdBe!j"fdCe!j"fdDe#j$fdEe#j%fdFe#j&fdGe#j'fdHe!j(dIfed�d6d7d8�e)fdLeeeje�fdMefdNefdOe*fdPe*fdQejfdRefe+dS�ge+dS�dTefdUed+fdRefge+dS�dVeeeej �fdWe fdXefdUed+fdRefge+dS�dYedZfdXed+fd[efdUed\fd]efd^ej fge+dS�d_ed+fdYed+fd`efdaefd^ej fge+dS�ed�d6d7d8�ejfdeejfdUed+fdXefd]efgdfefdgefgdhe!j(fdHe!j(d+fdie!j(fge+dS�djej fdkefdlefdmed+fdRefdnej fge+dS�doefdped+fdXefdlefdqeee�drfdRefdsej fdtefg e+dS�djej fdXefdRefdued+fge+dS�dve fdwefdledxfdyed+fdzej fdRefge+dS�dvefdyed\fdwefd{ed|fdzej fdRefge+dS�dvefdyed}fd~efded�fd�ejd�fdaefge+dS�d�ej fdaefd�efd�ed+fge+dS�d�ejfd:ed;fe,d+�gd��Z-dS )�r z� Lexer for the general purpose, state-of-the-art, pure and lazy functional programming language Clean (http://clean.cs.ru.nl/Clean). .. versionadded: 2.2 ZCleanZcleanz*.iclz*.dclNc C s t |d�}d|_tj| ||d�S )Nr )�context)r �indentr �get_tokens_unprocessed)�self�textr �ctx� r �/usr/lib/python3.6/clean.pyr s z!CleanLexer.get_tokens_unprocessedc c sd |j d�dkr>|j� tj|j d�fV |jd d� dg |_n|j� tj|j d�fV |j� |_d S )Nr �import� �fromimportfunc���) �group�startr � Namespace�stackr �Class�end�pos)�lexer�matchr r r r �check_class_not_import$ s z!CleanLexer.check_class_not_importc c sh |j d�dks|j d�dkr4|j� t|j d�fV n&|j� tj|j d�fV |jdg |_|j� |_d S )Nr �instance�class�fromimportfunctype)r r r r �Functionr"