+
    …rœid  ã                  óÄ   € R t ^ RIHt ^ RIHt ^ RIHt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:`hyperscan` backend for :class:`~pathspec.pathspec.PathSpec`.

WARNING: The *pathspec._backends.hyperscan* package is not part of the public
API. Its contents and structure are likely to change.
)Úannotations)ÚSequence)ÚAnyÚCallableÚOptionalN)Ú_Backend)ÚRegexPattern)Úoverride)Úenumerate_patterns)Úhyperscan_error)ÚHS_FLAGSÚHyperscanExprDatÚHyperscanExprDebugc                  ó€   € ] 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 R ltRtR# )ÚHyperscanPsBackendzÍ
The :class:`HyperscanPsBackend` class is the :module:`hyperscan`
implementation used by :class:`~pathspec.pathspec.PathSpec` for matching
files. The Hyperscan database uses block mode for matching files.
Ú_debug_exprsNÚ
_test_sortc               ó(   € V ^8„  d   QhRRRRRRRR/# )	é   ÚpatternszSequence[RegexPattern]r   úOptional[bool]r   z Optional[Callable[[list], None]]ÚreturnÚNone© )Úformats   "ÚG/usr/lib/python3/dist-packages/pathspec/_backends/hyperscan/pathspec.pyÚ__annotate__ÚHyperscanPsBackend.__annotate__.   s8   € ÷ Dñ Dà"ðDð ð	Dð
 /ðDð ñDó    c               óŠ  € \         f   \        hV'       d5   \        V^ ,          \        4      '       g   \	        RV^ ,          : R24      h\        VRRR7      p\        V4      pV'       d'   V P                  4       pV P                  VVVVR7      pMRp. pW`n	         WPn
         Wpn         RV n         \        V4      V n        R# )	z�
Initialize the :class:`HyperscanPsBackend` instance.

*patterns* (:class:`Sequence` of :class:`.RegexPattern`) contains the
compiled patterns.
Nzpatterns[0]=z must be a RegexPattern.TF)ÚfilterÚreverse)ÚdbÚdebugr   Úsort_ids©Néÿÿÿÿ)Ú	hyperscanr   Ú
isinstancer   Ú	TypeErrorr
   ÚboolÚ_make_dbÚ_init_dbÚ_dbr   Ú
_expr_dataÚ_outÚdictÚ	_patterns)Úselfr   r   r   Úuse_patternsÚdebug_exprsr"   Ú	expr_datas   &&$$    r   Ú__init__ÚHyperscanPsBackend.__init__.   s×   € ô ÒÜ	Ðç”j ¨!¥¬l×;Ò;Ü	�l�h˜q•kÑ%Ð%=Ð>Ó	?Ð?ä#Ø�D %ô€,ô �\Ó"€+ßØ�‰‹€2Ø�}‰}Ø	Ø
ØØð	 ó �9ð 	€2Ø€9à+-„(ðð "Ôðð
 -6„/ðð
 +5€$„)ðô -1°Ó,>€$„.ñr   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r   r"   úhyperscan.Databaser#   r*   r   zlist[tuple[int, RegexPattern]]r$   z%Optional[Callable[[list[int]], None]]r   zlist[HyperscanExprDat]r   )r   s   "r   r   r   u   sA   € ÷ Jñ JØðJà	ðJð +ðJð 2ð	Jð
 ñJr   c           
     ó  € V'       g   Q V4       h. p. pV Fÿ  w  rgVP                   f	   Q Wg34       h\        V\        4      '       g   Q V4       hVP                  P                  p\        V\
        4      '       d   Tp	M.\        V\        4      '       g   Q V4       hVP                  R4      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       EK  	  \        \        \        V4      4      4      p
Ve    V! V
4       V
 Uu. uF  qµV,          NK  	  ppV P                  VV
\        V4      \        R7       V# u upi )as  
Initialize the Hyperscan database from the given patterns.

*db* (:class:`hyperscan.Hyperscan`) is the Hyperscan database.

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

*patterns* (:class:`~collections.abc.Sequence` of :class:`.RegexPattern`)
contains the patterns.

*sort_ids* (:class:`callable` or :data:`None`) is a function used to sort
the compiled expression ids. This is used during testing to ensure the order
of expressions is not accidentally relied on.

Returns a :class:`list` indexed by expression id (:class:`int`) to its data
(:class:`HyperscanExprDat`).
Úutf8F)ÚincludeÚindexÚis_dir_patternÚregex)r<   r=   r>   )ÚexpressionsÚidsÚelementsÚflags)r<   r(   r   r?   ÚpatternÚbytesÚstrÚencodeÚappendr   r   ÚlistÚrangeÚlenÚcompiler   )r"   r#   r   r$   r5   ÚexprsÚpattern_indexrD   r?   Úregex_bytesrA   Ú_HyperscanPsBackend__ids   &&&&        r   r,   ÚHyperscanPsBackend._init_dbt   si  € ÷6 
Ð�8Óˆð ')€)Ø€%Û (Ñ€mØ
�/‰/Ò
%Ð?¨Ð'?Ó?Ð
%ô �Wœl×
+Ò
+Ð4¨WÓ4Ð
+Ø�=‰=× Ñ €5ä�œ×ÒØ�Kä�eœS×!Ò!Ð( 5Ó(Ð!Ø—,‘,˜vÓ&€KçØ×ÑÔ'Ø�_‰_ØØØô	õ ð ×ÑÔ%Ø�_‰_ØØôô ð 	‡<�<�×ñ7 !)ô< 	ŒU”3�u“:ÓÓ€#ØÒÙˆC„=Ù$'Ó(¡C˜D�$�KˆK¡C€5Ð(ð ‡*�*ØØ
Ü�‹JÜ	ð	 ô ð 
Ðùò )s   ÅE=c               ó    € V ^8„  d   QhRRRR/# )r   ÚfilerF   r   z$tuple[Optional[bool], Optional[int]]r   )r   s   "r   r   r   Â   s   € ÷ "ñ "˜Cð "Ð$Hñ "r   c                óÔ   € V P                   pV P                   f   R# RV n        VP                  VP                  R4      V P                  R7       V P                  w  r4VR8X  d   RpW43# )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`).
Nr;   )Úmatch_event_handler)NNr&   r%   )r-   r/   ÚscanrG   Ú_HyperscanPsBackend__on_match)r2   rS   r"   Úout_includeÚ	out_indexs   &&   r   Ú
match_fileÚHyperscanPsBackend.match_fileÁ   sd   € ð ‡x�x€"Ø	‡X�XÒð Ðà€$„)Ø‡'�'ˆ$�+‰+�fÓ
°4·?±?€'ÔCàŸ9™9Ñ€+Ø�"„_Ø€9à
Ð	!Ð!r   c               ó   € V ^8„  d   QhRR/# )r   r   r9   r   )r   s   "r   r   r   Þ   s   € ÷ :ñ :Ð%ñ :r   c                 óL   € \         P                  ! \         P                  R7      # )zU
Create the Hyperscan database.

Returns the database (:class:`hyperscan.Database`).
)Úmode)r'   ÚDatabaseÚHS_MODE_BLOCKr   r   r   r+   ÚHyperscanPsBackend._make_dbÝ   s   € ô 
×	Ò	¤×!8Ñ!8Ô	9Ð9r   c               ó0   € V ^8„  d   QhRRRRRRRRRRRR	/# )
r   Úexpr_idÚintÚ_fromÚ_toÚ_flagsÚ_contextr   r   r   r   )r   s   "r   r   r   æ   sF   € ÷ )ñ )àð)ð 
ð)ð ð	)ð
 ð)ð ð)ð ñ)r   c                ó    € V P                   V,          pVP                  pV P                  ^,          pWx8”  d   VP                  V3V n        R# R# )zf
Called on each match.

*expr_id* (:class:`int`) is the expression id (index) of the matched
pattern.
N)r.   r=   r/   r<   )	r2   rc   re   rf   rg   rh   Úexpr_datr=   Ú
prev_indexs	   &&&&&&   r   Ú
__on_matchÚHyperscanPsBackend.__on_matchæ   sE   € ð" �_‰_˜WÕ%€(Ø
�.‰.€%Ø�y‰y˜�|€*Ø
ÔØ× Ñ  %Ð(€4†9ñ r   )r-   r   r.   r/   r1   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r6   Ústaticmethodr,   r	   rZ   r+   rW   Ú__static_attributes__r   r   r   r   r   '   sm   † ñðDð "&ð	Dð
 26÷DðL ôJó ðJðX ô"ó ð"ð6 ô:ó ð:÷)ñ )r   r   )rr   Ú
__future__r   Úcollections.abcr   Útypingr   r   r   r'   ÚModuleNotFoundErrorÚpathspec.backendr   Úpathspec.patternr   Úpathspec._typingr	   Ú_utilsr
   Úbaser   Ú_baser   r   r   r   r   r   r   Ú<module>r      sm   ðñõ #õ÷ñ ð
Ûõõõõõ÷ñ ôT)˜ö T)øð+ ô Ø‚ðús   šA Á	AÁA