o
    ‡ÎÖa’  ã                   @   s8   d Z d
dd„Zdd„ ZG dd„ dƒZG dd	„ d	eƒZdS )zÍ
    pygments.filter
    ~~~~~~~~~~~~~~~

    Module that implements the default filter.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
Nc                    s$   ‡ fdd„}|D ]}||| ƒ} q| S )z¤
    Use this method to apply an iterable of filters to
    a stream. If lexer is given it's forwarded to the
    filter, otherwise the filter receives `None`.
    c                 3   s   � |   ˆ |¡E d H  d S ©N)Úfilter)Úfilter_Ústream©Úlexer© ú1/usr/lib/python3/dist-packages/pygments/filter.pyÚ_apply   s   €zapply_filters.<locals>._applyr   )r   Úfiltersr   r	   r   r   r   r   Úapply_filters   s   r   c                 C   s    t | jtft| dƒ| j| dœƒS )zÛ
    Decorator that converts a function into a filter::

        @simplefilter
        def lowercase(self, lexer, stream, options):
            for ttype, value in stream:
                yield ttype, value.lower()
    Ú
__module__)r   Ú__doc__Úfunction)ÚtypeÚ__name__ÚFunctionFilterÚgetattrr   )Úfr   r   r   Úsimplefilter   s
   
	ýr   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚFilterzl
    Default filter. Subclass this class or use the `simplefilter`
    decorator to create own filters.
    c                 K   s
   || _ d S r   )Úoptions©Úselfr   r   r   r   Ú__init__/   s   
zFilter.__init__c                 C   s   t ƒ ‚r   )ÚNotImplementedError©r   r   r   r   r   r   r   2   s   zFilter.filterN)r   r   Ú__qualname__r   r   r   r   r   r   r   r   )   s    r   c                   @   s$   e Zd ZdZdZdd„ Zdd„ ZdS )r   zÑ
    Abstract class used by `simplefilter` to create simple
    function filters on the fly. The `simplefilter` decorator
    automatically creates subclasses of this class for
    functions passed to it.
    Nc                 K   s0   t | dƒstd| jj ƒ‚tj| fi |¤Ž d S )Nr   z%r used without bound function)ÚhasattrÚ	TypeErrorÚ	__class__r   r   r   r   r   r   r   r   ?   s
   
ÿzFunctionFilter.__init__c                 c   s   � |   ||| j¡E d H  d S r   )r   r   r   r   r   r   r   E   s   €zFunctionFilter.filter)r   r   r   r   r   r   r   r   r   r   r   r   6   s
    r   r   )r   r   r   r   r   r   r   r   r   Ú<module>   s
    
