
    	h              
          % S r SSKJr  SSKrSSKrSSKrSSKrSSKr\R                  " S5      r	\R                  " S5      r
\R                  " S5      r\R                  " S5      r\R                  " S5      r\R                  " S	5      r\\\/r\R                  " S
5      r\R                  " S5      r\R                  " S5      r0 qS\S'   0 rS\S'    \R,                  S   R/                  S5      rS rS r0 4S jr\ S:X  a  \" 5         gg! \ az     \R,                  S   R/                  S5      r NB! \ aO    S/r \R5                  S\R6                  R9                  S\R,                  S   5      5          N! \ a       Nf = ff = ff = f)a  
Vendored from https://github.com/python/cpython/blob/3.8/Tools/scripts/h2py.py

Changes since vendored version:
- Minimal changes to satisfy our checkers.
- Rename `p_hex` to `p_signed_hex` and improve to include lowercase l
- Fixed `pytify` to remove leftover L after numbers and actually compute negative hexadecimal constants
- Added `p_int_cast` and `p_literal_constant`

---

Read #define's and translate to Python code.
Handle #include statements.
Handle #define macros with one argument.
Anything that isn't recognized or doesn't translate into valid
Python is ignored.

Without filename arguments, acts as a filter.
If one or more filenames are given, output is written to corresponding
filenames in the local directory, translated to all uppercase, with
the extension replaced by ".py".

By passing one or more options of the form "-i regular_expression"
you can specify additional strings to be ignored.  This is useful
e.g. to ignore casts to u_long: simply specify "-i '(u_long)'".
    )annotationsNz/^[\t ]*#[\t ]*define[\t ]+([a-zA-Z0-9_]+)[\t ]+zK^[\t ]*#[\t ]*define[\t ]+([a-zA-Z0-9_]+)\(([_a-zA-Z][_a-zA-Z0-9]*)\)[\t ]+z&^[\t ]*#[\t ]*include[\t ]+<([^>\n]+)>z/\*([^*]+|\*+[^/])*(\*+/)?z//.*z6\((DWORD|HRESULT|SCODE|LONG|HWND|HANDLE|int|HBITMAP)\)z'(\\.[^\\]*|[^\\])'z0x([0-9a-fA-F]+)[lL]?z#((0x[0-9a-fA-F]+?)|([0-9]+?))[uUlL]zdict[str, None]filedictzdict[str, str]
importableinclude;INCLUDEz/usr/include	MULTIARCHc            
        [         R                   " [        R                  SS  S5      u  pU  H6  u  p#US:X  d  M  [        R	                  [
        R                  " U5      5        M8     U(       d  S/nU GH>  nUS:X  aI  [        R                  R                  S5        [        [        R                  [        R                  5        MS  [        U5       n[        R                  R                  U5      nUR                  S5      nUS:  a  US U nUR!                  5       nUS-   n[        US	5       n	U	R                  S
U-  5        0 q[$         HG  n
US ['        U
5       U
:X  d  M  S ["        U['        U
5      S-   S  '   U[(        U['        U
5      S-   S  '     O   [        XY5        S S S 5        S S S 5        GMA     g ! , (       d  f       N= f! , (       d  f       GMe  = f)N   zi:z-i-z# Generated by h2py from stdin
.r   z.pywz# Generated by h2py from %s
)getoptsysargvignoresappendrecompilestdoutwriteprocessstdinopenospathbasenamerfindupperr   
searchdirslenr   )optsargsoafilenamefpoutfileimodnameoutfpdirs              eC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\win32/scripts/h2py.pymainr.   M   st   sxx|T2JD9NN2::a=)  us?JJ?@CIIszz*h2''**84MM#&q5%bqkG!--/!E/'3'5KK ?( JK!H)#Jc#h/36AEHXc#hln%=>CJJxC1'?@!	  *
 B& (    ('  s+   AG.0F7"?F7!G7
GG
G	c           
        [          H  nUR                  SU 5      n M     [        R                  SU 5      n Sn [        R	                  X5      nU(       d  O}UR                  5       u  pE[        R                  " [        U [        UR                  S5      6    S5      5      R                  nUS:  a  U S U S-   [        U5      -   S-   XS  -   n US-   nM  [        R                  SU 5      n U $ )	N z	ord('\1')r   r      ()z\1)r   subp_charp_signed_hexsearchspanctypesc_int32intslicevaluestrp_literal_constant)bodypstartmsevals          r-   pytifyrG   l   s    uuS$  ::lD)DE
,vvxnnSeQVVAY&7!8"=>DD78c>CH,s2T"X=DA  !!%.DK    c                V   Sn U R                  5       nU(       d  g US-   n[        R                  U5      nU(       a  USS  S:X  a,  U R                  5       nU(       d  OUS-   nXF-   nUSS  S:X  a  M,  UR                  S5      nXER	                  5       S  n[        U5      nSn	U< SUR                  5       < S3n
 [        X5        UR                  U
5        [        R                  U5      nU(       a]  UR                  SS5      u  pXER	                  5       S  n[        U5      nS	U< S
U< SU< S3n
 [        X5        UR                  U
5        [        R                  U5      nU(       a  UR                  nUS   u  pXNU nU[        ;   a  UR                  S[        U   -  5        OU[        ;  a  S [        U'   S n[          H  n [#        US-   U-   5      n  O   U(       a,  U   UR                  SU-  5        ['        UX5        S S S 5        O"[        R                  R                  SU-  5        GM1  !   [        R                  R                  SU
-  5         GN= f!   [        R                  R                  SU
-  5         GN6= f! [$         a     M  f = f! , (       d  f       Nv= f)Nr   r   z\
z = 
zSkipping: %s   zdef r2   z
): return zfrom %s import *
/z
# Included from %s
z!Warning - could not find file %s
)readlinep_definematchgroupendrG   stripexecr   r   stderrp_macro	p_includeregsr   r   r    r   IOErrorr   )r'   r+   envlinenolinerP   nextlinenamer@   okstmtmacroargrX   r%   br&   inclfpr,   s                      r-   r   r      sW   F
{{}!t$rs)v%;;=! rs)v% ;;q>D		&D$<DB"&

5D"T D!d#Q*JE		&D$<D05sDAD"T D!%::D7DAayH:%0:h3GGH)%)"%C!%cCi(&:!; & $<x$GH3   JJ$$%IH%TUu *8

  $!678

  $!67" #   s6   ;H5 4I J	&!J5$I$J	
JJ
J(__main__)!__doc__
__future__r   r9   r   r   r   r   r   rO   rV   rW   	p_commentp_cpp_comment
p_int_castr   r5   r6   r?   r   __annotations__r   environsplitr    KeyErrorinsertr   joinr.   rG   r   __name__ rH   r-   <module>rs      s  @ #   	 	 
::HI
**V JJ@A	JJ45	

6"ZZQR
mZ
0	*	+zz23ZZ FG / 
N 
I&,,S1J'>,  <V~ zF   ZZ	*005
 $%
	anbjj>U!VW 			sH   D FD44	F	>9E:7F:F F	FFF		F