+
    …rœi  ã                  óÀ   € R t ^ RIHt ^ RIHt ^ RIHtHt  ^ RIt^ RI
Ht ^ RIHt ^ RIHt ^RIHt ^R	IHt ^R
IHtHtHt  ! R R]4      tR#   ]	 d    Rt L@i ; i)zÙ
This module provides the :module:`re2` backend for :class:`~pathspec.pathspec.PathSpec`.

WARNING: The *pathspec._backends.re2* package is not part of the public API. Its
contents and structure are likely to change.
)Úannotations)ÚSequence)ÚCallableÚOptionalN)Ú_Backend)ÚRegexPattern)Úoverride)Úenumerate_patterns)Ú	re2_error)ÚRE2_OPTIONSÚRe2RegexDatÚRe2RegexDebugc                  ót   € ] tR t^&tRtRRRR/R R llt]R R l4       t]R	 R
 l4       t]	R R l4       t
RtR# )ÚRe2PsBackendz†
The :class:`Re2PsBackend` class is the :module:`re2` implementation used by
:class:`~pathspec.pathspec.PathSpec` for matching files.
Ú_debug_regexNÚ
_test_sortc               ó(   € V ^8„  d   QhRRRRRRRR/# )	é   ÚpatternszSequence[RegexPattern]r   zOptional[bool]r   z Optional[Callable[[list], None]]ÚreturnÚNone© )Úformats   "ÚA/usr/lib/python3/dist-packages/pathspec/_backends/re2/pathspec.pyÚ__annotate__ÚRe2PsBackend.__annotate__,   s2   € ÷ 2ñ 2à"ð2ð ð	2ð
 /ð2ð ñ2ó    c               ón  € \         e   \         hV'       d5   \        V^ ,          \        4      '       g   \        RV^ ,          : R24      h\	        \        VRRR7      4      pV P                  4       p\        V4      V n         W@n	         V P                  V P                  VVVR7      V n         WPn        R# )zŠ
Initialize the :class:`Re2PsBackend` instance.

*patterns* (:class:`Sequence` of :class:`.RegexPattern`) contains the
compiled patterns.
Nzpatterns[0]=z must be a RegexPattern.TF)ÚfilterÚreverse)Údebugr   Ú	regex_setÚsort_indices)r
   Ú
isinstancer   Ú	TypeErrorÚdictr	   Ú	_make_setÚboolr   Ú	_patternsÚ	_init_setÚ_regex_dataÚ_set)Úselfr   r   r   Úuse_patternsr!   s   &&$$  r   Ú__init__ÚRe2PsBackend.__init__,   s¼   € ô ÒÜ	€?ç”j ¨!¥¬l×;Ò;Ü	�l�h˜q•kÑ%Ð%=Ð>Ó	?Ð?äÔ(Ø�D %ôó €,ð �n‰nÓ€)ä˜<Ó(€$Ôðð
 -9„.ðð
 )-¯©Ø	×	Ñ	ØØØð	 )7ó )€$Ôðð
 !„)ñr   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r   r    r'   r   zdict[int, RegexPattern]r!   úre2.Setr"   z%Optional[Callable[[list[int]], None]]r   zlist[Re2RegexDat]r   )r   s   "r   r   r   a   s:   € ÷ 9ñ 9Ø	ð9à#ð9ð ð9ð 6ð	9ð
 ñ9r   c           
     óî  € \        VP                  4       4      pVe	   V! V4       . pV F·  pW,          pVP                  f   K  \        V\        4      '       g   Q V4       hVP
                  P                  pV '       d*   VP                  \        VP                  VRVR7      4       M'VP                  \        VP                  VRR7      4       VP                  V4       K¹  	  VP                  4        V# )a>  
Create the re2 regex set.

*debug* (:class:`bool`) is whether to include additional debugging
information for the regular expressions.

*patterns* (:class:`dict`) maps pattern index (:class:`int`) to pattern
(:class:`.RegexPattern`).

*regex_set* (:class:`re2.Set`) is the regex set.

*sort_indices* (:class:`callable` or :data:`None`) is a function used to
sort the patterns by index. This is used during testing to ensure the order
of patterns is not accidentally relied on.

Returns a :class:`list` indexed by regex id (:class:`int`) to its data
(:class:`Re2RegexDat`).
F)ÚincludeÚindexÚis_dir_patternÚregex)r3   r4   r5   )ÚlistÚkeysr3   r#   r   r6   ÚpatternÚappendr   r   ÚAddÚCompile)	r    r   r!   r"   ÚindicesÚ
regex_dataÚpattern_indexr9   r6   s	   &&&&     r   r)   ÚRe2PsBackend._init_set`   sÝ   € ô4 �—‘“Ó!€'ØÒÙ�Ôð #%€*Û€mØÕ$€7Ø‡o�oÒÙä
�Wœl×
+Ò
+Ð4¨WÓ4Ð
+Ø�=‰=× Ñ €5çØ×Ñ”mØ�_‰_ØØØô	õ ð ×Ñ”kØ�_‰_ØØôô ð ‡=�=�Öñ- ð2 ×ÑÔØ	Ðr   c               ó   € V ^8„  d   QhRR/# )r   r   r1   r   )r   s   "r   r   r   �   s   € ÷ (ñ (�Gñ (r   c                 óH   € \         P                  P                  \        4      # )z@
Create the re2 regex set.

Returns the set (:class:`re2.Set`).
)Úre2ÚSetÚ	SearchSetr   r   r   r   r&   ÚRe2PsBackend._make_setœ   s   € ô 
�‰×	Ñ	œ;Ó	'Ð'r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚfileÚstrr   z$tuple[Optional[bool], Optional[int]]r   )r   s   "r   r   r   ¦   s   € ÷ *ñ *˜Cð *Ð$Hñ *r   c                óÒ   a€ V P                   P                  V4      pV'       g   R# V P                  o\        V3R lV 4       4      pV P                  V,          pVP
                  V3# )a  
Check the file against the patterns.

*file* (:class:`str`) is the normalized file path to check.

Returns a :class:`tuple` containing whether to include *file* (:class:`bool`
or :data:`None`), and the index of the last matched pattern (:class:`int` or
:data:`None`).
c              3  óJ   <"  € T F  pSV,          P                   x € K  	  R # 5i)N)r4   )Ú.0Ú_Re2PsBackend__idr>   s   & €r   Ú	<genexpr>Ú*Re2PsBackend.match_file.<locals>.<genexpr>¹   s   øé € ÐC¹°�j Õ&×,Ö,»ùs   ƒ #)NN)r+   ÚMatchr*   Úmaxr(   r3   )r,   rH   Ú	match_idsr?   r9   r>   s   &&   @r   Ú
match_fileÚRe2PsBackend.match_file¥   sX   ø€ ð $(§9¡9§?¡?°4Ó#8€)ß	Ø
Ðà×Ñ€*ÜÔC¹ÓCÓC€-Ø�N‰N˜=Õ)€'Ø
�/‰/˜=Ð	)Ð)r   )r   r(   r*   r+   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r.   Ústaticmethodr)   r&   r   rS   Ú__static_attributes__r   r   r   r   r   &   s^   † ñð
2ð "&ð	2ð
 26÷2ðh ô9ó ð9ðv ô(ó ð(ð ô*ó ô*r   r   )rY   Ú
__future__r   Úcollections.abcr   Útypingr   r   rC   ÚModuleNotFoundErrorÚpathspec.backendr   Úpathspec.patternr   Úpathspec._typingr   Ú_utilsr	   Úbaser
   Ú_baser   r   r   r   r   r   r   Ú<module>rf      sh   ðñõ #õ÷ðÛõõõõõ÷ñ ôU*�8ö U*øð+ ô Ø‚ðús   ˜A Á	AÁA