§
    cÌcz  ã                   ód   — d Z ddlZddlmZ  G d„ dej        ¦  «        Z G d„ d¦  «        Zd	„ ZdS )
a:  Lazily compiled regex objects.

This module defines a class which creates proxy objects for regex
compilation.  This allows overriding re.compile() to return lazily compiled
objects.

We do this rather than just providing a new interface so that it will also
be used by existing Python modules that create regexs.
é    Né   )Úerrorsc                   ó   — e Zd ZdZd„ ZdS )ÚInvalidPatternz!Invalid pattern(s) found. %(msg)sc                 ó   — || _         d S )N)Úmsg)Úselfr   s     ú3/usr/lib/python3/dist-packages/breezy/lazy_regex.pyÚ__init__zInvalidPattern.__init__$   s   € ØˆŒˆˆó    N)Ú__name__Ú
__module__Ú__qualname__Ú_fmtr   © r   r
   r   r       s(   € € € € € à/€Dðð ð ð ð r   r   c                   óL   — e Zd ZdZg d¢Zg d¢ez   Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
S )Ú	LazyRegexzDA proxy around a real regex, which won't be compiled until accessed.)
Ú__copy__Ú__deepcopy__ÚfindallÚfinditerÚmatchÚscannerÚsearchÚsplitÚsubÚsubn©Ú_real_regexÚ_regex_argsÚ_regex_kwargsc                 ó0   — d| _         || _        || _        dS )zÁCreate a new proxy object, passing in the args to pass to re.compile

        :param args: The `*args` to pass to re.compile
        :param kwargs: The `**kwargs` to pass to re.compile
        Nr   )r	   ÚargsÚkwargss      r
   r   zLazyRegex.__init__7   s"   € ð  ˆÔØˆÔØ#ˆÔÐÐr   c           	      óš   —  | j         | j        i | j        ¤Ž| _        | j        D ]&}t          | |t          | j        |¦  «        ¦  «         Œ'dS )z$Actually compile the requested regexN)Ú_real_re_compiler    r!   r   Ú_regex_attributes_to_copyÚsetattrÚgetattr©r	   Úattrs     r
   Ú_compile_and_collapsezLazyRegex._compile_and_collapseA   sn   € à0˜4Ô0°$Ô2Bð GØ37Ô3EðGð GˆÔàÔ2ð 	Að 	AˆDÝ�D˜$¥¨Ô(8¸$Ñ ?Ô ?Ñ@Ô@Ð@Ð@ð	Að 	Ar   c                 óª   — 	 t          j        |i |¤ŽS # t           j        $ r0}t          d|d         z   dz   t	          |¦  «        z   ¦  «        ‚d}~ww xY w)z%Thunk over to the original re.compileú"r   z" N)ÚreÚcompileÚerrorr   Ústr)r	   r#   r$   Úes       r
   r&   zLazyRegex._real_re_compileH   sj   € ð	@Ý”:˜tÐ. vÐ.Ð.Ð.øÝŒxð 	@ð 	@ð 	@õ !  t¨A¤w¡°Ñ!5½¸A¹¼Ñ!>Ñ?Ô?Ð?øøøøð	@øøøs   ‚ “A¢+AÁAc                 ó    — | j         | j        dœS )z&Return the state to use when pickling.©r#   r$   )r    r!   )r	   s    r
   Ú__getstate__zLazyRegex.__getstate__Q   s   € ð Ô$ØÔ(ðð ð 	r   c                 óp   — d| _         t          | d|d         ¦  «         t          | d|d         ¦  «         dS )zRestore from a pickled state.Nr    r#   r!   r$   )r   r(   )r	   Údicts     r
   Ú__setstate__zLazyRegex.__setstate__X   s<   € àˆÔÝ��m T¨&¤\Ñ2Ô2Ð2Ý��o t¨H¤~Ñ6Ô6Ð6Ð6Ð6r   c                 ób   — | j         €|                      ¦   «          t          | j         |¦  «        S )zrReturn a member from the proxied regex object.

        If the regex hasn't been compiled yet, compile it
        )r   r,   r)   r*   s     r
   Ú__getattr__zLazyRegex.__getattr__^   s4   € ð
 ÔÐ#Ø×&Ò&Ñ(Ô(Ð(õ �tÔ'¨Ñ.Ô.Ð.r   N)r   r   r   Ú__doc__r'   Ú	__slots__r   r,   r&   r6   r9   r;   r   r   r
   r   r   (   s¥   € € € € € ØNÐNð!
ð !
ð !
Ððð ð Ø.ñ/€Ið$ð $ð $ðAð Að Að@ð @ð @ðð ð ð7ð 7ð 7ð	/ð 	/ð 	/ð 	/ð 	/r   r   c                  ó"   — t          | |¦  «        S )zjCreate a proxy object which will compile the regex on demand.

    :return: a LazyRegex proxy object.
    )r   r5   s     r
   Úlazy_compiler?   j   s   € õ
 �T˜6Ñ"Ô"Ð"r   )r<   r/   Ú r   ÚBzrErrorr   r   r?   r   r   r
   ú<module>rB      sš   ðð"ð ð 
€	€	€	à Ð Ð Ð Ð Ð ðð ð ð ð �V”_ñ ô ð ð?/ð ?/ð ?/ð ?/ð ?/ñ ?/ô ?/ð ?/ðD#ð #ð #ð #ð #r   