
    hM              
       x   S SK r \ R                  " \\\\\\\S9  S SKrS SKrS SKJr  S SKJr  SSK	J
r
  SSKJr  SSKJr  S	S
KJrJrJrJrJr  S	SKJrJrJr  S	SKJr  S rS rS rSrSqS r / SQr!\!/ SQ-   r" " S S5      r#S r$ " S S5      r% " S S\%5      r& " S S\%5      r' " S S\5      r(\S\(4S j5       r)g)    N)make_lexiconlexiconprint_functionerrorwarningosplatform)	normalize)contextmanager   )Utils)Scanner)UnrecognizedInput   )r   r   hold_errorsrelease_errorsCompileError)any_string_prefixr   IDENT)r   c                  8    [         (       d
  [        5       q [         $ N)r   r        R/var/www/fran/franai/venv/lib/python3.13/site-packages/Cython/Compiler/Scanning.pyget_lexiconr       s    7.Nr   )globalnonlocaldefclassprintdelpassbreakcontinuereturnraiseimportexectryexceptfinallywhileifelifelseforinassertandornotislambdafromyieldwith)	includectypedefcdefcpdefcimportDEFIFELIFELSEc                   <    \ rS rSrS
S jrS rS rS rS rS r	S	r
g)CompileTimeScope9   Nc                     0 U l         Xl        g r   entriesouter)selfrJ   s     r   __init__CompileTimeScope.__init__;   s    
r   c                      X R                   U'   g r   rI   )rK   namevalues      r   declareCompileTimeScope.declare?   s    "Tr   c                 :    U R                   R                  U5        g r   )rI   updaterK   others     r   rU   CompileTimeScope.updateB   s    E"r   c                      U R                   U   $ r   rO   rK   rP   s     r   lookup_hereCompileTimeScope.lookup_hereE   s    ||D!!r   c                     XR                   ;   $ r   rO   rZ   s     r   __contains__CompileTimeScope.__contains__H   s    ||##r   c                      U R                  U5      $ ! [         a(    U R                  nU(       a  UR                  U5      s $ e f = fr   )r[   KeyErrorrJ   lookup)rK   rP   rJ   s      r   rb   CompileTimeScope.lookupK   sE    	##D)) 	JJE||D))	s    .AArH   r   )__name__
__module____qualname____firstlineno__rL   rR   rU   r[   r^   rb   __static_attributes__r   r   r   rE   rE   9   s     ##"$r   rE   c                     [        5       n Sn[        U[        R                  " 5       5       H  u  p#U R	                  X#5        M     SS KnSnU H  n U R	                  U[        XB5      5        M!     SSKJ	n  U R	                  SU5        U R	                  S[        5        U R	                  S[        US[        US5      5      5        U R	                  S	[        US	[        US
5      5      5        [        U 5      nU$ ! [         a     M  f = f)N)UNAME_SYSNAMEUNAME_NODENAMEUNAME_RELEASEUNAME_VERSIONUNAME_MACHINEr   )*FalseTrueabsallanyasciibinbool	bytearraybyteschrcmpcomplexdictdivmod	enumeratefilterfloatformat	frozensethashhexintlenlistmapmaxminoctordpowrangereprreversedroundsetslicesortedstrsumtuplezip)reducer   unicodelongr   xranger   )rE   r   r	   unamerR   builtinsgetattrAttributeError	functoolsr   r   )benvnamesrP   rQ   r   r   denvs          r   initial_compile_time_envr   V   s    DbE5(.."23T! 4
E 	LLwx67  !LL6"LLC LL678U3KLMLL78Xwx7QRSD!DK  		s   C::
DDc                   h    \ rS rSrSrSrSrSrSrSr	S r
S rS	 rS
 rS rS rS rS rS rS rSrg)SourceDescriptor}   z4
A SourceDescriptor should be considered immutable.
NFpyx c                      er   r   rK   s    r   __str__SourceDescriptor.__str__   s    ur   c                     [         R                  R                  U5      u  p#US;   =(       a    USS  =(       d    SU l        g )N)z.pyxz.pxdz.pyr   r   )r   pathsplitext
_file_type)rK   filenamerP   exts       r   set_file_type_from_name(SourceDescriptor.set_file_type_from_name   s5    GG$$X.	!88DSWMr   c                      U R                   S;   $ )N)r   pxdr   r   s    r   is_cython_fileSourceDescriptor.is_cython_file   s    .00r   c                      U R                   S:H  $ )Npyr   r   s    r   is_python_fileSourceDescriptor.is_python_file   s    $&&r   c                 ~    U R                   c%  U R                  5       R                  SS5      U l         U R                   $ )N\/)_escaped_descriptionget_descriptionreplacer   s    r   get_escaped_description(SourceDescriptor.get_escaped_description   s:    $$, )-(<(<(>(F(FtS(QD%(((r   c                 V     U R                   UR                   :  $ ! [         a     gf = fNF	_cmp_namer   rV   s     r   __gt__SourceDescriptor.__gt__   ,    	>>EOO33 		    
((c                 V     U R                   UR                   :  $ ! [         a     gf = fr   r   rV   s     r   __lt__SourceDescriptor.__lt__   r   r   c                 V     U R                   UR                   :*  $ ! [         a     gf = fr   r   rV   s     r   __le__SourceDescriptor.__le__   s,    	>>U__44 		r   c                     U $ r   r   r   s    r   __copy__SourceDescriptor.__copy__       r   c                     U $ r   r   )rK   memos     r   __deepcopy__SourceDescriptor.__deepcopy__   r   r   )r   r   )rd   re   rf   rg   __doc__r   in_utility_coder   r   r   r   r   r   r   r   r   r   r   r   r   rh   r   r   r   r   r   }   sV     HOJIN1')r   r   c                   Z    \ rS rSrSrSS jrSS jrSS jrS rS r	S	 r
S
 rS rS rSrg)FileSourceDescriptor   a  
Represents a code source. A code source is a more generic abstraction
for a "filename" (as sometimes the code doesn't come from a file).
Instances of code sources are passed to Scanner.__init__ as the
optional name argument and will be passed back when asking for
the position()-tuple.
Nc                    [         R                  " U5      nXl        U=(       d    UU l         [        R
                  R                  U R                  5      U l        [        R
                  R                  S5      [        R                  -   nUR                  U5      (       a  U[        U5      S  OUU l        U R                  U5        Xl        0 U l        g ! [         a    U R                  U l         Nf = f)N.)r   decode_filenamer   path_descriptionr   r   relpath_short_path_description
ValueErrorabspathsep
startswithr   	file_pathr   r   _lines)rK   r   r   workdirs       r   rL   FileSourceDescriptor.__init__   s    ((2  0 <H	A+-77??4;P;P+QD(
 ''//#&/4<4G4G4P4P#g,-0V^$$X.!  	A+/+@+@D(	As   .C C43C4c                     X4nU R                   R                  U5      nUb  U$ U R                  XS9 nUR                  5       nS S S 5        X0R                   ;   a  UOS U R                   U'   U$ ! , (       d  f       N0= f)N)encodingerror_handling)r   getget_file_object	readlines)rK   r   r   keylinesfs         r   	get_linesFileSourceDescriptor.get_lines   sx     ($L!!8!SWXKKME T %(;;$65DC TSs   A..
A<c                 D    [         R                  " U R                  X5      $ r   )r   open_source_filer   )rK   r   r   s      r   r   $FileSourceDescriptor.get_file_object   s    %%dmmXNNr   c                     U R                   $ r   )r   r   s    r   r   $FileSourceDescriptor.get_description   s    +++r   c                     U R                   n[        R                  " [        R                  " 5       [        R
                  R                  -   5      nUR                  U5      (       a  U[        U5      S  $ U$ r   )	r   r   r   r   getcwdr   r   r   r   )rK   r   cwds      r   get_error_description*FileSourceDescriptor.get_error_description   sR    }}##BIIK"''++$=>??3C	?"r   c                     U R                   $ r   )r   r   s    r   get_filenametable_entry,FileSourceDescriptor.get_filenametable_entry   s    ~~r   c                 b    [        U[        5      =(       a    U R                  UR                  :H  $ r   )
isinstancer   r   rV   s     r   __eq__FileSourceDescriptor.__eq__   s"    %!56Z4==ENN;ZZr   c                 ,    [        U R                  5      $ r   )r   r   r   s    r   __hash__FileSourceDescriptor.__hash__   s    DMM""r   c                      SU R                   -  $ )Nz<FileSourceDescriptor:%s>)r   r   s    r   __repr__FileSourceDescriptor.__repr__   s    *T]]::r   )r   r   r   r   r   r   r   NN)rd   re   rf   rg   r   rL   r   r   r   r  r  r  r  r  rh   r   r   r   r   r      s6     O,[#;r   r   c                   J    \ rS rSrSrS rSS jrS r\rS r	S r
S	 rS
 rSrg)StringSourceDescriptor   zi
Instances of this class can be used instead of a filenames if the
code originates from a string object.
c                 x    Xl         UR                  S5       Vs/ s H  o3S-   PM	     snU l        Xl        g s  snf )N
)rP   split	codelinesr   )rK   rP   codexs       r   rL   StringSourceDescriptor.__init__   s4    	,0JJt,<=,<qd(,<= >s   7Nc                     U(       d  U R                   $ U R                    Vs/ s H#  nUR                  X5      R                  U5      PM%     sn$ s  snf r   )r  encodedecode)rK   r   r   lines       r   r    StringSourceDescriptor.get_lines  sN    >>! !%0 . KK9@@J .0 0 0s   *Ac                     U R                   $ r   rP   r   s    r   r   &StringSourceDescriptor.get_description  s    yyr   c                     g)Nz<stringsource>r   r   s    r   r  .StringSourceDescriptor.get_filenametable_entry  s    r   c                     [        U 5      $ r   )idr   s    r   r  StringSourceDescriptor.__hash__  s    $xr   c                 b    [        U[        5      =(       a    U R                  UR                  :H  $ r   )r
  r  rP   rV   s     r   r  StringSourceDescriptor.__eq__  s"    %!78TTYY%**=TTr   c                      SU R                   -  $ )Nz<StringSourceDescriptor:%s>r$  r   s    r   r  StringSourceDescriptor.__repr__  s    ,tyy88r   )r   r  rP   r  )rd   re   rf   rg   r   rL   r   r   r  r  r  r  r  rh   r   r   r   r  r     s3    0 , U9r   r  c                      \ rS rSr  S%S jrS rS rS rS rS r	S	 r
S
 rSSSSS.rS\4S jrS rS rS\4S jrS rS rS rS rS&S jrS rS'S jrS'S jrS'S jrS rS rS(S \R<                  4S! jjrS" r S# r!S$r"g))PyrexScanneri"  Nc	                    [         R                  " U [        5       XU5        UR                  5       (       a  SU l        [
        n	OSU l        [        n	U	 V
s0 s H  oU
_M     sn
U l        SU l        U(       aw  UR                  U l	        UR                  U l
        UR                  U l        UR                  U l        UR                  U l        UR                  (       a  U R                  5         OXPl	        UR                  U l
        [        5       U l        SU l        SU l        [!        UR"                  SS 5      (       a/  U R                  R%                  UR"                  R                  5        Xpl        X`l        [*        U l        S/U l        SU l        SU l        S U l        U R7                  S5        SU l        U R;                  5         g s  sn
f )	NTFr   r   compile_time_env INDENTr   )r   rL   r   r   in_python_filepy_reserved_wordspyx_reserved_wordskeywordsasync_enabledcontextincluded_filesr2  compile_time_evalcompile_time_exprenter_asyncr   r   optionsrU   parse_commentssource_encodingtrace_scannertraceindentation_stackindentation_charbracket_nesting_levelput_back_on_failurebeginsynext)rK   filer   parent_scannerscoper:  rA  r@  initial_posr8  keywords              r   rL   PyrexScanner.__init__+  sx   {}dkJ""$$"&D(H"'D)H9ABg')B)11DL"0"?"?D$2$C$CD!%3%E%ED"%3%E%ED"++  ""L"'"6"6D$<$>D!%&D"%&D"w(:DAA%%,,W__-M-MN,."
"# $%&"#' 

8		A Cs   Gc                 r    UR                  5       (       d  [        SU5      nU R                  [        U5        g )NNFKC)isasciir
   producer   rK   texts     r   normalize_identPyrexScanner.normalize_identW  s'    ||~~VT*DUD!r   c                 L    U R                   (       a  U R                  SU5        g g )Ncommentline)r@  rT  rU  s     r   rZ  PyrexScanner.commentline\  s    LL- r   c                 F    U R                  X!R                  SS5      5        g )N_r   )rT  r   )rK   rV  symbols      r   strip_underscoresPyrexScanner.strip_underscores`  s    V\\#r23r   c                      U R                   S   $ )N)rD  r   s    r   current_levelPyrexScanner.current_levelc  s    %%b))r   c                 0    U =R                   S-  sl         U$ Nr   rF  rU  s     r   open_bracket_action PyrexScanner.open_bracket_actionf      ""a'"r   c                 0    U =R                   S-  sl         U$ rf  rg  rU  s     r   close_bracket_action!PyrexScanner.close_bracket_actionj  rj  r   c                 l    U R                   S:X  a$  U R                  S5        U R                  SS5        g g )Nr   r4  NEWLINEr   )rF  rH  rT  rU  s     r   newline_actionPyrexScanner.newline_actionn  s/    %%*JJx LLB' +r   	SQ_STRING	DQ_STRING
TSQ_STRING
TDQ_STRING)'"z'''z"""rV  c                     U(       a(  US   [         ;   a  USS  nU(       a  US   [         ;   a  M  U R                  U R                  U   5        U R                  S5        g )Nr   r   BEGIN_STRING)r   rH  string_statesrT  rU  s     r   begin_string_action PyrexScanner.begin_string_actionz  sP    tAw"338D tAw"33

4%%d+,^$r   c                 H    U R                  S5        U R                  S5        g )Nr   
END_STRING)rH  rT  rU  s     r   end_string_actionPyrexScanner.end_string_action  s    

2\"r   c                 H    U R                  U5        U R                  S5        g )NzUnclosed string literal)r  error_at_scanposrU  s     r   unclosed_string_action#PyrexScanner.unclosed_string_action  s    t$78r   c                    U R                  S5        U(       ad  US   nU R                  S:X  a  X l        O!U R                  U:w  a  U R                  S5        UR                  US5      S:w  a  U R                  S5        U R	                  5       n[        U5      nXC:X  a  g XC:  a.  U R                  R                  U5        U R                  SS5        g X@R	                  5       :  aA  U R                  R                  5         U R                  SS5        X@R	                  5       :  a  MA  X@R	                  5       :w  a  U R                  S5        g g )Nr   r   r3  zMixed use of tabs and spacesr4  DEDENTzInconsistent indentation)
rH  rE  r  r   rc  r   rD  appendrT  pop)rK   rV  crc  	new_levels        r   indentation_actionPyrexScanner.indentation_action  s   

2
 QA$$,()% ((A-))*HI||Ar"b(%%&DE+/+=+=+?'*4y	%&"")))4LL2&0022&&**,Xr* 0022
 ..00%%&@A 1r   c                     [        U R                  5      S:  aG  U R                  SS5        U R                  R                  5         [        U R                  5      S:  a  MG  U R                  SS5        g )Nr   r  r   EOF)r   rD  rT  r  rU  s     r   
eof_actionPyrexScanner.eof_action  sZ    $(()A-LL2&""&&( $(()A- 	UBr   c                 v    U R                  5       u  pU[        :X  a  X R                  ;   a  US:X  a;  [
        U R                  R                  ;   a  U R                  R                  SS 5        OLUS:X  a7  U R                  R                  S:  a  U R                  R                  SS 5        OU R                  U   nU R                  R                  U5      nU R                  b+  U R                  R                  XU R                  5       45        Xl        X l        g ! [         a    U R                  S5         g f = f)NzUnrecognized characterr    r(      )readr   r  r   r8  r   r:  future_directivesr  language_levelintern_ustringrG  r  positionrI  systringr    )rK   rI  r  r]  r!  colts          r   rJ  PyrexScanner.next  s    	99;LB ;==(w&>T\\=[=[+[MM%%gt4'DLL,G,G1,LMM%%fd3x0B||228<H##/$$++R4==?,KL ! ! 	!!":;	s   D D87D8c                 :   U R                   U R                  4nU R                  5       nU R                  5         U R                   U R                  4nU R	                  U R                   U R                  U R                  5       5        Uu  U l         U l        X l        U$ r   )rI  r  r  rJ  unreadlast_token_position_tuple)rK   saved	saved_posrJ  s       r   peekPyrexScanner.peek  sq    &MMO			ww%DGGT]]DMMO<!&)2&r   c                     U R                  U R                  U R                  U R                  5        Xl        X l        X0l        g r   )r  rI  r  r  )rK   rI  r  poss       r   put_backPyrexScanner.put_back  s0    DGGT]]D,J,JK ),&r   c                     Uc  U R                  5       nU R                  S:X  a  [        US5        [        X!5      nU(       a  Ueg )Nr4  z!Possible inconsistent indentation)r  rI  r   )rK   messager  fatalerrs        r   r   PyrexScanner.error  s<    ;--/C77h#:;C!)5r   c                 H    U R                  5       nU R                  XS5        g NT)get_current_scan_posr   )rK   r  r  s      r   r  PyrexScanner.error_at_scanpos  s      '')

7&r   c                 h    U R                   U:X  a  U R                  5         g U R                  X5        g r   )rI  rJ  expectedrK   whatr  s      r   expectPyrexScanner.expect  s"    77d?IIKMM$(r   c                     U R                   [        :X  a!  U R                  U:X  a  U R                  5         g U R	                  X5        g r   )rI  r   r  rJ  r  r  s      r   expect_keywordPyrexScanner.expect_keyword  s.    77e 5IIKMM$(r   c                     U(       a  U R                  U5        g U R                  [        :X  a  U R                  nOU R                  nU R                  SU< SU< S35        g )Nz
Expected 'z
', found 'rv  )r   rI  r   r  )rK   r  r  founds       r   r  PyrexScanner.expected  s@    JJwww%JJdEBCr   c                 (    U R                  SS5        g )Nr4  z)Expected an increase in indentation levelr  r   s    r   expect_indentPyrexScanner.expect_indent  s    HIJr   c                 (    U R                  SS5        g )Nr  z(Expected a decrease in indentation levelr  r   s    r   expect_dedentPyrexScanner.expect_dedent  s    HHIr   ignore_semicolonc                     S nU(       a0  U R                   S:X  a   U R                  5       nU R                  5         U R                   S:w  a  U R                  SU5        Ub  [	        US5        g g )N;r  ro  zuseless trailing semicolon)rI  r  rJ  r  r   )rK   r  r  useless_trailing_semicolons       r   expect_newlinePyrexScanner.expect_newline  s[    %)"3)-&IIK77eKK	7+%1.0LM 2r   c                     U =R                   S-  sl         U R                   S:X  a  SU R                  S'   SU R                  S'   g g )Nr   asyncawait)r9  r8  r   s    r   r>  PyrexScanner.enter_async  sB    a"%,DMM'"%,DMM'" #r   c                 8   U R                   S:  d   eU =R                   S-  sl         U R                   (       db  U R                  S	 U R                  S	 U R                  S;   a7  [        U R                  R                  U R                  5      sU l        U l        g g g )Nr   r   r  r  )r  r  )r9  r8  rI  r   r:  r  r  r   s    r   
exit_asyncPyrexScanner.exit_async  s    !!A%%%a!!g&g&ww,,).0K0KDGG0T& - "r   )r9  rF  r2  r<  r=  r:  r5  r;  rE  rD  r8  r  r@  rG  rA  rI  r  rC  )NNNNTNr  r   )zExpected a newlineF)#rd   re   rf   rg   rL   rW  rZ  r_  rc  rh  rl  rp  rz  r   r{  r  r  r  r  rJ  r  r  r   r  r  r  r  r  r  cythonbintr  r>  r  rh   r   r   r   r0  r0  "  s     7;bf*X"
.4*( 	M% %#9"Bs "BH 56-'))DKJ	NV[[ 	N-Ur   r0  scannerc              #     #    [        5       n U R                  n/ U l        U R                  U R                  U R	                  5       4n Uv   U(       aO  U R                  (       a=  [        U R                  S S 5       H  nU R                  " U6   M     U R                  " U6   OUb  UR                  U R                  5        X l         [        SS9  g ! [
         a
  n S nANS nAff = f! U(       aU  U R                  (       a=  [        U R                  S S 5       H  nU R                  " U6   M     U R                  " U6   X l        f Ub  UR                  U R                  5        X l        f = f! [        SS9  f = f7f)Nrb  T)ignore)
r   rG  rI  r  r  r   r   r  extendr   )r  errorsrG  initial_stateer  s         r   tentatively_scanr  "  sU    ]F$%99&(# W%5%5w7G7G7IJ	>L ..$,W-H-H"-M$N(((3 %O $$m4$0 $**7+F+FG*='d#  		 ..$,W-H-H"-M$N(((3 %O $$m4
 +>'	 %0 $**7+F+FG*='d#sN   E<:E. 	C A:E. 
E<
C&C) !C&&C) )BE++E. .E99E<)*r  rR   objectr   r	   unicodedatar
   
contextlibr   r   r   Plex.Scannersr   Plex.Errorsr   Errorsr   r   r   r   r   Lexiconr   r   r   Futurer   debug_scannerrB  scanner_debug_flagsscanner_dump_filer   r   r6  r7  rE   r   r   r   r  r0  r  r   r   r   <module>r     s     FF$FF6+ 
  ! %  # + M M ; ; "  
  ' *   :"N8 8v>;+ >;B$9- $9R~U7 ~U@ $l $ $r   