Ë
    ì—0jBT  ã            	       óT  — d Z dZdZddlmZ ddlmZmZ ddl	Z	ddl
Z
ddlmZ ddlZddlZddlZddl­ dd	lmZ ddlZ ej(                  d
ej*                  «      Z ej(                  dej*                  «      ZddlZej0                  g d¢z   Z[ G d„ d e	j2                  dd«      «      Zd„ Zd„ Zd„ ZdZdZe edez   «      z    ee«      z   Z dZ!dZ"dZ#dZ$dZ% ee"e#e$e%«      Z&dZ' edd«       ee'«      z   Z(de'z   Z) ee(e)«      Z* ede*d z   «      Z+ ee+e*e&«      Z,d!„ Z-e
j\                  d"„ «       Z/ e e-«       Ž Z0d#Z1d$Z2d%Z3d&Z4 ee0d'z   e0d(z   «      Z5 ee0d)z   e0d*z   «      Z6 e e7ejp                   e9ed+¬,«      «      Ž Z: ed-e:«      Z; ee,e;e6e!«      Z<e e<z   Z= ee0d.z    ed/d«      z   e0d0z    ed1d«      z   «      Z> ed2ee5«      Z?e ee?e,e;e>e!«      z   Z@i ZA e-«       D ]"  ZBe1eAeBd/z   <   e2eAeBd1z   <   e3eAeBd'z   <   e4eAeBd(z   <   Œ$ [B eC«       ZD eC«       ZE e-«       D ]B  ZFeFd1z   eFd/z   fD ]  ZGeDj‘                  eG«       Œ eFd(z   eFd'z   fD ]  ZGeEj‘                  eG«       Œ ŒD [F[Gd3ZI G d4„ d5eJ«      ZK G d6„ d7eJ«      ZL G d8„ d9«      ZMd:„ ZNd;„ ZOd<„ ZPd=„ Zd>„ ZQd?„ ZRd@„ ZSdA„ ZTdDdB„ZUeVdCk(  r eS«        yy)Eao  Tokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
zKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foordé    )Úopen)ÚlookupÚBOM_UTF8N)ÚTextIOWrapper)Ú*)ÚEXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s   ^[ \t\f]*(?:[#\r\n]|$))ÚtokenizeÚgenerate_tokensÚdetect_encodingÚ
untokenizeÚ	TokenInfoc                   ó"   — e Zd Zd„ Zed„ «       Zy)r   c                 óp   — d| j                   t        | j                      fz  }d| j                  |¬«      z  S )Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))Útype)r   Útok_nameÚ_replace)ÚselfÚannotated_types     ú%/usr/local/lib/python3.12/tokenize.pyÚ__repr__zTokenInfo.__repr__0   s9   € Ø" d§i¡i´¸$¿)¹)Ñ1DÐ%EÑEˆØJØ—‘ >�Ó2ñ3ð 	4ó    c                 óŠ   — | j                   t        k(  r%| j                  t        v rt        | j                     S | j                   S ©N)r   ÚOPÚstringr   ©r   s    r   Ú
exact_typezTokenInfo.exact_type5   s2   € à�9‰9œŠ?˜tŸ{™{Ô.?Ñ?Ü$ T§[¡[Ñ1Ð1à—9‘9Ðr   N)Ú__name__Ú
__module__Ú__qualname__r   Úpropertyr   © r   r   r   r   /   s   „ ò4ð
 ñó ñr   r   ztype string start end linec                  ó0   — ddj                  | «      z   dz   S )NÚ(Ú|Ú))Újoin©Úchoicess    r   Úgroupr*   <   s   € ˜C #§(¡(¨7Ó"3Ñ3°cÑ9Ð9r   c                  ó   — t        | Ž dz   S )Nr   ©r*   r(   s    r   Úanyr-   =   s   € œ% ˜/¨CÑ/Ð/r   c                  ó   — t        | Ž dz   S )NÚ?r,   r(   s    r   Úmayber0   >   s   € œE 7˜O¨cÑ1Ð1r   z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]c            
      ó
  — g d¢} dh}| D ]q  }t        j                  |«      D ]W  }t        j                  |D �cg c]  }||j                  «       f‘Œ c}Ž D ]"  }|j	                  dj                  |«      «       Œ$ ŒY Œs |S c c}w )N)ÚbÚrÚuÚfÚbrÚfrÚ )Ú
_itertoolsÚpermutationsÚproductÚupperÚaddr'   )Ú_valid_string_prefixesÚresultÚprefixÚtÚcr4   s         r   Ú_all_string_prefixesrC   U   s‚   € ò >ÐàˆT€FÛ(ˆÜ×(Ñ(¨Ö0ˆAô  ×'Ñ'Á!Ó)DÁ!¸Q¨1¨a¯g©g«iª.À!Ñ)DÓE�Ø—
‘
˜2Ÿ7™7 1›:Õ&ñ Fñ 1ð )ð €Mùò *Es   ¸B c                 óJ   — t        j                  | t         j                  «      S r   )ÚreÚcompileÚUNICODE)Úexprs    r   Ú_compilerI   d   s   € ä�:‰:�dœBŸJ™JÓ'Ð'r   z[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)Úreversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*Ú'z"[^\n"\\]*(?:\\.[^\n"\\]*)*Ú"z
\\\r?\n|\Zé   c                   ó   — e Zd Zy)Ú
TokenErrorN©r   r   r    r"   r   r   rO   rO   ¢   ó   … r   rO   c                   ó   — e Zd Zy)ÚStopTokenizingNrP   r"   r   r   rS   rS   ¥   rQ   r   rS   c                   ó0   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚUntokenizerc                 óX   — g | _         d| _        d| _        d | _        d| _        d | _        y )Né   r   r8   )ÚtokensÚprev_rowÚprev_colÚ	prev_typeÚ	prev_lineÚencodingr   s    r   Ú__init__zUntokenizer.__init__©   s,   € ØˆŒØˆŒØˆŒØˆŒØˆŒØˆ�r   c                 óL  — |\  }}|| j                   k  s|| j                   k(  r@|| j                  k  r1t        dj                  ||| j                   | j                  «      «      ‚| j	                  |«       || j                  z
  }|r| j
                  j                  d|z  «       y y )Nz+start ({},{}) precedes previous end ({},{})Ú )rY   rZ   Ú
ValueErrorÚformatÚadd_backslash_continuationrX   Úappend)r   ÚstartÚrowÚcolÚ
col_offsets        r   Úadd_whitespacezUntokenizer.add_whitespace±   s’   € Ø‰ˆˆSØ�—‘Ò #¨¯©Ò"6¸3ÀÇÁÒ;NÜÐJß$™f S¨#¨t¯}©}¸d¿m¹mÓLóNð Nà×'Ñ'¨Ô.Ø˜4Ÿ=™=Ñ(ˆ
ÙØ�K‰K×Ñ˜s ZÑ/Õ0ð r   c                 óz  — |d   }|| j                   z
  }|dk(  ry| j                  j                  d«      rdnd}| j                  j                  d«      }dj	                  t        j                  t        j                  t        |«      «      «      }| j                  j                  |d|› �|z  z   «       d| _        y)zÇAdd backslash continuation characters if the row has increased
        without encountering a newline token.

        This also inserts the correct amount of whitespace before the backslash.
        r   Nz
Ú
z\
r8   Ú\)rY   r\   ÚendswithÚrstripr'   r9   Ú	takewhileÚstrÚisspaceÚreversedrX   rd   rZ   )r   re   rf   Ú
row_offsetÚnewlineÚlineÚwss          r   rc   z&Untokenizer.add_backslash_continuation»   s�   € ð �A‰hˆØ˜4Ÿ=™=Ñ(ˆ
Ø˜Š?Øà ŸN™N×3Ñ3°FÔ;‘&ÀˆØ�~‰~×$Ñ$ XÓ.ˆØ�W‰W”Z×)Ñ)¬#¯+©+´xÀ³~ÓFÓGˆØ�‰×Ñ˜2 " W I °Ñ ;Ñ;Ô<Øˆ�r   c                 óP  — g }d}|D ]�  }|dk(  r|rd}n|j                  |«       |dk(  rZt        d„ t        j                  dj                  |dd d…   «      D «       «      }|dz  d	k(  s|d   d
k7  r|j                  |«       nd}|j                  |«       Œ� dj                  |«      S )NFÚ}Ú{c              3   ó    K  — | ]  }d –— Œ y­w)rW   Nr"   )Ú.0Úchars     r   Ú	<genexpr>z.Untokenizer.escape_brackets.<locals>.<genexpr>Ö   s   è ø€ ð $ñ#˜$”Añ #ùs   ‚rl   éþÿÿÿéÿÿÿÿé   r   ÚNTr8   )rd   Úsumr9   ro   Ú__eq__r'   )r   ÚtokenÚ
charactersÚconsume_until_next_bracketÚ	characterÚn_backslashess         r   Úescape_bracketszUntokenizer.escape_bracketsÌ   sÂ   € Øˆ
Ø%*Ð"ÛˆIØ˜CÒÙ-Ø16Ñ.à×%Ñ% iÔ0Ø˜CÒÜ #ñ $Ü",×"6Ñ"6ØŸ™Ø" 2 6 r 6Ñ*ô#ó$ó !�ð ! 1Ñ$¨Ò)¨Z¸©^¸sÒ-BØ×%Ñ% iÕ0à15Ð.Ø×Ñ˜iÕ(ð# ð$ �w‰w�zÓ"Ð"r   c                 óâ  — t        |«      }g }d}|D �]À  }t        |«      dk(  r| j                  ||«        �n�|\  }}}}	}
|t        k(  r|| _        Œ@|t
        k(  r �nx|t        k(  r|j                  |«       Œg|t        k(  r |j                  «        |	\  | _
        | _        Œ�|t        t        fv rd}n­|rF|rD|d   }|d   t        |«      k\  r+| j                  j                  |«       t        |«      | _        d}ne|t        k(  r\d|v sd|v rT| j!                  |«      } |j"                  «       d   }|	\  }}|j%                  d«      |j%                  d	«      z   }|||z   f}	| j'                  |«       | j                  j                  |«       |	\  | _
        | _        |t        t        fv r| xj                  dz  c_
        d
| _        || _        |
| _        �ŒÃ dj-                  | j                  «      S )NFr€   Tr   rW   ry   rx   z{{z}}r   r8   )ÚiterÚlenÚcompatÚENCODINGr]   Ú	ENDMARKERÚINDENTrd   ÚDEDENTÚpoprY   rZ   ÚNEWLINEÚNLrX   ÚFSTRING_MIDDLEr‰   Ú
splitlinesÚcountri   r[   r\   r'   )r   ÚiterableÚitÚindentsÚ	startlinerA   Útok_typer„   re   Úendru   ÚindentÚ	last_lineÚend_lineÚend_colÚextra_charss                   r   r   zUntokenizer.untokenizeã   sÕ  € Ü�(‹^ˆØˆØˆ	ÜˆAÜ�1‹v˜Š{Ø—‘˜A˜rÔ"ÚØ01Ñ-ˆH�e˜U C¨Øœ8Ò#Ø %�”ØØœ9Ò$ÚØœ6Ò!Ø—‘˜uÔ%ØØœVÒ#Ø—‘”Ø/2Ñ,�”˜tœ}ØØœg¤r˜]Ñ*Ø ‘	Ù™wØ  ™�Ø˜‘8œs 6›{Ò*Ø—K‘K×&Ñ& vÔ.Ü$'¨£K�D”MØ!‘	Øœ^Ò+Ø˜%‘< 3¨%¡<Ø ×0Ñ0°Ó7�EØ 0 × 0Ñ 0Ó 2°2Ñ 6�IØ(+Ñ%�H˜gØ"+§/¡/°$Ó"7¸)¿/¹/È$Ó:OÑ"O�KØ# W¨{Ñ%:Ð;�Cà×Ñ Ô&Ø�K‰K×Ñ˜uÔ%Ø+.Ñ(ˆDŒM˜4œ=ØœG¤R˜=Ñ(Ø—’ Ñ"•Ø !�”Ø%ˆDŒNØ!ˆDŽNðQ ðR �w‰w�t—{‘{Ó#Ð#r   c                 ó,  — g }| j                   j                  }|d   t        t        fv }d}d}t	        j
                  |g|«      D �]L  }|d d \  }	}
|	t        k(  r|
| _        Œ|	t        t        fv r|
dz  }
|	t        k(  r
|rd|
z   }
d}nd}|	t        k(  r|dz  }n|	t        k(  r|dz  }|	t        k(  r|j                  |
«       Œ}|	t        k(  r|j                  «        Œ—|	t        t        fv rd}n,|r|r ||d   «       d}n|	t         k(  r| j#                  |
«      }
|
dv r%| j                   r| j                   d   |
k(  r|rd|
z   }
|	t        t        fv r3| j$                  t        t        fv r| j                   j                  d«        ||
«       |	| _        �ŒO y )	Nr   Fr€   r`   TrW   r   >   ry   rx   )rX   rd   r“   r”   r9   ÚchainrŽ   r]   ÚNAMEÚNUMBERÚSTRINGÚFSTRING_STARTÚFSTRING_ENDr�   r‘   r’   r•   r‰   r[   )r   r„   r˜   rš   Útoks_appendr›   Ú
prevstringÚ
in_fstringÚtokÚtoknumÚtokvals              r   r�   zUntokenizer.compat  sš  € ØˆØ—k‘k×(Ñ(ˆØ˜!‘H¤¬" Ð-ˆ	Øˆ
Øˆ
ä×#Ñ# U G¨X×6ˆCØ   !˜W‰NˆF�FØœÒ!Ø &�”Øàœ$¤˜Ñ'Ø˜#‘�ð œÒÙØ  6™\�FØ!‘
à"�
àœÒ&Ø˜a‘‘
Øœ;Ò&Ø˜a‘�
ØœÒØ—‘˜vÔ&ØØœ6Ò!Ø—‘”ØØœG¤R˜=Ñ(Ø ‘	Ù™wÙ˜G B™KÔ(Ø!‘	Øœ>Ò)Ø×-Ñ-¨fÓ5�ð ˜Ñ#¨¯ª¸¿¹ÀB¹È6Ò8QÑV`Ø˜v™�ð œ&¤-Ð0Ñ0°T·^±^ÌÔP[ÐG\Ñ5\Ø—‘×"Ñ" 3Ô'á˜ÔØ#ˆDŽNñY 7r   N)	r   r   r    r^   ri   rc   r‰   r   r�   r"   r   r   rU   rU   §   s!   „ òò1òò"#ò.-$ó^3$r   rU   c                 óŠ   — t        «       }|j                  | «      }|j                  �|j                  |j                  «      }|S )a}  Transform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    The result is guaranteed to tokenize back to match the input so
    that the conversion is lossless and round-trips are assured.
    The guarantee applies only to the token type and token string as
    the spacing between tokens (column positions) may change.
    )rU   r   r]   Úencode)r˜   ÚutÚouts      r   r   r   H  s:   € ô 
‹€BØ
�-‰-˜Ó
!€CØ	‡{�{ÐØ�j‰j˜Ÿ™Ó%ˆØ€Jr   c                 ó¦   — | dd j                  «       j                  dd«      }|dk(  s|j                  d«      ry|dv s|j                  d«      ry	| S )
z(Imitates get_normal_name in tokenizer.c.Né   Ú_Ú-úutf-8zutf-8-)zlatin-1ú
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r¹   )ÚlowerÚreplaceÚ
startswith)Úorig_encÚencs     r   Ú_get_normal_namer¿   ]  sX   € ð �3�Bˆ-×
Ñ
Ó
×
'Ñ
'¨¨SÓ
1€CØ
ˆg‚~˜Ÿ™¨Ô1ØØ
Ð6Ñ6Ø
‡~�~ÐAÔBØØ€Or   c                 ój  ‡ ‡‡— 	 ‰ j                   j                  ŠdŠd}d}ˆ fd„}ˆˆfd„} |«       }|j                  t        «      r	dŠ|dd }d}|s|g fS  ||«      }|r||gfS t
        j                  |«      s||gfS  |«       }|s||gfS  ||«      }|r|||gfS |||gfS # t        $ r dŠY Œ–w xY w)	a  
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file.  It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263.  If both a bom and a cookie are present,
    but disagree, a SyntaxError will be raised.  If the encoding cookie is an
    invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    NFr¸   c                  ó2   •— 	  ‰ «       S # t         $ r Y yw xY w)Nr   )ÚStopIteration©Úreadlines   €r   Úread_or_stopz%detect_encoding.<locals>.read_or_stop€  s"   ø€ ð	Ù“:ÐøÜò 	Ùð	ús   ƒ
 Š	•c                 óê  •— 	 | j                  d«      }t        j                  |«      }|sy t        |j                  d«      «      }	 t        |«      }‰r5|dk7  r+‰€d}t        |«      ‚dj                  ‰«      }t        |«      ‚|d	z  }|S # t        $ r" d}‰�dj                  |‰«      }t        |«      ‚w xY w# t        $ r0 ‰€d|z   }t        |«      ‚dj                  ‰|«      }t        |«      ‚w xY w)
Nr¸   z'invalid or missing encoding declarationz{} for {!r}rW   zunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
ÚdecodeÚUnicodeDecodeErrorrb   ÚSyntaxErrorÚ	cookie_reÚmatchr¿   r*   r   ÚLookupError)ru   Úline_stringÚmsgrË   r]   ÚcodecÚ	bom_foundÚfilenames         €€r   Úfind_cookiez$detect_encoding.<locals>.find_cookie†  s(  ø€ ð		#ð Ÿ+™+ gÓ.ˆKô —‘ Ó,ˆÙØÜ# E§K¡K°£NÓ3ˆð		#Ü˜8Ó$ˆEñ Ø˜7Ò"àÐ#Ø3�Cô " #Ó&Ð&ð =×CÑCÀHÓM�CÜ! #Ó&Ð&Ø˜ÑˆHØˆøô= "ò 	#Ø;ˆCØÐ#Ø#×*Ñ*¨3°Ó9�Ü˜cÓ"Ð"ð		#ûô ò 	#àÐØ*¨XÑ5�ô ˜cÓ"Ð"ð 6×<Ñ<¸XØ ó"�ä˜cÓ"Ð"ð	#ús   ƒB ÁB9 Â+B6Â99C2Té   ú	utf-8-sig)Ú__self__ÚnameÚAttributeErrorr¼   r   Úblank_rerË   )	rÄ   r]   ÚdefaultrÅ   rÒ   ÚfirstÚsecondrÐ   rÑ   s	   `      @@r   r   r   h  sú   ú€ ð"Ø×$Ñ$×)Ñ)ˆð €IØ€HØ€Gôõ$ñL ‹N€EØ×ÑœÔ!Øˆ	Ø�a�b�	ˆØˆÙØ˜ˆ{Ðá˜5Ó!€HÙØ˜%˜Ð Ð Ü�>‰>˜%Ô Ø˜˜ÐÐá‹^€FÙØ˜˜ÐÐá˜6Ó"€HÙØ˜% ˜Ð(Ð(à�U˜F�OÐ#Ð#øôO ò ØŠðús   …B$ Â$B2Â1B2c                 óÈ   — t        | d«      }	 t        |j                  «      \  }}|j                  d«       t	        ||d¬«      }d|_        |S #  |j                  «        ‚ xY w)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    Úrbr   T)Úline_bufferingr3   )Ú_builtin_openr   rÄ   Úseekr   ÚmodeÚclose)rÑ   Úbufferr]   ÚlinesÚtexts        r   r   r   Å  s_   € ô ˜8 TÓ*€FðÜ)¨&¯/©/Ó:‰ˆ�%Ø�‰�AŒÜ˜V X¸dÔCˆØˆŒ	ØˆøðØ�‰ŒØús   Ž?A ÁA!c              #   óè   K  — t        | «      \  }}t        j                  |t        | d«      «      }|�|dk(  rd}t	        t
        |ddd«      –— t        |j                  |d¬«      E d{  –—†  y7 Œ­w)	a½  
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r   NrÔ   r¸   )r   r   r8   T©Úextra_tokens)r   r9   r¤   r‹   r   rŽ   Ú!_generate_tokens_from_c_tokenizerÚ__next__)rÄ   r]   ÚconsumedÚrl_gens       r   r	   r	   Ô  sm   è ø€ ô& )¨Ó2Ñ€HˆhÜ×Ñ˜h¬¨X°sÓ(;Ó<€FØÐØ�{Ò"àˆHÜœ (¨F°F¸BÓ?Ò?Ü0°·±À(ÐY]Ô^×^Ò^ús   ‚A(A2Á*A0Á+A2c                 ó   — t        | d¬«      S )zÃTokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    Trç   )ré   rÃ   s    r   r
   r
   ð  s   € ô -¨XÀDÔIÐIr   c                  óR  ‡— dd l } d„ Šdˆfd„	}| j                  d¬«      }|j                  dddd	¬
«       |j                  ddddd¬«       |j                  «       }	 |j                  r@|j                  }t        |d«      5 }t        t        |j                  «      «      }d d d «       n'd}t        t        j                  j                  d¬«      }D ]g  }|j                  }|j                  r|j                  }d|j                  |j                   z   z  }	t#        |	d›t$        |   d›|j&                  d›�«       Œi y # 1 sw Y   ŒvxY w# t(        $ r8}
|
j*                  d   dd \  }} ||
j*                  d   ||f«       Y d }
~
y d }
~
wt,        $ r5}
|
j*                  d   \  }} ||
j*                  d   ||f«       Y d }
~
y d }
~
wt.        $ r}
 ||
«       Y d }
~
y d }
~
wt0        $ r}
 ||
«       Y d }
~
y d }
~
wt2        $ r t#        d«       Y y t4        $ r}
 ‰d|
z  «       ‚ d }
~
ww xY w)Nr   c                 ó€   — t         j                  j                  | «       t         j                  j                  d«       y )Nrk   )ÚsysÚstderrÚwrite)Úmessages    r   Úperrorzmain.<locals>.perrorü  s&   € Ü�
‰
×Ñ˜Ô!Ü�
‰
×Ñ˜Õr   c                 ó–   •— |r|f|z   | fz   } ‰d|z  «       n|r ‰|›d| ›�«       n ‰d| z  «       t        j                  d«       y )Nz%s:%d:%d: error: %sz	: error: z	error: %srW   )rð   Úexit)ró   rÑ   ÚlocationÚargsrô   s       €r   Úerrorzmain.<locals>.error   sO   ø€ ÙØ�; Ñ)¨W¨JÑ6ˆDÙÐ(¨4Ñ/Õ0ÙÙ¢h±Ð8Õ9á�; Ñ(Ô)Ü�‰��r   zpython -m tokenize)ÚprogrÑ   r/   zfilename.pyz'the file to tokenize; defaults to stdin)ÚdestÚnargsÚmetavarÚhelpz-ez--exactÚexactÚ
store_truez(display token names using the exact type)rû   Úactionrþ   rÝ   z<stdin>Trç   z%d,%d-%d,%d:Ú20Ú15rW   rÓ   zinterrupted
zunexpected error: %s)NN)ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsrÑ   rß   Úlistr	   rÄ   ré   rð   Ústdinr   rÿ   r   re   r�   Úprintr   r   ÚIndentationErrorrø   rO   rÉ   ÚOSErrorÚKeyboardInterruptÚ	Exception)r  rù   Úparserrø   rÑ   r5   rX   r„   Ú
token_typeÚtoken_rangeÚerrru   Úcolumnrô   s                @r   Úmainr  ø  s   ø€ Ûòõð ×$Ñ$Ð*>Ð$Ó?€FØ
×Ñ˜Z¨sØ -ØFð ô Hð ×Ñ˜˜i¨g¸lØGð ô Ià×ÑÓ€Dð"à�=Š=Ø—}‘}ˆHÜ˜x¨Ô.°!Üœh q§z¡zÓ2Ó3�÷ /Ð.ð !ˆHÜ6Ü—	‘	×"Ñ"°ô7ˆFó
 ˆEØŸ™ˆJØ�zŠzØ"×-Ñ-�
Ø(¨E¯K©K¸%¿)¹)Ñ,CÑDˆKÜÚ¤¨Ó 4°e·l³lðDõ Eñ ÷ /Ð.ûô  ò 5Ø—x‘x ‘{ 1 QÐ'‰ˆˆfÙˆc�h‰h�q‰k˜8 d¨F ^×4Ñ4ûÜò 5Ø—x‘x ‘{‰ˆˆfÙˆc�h‰h�q‰k˜8 d¨F ^×4Ñ4ûÜò Ùˆc�8×ÑûÜò Ùˆc�
‰
ûÜò ÜˆoÖÜò ÙÐ%¨Ñ+Ô,Øûðúsg   Á$E	 ÂD=Â BE	 Ä=EÅE	 Å		H&Å.FÆH&Æ+GÇH&Ç	GÇH&Ç'G4Ç4H&ÈH&ÈH!È!H&c                 ó   — d| v ry| S )zÓTransform error messages from the C tokenizer into the Python tokenize

    The C tokenizer is more picky than the Python one, so we need to massage
    the error messages a bit for backwards compatibility.
    z)unterminated triple-quoted string literalzEOF in multi-line stringr"   )rÎ   s    r   Ú_transform_msgr  7  s   € ð 3°cÑ9Ø)Ø€Jr   c              #   ój  K  — |€t        j                  | |¬«      }nt        j                  | ||¬«      }	 |D ]  }t        j                  |«      –— Œ y# t        $ rR}t        |«      t        k7  r|d‚t        |j                  «      }t        ||j                  |j                  f«      d‚d}~ww xY w­w)zWTokenize a source reading Python code as unicode strings using the internal C tokenizerNrç   )r]   rè   )Ú	_tokenizeÚTokenizerIterr   Ú_makerÉ   r   r  rÎ   rO   ÚlinenoÚoffset)Úsourcer]   rè   r™   ÚinfoÚerÎ   s          r   ré   ré   A  s�   è ø€ àÐÜ×$Ñ$ V¸,ÔG‰ä×$Ñ$ V°hÈ\ÔZˆð>ÛˆDÜ—/‘/ $Ó'Ó'ñ øäò >Ü�‹7”kÒ!Ø˜ÐÜ˜QŸU™UÓ#ˆÜ˜˜qŸx™x¨¯©Ð2Ó3¸Ð=ûð	>üs)   ‚3B3¶A ÁB3Á	B0ÁAB+Â+B0Â0B3Ú__main__)NF)WÚ__doc__Ú
__author__Ú__credits__Úbuiltinsr   rß   Úcodecsr   r   ÚcollectionsÚ	functoolsÚior   Ú	itertoolsr9   rE   rð   r„   r   r  rF   ÚASCIIrÊ   rØ   Ú__all__Ú
namedtupler   r*   r-   r0   Ú
WhitespaceÚCommentÚIgnoreÚNameÚ	HexnumberÚ	BinnumberÚ	OctnumberÚ	DecnumberÚ	IntnumberÚExponentÚ
PointfloatÚExpfloatÚFloatnumberÚ
ImagnumberÚNumberrC   Ú	lru_cacherI   ÚStringPrefixÚSingleÚDoubleÚSingle3ÚDouble3ÚTripleÚStringÚmapÚescapeÚsortedÚSpecialÚFunnyÚ
PlainTokenÚTokenÚContStrÚPseudoExtrasÚPseudoTokenÚendpatsÚ_prefixÚsetÚsingle_quotedÚtriple_quotedrA   r4   r=   Útabsizer  rO   rS   rU   r   r¿   r   r	   r
   r  r  ré   r   r"   r   r   Ú<module>rT     s™  ðñð, *€
ð€õ +ß #Û Û Ý Û Û 	Û 
Ü Ý #Û àˆB�J‰JÐ@À"Ç(Á(ÓK€	Øˆ2�:‰:Ð0°"·(±(Ó;€ã Ø
�-‰-ò 6ñ 6€à	ôÐ&�×&Ñ& {Ð4PÓQô ò :Ú /Ú 1ð €
Ø
€Ø	‘c˜* zÑ1Ó2Ñ	2±U¸7³^Ñ	C€Ø€à&€	Ø€	Ø €	Ø.€	Ù�)˜Y¨	°9Ó=€	Ø(€ÙÐ?Ø)ó+Ù-2°8«_ñ=€
à (Ñ*€Ù�J Ó)€ÙÐ+¨[¸7Ñ-BÓC€
Ù	ˆz˜;¨	Ó	2€òð ×Ññ(ó ð(ñ
 Ñ*Ó,Ð-€ð 
$€à	#€à
2€à
2€Ù	ˆ|˜eÑ# \°EÑ%9Ó	:€á	ˆ|Ð=Ñ=ØÐ=Ñ=ó
?€ñ ‘�R—Y‘Y¡Ð'8À$Ô GÓHÐ
I€Ùˆh˜Ó €á�6˜5 &¨$Ó/€
Ø�Ñ€ñ �Ð=Ñ=Ù�c˜:Ó&ñ'àÐ=Ñ=Ù�c˜:Ó&ñ'ó(€ñ �] G¨VÓ4€Ø™5 ¨v°u¸gÀtÓLÑL€ð
 €Ù#Ö%€GØ#€GˆG�c‰MÑØ#€GˆG�c‰MÑØ&€GˆG�e‰OÑØ&€GˆG�e‰OÒð	 &ð
 ñ “€Ù“€Ù	Ö	€AØ�#‰g�q˜3‘wÓˆØ×Ñ˜!Õð  à�%‰i˜˜U™Ó#ˆØ×Ñ˜!Õñ $ð 
 ð
 €qà
€ä !�Ô !ô &�YÔ %÷^$ñ ^$òBò*	òZ$òzò_ò8Jò=ò~ó>ð  ˆzÒÙ…Fð r   