
    5 f                        d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	m
Z
 d dlmZ d dlmZ dd	Zd
ZddZdddZddZdS )    )annotations)contextinference_tipnodes)register_module_extender)_extract_single_nodeparse)	PY39_PLUS)AstroidManagerreturnnodes.Modulec                      t          d          S )zThe RegexFlag enum exposes all its entries by updating globals().

    We hard-code the flags for now.
    # pylint: disable-next=line-too-long
    See https://github.com/mrabarnett/mrab-regex/blob/2022.10.31/regex_3/regex.py#L200
    aA  
    A = ASCII = 0x80          # Assume ASCII locale.
    B = BESTMATCH = 0x1000    # Best fuzzy match.
    D = DEBUG = 0x200         # Print parsed pattern.
    E = ENHANCEMATCH = 0x8000 # Attempt to improve the fit after finding the first
                              # fuzzy match.
    F = FULLCASE = 0x4000     # Unicode full case-folding.
    I = IGNORECASE = 0x2      # Ignore case.
    L = LOCALE = 0x4          # Assume current 8-bit locale.
    M = MULTILINE = 0x8       # Make anchors look for newline.
    P = POSIX = 0x10000       # POSIX-style matching (leftmost longest).
    R = REVERSE = 0x400       # Search backwards.
    S = DOTALL = 0x10         # Make dot match newline.
    U = UNICODE = 0x20        # Assume Unicode locale.
    V0 = VERSION0 = 0x2000    # Old legacy behaviour.
    DEFAULT_VERSION = V0
    V1 = VERSION1 = 0x100     # New enhanced behaviour.
    W = WORD = 0x800          # Default Unicode word breaks.
    X = VERBOSE = 0x40        # Ignore whitespace and comments.
    T = TEMPLATE = 0x1        # Template (present because re module has it).
    )r	        O/var/www/equiseq/venv/lib/python3.11/site-packages/astroid/brain/brain_regex.py_regex_transformr      s     	  r   z?
@classmethod
def __class_getitem__(cls, item):
    return cls
node
nodes.Callboolc                   |                                  j        dk    ot          | j        t          j                  o| j        j        dk    o~t          | j        t          j                  o_t          | j        j	                  dk    oBt          | j        j	        d         t          j
                  o| j        j	        d         j        dv S )zCheck for regex.Pattern or regex.Match call in stdlib.

    Match these patterns from stdlib/re.py
    ```py
    Pattern = type(...)
    Match = type(...)
    ```
    zregex.regextype   r   >   MatchPattern)rootname
isinstancefuncr   NameparentAssignlentargets
AssignName)r   s    r   _looks_like_pattern_or_matchr%   5   s     			M) 	@ty%*--	@INf$	@ t{EL11	@ #$$)		@
 t{*1-u/?@@	@ K"'+??r   Nctxcontext.InferenceContext | Nonec                    t          j        | j        j        d         j        | j        | j        | j        | j        | j                  }t          rt          t                    }|g|j        d<   t          |g          S )z\Infer regex.Pattern and regex.Match as classes.

    For PY39+ add `__class_getitem__`.
    r   )r   lineno
col_offsetr    
end_linenoend_col_offset__class_getitem__)r   ClassDefr    r#   r   r)   r*   r+   r,   r
   r   CLASS_GETITEM_TEMPLATElocalsiter)r   r&   	class_deffunc_to_adds       r   infer_pattern_matchr4   I   s|    
 [ #({?{?*  I  >*+ABB1<	,-r   managerr   Nonec                    t          | dt                     |                     t          j        t          t                    t                     d S )Nregex)r   r   register_transformr   Callr   r4   r%   )r5   s    r   registerr;   \   sJ    Wg/?@@@
M"5668T    r   )r   r   )r   r   r   r   )N)r   r   r&   r'   )r5   r   r   r6   )
__future__r   astroidr   r   r   astroid.brain.helpersr   astroid.builderr   r	   astroid.constr
   astroid.managerr   r   r/   r%   r4   r;   r   r   r   <module>rB      s   
 # " " " " " 1 1 1 1 1 1 1 1 1 1 : : : : : : 7 7 7 7 7 7 7 7 # # # # # # * * * * * *   @    (    &     r   