o
    ۾i\                     @   sj   d dl Z d dlZd dlmZmZ d dlmZ g Zdd Zdd Z	dd	 Z
d
d Ze de jZdd ZdS )    N)typingsigutils)ExportEntryc                    s.   t jdtdd t| \  fdd}|S )Nz9export() is deprecated, use the numba.pycc.CC API instead   
stacklevelc                    s<   t  \}}tj|g|R  }t|| d}t| d S )N)symbol	signaturefunction)r   normalize_signaturer   r	   r   export_registryappend)func	fn_argtysfn_rettyr	   entrysigsym I/home/ubuntu/.local/lib/python3.10/site-packages/numba/pycc/decorators.pywrappped   s   zexport.<locals>.wrappped)warningswarnDeprecationWarningparse_prototype)	prototyper   r   r   r   export   s   r   c                    s    t jdtdd  fdd}|S )Nz=exportmany() is deprecated, use the numba.pycc.CC API insteadr   r   c                    s    D ]}t ||  qd S N)r   )r   proto
prototypesr   r   wrapped   s   zexportmany.<locals>.wrapped)r   r   r   )r!   r"   r   r    r   
exportmany   s
   r#   c              	   C   sJ   | D ] }t |}tt| |d W d   n1 sw   Y  qdS )z_
    Read input source files for execution of legacy @export / @exportmany
    decorators.
    execN)openr$   compileread)inputsifilefinr   r   r   process_input_files%   s   
r+   c                   C   s   g t d d < d S r   )r   r   r   r   r   clear_export_registry/   s   r,   z[_a-z][_a-z0-9]*c                 C   sN   t | }|std|d}|d}| || }| |d d }||fS )zSeparate the symbol and function-type in a a string with
    "symbol function-type" (e.g. "mult float(float, float)")

    Returns
    ---------
    (symbol_string, functype_string)
    z*Invalid function name for export prototyper      N)	re_symbolmatch
ValueErrorstartend)textmser   functyper   r   r   r   8   s   


r   )rer   
numba.corer   r   numba.pycc.compilerr   r   r   r#   r+   r,   r&   Ir.   r   r   r   r   r   <module>   s    

