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

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ÚOptionalÚUnionN)ÚRegexPattern)ÚGitIgnoreSpecPatternÚ_BYTES_ENCODINGÚ_DIR_MARK_CGÚ_DIR_MARK_OPT)Úoverride)ÚHS_FLAGSÚHyperscanExprDatÚHyperscanExprDebug)ÚHyperscanPsBackendc                  ó–   a € ] tR t^(t$ RtR]R&   RRRR/R V 3R lllt]]R	 R
 l4       4       t	]R R l4       t
]R R l4       tRtV ;t# )ÚHyperscanGiBackendzÀ
The :class:`HyperscanGiBackend` class is the :module:`hyperscan`
implementation used by :class:`~pathspec.gitignore.GitIgnoreSpec`. The
Hyperscan database uses block mode for matching files.
ztuple[Optional[bool], int, int]Ú_outÚ_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   "ÚH/usr/lib/python3/dist-packages/pathspec/_backends/hyperscan/gitignore.pyÚ__annotate__ÚHyperscanGiBackend.__annotate__2   s2   € ÷ ñ à"ðð ð	ð
 /ðð ñó    c               ó8   <€ \         SV `  WVR7       RV n        R# )zŽ
Initialize the :class:`HyperscanMatcher` instance.

*patterns* (:class:`Sequence` of :class:`.RegexPattern`) contains the
compiled patterns.
)r   r   N©Néÿÿÿÿé    )ÚsuperÚ__init__r   )Úselfr   r   r   Ú	__class__s   &&$$€r   r(   ÚHyperscanGiBackend.__init__2   s#   ø€ ô �'Ñ�8À:ÐÔNà€$„)ñr"   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r   Údbzhyperscan.DatabaseÚdebugÚboolr   zlist[tuple[int, RegexPattern]]Úsort_idsz%Optional[Callable[[list[int]], None]]r   zlist[HyperscanExprDat]r   )r   s   "r   r    r!   N   sA   € ÷ fñ fØðfà	ðfð +ðfð 2ð	fð
 ñfr"   c                ó6  € V'       g   Q V4       h. p. pV EF  w  rgVP                   f	   Q Wg34       h\        V\        4      '       g   Q V4       hVP                  P                  p. p	\        V\
        4      '       dÛ   \        V\        4      '       d   Tp
M2\        V\        4      '       g   Q V4       hVP                  \        4      p
\        V
9   d…   V
P                  \        4      '       dA   V
R\        \        4      )  pV	P                  V R2R34       V	P                  V R2R34       M)V
P                  \        R4      pV	P                  VR34       V	'       g   V	P                  VR34       V	 Fµ  w  rŒ\        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VVR7      4       M'VP                  \%        VP                   VVR7      4       VP                  V4       K·  	  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 )
ao  
Create 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`).
NÚ/TÚ$FÚutf8)ÚincludeÚindexÚis_dir_patternÚregex)r5   r6   r7   )ÚexpressionsÚidsÚelementsÚflags)r5   Ú
isinstancer   r8   Úpatternr	   ÚstrÚbytesÚdecoder
   r   Úendswithr   ÚlenÚappendÚreplaceÚencoder   r   ÚlistÚrangeÚcompiler   )r-   r.   r   r0   Ú	expr_dataÚexprsÚpattern_indexr>   r8   Úuse_regexesÚ	regex_strÚ
base_regexr7   Úregex_bytesr:   Ú_HyperscanGiBackend__ids   &&&&            r   Ú_init_dbÚHyperscanGiBackend._init_dbL   se  € ÷8 
Ð�8Óˆð ')€)Ø€%Ü (Ñ€mØ
�/‰/Ò
%Ð?¨Ð'?Ó?Ð
%ô �Wœl×
+Ò
+Ð4¨WÓ4Ð
+Ø�=‰=× Ñ €5à79€;Ü�Ô.×/Ò/ô �%œ×ÒØ�Yä�uœe×$Ò$Ð+ eÓ+Ð$Ø—‘œoÓ.€Yä�yÔ à×Ñœ=×)Ò)ð Ð1œs¤=Ó1Ð1Ð2€jØ×Ñ˜Z˜L¨Ð*¨DÐ1Ô2Ø×Ñ˜Z˜L¨Ð*¨EÐ2Õ3ð ×$Ñ$¤\°3Ó7€jØ×Ñ˜* dÐ+Ô,ç
à×Ñ˜˜u�~Ô&ã +Ñ€uÜ�%œ×ÒØ�[ä�uœc×"Ò"Ð) EÓ)Ð"Ø—<‘< Ó'€[çØ×ÑÔ(Ø�o‰oØØ#Øô	õ ð ×ÑÔ&Ø�o‰oØØ#ôô ð 
‡L�L�Öô+ !,ñG !)ôv 	ŒU”3�u“:ÓÓ€#ØÒÙˆC„=Ù$'Ó(¡C˜D�$�KˆK¡C€5Ð(ð ‡*�*ØØ
Ü�‹JÜ	ð	 ô ð 
Ðùò )s   ÉJc               ó    € V ^8„  d   QhRRRR/# )r   Úfiler?   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                  R,          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`).
Nr4   )Úmatch_event_handler:Nr   N)NNr%   r$   )Ú_dbr   ÚscanrF   Ú_HyperscanGiBackend__on_match)r)   rU   r-   Úout_includeÚ	out_indexs   &&   r   Ú
match_fileÚHyperscanGiBackend.match_file¶   sh   € ð ‡x�x€"Ø	‡X�XÒð Ðà€$„)Ø‡'�'ˆ$�+‰+�fÓ
°4·?±?€'ÔCàŸ9™9 R�=Ñ€+Ø�"„_Ø€9à
Ð	!Ð!r"   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   € ÷ "3ñ "3àð"3ð 
ð"3ð ð	"3ð
 ð"3ð ð"3ð ñ"3r"   c                óT  € V P                   V,          pVP                  pV'       d   ^pM^pVP                  p	VP                  p
V P                  ^,          pV P                  ^,          pV	'       d   V'       d   W«8”  g   WŒ8X  d   W«8”  g   WŒ8”  d   W–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)Ú
_expr_datar7   r5   r6   r   )r)   r`   rb   rc   rd   re   Úexpr_datr7   Úpriorityr5   r6   Ú
prev_indexÚprev_prioritys   &&&&&&       r   Ú
__on_matchÚHyperscanGiBackend.__on_matchÒ   sŒ   € ð �_‰_˜WÕ%€(à×*Ñ*€.ßà�8ð €8ð ×Ñ€'Ø
�.‰.€%Ø�y‰y˜�|€*Ø—)‘)˜A•,€-ç— 5Ô#5ØÔ  UÔ%7ØÔàŸ™¨Ð2€4†9ñ r"   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r(   r   ÚstaticmethodrR   r]   rZ   Ú__static_attributes__Ú__classcell__)r*   s   @r   r   r   (   su   ø‡ ñð 'Ó&ðð "&ð	ð
 26÷ò ð4 Øôfó ó ðfðP ô"ó ð"ð6 ô"3ó ö"3r"   r   )rr   Ú
__future__r   Úcollections.abcr   Útypingr   r   r   r   Ú	hyperscanÚModuleNotFoundErrorÚpathspec.patternr   Ú pathspec.patterns.gitignore.specr	   r
   r   r   Úpathspec._typingr   Ú_baser   r   r   Úpathspecr   r   r   r"   r   Ú<module>r�      sn   ðñõ #õ÷ó ðÛõ÷ó õ
÷ñ õôM3Ð+ö M3øð+ ô Ø‚ðús   œA Á	A!Á A!