Ë
    üÇ:jµ  ã                   óV   — d Z ddlZddlZddlZ G d„ dej                  «      Zd„ Zd„ Zy)zR
This module provides helper functions to find the first line of a function
body.
é    Nc                   óH   ‡ — e Zd ZdZd„ Zˆ fd„Zdej                  fd„Zˆ xZ	S )ÚFindDefFirstLinezÊ
    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                 ó.   — || _         || _        d| _        y)zf
        Parameters
        ----------
        code :
            The function's code object.
        N)Ú_co_nameÚ_co_firstlinenoÚfirst_stmt_line)ÚselfÚnameÚfirstlinenos      úo/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/numba/misc/firstlinefinder.pyÚ__init__zFindDefFirstLine.__init__   s   € ð ˆŒØ*ˆÔØ#ˆÕó    c                 óX   •— t        j                  |«      D ]  }t        ‰| �  |«       Œ y )N)ÚastÚiter_child_nodesÚsuperÚvisit)r	   ÚnodeÚchildÚ	__class__s      €r   Ú_visit_childrenz FindDefFirstLine._visit_children   s)   ø€ Ü×)Ñ)¨$Ó/ò 	!ˆEÜ‰G‰M˜%Õ ñ	!r   r   c                 óœ  — |j                   | j                  k(  r¢t        |j                  g«      }|j                  r*|j                  d   }|j                  |j                  «       | j                  |v rH|j                  r;|j                  d   }t        |«      r|j                  d   }|j                  | _	        y 	 | j                  |«       y )Nr   é   )r
   r   ÚsetÚlinenoÚdecorator_listÚaddr   ÚbodyÚ_is_docstringr   r   )r	   r   Úpossible_start_linesÚfirst_decorÚ
first_stmts        r   Úvisit_FunctionDefz"FindDefFirstLine.visit_FunctionDef#   s²   € Ø�9‰9˜Ÿ™Ò%ô $'¨¯© }Ó#5Ð Ø×"Ò"ð #×1Ñ1°!Ñ4�Ø$×(Ñ(¨×);Ñ);Ô<à×#Ñ#Ð';Ñ;ð —9’9Ø!%§¡¨1¡�JÜ$ ZÔ0à%)§Y¡Y¨q¡\˜
Ø+5×+<Ñ+<�DÔ(Øð
 Ø×Ñ˜TÕ"r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   ÚFunctionDefr#   Ú__classcell__)r   s   @r   r   r      s"   ø„ ñò	$ô!ð# c§o¡o÷ #r   r   c                 óÊ   — t        | t        j                  «      rIt        | j                  t        j                  «      r%t        | j                  j                  t
        «      ryy)NTF)Ú
isinstancer   ÚExprÚvalueÚConstantÚstr)r   s    r   r   r   A   s<   € Ü�$œŸ™Ô!Ü�t—z‘z¤3§<¡<Ô0Ü˜tŸz™z×/Ñ/´Ô5ØØr   c                 ó:  — | j                   }	 t        |j                  «      5 }|j                  «       }d}ddd«       t        j                  t        j                  «      «      }t        |j                  |j                   z
  «      }|j#                  |«       |j$                  r|j$                  |z   S y# 1 sw Y   Œ�xY w# t        t
        f$ rI 	 t        j                  | «      \  }}dj                  |«      }|dz
  }n# t
        t        f$ r Y Y yw xY wY ŒÛw xY w)a  
    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.
    r   NÚ r   )Ú__code__ÚopenÚco_filenameÚreadÚFileNotFoundErrorÚOSErrorÚinspectÚgetsourcelinesÚjoinÚ	TypeErrorr   ÚparseÚtextwrapÚdedentr   Úco_nameÚco_firstlinenor   r   )ÚpyfuncÚcoÚfinÚsourceÚoffsetÚlinesÚtreeÚfinders           r   Úget_func_body_first_linenorI   I   s  € ð 
�‰€Bð
Ü�"—.‘.Ó!ð 	 SØ—X‘X“ZˆFØˆF÷	ô �9‰9”X—_‘_ VÓ,Ó-€DÜ˜bŸj™j¨"×*;Ñ*;¸fÑ*DÓE€FØ
‡L�L�ÔØ×ÒØ×%Ñ%¨Ñ.Ð.ð ÷%	ð 	ûô œwÐ'ò ð	Ü#×2Ñ2°6Ó:‰MˆE�6Ø—W‘W˜U“^ˆFØ˜a‘Z‰FøÜœÐ#ò 	Úð	úñ ð	úsK   ŽC £B6¶C Â6B?Â;C ÃDÃ.DÄ DÄDÄDÄDÄDÄD)r'   r   r8   r=   ÚNodeVisitorr   r   rI   © r   r   ú<module>rL      s0   ðñó
 Û Û ô3#�s—‘ô 3#òlór   