o
    i                     @   sL   d dl Z d dlmZmZ G dd deZG dd deZG dd deZdS )	    N)OptionalUnionc                   @   sl   e Zd ZdZdefddZdee dejde	edf fd	d
Z
dee fddZdd Zdd Zdd ZdS )CompilationError   returnc                 C   s   | j }| jd u rd}n%| jdd |j | j d  }|r.|d|j d  d|}nd}d|j|j|}| j	rC|d| j	 7 }|S )Nz <source unavailable>
 ^z <source empty>zat {}:{}:{})
nodesrcsplitlineno source_line_count_max_in_messageappend
col_offsetjoinformaterror_message)selfr
   Zsource_excerptmessage r   e/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/triton/compiler/errors.py_format_message   s   
"z CompilationError._format_messager   r
   r   Nc                 C   s    || _ || _|| _|  | _d S N)r   r
   r   r   r   )r   r   r
   r   r   r   r   __init__   s   zCompilationError.__init__c                 C   s   || _ |  | _d S r   )r   r   r   )r   r   r   r   r   set_source_code   s   z CompilationError.set_source_codec                 C   s   | j S r   )r   r   r   r   r   __str__#   s   zCompilationError.__str__c                 C   s   d t| j| jS )Nz{}({!r}))r   type__name__r   r   r   r   r   __repr__&   s   zCompilationError.__repr__c                 C   s   t | | j| j| jffS r   )r   r   r
   r   r   r   r   r   
__reduce__)   s   zCompilationError.__reduce__)r   
__module____qualname__r   strr   r   astASTr   r   r   r   r    r!   r   r   r   r   r      s    $r   c                   @   s   e Zd ZdZdS )CompileTimeAssertionFailurezBSpecific exception for failed tests in `static_assert` invocationsN)r   r"   r#   __doc__r   r   r   r   r'   .   s    r'   c                   @   s   e Zd ZdS )UnsupportedLanguageConstructN)r   r"   r#   r   r   r   r   r)   3   s    r)   )r%   typingr   r   	Exceptionr   r'   r)   r   r   r   r   <module>   s
    )