Index: generic/nsf.c =================================================================== diff -u -r7def5bc35b6d31f0390d943d6d2221f8938b0e8a -r04e3056621ba12a8eacb56a92f5d3d00fdbbbfbb --- generic/nsf.c (.../nsf.c) (revision 7def5bc35b6d31f0390d943d6d2221f8938b0e8a) +++ generic/nsf.c (.../nsf.c) (revision 04e3056621ba12a8eacb56a92f5d3d00fdbbbfbb) @@ -1,3 +1,4 @@ +#define NSF_ASSEMBLE 1 /* * nsf.c -- * @@ -221,7 +222,9 @@ static Tcl_ObjCmdProc NsfObjscopedMethod; static Tcl_ObjCmdProc NsfSetterMethod; static Tcl_ObjCmdProc NsfProcAliasMethod; +static Tcl_ObjCmdProc NsfAsmProc; + /* prototypes for methods called directly when CallDirectly() returns NULL */ static int NsfCAllocMethod(Tcl_Interp *interp, NsfClass *cl, Tcl_Obj *nameObj); static int NsfCCreateMethod(Tcl_Interp *interp, NsfClass *cl, CONST char *name, int objc, Tcl_Obj *CONST objv[]); @@ -770,7 +773,6 @@ #include "nsfStack.c" - /*********************************************************************** * Value added replacements of Tcl functions ***********************************************************************/ @@ -9421,6 +9423,13 @@ return result; } +#if !defined(NSF_ASSEMBLE) +static int NsfAsmProc(ClientData clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *CONST objv[]) { + return TCL_OK; +} +#endif + /* *---------------------------------------------------------------------- * MethodDispatchCsc -- @@ -9672,7 +9681,8 @@ } else if (proc == NsfForwardMethod || proc == NsfObjscopedMethod || - proc == NsfSetterMethod + proc == NsfSetterMethod || + proc == NsfAsmProc ) { TclCmdClientData *tcd = (TclCmdClientData *)cp; @@ -11950,7 +11960,7 @@ Tcl_PushCallFrame(interp, (Tcl_CallFrame *)framePtr, nsPtr, 0); /* create the method in the provided namespace */ - result = Tcl_ProcObjCmd(0, interp, 4, ov); + result = Tcl_ProcObjCmd(NULL, interp, 4, ov); if (result == TCL_OK) { /* retrieve the defined proc */ Proc *procPtr = FindProcMethod(nsPtr, methodName); @@ -12082,7 +12092,7 @@ } /************************************************************************** - * Begin Definition of Parameter procs (Tcl Procs with Parameter handling) + * Begin Definition of nsf::proc (Tcl Procs with Parameter handling) **************************************************************************/ /* *---------------------------------------------------------------------- @@ -12310,8 +12320,7 @@ * * TODO: the current 1 cmd + 1 proc implementation is not robust * against renaming and partial deletions (deletion of the - * stub). The sketched variant should be better and should be - * examined first in detail. + * stub). * * Results: * Tcl return code. @@ -12544,7 +12553,7 @@ return TCL_OK; } /************************************************************************** - * End Definition of Parameter procs (Tcl Procs with Parameter handling) + * End Definition of nsf::proc (Tcl Procs with Parameter handling) **************************************************************************/ /* @@ -17857,6 +17866,16 @@ return 0; } +#if defined(NSF_ASSEMBLE) +# include "nsfAssemble.c" +#else +static int +NsfAsmMethodCreateCmd(Tcl_Interp *interp, NsfObject *defObject, + int withInner_namespace, int withPer_object, NsfObject *regObject, + Tcl_Obj *nameObj, Tcl_Obj *argumentsObj, Tcl_Obj *bodyObj) { + return TCL_OK; +} +#endif /*********************************************************************** * Begin generated Next Scripting commands @@ -18051,6 +18070,52 @@ } /* +cmd asmproc NsfAsmProcCmd { + {-argName "-ad" -required 0} + {-argName "procName" -required 1 -type tclobj} + {-argName "arguments" -required 1 -type tclobj} + {-argName "body" -required 1 -type tclobj} +} +*/ +#if !defined(NSF_ASSEMBLE) +static int +NsfAsmProcCmd(Tcl_Interp *interp, int with_ad, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { + return TCL_OK; +} +#else +static int +NsfAsmProcCmd(Tcl_Interp *interp, int with_ad, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { + NsfParsedParam parsedParam; + int result; + /* + * Parse argument list "arguments" to determine if we should provide + * nsf parameter handling. + */ + result = ParamDefsParse(interp, nameObj, arguments, + NSF_DISALLOWED_ARG_METHOD_PARAMETER, 0, + &parsedParam); + if (result != TCL_OK) { + return result; + } + + if (parsedParam.paramDefs) { + /* + * We need parameter handling. + */ + result = NsfAsmProcAddParam(interp, &parsedParam, nameObj, body, with_ad); + + } else { + /* + * No parameter handling needed. + */ + result = NsfAsmProcAddArgs(interp, arguments, nameObj, body, with_ad); + } + + return result; +} +#endif + +/* cmd configure NsfConfigureCmd { {-argName "configureoption" -required 1 -type "debug|dtrace|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} {-argName "value" -required 0 -type tclobj} @@ -19772,13 +19837,13 @@ * later. */ result = NsfProcAdd(interp, &parsedParam, ObjStr(nameObj), body, with_ad); - + } else { /* * No parameter handling needed. A plain Tcl proc is added. */ Tcl_Obj *ov[4]; - + ov[0] = NULL; ov[1] = nameObj; ov[2] = arguments;