
    shO                     F    S r SSKr " S S\R                  5      rS rS rg)zR
This module provides helper functions to find the first line of a function
body.
    Nc                   T   ^  \ rS rSrSrS rU 4S jrS\R                  4S jr	Sr
U =r$ )FindDefFirstLine	   z
Attributes
----------
first_stmt_line : int or None
    This stores the first statement line number if the definition is found.
    Or, ``None`` if the definition is not found.
c                 V    UR                   U l        UR                  U l        SU l        g)z>
Parameters
----------
code :
    The function's code object.
N)co_name_co_nameco_firstlineno_co_firstlinenofirst_stmt_line)selfcodes     n/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/misc/firstlinefinder.py__init__FindDefFirstLine.__init__   s%     #22#    c                 ^   > [         R                  " U5       H  n[        TU ]  U5        M     g )N)astiter_child_nodessupervisit)r   nodechild	__class__s      r   _visit_children FindDefFirstLine._visit_children   s$    ))$/EGM%  0r   r   c                    UR                   U R                  :X  a  [        UR                  /5      nUR                  (       a*  UR                  S   nUR                  UR                  5        U R                  U;   aR  UR                  (       a@  UR                  S   n[        U5      (       a  UR                  S   nUR                  U l	        g  U R                  U5        g )Nr      )namer   setlinenodecorator_listaddr
   body_is_docstringr   r   )r   r   possible_start_linesfirst_decor
first_stmts        r   visit_FunctionDef"FindDefFirstLine.visit_FunctionDef!   s    99% $'}#5 "" #11!4$((););<##';; 99!%1J$Z00%)YYq\
+5+<+<D(
 T"r   )r
   r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   FunctionDefr(   __static_attributes____classcell__)r   s   @r   r   r   	   s'    	$!#coo # #r   r   c                     [        U [        R                  5      (       aS  [        U R                  [        R                  5      (       a*  [        U R                  R                  [
        5      (       a  gg)NTF)
isinstancer   ExprvalueConstantstr)r   s    r   r$   r$   ?   sE    $!!tzz3<<00tzz//55r   c                 B   U R                   n [        UR                  5       nUR                  5       nSSS5        [        R
                  " W5      n[        U5      nUR                  U5        UR                  $ ! , (       d  f       NL= f! [        [        4 a     gf = f)z
Look up the first line of function body using the file in
``pyfunc.__code__.co_filename``.

Returns
-------
lineno : int; or None
    The first line number of the function body; or ``None`` if the first
    line cannot be determined.
N)__code__openco_filenamereadr   parser   r   r   FileNotFoundErrorOSError)pyfunccofinfile_contenttreefinders         r   get_func_body_first_linenorF   G   s     
B	&"..!S88:L "
 yy&!"%T%%% "!w' s'   B A:B :
BB BB)r.   r   NodeVisitorr   r$   rF    r   r   <module>rI      s*   
 3#s 3#l&r   