-/**
- * \brief Set the value of a variable
- * \return Boolean Failure
- */
-int Variable_SetValue(tAST_BlockState *Block, const char *Name, tSpiderValue *Value)
-{
- tAST_Variable *var;
- tAST_BlockState *bs;
-
- for( bs = Block; bs; bs = bs->Parent )
+tAST_Variable *Variable_Lookup(tAST_BlockState *Block, tAST_Node *VarNode, int CreateType)
+{
+ tAST_Variable *var = NULL;
+
+ // Speed hack
+ if( VarNode->BlockState == Block && VarNode->BlockIdent == Block->Ident ) {
+ var = VarNode->ValueCache;
+ #if TRACE_VAR_LOOKUPS
+ AST_RuntimeMessage(VarNode, "debug", "Fast var fetch on '%s' %p (%p:%i)",
+ VarNode->Variable.Name, var,
+ VarNode->BlockState, VarNode->BlockIdent
+ );
+ #endif
+ }
+ else