summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsGR.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-12-30 08:37:49 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-12-30 08:37:49 (GMT)
commit4ad593f2bfa83036baa51ee39064e8c5f1020e5e (patch)
treea8680fa7474bcf0220ce6342a82e0a07e23ef8ff /generic/tclCompCmdsGR.c
parentcdacc33cbbaa19a6840b6de4549153bf33da94e4 (diff)
downloadtcl-4ad593f2bfa83036baa51ee39064e8c5f1020e5e.zip
tcl-4ad593f2bfa83036baa51ee39064e8c5f1020e5e.tar.gz
tcl-4ad593f2bfa83036baa51ee39064e8c5f1020e5e.tar.bz2
implement [namespace origin] in bytecode
Diffstat (limited to 'generic/tclCompCmdsGR.c')
-rw-r--r--generic/tclCompCmdsGR.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index fc54620..df8895f 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -1956,6 +1956,28 @@ TclCompileNamespaceCodeCmd(
}
int
+TclCompileNamespaceOriginCmd(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Parse *parsePtr, /* Points to a parse structure for the command
+ * created by Tcl_ParseCommand. */
+ Command *cmdPtr, /* Points to defintion of command being
+ * compiled. */
+ CompileEnv *envPtr) /* Holds resulting instructions. */
+{
+ Tcl_Token *tokenPtr;
+ DefineLineInformation; /* TIP #280 */
+
+ if (parsePtr->numWords != 2) {
+ return TCL_ERROR;
+ }
+ tokenPtr = TokenAfter(parsePtr->tokenPtr);
+
+ CompileWord(envPtr, tokenPtr, interp, 1);
+ TclEmitOpcode( INST_ORIGIN_COMMAND, envPtr);
+ return TCL_OK;
+}
+
+int
TclCompileNamespaceQualifiersCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command