
    1Vh                     p    d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlmZ ddlm	Z	  G d d	e
      Zd
 Zy)z$Inline constants in a python module.    )absolute_import)division)print_functionN)	ast_utils)scopec                       e Zd Zy)InlineErrorN)__name__
__module____qualname__     D/home/dcms/DCMS/lib/python3.12/site-packages/pasta/augment/inline.pyr	   r	      s    r   r	   c                    t        j                  |       }|j                  |   }t        |j                  t
        j                        s#t        |dt        |j                              |j                  |j                        }t        |t
        j                        st        d|z        |j                  }t        |j                  |      t
        j                        st        d|z        |j                  D ]5  }t        t        |dd      t
        j                        s)t        d|z         |j                  D ];  }t!        j"                  |j                  |      |t%        j&                  |             = t)        |j*                        dk(  r&t!        j,                  |j                  |      |       y|j*                  D cg c]-  }t        |t
        j                        r|j.                  |k(  s|/ }}||_        yc c}w )z%Inline a constant name into a module.z  is not a constant; it has type z#%r is not declared in an assignmentz%r is not a top-level namectxNz%r is not a constant   )r   analyzenames
isinstance
definitionastNamer	   typeparentAssignvalueModulereadsgetattrStorer   replace_childcopydeepcopylentargetsremove_childid)	tnamesc	name_nodeassign_noder   reftgttgt_lists	            r   inline_namer0       s   }}Q"hhtn) 
I((#((	3
d9''(* + + 		)../+	K	,
;dB
CC


%	BIIk*CJJ	7
2T9
:: __ 7c'#ud+SYY7.5667
 __ GcBIIcNCu1EFG 			"299[1;?*22 G"31cffn  GH G"KGs   2H)__doc__
__future__r   r   r   r   r"   
pasta.baser   r   	Exceptionr	   r0   r   r   r   <module>r5      s0    * '  % 
    ) !#r   