
    h                        d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ dZdZddlZdd	lmZ d
dlmZ   e!e       D  cg c]  } | d   dk7  s|  c} g dz   Z"[ e#e$e$f   Z%e#e$e&e%e%e&f   Z'i ejP                  eejR                  eejT                  eejV                  eejX                  eejZ                  eej\                  eej^                  eej`                  eejb                  eejd                  eejf                  eejh                  eejj                  eejl                  eejn                  eejp                  eejr                  eejt                  eejv                  eejx                  eiZ= G d de>      Z?dej                  de&deej                     dej                  fdZAdde&dee   dee'   fdZBde$de&de%de%de&ddfdZCeDdk(  rl eEej                        d
kD  r* eB eGej                  d
         j                               ZIn  eBej                  j                               ZIeID ]  ZK eCeK  	 yyc c} w )a  Tokenization help for Python programs.

generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens.  It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" 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

Older entry points
    tokenize_loop(readline, tokeneater)
    tokenize(readline, tokeneater=printtoken)
are the same, except instead of generating tokens, tokeneater is a callback
function to which the 5 fields described above are passed as 5 arguments,
each time a new token is found.    N)Iterator)Optional)Grammar)ASYNCAWAITCOMMENTDEDENT	ENDMARKER
ERRORTOKENFSTRING_ENDFSTRING_MIDDLEFSTRING_STARTINDENTNAMENEWLINENLNUMBEROPSTRINGtok_namezKa-Ping Yee <ping@lfw.org>z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro)	TokenType   )token_)tokenizegenerate_tokens
untokenizec                       e Zd Zy)
TokenErrorN)__name__
__module____qualname__     J/var/www/html/immo/lib/python3.12/site-packages/blib2to3/pgen2/tokenize.pyr   r   b   s    r$   r   r   source
prev_tokenreturnc           
         | j                   t        j                  k(  rR|O|j                   t        j                  t        j                  fvr"|| j
                  | j                   }|j                  d      rkt        j                  t        j                  | j
                  | j
                  dz   | j                  | j                  | j                  | j                  dz         S |j                  d      s|j                  d      rkt        j                  t        j                  | j
                  | j
                  dz   | j                  | j                  | j                  | j                  dz         S | S )a
  
    Black treats `\\\n` at the end of a line as a 'NL' token, while it
    is ignored as whitespace in the regular Python parser.
    But, only the first one. If there's a `\\\n` following it
    (as in, a \ just by itself on a line), that is not made into NL.
    z\
   z\
z\   )typer   
whitespacenlnewlinestart_index	end_index
startswithpytokensToken
start_line	start_col)r   r&   r'   	token_strs       r%   transform_whitespacer8   e   s'    	

i***"OOILL)2C2C#DD5,,u?	)>>!!!!A%    !#  !!&)Y-A-A&-I>>!!!!A%    !#  Lr$   grammarc              #   >  K   | j                  d      }|dgz  }d\  }}d }	 t        j                  |       D ]  }t        || |      }|j                  |j
                  }}|j                  t        j                  k(  rG| |j                  |j                   }|j                  t        j                  k(  r|dk(  r|}||j                  dz
     }|j                  t        j                  k(  rJ|dv rF|dk(  rt        nt        ||j                  |j
                  f|j                  |j                   f|f n|j                  t        j"                  k(  r|dk(  r|j                  |j                  k(  sJ |j                   |j
                  dz   k(  sJ d	}t%        |j
                  |j
                  dz         D ]9  }	|	dz   }
t&        |j                     ||j                  |	f|j                  |
f|f ; nFt&        |j                     ||j                  |j
                  f|j                  |j                   f|f |} y # t        j(                  $ r t+        d
||f      t        j,                  $ r)}t+        dt        |      j.                   ||f      d }~ww xY ww)N
 )r   r   r   )asyncawaitr=   z...r*   .z&Unexpected EOF in multi-line statementzFailed to parse: )splitr3   r   r8   r5   r6   r,   r   r-   r0   r1   r/   
identifierr   r   end_lineend_coloprangeTOKEN_TYPE_MAPUnexpectedEOFr   TokenizeErrorr    )r&   r9   lineslinecolumnr'   r   r7   source_liner6   rC   excs               r%   r   r      s    LLE	bTMELD&+/J7S&&v. 1	E(
CE ++U__&DzzY111u005??CIzzY...9? #
 0 01 45KzzY111iCU6U ''1Eu%%u7^^U]]3  y||+	U0B''5>>999}}!(;;;;	!&u!8K!L I'!mG&uzz2!))951#  #5::.%%u7^^U]]3  Jc1	f !! SAD&>RR!! S,T#Y-?-?,@AD&>RRSs)   JHH> =J>3J1$JJJr,   srow_colerow_colrJ   c                 ^    |\  }}|\  }}t        | d| d| d| dt        |     d|       y )N,-z:		)printr   )	r,   r   rN   rO   rJ   srowscolerowecols	            r%   
printtokenrY      sF     LT4LT4	TF!D64&$s8D>*:"UI
FGr$   __main__)N)L__doc__syscollections.abcr   typingr   blib2to3.pgen2.grammarr   blib2to3.pgen2.tokenr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   
__author____credits__r3   r   r<   r   _tokendir__all__tupleintCoordstr	TokenInfoindentdedentr/   r.   comment	semicolonlparenrparenlbracketrbracketlbracerbracecolonrD   rA   numberstringfstring_startfstring_middlefstring_end	endmarkerrF   	Exceptionr   r4   r8   r   rY   r    lenargvopenreadtoken_iteratorstdintok)xs   0r%   <module>r      s  #0  $  *    ( *
P   &k
1QqTS[1
1 5 
 c3h#sE5#-.	ff w LL"	
 w  b b   b b OOR LL" $  f!" f#$ ]n;+2 !  $>>$#&$4<X^^4L$^^$N=SS =S8G#4 =S@S =S@H
HH%*H6;HCFH	H z
388}q!$sxx{"3"8"8":;!#)).."23 C k 2s   I%+I%