
     Ti                    l    S r SSKJr  SSKrSSKJr   " S S5      r\\R                  \/\4   r	SS jr
g)	z5Source code information used for diagnostic messages.    )annotationsN)Callablec                  Z    \ rS rSrSrSSS.     S
S jjr\S 5       rSS jrSS jr	S	r
g)
SourceInfo   zKInformation about onnxscript source fragment, used for diagnostic messages.N)codefunction_namec               (    Xl         X l        X0l        g Nast_noder   r	   )selfr   r   r	   s       ^/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/onnxscript/_internal/sourceinfo.py__init__SourceInfo.__init__   s     !	*    c                .    U R                   R                  $ r   )r   linenor   s    r   r   SourceInfo.lineno   s    }}###r   c                0   U R                   nU R                  (       a  SU R                   SU 3nOSU 3nU R                  (       aD  U R                  R                  S5      nXBS-
     nSU R                  R
                  -  nU SU S3nOSnS	U S
U SU 3$ )Nz
Function 'z', line zLine 
    z^
 zERROR: z
at: )r   r	   r   splitr   
col_offset)r   error_messager   
source_loclineslinemarker_prefixsource_lines           r   msgSourceInfo.msg   s    %d&8&8%9&JJ )J99IIOOD)E!$D4==#;#;<M!F"]O37KKvj\K=IIr   c                    [        S5      e)NzCannot happen!)
ValueErrorr   s    r   __str__SourceInfo.__str__/   s    )**r   r   )r   ast.ASTr   
str | Noner	   r+   )r   strreturnr,   )r-   r,   )__name__
__module____qualname____firstlineno____doc__r   propertyr   r$   r(   __static_attributes__ r   r   r   r      sM    U  $(	+	+ 		+
 "	+ $ $J"+r   r   c                   ^  SU 4S jjnU$ )Nc                6   > [        U TS9R                  U5      $ )N)r   )r   r$   )nodemessagesource_codes     r   formatformatter.<locals>.format7   s    $[155g>>r   )r8   r*   r9   r,   r-   r,   r5   )r:   r;   s   ` r   	formatterr=   6   s    ? Mr   )r:   r+   r-   	Formatter)r2   
__future__r   asttypingr   r   ASTr,   r>   r=   r5   r   r   <module>rC      s<    < " 
 $+ $+N cggs^S()	r   