Diff
Not logged in

Differences From Artifact [2f4f424c9a]:

To Artifact [c04853655b]:


898
899
900
901
902
903
904
905
906
907
908
909
910
911


912
913
914
915
916
917

918
919
920
921
922

923
924
925
926
927
928

929
930
931
932
933
934
935

936
937
938
939

940
941
942
943
944
945


946
947
948
949
950
951
952
953
954
955
956
957


958
959
960
961
962
963
964
898
899
900
901
902
903
904







905
906






907





908






909







910




911






912
913



914








915
916
917
918
919
920
921
922
923







-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
-
+
+
-
-
-

-
-
-
-
-
-
-
-
+
+







ProcedureMethodVarResolver(
    Tcl_Interp *interp,
    const char *varName,
    Tcl_Namespace *contextNs,
    int flags,
    Tcl_Var *varPtr)
{
    Interp *iPtr = (Interp *) interp;
    CallFrame *framePtr = iPtr->varFramePtr;
    CallContext *contextPtr;
    Tcl_Obj *variableObj;
    Tcl_HashEntry *hPtr;
    int i, isNew;

    int result;
    Tcl_ResolvedVarInfo *rPtr;
    /*
     * Check that the variable is being requested in a context that is also a
     * method call; if not (i.e. we're evaluating in the object's namespace or
     * in a procedure of that namespace) then we do nothing.
     */

    
    if (framePtr == NULL || !(framePtr->isProcCallFrame & FRAME_IS_METHOD)) {
	return TCL_CONTINUE;
    }
    contextPtr = framePtr->clientData;

    result = ProcedureMethodCompiledVarResolver(interp, varName,
    /*
     * Check if the variable is one we want to resolve at all (i.e. whether it
     * is in the list provided by the user). If not, we mustn't do anything
     * either.
     */

	    strlen(varName), contextNs, &rPtr);
    if (contextPtr->callPtr->chain[contextPtr->index]
	    .mPtr->declaringClassPtr != NULL) {
	FOREACH(variableObj, contextPtr->callPtr->chain[contextPtr->index]
		.mPtr->declaringClassPtr->variables) {
	    if (!strcmp(Tcl_GetString(variableObj), varName)) {
		goto gotMatch;
	    }

	}
    } else {
	FOREACH(variableObj, contextPtr->oPtr->variables) {
	    if (!strcmp(Tcl_GetString(variableObj), varName)) {
    if (result != TCL_OK) {
		goto gotMatch;
	    }
	}
    }
    return TCL_CONTINUE;

	return result;
    }
    /*
     * It is a variable we want to resolve, so resolve it.
     */

  gotMatch:
    hPtr = Tcl_CreateHashEntry(TclVarTable(contextNs), (char *) variableObj,
	    &isNew);
    if (isNew) {
	TclSetVarNamespaceVar((Var *) TclVarHashGetValue(hPtr));
    }
    *varPtr = TclVarHashGetValue(hPtr);
    return TCL_OK;
    *varPtr = rPtr->fetchProc(interp, rPtr);
    return (*varPtr? TCL_OK : TCL_CONTINUE);
}

static Tcl_Var
ProcedureMethodCompiledVarConnect(
    Tcl_Interp *interp,
    Tcl_ResolvedVarInfo *rPtr)
{