
    ڏDj`                     J    d Z ddlmZ ddlmZ  G d d      Z e       ZddZy)	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                       e Zd Zd Zy)
EmptyScopec                      y )N )selfnames     _C:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\Cython/Compiler/Interpreter.pylookupzEmptyScope.lookup   s        N)__name__
__module____qualname__r   r   r   r   r   r      s    r   r   Nc                 D   fd}| r$t        |       D cg c]  \  }} |||       } }}|rgt        |t              sJ i }|j                  D ]B  } ||j                  d      \  }	}
 ||j
                  |j                  j
                        ||	<   D |}| fS c c}}w )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                     |v rOr7| j                        }|st        | j                  d      || j                  fS t        | j                  d      | j                  t              | j                  fS )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   	interpretz0interpret_compiletime_options.<locals>.interpret%   sl    ?++H5&txxAAdhh''"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DA9Q#DD'8,,++ 	ID&txx6NGU#,TZZ#HK 	I [!! Es   B)Nr   )__doc__	ExprNodesr   Errorsr   r   r   r)   r   r   r   <module>r-      s*         l%"r   