public void UntraceVar(string name, VarTrace trace, TCL.VarFlag flags) { Var.UntraceVar(this, name, flags, trace); }
public void UntraceVar(string part1, string part2, VarTrace trace, TCL.VarFlag flags) { Var.UntraceVar(this, part1, part2, flags, trace); }
public void UnsetVar(string name1, string name2, TCL.VarFlag flags) { Var.UnsetVar(this, name1, name2, (flags | TCL.VarFlag.LEAVE_ERR_MSG)); }
// OR-ed collection of bits describing current trace, including any of TCL.VarFlag.TRACE_READS, // TCL.VarFlag.TRACE_WRITES, TCL.VarFlag.TRACE_UNSETS, TCL.VarFlag.GLOBAL_ONLY and TCL.VarFlag.NAMESPACE_ONLY. public void UntraceVar(TclObject nameObj, VarTrace trace, TCL.VarFlag flags) { Var.UntraceVar(this, nameObj, flags, trace); }
public TclObject GetVar(string name1, string name2, TCL.VarFlag flags) { return Var.GetVar(this, name1, name2, (flags | TCL.VarFlag.LEAVE_ERR_MSG)); }
public void UnsetVar(TclObject nameObj, TCL.VarFlag flags) { Var.UnsetVar(this, nameObj, (flags | TCL.VarFlag.LEAVE_ERR_MSG)); }
public void SetVar(string name1, string name2, string strValue, TCL.VarFlag flags) { Var.SetVar(this, name1, name2, TclString.NewInstance(strValue), (flags | TCL.VarFlag.LEAVE_ERR_MSG)); }
public TclObject GetVar(TclObject nameObj, TCL.VarFlag flags) { return Var.GetVar(this, nameObj, (flags | TCL.VarFlag.LEAVE_ERR_MSG)); }
public TclObject SetVar(string name, TclObject value, TCL.VarFlag flags) { return Var.SetVar(this, name, value, (flags | TCL.VarFlag.LEAVE_ERR_MSG)); }
internal void transferResult(Interp sourceInterp, TCL.CompletionCode result) { if (sourceInterp == this) { return; } if (result == TCL.CompletionCode.ERROR) { TclObject obj; // An error occurred, so transfer error information from the source // interpreter to the target interpreter. Setting the flags tells // the target interp that it has inherited a partial traceback // chain, not just a simple error message. if (!sourceInterp._errAlreadyLogged) { sourceInterp.AddErrorInfo(""); } sourceInterp._errAlreadyLogged = true; ResetResult(); obj = sourceInterp.GetVar("errorInfo", TCL.VarFlag.GLOBAL_ONLY); SetVar("errorInfo", obj, TCL.VarFlag.GLOBAL_ONLY); obj = sourceInterp.GetVar("errorCode", TCL.VarFlag.GLOBAL_ONLY); SetVar("errorCode", obj, TCL.VarFlag.GLOBAL_ONLY); _errInProgress = true; _errCodeSet = true; } _returnCode = result; SetResult(sourceInterp.GetResult()); sourceInterp.ResetResult(); if (result != TCL.CompletionCode.OK) { throw new TclException(this, GetResult().ToString(), result); } }
internal void processUnexpectedResult(TCL.CompletionCode returnCode) { ResetResult(); if (returnCode == TCL.CompletionCode.BREAK) { throw new TclException(this, "invoked \"break\" outside of a loop"); } else if (returnCode == TCL.CompletionCode.CONTINUE) { throw new TclException(this, "invoked \"continue\" outside of a loop"); } else { throw new TclException(this, "command returned bad code: " + returnCode); } }
public void traceProc(Interp interp, string part1, string part2, TCL.VarFlag flags) { if (((this.flags & flags) != 0) && ((flags & TCL.VarFlag.INTERP_DESTROYED) == 0)) { StringBuilder sbuf = new StringBuilder(command); try { Util.appendElement(interp, sbuf, part1); if ((System.Object)part2 != null) { Util.appendElement(interp, sbuf, part2); } else { Util.appendElement(interp, sbuf, ""); } if ((flags & TCL.VarFlag.TRACE_READS) != 0) { Util.appendElement(interp, sbuf, "r"); } else if ((flags & TCL.VarFlag.TRACE_WRITES) != 0) { Util.appendElement(interp, sbuf, "w"); } else if ((flags & TCL.VarFlag.TRACE_UNSETS) != 0) { Util.appendElement(interp, sbuf, "u"); } } catch (TclException e) { throw new TclRuntimeError("unexpected TclException: " + e.Message, e); } // Execute the command. interp.Eval(sbuf.ToString(), 0); } }
internal CmdTraceProc(string cmd, TCL.VarFlag newFlags) { flags = newFlags; command = cmd; }