
    F\h                         S r SSKrSSKr\R                   V s/ s H  n \" \U 5      PM     sn r/ SQrSrSrSr	S r
SS jrSS	 jr " S
 S5      r " S S5      rgs  sn f )aA  Utilities to compile possibly incomplete Python source code.

This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:

- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).

The two interfaces are:

compile_command(source, filename, symbol):

    Compiles a single command in the manner described above.

CommandCompiler():

    Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.

The module also provides another class:

Compile():

    Instances of this class act like the built-in function compile,
    but with 'memory' in the sense described above.
    N)compile_commandCompileCommandCompileri   i   i @  c                    UR                  S5       H'  nUR                  5       nU(       d  M  US   S:w  d  M'    O
   US:w  a  Sn[        R                  " 5          [        R                  " S[
        [        45         U " XU5        S S S 5        U " XUSS9$ ! [         aK     U " US-   X#5         S S S 5        g ! [         a  n S nA S S S 5        g S nAf[         a  n S nA N\S nAff = ff = f! , (       d  f       Nn= f)	N
r   #evalpassignoreF)incomplete_input)	splitstripwarningscatch_warningssimplefilterSyntaxWarningDeprecationWarningSyntaxError_IncompleteInputError)compilersourcefilenamesymbollinees         /usr/lib/python3.13/codeop.py_maybe_compiler   2   s    T"zz|4DGsN #
 VF 
	 	 	"h8J(KL		Vv. 
# FfuEE  	$9 
#	" )  
#	"  		 
#	"sZ   "C.=	B
C+!B7-C.7
C'C+C.C'C+ C."C''C++C..
C<c                 P    SnU(       a  U[         -  nU[        -  n[        XX$5      $ )Nr   )PyCF_ALLOW_INCOMPLETE_INPUTPyCF_DONT_IMPLY_DEDENTcompile)r   r   r   r   flagss        r   _compiler#   M   s-    E,,''6V33    c                 $    [        [        XU5      $ )aU  Compile a command and determine whether it is incomplete.

Arguments:

source -- the source string; may contain \n characters
filename -- optional filename from which source was read; default
            "<input>"
symbol -- optional grammar start symbol; "single" (default), "exec"
          or "eval"

Return value / exceptions raised:

- Return a code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).
)r   r#   )r   r   r   s      r   r   r   T   s    & (Ff==r$   c                   (    \ rS rSrSrS rSS jrSrg)r   i   zInstances of this class behave much like the built-in compile
function, but if one is used to compile text containing a future
statement, it "remembers" and compiles all subsequent program texts
with the statement in force.c                 (    [         [        -  U l        g N)r    r   r"   selfs    r   __init__Compile.__init__n   s    +.II
r$   c                 F   X@R                   -  nUR                  SS5      SL a  U[        ) -  nU[        ) -  n[	        XX4S5      nU[
        -  (       a  U$ [         HB  nUR                  UR                  -  (       d  M#  U =R                   UR                  -  sl         MD     U$ )Nr   TF)	r"   getr    r   r!   PyCF_ONLY_AST	_featuresco_flagscompiler_flag)r+   r   r   r   r"   kwargscodeobfeatures           r   __call__Compile.__call__q   s    ::($/58,,,E111E6$?= M G!6!666

g333
 ! r$   )r"   N)r   __name__
__module____qualname____firstlineno____doc__r,   r7   __static_attributes__ r$   r   r   r   i   s    $Jr$   r   c                   (    \ rS rSrSrS rSS jrSrg)r   ~   a  Instances of this class have __call__ methods identical in
signature to compile_command; the difference is that if the
instance compiles program text containing a __future__ statement,
the instance 'remembers' and compiles all subsequent program texts
with the statement in force.c                 "    [        5       U l        g r)   )r   r   r*   s    r   r,   CommandCompiler.__init__   s    	r$   c                 0    [        U R                  XU5      $ )aM  Compile a command and determine whether it is incomplete.

Arguments:

source -- the source string; may contain \n characters
filename -- optional filename from which source was read;
            default "<input>"
symbol -- optional grammar start symbol; "single" (default) or
          "eval"

Return value / exceptions raised:

- Return a code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).
)r   r   )r+   r   r   r   s       r   r7   CommandCompiler.__call__   s    & dmmVvFFr$   )r   Nz<input>singler9   r@   r$   r   r   r   ~   s    $"Gr$   r   )TrG   )r>   
__future__r   all_feature_namesgetattrr1   __all__r    r0   r   r   r#   r   r   r   )fnames   0r   <module>rN      s    D   %6686 Z'68	 <
  $ F64>* *G Gq8s   A