
    e                    z   d dl mZ d dlZd dlmZ d dlmZ dZ ej                  eej                        Z
 G d de      Z ed      Z ed	      Zd
j                   eeez  ed            ZddeddfdddgZd
j                  d eD              ZddZ G d de      Z G d de      Z G d de      ZddZy)    )annotationsN)	Generator)
NamedTuplea  
    (?:^\s*\#.*|\s*|               # Comment line, or whitespaces,
       \s*\#.*(?=\#.*?\bpylint:))  # or a beginning of an inline comment
                                   # followed by "pylint:" pragma
    (\#                            # Beginning of comment
    .*?                            # Anything (as little as possible)
    \bpylint:                      # pylint word and column
    \s*                            # Any number of whitespaces
    ([^;#\n]+))                    # Anything except semicolon or hash or
                                   # newline (it is the second matched group)
                                   # and end of the first matched group
    [;#]{0,1}                      # From 0 to 1 repetition of semicolon or hash
c                  "    e Zd ZU ded<   ded<   y)PragmaRepresenterstraction	list[str]messagesN)__name__
__module____qualname____annotations__     </usr/lib/python3/dist-packages/pylint/utils/pragma_parser.pyr   r      s    Kr   r   )zdisable-allz	skip-file)zdisable-nextzdisable-msgz
enable-msgdisableenable|T)keyreverseKEYWORDz\b(sz)\b)MESSAGE_STRINGz[0-9A-Za-z\-\_]{2,})ASSIGN=)MESSAGE_NUMBERz[CREIWF]{1}\d*c              #  8   K   | ]  \  }}d |dd|dd  yw)z(?P<r   >)Nr   ).0
token_name	token_rgxs      r   	<genexpr>r$   7   s/      
I :a.)Aa(s   c                F    |s| t         v rt        d|       t        | |      S )Nz1The keyword is not followed by message identifier)MESSAGE_KEYWORDSInvalidPragmaErrorr   )r	   r   s     r   emit_pragma_representerr(   =   s.    "22 ?
 	
 VX..r   c                  $     e Zd ZdZd fdZ xZS )PragmaParserErrorz6A class for exceptions thrown by pragma_parser module.c                T    || _         || _        t        |   | j                          y)z:args message: explain the reason why the exception has been thrown
        :args token: token concerned by the exception.
        N)messagetokensuper__init__)selfr,   r-   	__class__s      r   r/   zPragmaParserError.__init__H   s$     
&r   )r,   r   r-   r   returnNone)r   r   r   __doc__r/   __classcell__)r1   s   @r   r*   r*   E   s    @' 'r   r*   c                      e Zd ZdZy)UnRecognizedOptionErrorz6Thrown in case the of a valid but unrecognized option.Nr   r   r   r4   r   r   r   r7   r7   Q   s    @r   r7   c                      e Zd ZdZy)r'   z%Thrown in case the pragma is invalid.Nr8   r   r   r   r'   r'   U   s    /r   r'   c              #    K   d }g }d}d}t        j                  t        |       D ]  }|j                  }|j	                         }|dk(  r-|s(|rt        d|      |rt        d|      t        dd      d}nW|rt        d|xs d      |dk(  r|rt        ||       |}g }|t        v }n#|d	v r|j                  |       d}nt        d
      |} |rt        ||       y t        d|      w)NF r   z&The keyword doesn't support assignmentzThe keyword is unknownz!Missing keyword before assignmentz'The = sign is missing after the keywordr   >   r   r   zToken not recognized)refinditer	TOK_REGEX	lastgroupgroupr7   r'   r(   r&   appendRuntimeError)pylint_pragmar	   r   assignment_requiredprevious_tokenmokindvalues           r   parse_pragmarI   Y   s-    FHNkk)]3 #||
8&1@&  "10.  ))LbQQ"' $96<R  Y-fh??FH"(,<"<99OOE""'566G#J %fh77%&>OOs   C,C.)r	   r   r   r
   r2   r   )rC   r   r2   z(Generator[PragmaRepresenter, None, None])
__future__r   r<   collections.abcr   typingr   
OPTION_RGXcompileVERBOSE	OPTION_POr   	frozensetATOMIC_KEYWORDSr&   joinsortedlenALL_KEYWORDSTOKEN_SPECIFICATIONr>   r(   	Exceptionr*   r7   r'   rI   r   r   r   <module>rY      s   
 # 	 % 

 BJJz2::.	
 
 89F  xx
?--3E 3|A&c*+.)	  HH !4 	/	'	 	'A/ A0* 0.Pr   