
    wg                     f    d dl Z d dlmZ ddlmZ  G d de      Z G d de      Z G d	 d
e      Zy)    N)Optional   )TritonErrorc                   b    e Zd ZdZdZdefdZddee   dej                  dee   fd	Z
d
 Zd Zy)CompilationErrorz3Base class for all errors raised during compilation   returnc                    | j                   }| j                  d}nt        |d      rn| j                  j                  d      d |j                   | j
                   d  }|r3|j                  d|j                  z  dz          dj                  |      }nd}n| j                  }t        |d      r'dj                  |j                  |j                  |      n|}| j                  r|d| j                  z   z  }|S )Nz <source unavailable>lineno
 ^z <source empty>zat {}:{}:
{})nodesrchasattrsplitr    source_line_count_max_in_messageappend
col_offsetjoinformaterror_message)selfr   source_excerptmessages       [/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/triton/compiler/errors.py_format_messagez CompilationError._format_message
   s    yy884NtX&!%!5lt{{!CTEjEjDjDk!l!"))#*?#*EF%)YY~%>N%6N!%Za([/((doo~V!/ 	td0000G    Nr   r   r   c                 X    || _         || _        || _        | j                         | _        y N)r   r   r   r   r   )r   r   r   r   s       r   __init__zCompilationError.__init__   s(    	*++-r   c                     | j                   S r    )r   r   s    r   __str__zCompilationError.__str__%   s    ||r   c                 ^    t        |       | j                  | j                  | j                  ffS r    )typer   r   r   r#   s    r   
__reduce__zCompilationError.__reduce__(   s&    DzDHHdii1C1CDDDr   r    )__name__
__module____qualname____doc__r   strr   r   astASTr!   r$   r'    r   r   r   r      sI    =')$ *.HSM . .RU .Er   r   c                       e Zd ZdZy)CompileTimeAssertionFailurezBSpecific exception for failed tests in `static_assert` invocationsN)r(   r)   r*   r+   r/   r   r   r1   r1   -   s    Lr   r1   c                       e Zd Zy)UnsupportedLanguageConstructN)r(   r)   r*   r/   r   r   r3   r3   2   s    r   r3   )r-   typingr   errorsr   r   r1   r3   r/   r   r   <module>r6      s7    
   $E{ $EN	"2 	
	#3 	r   