summaryrefslogtreecommitdiffstats
path: root/generic/tclDisassemble.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-05-26 13:19:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-05-26 13:19:43 (GMT)
commitb2214142f4719ab73e4979553e03e6daf1ad4508 (patch)
tree7f001c238f93c5f63e92ad456786dc0f89e6b425 /generic/tclDisassemble.c
parentf2ff6304e87498f35a1563e1d8903cf005fa677b (diff)
parent1c8e57af313b8a648e803d05a8563cb16c1beec7 (diff)
downloadtcl-b2214142f4719ab73e4979553e03e6daf1ad4508.zip
tcl-b2214142f4719ab73e4979553e03e6daf1ad4508.tar.gz
tcl-b2214142f4719ab73e4979553e03e6daf1ad4508.tar.bz2
merge 8.6
Diffstat (limited to 'generic/tclDisassemble.c')
-rw-r--r--generic/tclDisassemble.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index a096a85..304fa30 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -1121,7 +1121,7 @@ DisassembleByteCodeAsDicts(
Tcl_Obj *desc;
TclNewObj(desc);
- Tcl_DictObjPut(NULL, desc, Tcl_NewStringObj("name", -1), auxDesc);
+ TclDictPut(NULL, desc, "name", auxDesc);
auxDesc = desc;
auxData->type->disassembleProc(auxData->clientData, auxDesc,
codePtr, 0);
@@ -1188,23 +1188,21 @@ DisassembleByteCodeAsDicts(
sourceOffset += Decode(srcOffPtr);
sourceLength = Decode(srcLenPtr);
TclNewObj(cmd);
- Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codefrom", -1),
- Tcl_NewWideIntObj(codeOffset));
- Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codeto", -1),
- Tcl_NewWideIntObj(codeOffset + codeLength - 1));
+ TclDictPut(NULL, cmd, "codefrom", Tcl_NewWideIntObj(codeOffset));
+ TclDictPut(NULL, cmd, "codeto", Tcl_NewWideIntObj(
+ codeOffset + codeLength - 1));
/*
* Convert byte offsets to character offsets; important if multibyte
* characters are present in the source!
*/
- Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptfrom", -1),
- Tcl_NewWideIntObj(TclNumUtfChars(codePtr->source,
- sourceOffset)));
- Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptto", -1),
- Tcl_NewWideIntObj(TclNumUtfChars(codePtr->source,
+ TclDictPut(NULL, cmd, "scriptfrom", Tcl_NewWideIntObj(
+ TclNumUtfChars(codePtr->source, sourceOffset)));
+ TclDictPut(NULL, cmd, "scriptto", Tcl_NewWideIntObj(
+ TclNumUtfChars(codePtr->source,
sourceOffset + sourceLength - 1)));
- Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("script", -1),
+ TclDictPut(NULL, cmd, "script",
Tcl_NewStringObj(codePtr->source+sourceOffset, sourceLength));
Tcl_ListObjAppendElement(NULL, commands, cmd);
}
@@ -1223,32 +1221,26 @@ DisassembleByteCodeAsDicts(
*/
TclNewObj(description);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("literals", -1),
- literals);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("variables", -1),
- variables);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exception", -1), exn);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("instructions", -1),
- instructions);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("auxiliary", -1), aux);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("commands", -1),
- commands);
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("script", -1),
+ TclDictPut(NULL, description, "literals", literals);
+ TclDictPut(NULL, description, "variables", variables);
+ TclDictPut(NULL, description, "exception", exn);
+ TclDictPut(NULL, description, "instructions", instructions);
+ TclDictPut(NULL, description, "auxiliary", aux);
+ TclDictPut(NULL, description, "commands", commands);
+ TclDictPut(NULL, description, "script",
Tcl_NewStringObj(codePtr->source, codePtr->numSrcBytes));
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("namespace", -1),
+ TclDictPut(NULL, description, "namespace",
Tcl_NewStringObj(codePtr->nsPtr->fullName, -1));
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("stackdepth", -1),
+ TclDictPut(NULL, description, "stackdepth",
Tcl_NewWideIntObj(codePtr->maxStackDepth));
- Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exceptdepth", -1),
+ TclDictPut(NULL, description, "exceptdepth",
Tcl_NewWideIntObj(codePtr->maxExceptDepth));
if (line >= 0) {
- Tcl_DictObjPut(NULL, description,
- Tcl_NewStringObj("initiallinenumber", -1),
+ TclDictPut(NULL, description, "initiallinenumber",
Tcl_NewWideIntObj(line));
}
if (file) {
- Tcl_DictObjPut(NULL, description,
- Tcl_NewStringObj("sourcefile", -1), file);
+ TclDictPut(NULL, description, "sourcefile", file);
}
return description;
}