
    h'                     L    S r SSKJr  SSKJr   " S S5      r\" 5       rSS jrg)	z
This module deals with interpreting the parse tree as Python
would have done, in the compiler.

For now this only covers parse tree to value conversion of
compile-time values.
   )DictNode)CompileErrorc                       \ rS rSrS rSrg)
EmptyScope   c                     g )N )selfnames     U/var/www/fran/franai/venv/lib/python3.13/site-packages/Cython/Compiler/Interpreter.pylookupEmptyScope.lookup   s        r	   N)__name__
__module____qualname____firstlineno__r   __static_attributes__r	   r   r   r   r      s    r   r   Nc                 f  ^^ UU4S jnU (       a%  [        U 5       VVs/ s H  u  pVU" Xe5      PM     n nnU(       al  [        U[        5      (       d   e0 nUR                   HA  nU" UR                  S5      u  pU" UR
                  UR                  R
                  5      Xy'   MC     UnU W4$ s  snnf )a   
Tries to interpret a list of compile time option nodes.
The result will be a tuple (optlist, optdict) but where
all expression nodes have been interpreted. The result is
in the form of tuples (value, pos).

optlist is a list of nodes, while optdict is a DictNode (the
result optdict is a dict)

If type_env is set, all type nodes will be analysed and the resulting
type set. Otherwise only interpretateable ExprNodes
are allowed, other nodes raises errors.

A CompileError will be raised if there are problems.
c                   > UT;   aX  T(       a;  U R                  T5      nU(       d  [        U R                  S5      eX R                  4$ [        U R                  S5      eU R                  [        5      U R                  4$ )NzInvalid type.zType not allowed here.)analyse_as_typer   poscompile_time_valueempty_scope)nodeixtype	type_argstype_envs      r   	interpret0interpret_compiletime_options.<locals>.interpret%   sj    ?++H5&txxAAhh''"488-EFF''4dhh??r   N)	enumerate
isinstancer   key_value_pairskeyvalue)optlistoptdictr   r   r    r   xnew_optdictitemnew_keydummys     ``       r   interpret_compiletime_optionsr.      s    "	@ 1:71CD1C9Q#1CD'8,,,,++D&txx6NG#,TZZ#HK  , [!! Es   B-)Nr	   )__doc__	ExprNodesr   Errorsr   r   r   r.   r	   r   r   <module>r2      s*         l%"r   