U
    ?h\                     @   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|f| }t|| d}t| d S )N)symbol	signaturefunction)r   Znormalize_signaturer   r	   r   export_registryappend)funcZ	fn_argtysZfn_rettyr	   entrysigsym G/var/www/html/venv/lib/python3.8/site-packages/numba/pycc/decorators.pywrappped   s    zexport.<locals>.wrappped)warningswarnDeprecationWarningparse_prototype)Z	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   s6   | D ],}t |}tt| |d W 5 Q R X qdS )z_
    Read input source files for execution of legacy @export / @exportmany
    decorators.
    execN)openr    compileread)inputsZifileZ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   Zfunctyper   r   r   r   8   s    


r   )rer   Z
numba.corer   r   Znumba.pycc.compilerr   r   r   r   r%   r&   r"   Ir(   r   r   r   r   r   <module>   s   

