§
    ñyIf§  ã                  ó€   — 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 )zëThe 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	   © ó    úM/var/www/piapp/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    o­t          | 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 )z§Check 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Ò)ð 	@Ý�t”y¥%¤*Ñ-Ô-ð	@àŒIŒN˜fÒ$ð	@õ �t”{¥E¤LÑ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   € Ý˜W gÕ/?Ñ@Ô@Ð@Ø×ÒÝŒ
•MÕ"5Ñ6Ô6Õ8Tñô ð ð ð 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   