diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-11-02 18:13:20 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-11-02 18:13:20 (GMT) |
commit | ce7c13b7962d2ebcd432dfb05fffe812c4d172d2 (patch) | |
tree | 51f3474d6aea4c638b7abdc0ee79609ab7fccd98 /generic/tclCompCmds.c | |
parent | a7dc229d16889c9f6f66d197d4e0bf1afbec5578 (diff) | |
download | tcl-ce7c13b7962d2ebcd432dfb05fffe812c4d172d2.zip tcl-ce7c13b7962d2ebcd432dfb05fffe812c4d172d2.tar.gz tcl-ce7c13b7962d2ebcd432dfb05fffe812c4d172d2.tar.bz2 |
Added more TclOO introspection bytecodes ([info object class], [info object namespace]). Also moved TclOO-in-8.6 to using the main Tcl internal ensemble builder.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r-- | generic/tclCompCmds.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 5beb7bd..e476cf0 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3666,6 +3666,46 @@ TclCompileInfoLevelCmd( } return TCL_OK; } + +int +TclCompileInfoObjectClassCmd( + 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) +{ + DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); + + if (parsePtr->numWords != 2) { + return TCL_ERROR; + } + CompileWord(envPtr, tokenPtr, interp, 1); + TclEmitOpcode( INST_TCLOO_CLASS, envPtr); + return TCL_OK; +} + +int +TclCompileInfoObjectNamespaceCmd( + 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) +{ + DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); + + if (parsePtr->numWords != 2) { + return TCL_ERROR; + } + CompileWord(envPtr, tokenPtr, interp, 1); + TclEmitOpcode( INST_TCLOO_NS, envPtr); + return TCL_OK; +} /* *---------------------------------------------------------------------- |