Index: generic/asm/asmAssembleTemplate.c =================================================================== diff -u -r6af35a888e33da976e283271bb68060f34d91a9a -r6450e201d04b5d79ac2cdc5c2f33f9d411499f58 --- generic/asm/asmAssembleTemplate.c (.../asmAssembleTemplate.c) (revision 6af35a888e33da976e283271bb68060f34d91a9a) +++ generic/asm/asmAssembleTemplate.c (.../asmAssembleTemplate.c) (revision 6450e201d04b5d79ac2cdc5c2f33f9d411499f58) @@ -1,34 +1,34 @@ enum asmStatementIndex { - asmObjProcIdx, + asmObjProcIdx, $STATEMENT_INDICES }; static CONST char *asmStatementNames[] = { - "cmd", + "cmd", $STATEMENT_NAMES, NULL }; enum asmStatementArgTypeIndex { - asmStatementArgTypeArgIdx, - asmStatementArgTypeArgvIdx, - asmStatementArgTypeInstructionIdx, - asmStatementArgTypeIntIdx, - asmStatementArgTypeObjIdx, - asmStatementArgTypeResultIdx, + asmStatementArgTypeArgIdx, + asmStatementArgTypeArgvIdx, + asmStatementArgTypeInstructionIdx, + asmStatementArgTypeIntIdx, + asmStatementArgTypeObjIdx, + asmStatementArgTypeResultIdx, asmStatementArgTypeSlotIdx, asmStatementArgTypeVarIdx }; static CONST char *asmStatementArgType[] = { - "arg", - "argv", - "instruction", - "int", - "obj", - "result", - "slot", - "var", + "arg", + "argv", + "instruction", + "int", + "obj", + "result", + "slot", + "var", NULL}; static CONST char *asmStatementCmdType[] = {"arg", "obj", "result", "var", NULL}; @@ -58,8 +58,8 @@ *---------------------------------------------------------------------- */ -static int -AsmAssemble(ClientData cd, Tcl_Interp *interp, Tcl_Obj *nameObj, +static int +AsmAssemble(ClientData cd, Tcl_Interp *interp, Tcl_Obj *nameObj, int nrArgs, Tcl_Obj *asmObj, AsmCompiledProc **retAsmProc) { AsmPatches patchArray[100], *patches = &patchArray[0], *patchPtr; // TODO: make me dynamic Tcl_Command cmd; @@ -72,7 +72,7 @@ assert(nameObj != NULL); procName = ObjStr(nameObj); - + if (Tcl_ListObjGetElements(interp, asmObj, &oc, &ov) != TCL_OK) { return NsfPrintError(interp, "Asm code is not a valid list"); } @@ -87,42 +87,42 @@ for (i = 0; i < oc; i++) { int index, offset, wordOc; Tcl_Obj *lineObj = ov[i], **wordOv; - + if (Tcl_ListObjGetElements(interp, lineObj, &wordOc, &wordOv) != TCL_OK) { - return NsfPrintError(interp, - "Asm: line is not a well-formed asm instruction: %s", + return NsfPrintError(interp, + "Asm: line is not a well-formed asm instruction: %s", ObjStr(lineObj)); } result = Tcl_GetIndexFromObj(interp, wordOv[0], asmStatementNames, "asm instruction", 0, &index); if (result != TCL_OK) { - return NsfPrintError(interp, - "Asm: line is not a valid asm instruction: word %s, line %s", + return NsfPrintError(interp, + "Asm: line is not a valid asm instruction: word %s, line %s", ObjStr(wordOv[0]), ObjStr(lineObj)); } offset = (asmStatementInfo[index].flags & ASM_INFO_SKIP1) ? 2 : 1; if ((asmStatementInfo[index].flags & ASM_INFO_PAIRS) && (wordOc-offset) % 2 == 1) { - return NsfPrintError(interp, "Asm: argument list of cmd must contain pairs: %s", + return NsfPrintError(interp, "Asm: argument list of cmd must contain pairs: %s", ObjStr(lineObj)); } - if (asmStatementInfo[index].minArgs > -1 + if (asmStatementInfo[index].minArgs > -1 && wordOc < asmStatementInfo[index].minArgs) { - return NsfPrintError(interp, "Asm: statement must contain at least %d words: %s", + return NsfPrintError(interp, "Asm: statement must contain at least %d words: %s", asmStatementInfo[index].minArgs, ObjStr(lineObj)); } if (asmStatementInfo[index].maxArgs > -1 && wordOc > asmStatementInfo[index].maxArgs) { - return NsfPrintError(interp, "Asm: statement must contain at most %d words: %s", + return NsfPrintError(interp, "Asm: statement must contain at most %d words: %s", asmStatementInfo[index].maxArgs, ObjStr(lineObj)); } if (asmStatementInfo[index].argTypes) { - result = AsmInstructionArgvCheck(interp, offset, wordOc, - asmStatementInfo[index].argTypes, + result = AsmInstructionArgvCheck(interp, offset, wordOc, + asmStatementInfo[index].argTypes, nrLocalObjs, oc, wordOv, lineObj); if (unlikely(result != TCL_OK)) {return result;} } @@ -157,13 +157,13 @@ /* {cmd ::set slot 0 slot 2} */ cmd = Tcl_GetCommandFromObj(interp, wordOv[1]); if (cmd == NULL) { - return NsfPrintError(interp, - "Asm: cmd is not a valid Tcl command: %s\n", + return NsfPrintError(interp, + "Asm: cmd is not a valid Tcl command: %s\n", Tcl_GetString( wordOv[1])); } break; - /* begin generated code */ + /* begin generated code */ $ASSEMBLE_CHECK_CODE /* end generated code */ @@ -173,8 +173,8 @@ } nrAsmInstructions ++; - fprintf(stderr, "%s: nrAsmInstructions %d nrLocalObjs %d nrArgs %d argvArgs %d => data %d\n", - procName, nrAsmInstructions, nrLocalObjs, nrArgs, totalArgvArgs, + fprintf(stderr, "%s: nrAsmInstructions %d nrLocalObjs %d nrArgs %d argvArgs %d => data %d\n", + procName, nrAsmInstructions, nrLocalObjs, nrArgs, totalArgvArgs, nrLocalObjs + nrArgs + totalArgvArgs ); /* @@ -193,8 +193,8 @@ //fprintf(stderr, "args = %ld\n", proc->slots - proc->locals); AsmLocalsAlloc(proc, nrArgs + nrLocalObjs); - /* when freeing, we need something like - for (i=0; i < nrArgs + nrLocalObjs; i++) { + /* when freeing, we need something like + for (i=0; i < nrArgs + nrLocalObjs; i++) { if (proc->slotFlags[i] & ASM_SLOT_MUST_DECR) {Tcl_DecrRefCount(proc->slots[i]); } } */ @@ -208,7 +208,7 @@ for (i = 0; i < oc; i++) { int index, offset, cArgs, argc, codeIndex, argvIndex, j; Tcl_Obj *lineObj = ov[i], **argv; - + Tcl_ListObjGetElements(interp, lineObj, &argc, &argv); Tcl_GetIndexFromObj(interp, argv[0], asmStatementNames, "asm instruction", 0, &index); @@ -220,7 +220,7 @@ } else if (cArgs == NR_PAIRS1) { cArgs = 1 + (argc-offset) / 2; } - + switch (index) { case asmObjProcIdx: @@ -244,7 +244,7 @@ $ASSEMBLE_EMIT_CODE /* end generated code */ } - + if ((asmStatementInfo[index].flags & ASM_INFO_DECL) == 0) { currentAsmInstruction ++; } @@ -254,7 +254,7 @@ * add END instruction */ inst = AsmInstructionNew(proc, NULL, 0); - + /* * All addresses are determined, apply the argv patches triggered * from above. @@ -264,7 +264,7 @@ fprintf(stderr, "want to patch code[%d]->argv = code[%d]->argv[%d]\n", patchPtr->targetAsmInstruction, patchPtr->sourceAsmInstruction, patchPtr->argvIndex); /* set the argument vector of code[1] to the address of code[4]->argv[1] */ - (&proc->code[patchPtr->targetAsmInstruction])->argv = + (&proc->code[patchPtr->targetAsmInstruction])->argv = &(&proc->code[patchPtr->sourceAsmInstruction])->argv[patchPtr->argvIndex]; } Index: generic/asm/nsfAsmAssemble.c =================================================================== diff -u -r6af35a888e33da976e283271bb68060f34d91a9a -r6450e201d04b5d79ac2cdc5c2f33f9d411499f58 --- generic/asm/nsfAsmAssemble.c (.../nsfAsmAssemble.c) (revision 6af35a888e33da976e283271bb68060f34d91a9a) +++ generic/asm/nsfAsmAssemble.c (.../nsfAsmAssemble.c) (revision 6450e201d04b5d79ac2cdc5c2f33f9d411499f58) @@ -1,5 +1,5 @@ enum asmStatementIndex { - asmObjProcIdx, + asmObjProcIdx, asmEvalIdx, asmDuplicateObjIdx, asmIncrIntIdx, @@ -24,7 +24,7 @@ }; static CONST char *asmStatementNames[] = { - "cmd", + "cmd", "eval", "duplicateObj", "incrInt", @@ -50,25 +50,25 @@ }; enum asmStatementArgTypeIndex { - asmStatementArgTypeArgIdx, - asmStatementArgTypeArgvIdx, - asmStatementArgTypeInstructionIdx, - asmStatementArgTypeIntIdx, - asmStatementArgTypeObjIdx, - asmStatementArgTypeResultIdx, + asmStatementArgTypeArgIdx, + asmStatementArgTypeArgvIdx, + asmStatementArgTypeInstructionIdx, + asmStatementArgTypeIntIdx, + asmStatementArgTypeObjIdx, + asmStatementArgTypeResultIdx, asmStatementArgTypeSlotIdx, asmStatementArgTypeVarIdx }; static CONST char *asmStatementArgType[] = { - "arg", - "argv", - "instruction", - "int", - "obj", - "result", - "slot", - "var", + "arg", + "argv", + "instruction", + "int", + "obj", + "result", + "slot", + "var", NULL}; static CONST char *asmStatementCmdType[] = {"arg", "obj", "result", "var", NULL}; @@ -139,8 +139,8 @@ *---------------------------------------------------------------------- */ -static int -AsmAssemble(ClientData cd, Tcl_Interp *interp, Tcl_Obj *nameObj, +static int +AsmAssemble(ClientData cd, Tcl_Interp *interp, Tcl_Obj *nameObj, int nrArgs, Tcl_Obj *asmObj, AsmCompiledProc **retAsmProc) { AsmPatches patchArray[100], *patches = &patchArray[0], *patchPtr; // TODO: make me dynamic Tcl_Command cmd; @@ -153,7 +153,7 @@ assert(nameObj != NULL); procName = ObjStr(nameObj); - + if (Tcl_ListObjGetElements(interp, asmObj, &oc, &ov) != TCL_OK) { return NsfPrintError(interp, "Asm code is not a valid list"); } @@ -168,42 +168,42 @@ for (i = 0; i < oc; i++) { int index, offset, wordOc; Tcl_Obj *lineObj = ov[i], **wordOv; - + if (Tcl_ListObjGetElements(interp, lineObj, &wordOc, &wordOv) != TCL_OK) { - return NsfPrintError(interp, - "Asm: line is not a well-formed asm instruction: %s", + return NsfPrintError(interp, + "Asm: line is not a well-formed asm instruction: %s", ObjStr(lineObj)); } result = Tcl_GetIndexFromObj(interp, wordOv[0], asmStatementNames, "asm instruction", 0, &index); if (result != TCL_OK) { - return NsfPrintError(interp, - "Asm: line is not a valid asm instruction: word %s, line %s", + return NsfPrintError(interp, + "Asm: line is not a valid asm instruction: word %s, line %s", ObjStr(wordOv[0]), ObjStr(lineObj)); } offset = (asmStatementInfo[index].flags & ASM_INFO_SKIP1) ? 2 : 1; if ((asmStatementInfo[index].flags & ASM_INFO_PAIRS) && (wordOc-offset) % 2 == 1) { - return NsfPrintError(interp, "Asm: argument list of cmd must contain pairs: %s", + return NsfPrintError(interp, "Asm: argument list of cmd must contain pairs: %s", ObjStr(lineObj)); } - if (asmStatementInfo[index].minArgs > -1 + if (asmStatementInfo[index].minArgs > -1 && wordOc < asmStatementInfo[index].minArgs) { - return NsfPrintError(interp, "Asm: statement must contain at least %d words: %s", + return NsfPrintError(interp, "Asm: statement must contain at least %d words: %s", asmStatementInfo[index].minArgs, ObjStr(lineObj)); } if (asmStatementInfo[index].maxArgs > -1 && wordOc > asmStatementInfo[index].maxArgs) { - return NsfPrintError(interp, "Asm: statement must contain at most %d words: %s", + return NsfPrintError(interp, "Asm: statement must contain at most %d words: %s", asmStatementInfo[index].maxArgs, ObjStr(lineObj)); } if (asmStatementInfo[index].argTypes) { - result = AsmInstructionArgvCheck(interp, offset, wordOc, - asmStatementInfo[index].argTypes, + result = AsmInstructionArgvCheck(interp, offset, wordOc, + asmStatementInfo[index].argTypes, nrLocalObjs, oc, wordOv, lineObj); if (unlikely(result != TCL_OK)) {return result;} } @@ -238,14 +238,14 @@ /* {cmd ::set slot 0 slot 2} */ cmd = Tcl_GetCommandFromObj(interp, wordOv[1]); if (cmd == NULL) { - return NsfPrintError(interp, - "Asm: cmd is not a valid Tcl command: %s\n", + return NsfPrintError(interp, + "Asm: cmd is not a valid Tcl command: %s\n", Tcl_GetString( wordOv[1])); } break; - /* begin generated code */ - + /* begin generated code */ + /* end generated code */ default: @@ -254,8 +254,8 @@ } nrAsmInstructions ++; - fprintf(stderr, "%s: nrAsmInstructions %d nrLocalObjs %d nrArgs %d argvArgs %d => data %d\n", - procName, nrAsmInstructions, nrLocalObjs, nrArgs, totalArgvArgs, + fprintf(stderr, "%s: nrAsmInstructions %d nrLocalObjs %d nrArgs %d argvArgs %d => data %d\n", + procName, nrAsmInstructions, nrLocalObjs, nrArgs, totalArgvArgs, nrLocalObjs + nrArgs + totalArgvArgs ); /* @@ -274,8 +274,8 @@ //fprintf(stderr, "args = %ld\n", proc->slots - proc->locals); AsmLocalsAlloc(proc, nrArgs + nrLocalObjs); - /* when freeing, we need something like - for (i=0; i < nrArgs + nrLocalObjs; i++) { + /* when freeing, we need something like + for (i=0; i < nrArgs + nrLocalObjs; i++) { if (proc->slotFlags[i] & ASM_SLOT_MUST_DECR) {Tcl_DecrRefCount(proc->slots[i]); } } */ @@ -289,7 +289,7 @@ for (i = 0; i < oc; i++) { int index, offset, cArgs, argc, codeIndex, argvIndex, j; Tcl_Obj *lineObj = ov[i], **argv; - + Tcl_ListObjGetElements(interp, lineObj, &argc, &argv); Tcl_GetIndexFromObj(interp, argv[0], asmStatementNames, "asm instruction", 0, &index); @@ -301,7 +301,7 @@ } else if (cArgs == NR_PAIRS1) { cArgs = 1 + (argc-offset) / 2; } - + switch (index) { case asmObjProcIdx: @@ -362,7 +362,7 @@ proc->slotFlags[currentSlot] |= ASM_SLOT_IS_INTEGER; currentSlot ++; } - + break; case asmJumpIdx: @@ -404,7 +404,7 @@ { Tcl_Command cmd = NULL; NsfObject *object = NULL; AsmResolverInfo *resInfo; - + if (strncmp(ObjStr(inst->argv[1]), "::nsf::methods::", 16) == 0) { cmd = Tcl_GetCommandFromObj(interp, inst->argv[1]); //fprintf(stderr, "%s: asmMethod cmd '%s' => %p\n", procName, ObjStr(inst->argv[1]), cmd); @@ -422,20 +422,20 @@ AsmInstructionSetCmd(inst, asmMethodDelegateDispatch11); } else if (cmd != 0) { inst->clientData = cmd; - } else { + } else { inst->clientData = NULL; } } - + break; case asmMethodSelfDispatchIdx: inst = AsmInstructionNew(proc, asmMethodSelfDispatch, cArgs); if (cArgs > 0) {AsmInstructionArgvSet(interp, offset, argc, 0, inst, proc, argv, 0);} - { Tcl_Command cmd = NULL; + { Tcl_Command cmd = NULL; AsmResolverInfo *resInfo; - + if (strncmp(ObjStr(inst->argv[0]), "::nsf::methods::", 16) == 0) { cmd = Tcl_GetCommandFromObj(interp, inst->argv[0]); if (cmd != 0) { @@ -450,7 +450,7 @@ resInfo->proc = proc; inst->clientData = resInfo; } - + break; case asmNoopIdx: @@ -465,7 +465,7 @@ Tcl_IncrRefCount(proc->slots[currentSlot]); proc->slotFlags[currentSlot] |= ASM_SLOT_MUST_DECR; currentSlot ++; - + break; case asmSelfIdx: @@ -537,20 +537,20 @@ patches->sourceAsmInstruction = codeIndex; patches->argvIndex = argvIndex; patches++; - + break; case asmVarIdx: proc->slots[currentSlot] = NULL; currentSlot ++; - + break; /* end generated code */ } - + if ((asmStatementInfo[index].flags & ASM_INFO_DECL) == 0) { currentAsmInstruction ++; } @@ -560,7 +560,7 @@ * add END instruction */ inst = AsmInstructionNew(proc, NULL, 0); - + /* * All addresses are determined, apply the argv patches triggered * from above. @@ -570,7 +570,7 @@ fprintf(stderr, "want to patch code[%d]->argv = code[%d]->argv[%d]\n", patchPtr->targetAsmInstruction, patchPtr->sourceAsmInstruction, patchPtr->argvIndex); /* set the argument vector of code[1] to the address of code[4]->argv[1] */ - (&proc->code[patchPtr->targetAsmInstruction])->argv = + (&proc->code[patchPtr->targetAsmInstruction])->argv = &(&proc->code[patchPtr->sourceAsmInstruction])->argv[patchPtr->argvIndex]; } Index: generic/asm/nsfAssemble.c =================================================================== diff -u -r24571ae44c492c681d3efd2f2d2f5169ad7d6d57 -r6450e201d04b5d79ac2cdc5c2f33f9d411499f58 --- generic/asm/nsfAssemble.c (.../nsfAssemble.c) (revision 24571ae44c492c681d3efd2f2d2f5169ad7d6d57) +++ generic/asm/nsfAssemble.c (.../nsfAssemble.c) (revision 6450e201d04b5d79ac2cdc5c2f33f9d411499f58) @@ -1,4 +1,4 @@ -/* +/* * nsfAssemble.c -- * * Support for the experimental assemble feature. This file is @@ -98,7 +98,7 @@ # define AsmInstructionNew(proc, instruction, argc) AsmInstructionNewCT(proc, (Tcl_ObjCmdProc*)instruction, argc) # define AsmInstructionSetCmd(inst, name) inst->cmd = (Tcl_ObjCmdProc*)name # define NsfAsmJump(index) proc->ip = &proc->code[(index)-1] -# define NsfAsmJumpNext() +# define NsfAsmJumpNext() AsmInstruction *AsmInstructionNewCT(AsmCompiledProc *proc, Tcl_ObjCmdProc *objProc, int argc) { proc->ip->cmd = objProc; @@ -122,7 +122,7 @@ } void AsmInstructionPrint(AsmInstruction *ip) { - int i; + int i; fprintf(stderr, "(%d) ", ip->argc); for (i=0; iargc; i++) {fprintf(stderr, "%s ", ObjStr(ip->argv[i]));} fprintf(stderr, "\n"); @@ -144,10 +144,10 @@ * Prototypes needed for the execution engines included below */ static int -AsmInstructionArgvCheck(Tcl_Interp *interp, int from, int to, CONST char **argType, - int nrObjs, int nrStatements, +AsmInstructionArgvCheck(Tcl_Interp *interp, int from, int to, CONST char **argType, + int nrObjs, int nrStatements, Tcl_Obj **wordOv, Tcl_Obj *lineObj); -static void +static void AsmInstructionArgvSet(Tcl_Interp *interp, int from, int to, int currentArg, AsmInstruction *inst, AsmCompiledProc *asmProc, Tcl_Obj **wordOv, int verbose); @@ -170,53 +170,53 @@ *---------------------------------------------------------------------- */ static int -AsmInstructionArgvCheck(Tcl_Interp *interp, int from, int to, CONST char **argType, +AsmInstructionArgvCheck(Tcl_Interp *interp, int from, int to, CONST char **argType, int nrSlots, int nrStatements, Tcl_Obj **wordOv, Tcl_Obj *lineObj) { int j; for (j = from; j < to; j += 2) { int argIndex, typesIndex, intValue, result; //fprintf(stderr, "check arg type %s\n", ObjStr(wordOv[j])); - result = Tcl_GetIndexFromObj(interp, wordOv[j], asmStatementArgType, + result = Tcl_GetIndexFromObj(interp, wordOv[j], asmStatementArgType, "asm statement arg type", 0, &typesIndex); if (result != TCL_OK) { - return NsfPrintError(interp, - "Asm: unknown arg type %s, line '%s'", + return NsfPrintError(interp, + "Asm: unknown arg type %s, line '%s'", ObjStr(wordOv[j]), ObjStr(lineObj)); } result = Tcl_GetIndexFromObj(interp, wordOv[j], argType, "asm internal arg type", 0, &argIndex); if (result != TCL_OK) { - return NsfPrintError(interp, - "Asm: instruction argument has invalid type: '%s', line %s\n", + return NsfPrintError(interp, + "Asm: instruction argument has invalid type: '%s', line %s\n", ObjStr(wordOv[j]), ObjStr(lineObj)); } //fprintf(stderr, "check arg value %s\n", ObjStr(wordOv[j+1])); - if (Tcl_GetIntFromObj(interp, wordOv[j+1], &intValue) != TCL_OK + if (Tcl_GetIntFromObj(interp, wordOv[j+1], &intValue) != TCL_OK || intValue < 0) { - return NsfPrintError(interp, + return NsfPrintError(interp, "Asm: instruction argument of type %s must have numeric index >= 0," - " got '%s', line '%s'", + " got '%s', line '%s'", ObjStr(wordOv[j]), ObjStr(wordOv[j+1]), ObjStr(lineObj)); } if (( - typesIndex == asmStatementArgTypeObjIdx || + typesIndex == asmStatementArgTypeObjIdx || typesIndex == asmStatementArgTypeSlotIdx ) && intValue > nrSlots) { - return NsfPrintError(interp, + return NsfPrintError(interp, "Asm: instruction argument value must be less than %d," - " got '%s', line '%s'", + " got '%s', line '%s'", nrSlots, ObjStr(wordOv[j+1]), ObjStr(lineObj)); } /* we assume, that every declaration results in exactly one slot */ if ((typesIndex == asmStatementArgTypeInstructionIdx) && intValue > (nrStatements - nrSlots)) { - return NsfPrintError(interp, + return NsfPrintError(interp, "Asm: instruction argument value must be less than %d," - " got '%s', line '%s'", + " got '%s', line '%s'", nrStatements - nrSlots, ObjStr(wordOv[j+1]), ObjStr(lineObj)); } } @@ -233,33 +233,33 @@ * *---------------------------------------------------------------------- */ -static void +static void AsmInstructionArgvSet(Tcl_Interp *interp, int from, int to, int currentArg, AsmInstruction *inst, AsmCompiledProc *asmProc, Tcl_Obj **wordOv, int verbose) { int j; for (j = from; j < to; j += 2, currentArg++) { int argIndex, intValue; - + Tcl_GetIndexFromObj(interp, wordOv[j], asmStatementArgType, "asm cmd arg type", 0, &argIndex); Tcl_GetIntFromObj(interp, wordOv[j+1], &intValue); if (verbose != 0) { - fprintf(stderr, "AsmInstructionArgvSet (type %d) arg[%d] := %s[%s]\n", + fprintf(stderr, "AsmInstructionArgvSet (type %d) arg[%d] := %s[%s]\n", argIndex, currentArg, ObjStr(wordOv[j]), ObjStr(wordOv[j+1])); } - + switch (argIndex) { - case asmStatementArgTypeObjIdx: + case asmStatementArgTypeObjIdx: inst->argv[currentArg] = asmProc->slots[intValue]; break; - + case asmStatementArgTypeArgIdx: AsmArgSet(asmProc, intValue, &inst->argv[currentArg]); break; - - case asmStatementArgTypeResultIdx: + + case asmStatementArgTypeResultIdx: inst->argv[currentArg] = NULL; break; @@ -277,7 +277,7 @@ } /*fprintf(stderr, "[%d] inst %p name %s arg[%d] %s\n", currentAsmInstruction, - inst, ObjStr(inst->argv[0]), currentArg, + inst, ObjStr(inst->argv[0]), currentArg, inst->argv[currentArg] ? ObjStr(inst->argv[currentArg]) : "NULL");*/ } } @@ -304,7 +304,7 @@ AsmProcClientData *cd = clientData; /*fprintf(stderr, "NsfAsmProcDeleteProc received %p\n", clientData);*/ - + fprintf(stderr, "NsfAsmProcDeleteProc: TODO free asmProc\n"); if (cd->paramDefs != 0) { /* tcd->paramDefs is freed by NsfProcDeleteProc() */ @@ -354,12 +354,12 @@ */ memcpy(tov, objv, sizeof(Tcl_Obj *)*(objc)); //tov[0] = tcd->procName; - + /* If the argument parsing is ok, the body will be called */ result = ProcessMethodArguments(pcPtr, interp, NULL, 0, cd->paramDefs, objv[0], objc, tov); - + if (likely(result == TCL_OK)) { result = InvokeShadowedProc(interp, cd->procName, cd->cmd, pcPtr); } else { @@ -382,7 +382,7 @@ } cd->proc->currentObject = cd->object; result = AsmExecute(NULL, interp, cd->proc, objc, objv); - + } return result; @@ -402,7 +402,7 @@ static int NsfAsmProcAddArgs(Tcl_Interp *interp, Tcl_Obj *argumentsObj, - Tcl_Obj *nameObj, Tcl_Obj *bodyObj, + Tcl_Obj *nameObj, Tcl_Obj *bodyObj, int with_ad, int with_checkAlways) { int argc, result; Tcl_Obj **argv; @@ -413,7 +413,7 @@ if (unlikely(Tcl_ListObjGetElements(interp, argumentsObj, &argc, &argv) != TCL_OK)) { return NsfPrintError(interp, "argument list invalid '%s'", ObjStr(argumentsObj)); } - + result = AsmAssemble(NULL, interp, nameObj, argc, bodyObj, &asmProc); if (unlikely(result != TCL_OK)) { return result; @@ -457,9 +457,9 @@ (withPer_object || ! NsfObjectIsClass(defObject)) ? NULL : (NsfClass *)defObject; - // not handled: - // * withInner_namespace, - // * regObject, + // not handled: + // * withInner_namespace, + // * regObject, // * pre and post-conditions // * withCheckAlways ? NSF_ARGPARSE_CHECK : 0 @@ -470,7 +470,7 @@ if (unlikely(Tcl_ListObjGetElements(interp, argumentsObj, &argc, &argv) != TCL_OK)) { return NsfPrintError(interp, "argument list invalid '%s'", ObjStr(argumentsObj)); } - + result = AsmAssemble(NULL, interp, nameObj, argc, bodyObj, &asmProc); if (unlikely(result != TCL_OK)) { return result;