+
    ei  c                   s   ^ RI t ^ RIt ]P                  ! R]P                  4      t]P                  ! R]P                  4      t]P                  ! R]P                  4      tR t]P                  ! R4      t]P                  ! R4      t	]P                  ! R4      t
R	 tR
 t]P                  ! R4      tR tR t]P                  ! R4      tR tR t]P                  ! R]P                  4      tR tR t]! R4      tR# )    Nz2(\n|\A)((     (\$|\*))|)\s*(subroutine|function)\bz+\n\s*end\s*(subroutine|function)\b.*(\n|\Z)z\n     (\$|\*)\s*function\bc                s   . p^ p \         P                  W4      pVf    V# VP                  4       p\        P	                  WVP                  4       4      '       d1    V P                  RW$4      pVR8X  d   MTpWV^,            R8w  g   K/   V^,          p\        P                  WP                  4       4      pT;'       d     VP                  4       ^,
          ;'       g    \        V 4      ;r&VP                  WF34       K  )zReturn a list of tuples for each function or subroutine each
tuple is the start and end of a subroutine or function to be
expanded.
Z
z
     $i)
routine_start_reZsearchstartfunction_start_rematchendZrfindroutine_end_relenappend)astrZspanlistZindmr   ir      &      :/usr/lib64/python3.14/site-packages/numpy/f2py/_src_pyf.pyparse_structurer   7   s     H
C
##D.9 O 	""488JJtS07!a%=J.
!!$0&&1557Q;443t94%    z<\s*(\w[\w\d]*)\s*>z<\s*(\w[\w\d]*)\s*=\s*(.*?)\s*>z<\s*((.*?))\s*>c                 s    \         P                  V 4      p/ pV FU  pV^ ,          P                  4       ;'       g    \        V4      pV^,          P	                  RR4      p\        V4      pWbV&   KW  	  V# )r    \,@comma@)named_refindallstrip
unique_keyreplaceconv)r	   ZrepsnamesZrepnameZreplthelistr   r   find_repl_patternsr   W   sh    D!DE1v||~22E!21v~~eY/t*d	 
 Lr   c                 sd    \        V 4      p\        P                  ! \        R V 4      ^ ,          p W3#  )r   reZsubnr   )r	   r      & r   find_and_remove_repl_patternsr    a   s+    t$E778R&q)D;r   z\A\\(?P<index>\d+)\Zc                 sT   V P                  R 4      pV Uu. uF  q"P                  4       NK  	  pp\        \        V4      4       FL  p\        P                  W4,          4      pV'       g   K(  \        VP                  R4      4      pW6,          W4&   KN  	  R P                  V4      # u upi ),Zindex)	splitr   ranger   item_rer   Zintgroupjoin)r	   ZbZxZlr   r
   Zjr   r   r   r   h   s    

3AAqAA3q6]MM!$1AGGG$%A4AD	 
 88A; 	s   B%c                s    \        V P                  4       4      pRp^pV'       g   RV 2pWA9   d   V^,          pK  RpK"  X# )z'Obtain a unique key given a dictionary.FZ__lT)Zlistkeys)ZadictZallkeysZdoneZnZnewkeys   &    r   r   r   r   sC    5::< GD	AqcFADMr   z\A\s*(\w[\w\d]*)\s*\Zc                 s  aaa V P                  R R4      p V P                  RR4      p \        V 4      o\        P                  RV 4      p V3R lp\        P                  W 4      p RpRp/ o\
        P                  V 4       F  pVS9  g   K  SP                  WQP                  VR4      4      pVf   \        RV R24      hWQ9  d   VP                  R	4      '       g   WaV&   VP                  R
4       Uu. uF  qwP                  RR
4      NK  	  pp\        V4      p	Vf   T	pVSV&   TpK  W8X  d   VSV&   K  R
P                  SV,          4      p
\        RV RV
 RV RV R2	4       K  	  S'       g   V # VV3R lpRp\        V4       F&  oV\
        P                  W4      R,           ,          pK(  	  VP                  RR4      pVP                  RR4      pV# u upi )z\>z@rightarrow@z\<z@leftarrow@z<\1>c                 s$  < \        V P                  ^4      P                  RR4      4      p\        P	                  V4      '       d   RV R2# RpSP                  4        F  pSV,          V8X  g   K  TpK  	  Vf   \        S4      pVSV&   RV R2# )   r   r   <>N)r   r%   r   template_name_rer   r'   r   )mobjr   r   Zkeylnamess   &   r   listreplZexpand_sub.<locals>.listrepl   s    tzz!},,UI>?!!'**wiq>!;;=Cc{g% ! <f%D"F4L4&{r   NzNo replicates found for <r*   Z_r!   r   z*Mismatch in number of replacements (base <Z=z>) for <z>. Ignoring.c                 sv   < V P                  ^4      pSP                  VS^,           V.,          4      S,          # )r(   )r%   get)r,   r   kruless   & r   namereplZexpand_sub.<locals>.namerepl   s1    zz!}yyA$/033r   r   z

r)   )r   r   r   sublist_retemplate_rer   r/   Z
ValueErrorZ
startswithr"   r   r&   Zprintr#   )Zsubstrr   r.   ZnumsubsZ	base_ruleZrr   r   ZruleZnumZrules_base_ruler2   newstrr0   r-   r1   s   &&           @@@r   
expand_subr7      s   ^^E>2F^^E=1F'F\\'6*F [[*FGIE  (E>jjIIa$67G #<QCq!ABB~g&8&8&=&="a7>}}S7IJ7I!IIi-7IDJd)Ca	a"%((5+;"<   ){!O+< =S',8 9% )* 4 F7^+//(3f<<  ^^NC0F^^M3/FM7 Ks   3Gc                 s4   T pR p\        V4      p^ p/ pVP                  \        4       V F^  p\        WV^ ,           4      w  rxW',          pVP                  V4       V\	        W^ ,          V^,           V4      ,          pV^,          pK`  	  W!VR ,          pV# )r   N)r   Zupdate_special_namesr    r7   )	Zallstrr6   ZwritestrZstructZoldendr   r3   Z
cleanedstrZdefss	   &        r   process_strr9      s    FHV$FFE	LL 8s1v9NO
TJv!fSV4e<<Q  vwHOr   z8(\n|\A)\s*include\s*['\"](?P<name>[\w\d./\\]+\.src)['\"]c                 sh   \         P                  P                  V 4      p\        V 4      ;_uu_ 4       p. pV F  p\        P                  V4      pV'       d   VP                  R 4      p\         P                  P                  V4      '       g    \         P                  P                  W4      p\         P                  P                  V4      '       d   VP                  \        V4      4       K  VP                  V4       K  VP                  V4       K  	  RRR4       V#   + '       g   i     X# ; i)r   N)osZpathZdirnameZopeninclude_src_rer   r%   Zisabsr&   ZisfileZextendresolve_includesr   )sourceZdZfidlinesZliner
   Zfnr   r   r<   r<      s    
A	fD$$T*AWWV_ww}}R((a,B77>>"%%LL!1"!56LL&T"  
 L 
 Ls   AD AD AD  D1	c                 sL    \        V 4      p\        R P                  V4      4      # r   )r<   r9   r&   )r=   r>   r   r   process_filer?      s    V$Erwwu~&&r   z
<_c=s,d,c,z>
<_t=real,double precision,complex,double complex>
<prefix=s,d,c,z>
<ftype=real,double precision,complex,double complex>
<ctype=float,double,complex_float,complex_double>
<ftypereal=real,double precision,\0,\1>
<ctypereal=float,double,\0,\1>
)r:   r   ZcompileZIr   r   r   r   r5   r   r4   r   r    r$   r   r   r+   r7   r9   r;   r<   r?   r8   ) r   r   <module>r@      s   	 	+Z ::SUWUYUYZ JBDDQJJ=rttD 8 jj/0::89
**'
( **,
- ::67 <|( WY[Y]Y]^$'
 $ % r   