Ë
    ù\jM  ã                   óf   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ  G d	„ d
e«      Zy)zÛ
This module provides the simple backend for :class:`~pathspec.gitignore.GitIgnoreSpec`.

WARNING: The *pathspec._backends.simple* package is not part of the public API.
Its contents and structure are likely to change.
é    )ÚSequence)ÚOptional)ÚRegexPattern)Ú	_DIR_MARK)Úoverrideé   )ÚSimplePsBackendc            	       óš   ‡ — e Zd ZU dZeeeef      ed<   dddœde	e   de
e   de
e   ddfˆ fd	„Zed
edee
e   e
e   f   fd„«       Zˆ xZS )ÚSimpleGiBackendz˜
	The :class:`SimpleGiBackend` class is the default (or simple) implementation
	used by :class:`~pathspec.gitignore.GitIgnoreSpec` for matching files.
	Ú	_patternsN©Ú	no_filterÚ
no_reverseÚpatternsr   r   Úreturnc                ó*   •— t         ‰|   |||¬«       y)a„  
		Initialize the :class:`SimpleGiBackend` instance.

		*patterns* (:class:`Sequence` of :class:`.RegexPattern`) contains the
		compiled patterns.

		*no_filter* (:class:`bool`) is whether to keep no-op patterns (:data:`True`),
		or remove them (:data:`False`).

		*no_reverse* (:class:`bool`) is whether to keep the pattern order
		(:data:`True`), or reverse the order (:data:`True`).
		r   N)ÚsuperÚ__init__)Úselfr   r   r   Ú	__class__s       €úM/root/env/lib/python3.12/site-packages/pathspec/_backends/simple/gitignore.pyr   zSimpleGiBackend.__init__!   s   ø€ ô& 'Ñ8 y¸ZÐÕHó    Úfilec                 óX  — | j                   }d}d}d}| j                  D ]†  \  }}|j                  x}€Œ|j                  |«      x}	€Œ)|	j                  j                  «       j                  t        «      }
|
rd}nd}|r||kD  r|}|}|}n|r|
s||k\  r|}|}|}|sŒ}|dk(  sŒƒ ||fS  ||fS )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   r   é   )Ú_is_reversedr   ÚincludeÚ
match_fileÚmatchÚ	groupdictÚgetr   )r   r   Úis_reversedÚout_includeÚ	out_indexÚout_priorityÚindexÚpatternr   r   Údir_markÚprioritys               r   r   zSimpleGiBackend.match_file6   sç   € ð ×!Ñ!€+à $€+Ø!€)Ø€,ØŸ™ò  n€eˆWà—‘Ð€WÑ,Ø×$Ñ$ TÓ*Ð	*ˆÑ7ð
 {‰{×$Ñ$Ó&×*Ñ*¬9Ó5€HáàXð €XáØ<ÒØ€kØ€iØlñ 
‘X (¨lÒ":Ø€kØ€iØ€lâx 1“}ð à
yÐ	!Ð!ðE ðD yÐ	!Ð!r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚlistÚtupleÚintr   Ú__annotations__r   r   Úboolr   r   Ústrr   Ú__classcell__)r   s   @r   r   r      s˜   ø… ñð s˜LÐ(Ñ)Ñ*Ó*ð #Ø#òIà\Ñ"ðIð d‰^ð	Ið
 t‰nðIð õIð* ð1"˜Cð 1" E¨(°4©.¸(À3¹-Ð*GÑ$Hò 1"ó ô1"r   r   N)r-   Úcollections.abcr   Útypingr   Úpathspec.patternr   Ú pathspec.patterns.gitignore.specr   Úpathspec._typingr   Úpathspecr	   r   © r   r   ú<module>r<      s6   ðñõõõõõõôP"oõ P"r   