o
    i                     @   s    d dl mZ G dd deZdS )   )cachedmethodc                   @   s6   e Zd ZdZdd Ze dd Zdd Zdd	 Zd
S )GlobMatchera  This is a backtracking implementation of the glob matching algorithm.
    The glob pattern language supports `*` as a multiple character wildcard which includes matches on `""`
    and `?` as a single character wildcard, but no escape sequences.
    The match is case insensitive.
    The match method will be cached for quicker matching and is in a class to keep it from being global.
    c                 C   s   |  | _d S )N)lowerpattern)selfr    r   R/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/internal/glob_matching.py__init__   s   zGlobMatcher.__init__c                 C   s   | j }| }d}d}d}d}|t|k s|t|k rs|t|k r]|| }|dkr9|t|k r8|d7 }|d7 }qn$|dkrH|}|d }|d7 }q|t|k r]|| |kr]|d7 }|d7 }qd|  k rit|krqn dS |}|}qdS dS )N    ?r   *FT)r   r   len)r   subjectr   pxsxnextPxnextSxcharr   r   r   match   s>   zGlobMatcher.matchc                 C   s   d| j  dS )NzGlobMatcher(pattern=))r   )r   r   r   r   __repr__7   s   zGlobMatcher.__repr__c                 C   s   t |tr| j|jkS dS )NF)
isinstancer   r   )r   otherr   r   r   __eq__:   s   
zGlobMatcher.__eq__N)	__name__
__module____qualname____doc__r	   r   r   r   r   r   r   r   r   r      s    
&r   N)utils.cacher   objectr   r   r   r   r   <module>   s    