summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclCmdAH.c: Fix cases where value returned bydgp2010-09-231-1/+2
| | | | | | * generic/tclEvent.c: Tcl_GetReturnOptions() was leaked. * generic/tclMain.c: Thanks to Jeff Hobbs for discovery of the anti-pattern to seek and destroy.
* * generic/tclBasic.c: New implementation for [tailcall]:Miguel Sofer2010-08-301-3/+1
| | | | | | | | | * generic/tclCmdAH.c: it now schedules the command and returns * generic/tclCmdMZ.c: TCL_RETURN. This fixes all issues with * generic/tclExecute.c: [catch] and [try] - [Bug 3046594], * generic/tclInt.h: [Bug 3047235] and [Bug 3048771]. Thanks * generic/tclNamesp.c: dgp for exploring the dark corners. * tests/tailcall.test: More thorough testing is required.
* * generic/tclBasic.c: Redesign of [tailcall] toMiguel Sofer2010-08-181-17/+6
| | | | | | | | | * generic/tclCmdAH.c: (a) fix #3047235 * generic/tclCompile.h: (b) enable fix for #3046594 * generic/tclExecute.c: (c) enable recursive tailcalls * generic/tclInt.h: * generic/tclNamesp.c: * tests/tailcall.test:
* Code Audit results:dkf2010-03-051-2/+1
| | | | | | | | * use do { ... } while (0) in macros * avoid shadowing one local variable with another * use clearer 'foo.bar++;' instead of '++foo.bar;' where result not required (i.e., semantically equivalent) * follow Engineering Manual rules on spacing and declarations
* [Bug 942170]: Detect the st_blocks field of 'struct stat' correctly.dkf2009-12-281-3/+6
|
* Eliminate various gcc warnings (in -Wextra mode)nijtmans2009-11-181-2/+2
|
* Make interpreted [for] and [while] NRE-safe. [Bug 2823276]dkf2009-08-191-61/+121
|
* Change ForIterData, make it const-safe.nijtmans2009-08-161-2/+2
|
* TIP #353 IMPLEMENTATIONdgp2009-08-121-9/+34
| | | | | | | | | | | | | | * doc/NRE.3: New public routine Tcl_NRExprObj() permits * generic/tcl.decls: extension commands to evaluate Tcl expressions * generic/tclBasic.c: in NR-enabled command procedures. * generic/tclCmdAH.c: * generic/tclExecute.c: * generic/tclInt.h: * generic/tclObj.c: * tests/expr.test: * generic/tclDecls.h: make genstubs * generic/tclStubInit.c:
* minor cleanupsdgp2009-07-241-2/+2
|
* * generic/tclCompile.c (TclInitCompileEnv, EnterCmdWordIndex,andreas_kupries2009-07-141-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclCleanupByteCode, TclCompileScript): * generic/tclExecute.c (TclCompileObj, TclExecuteByteCode): * tclCompile.h (ExtCmdLoc): * tclInt.h (ExtIndex, CFWordBC, CmdFrame): * tclBasic.c (DeleteInterpProc, TclArgumentBCEnter, TclArgumentBCRelease, TclArgumentGet, SAVE_CONTEXT, RESTORE_CONTEXT, NRCoroutineExitCallback, TclNRCoroutineObjCmd): * generic/tclCmdAH.c (TclNRForObjCmd, TclNRForIterCallback, ForNextCallback): * generic/tclCmdMZ.c (TclNRWhileObjCmd): Extended the bytecode compiler initialization to recognize the compilation of whole files (NRE enabled 'source' command) and switch to the counting of absolute lines in that case. Further extended the bytecode compiler to track the start line in the generated information, and modified the bytecode execution to recompile an object if the location as per the calling context doesn't match the location saved in the bytecode. This part could be optimized more by using more memory to keep all possibilities which occur around, or by just adjusting the location information instead of a total recompile. Reworked the handling of literal command arguments in bytecode to be saved (compiler) and used (execution) per command (See the TCL_INVOKE_STK* instructions), and not per the whole bytecode. This, and the previous change remove the problems with location data caused by literal sharing (across whole files, but also proc bodies). Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex). The last change causes the hashtable 'lineLABCPtr' to be state which has to be kept per coroutine, like the CmdFrame stack. Reworked the coroutine support code to create, delete and switch the information as needed. Further reworked the tailcall command as well, it has to pop its own arguments when run in a bytecode context to keep a proper stack in 'lineLABCPtr'. Fixed the mishandling of line information in the NRE-enabled 'for' and 'while' commands introduced when both were made to share their iteration callbacks without taking into account that the loop body is found in different words of the command. Introduced a separate data structure to hold all the callback information, as we went over the limit of 4 direct client-data values for NRE callbacks. The above fixes [Bug 1605269].
* * generic/tclBasic.c: Fix for (among others) [Bug 2699087]Miguel Sofer2009-03-211-1/+15
| | | | | | | | | * generic/tclCmdAH.c: Tailcalls now perform properly even from * generic/tclExecute.c: within [eval]ed scripts. * generic/tclInt.h: More tests missing, as well as proper exploration and testing of the interaction with "redirectors" like interp-alias (suspect that it does not happen in constant space) and pure-eval commands.
* - eliminate some unnessary type castsnijtmans2009-02-031-4/+4
| | | | | - some internal const decorations - spacing
* More coding style improvements.dkf2009-01-041-40/+40
|
* oopsdkf2008-12-061-1/+2
|
* Partial fix for [Bug 2388866]dkf2008-12-061-1/+13
|
* TIP #336 IMPLEMENTATIONdgp2008-12-021-6/+7
| | | | | | | | | | | | | | | | | | * generic/tcl.decls: New routines Tcl_(Get|Set)ErrorLine. * generic/tcl.h: Dropped default access to interp->errorLine. * generic/tclCmdAH.c: Restore it with -DUSE_INTERP_ERRORLINE. * generic/tclCmdMZ.c: Updated callers. * generic/tclDictObj.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclOOBasic.c: * generic/tclOODefinedCmds.c: * generic/tclOOMethod.c: * generic/tclProc.c: * generic/tclResult.c: * generic/tclDecls.h: make genstubs * generic/tclStubInit.c:
* Implementation of TIP #210.dkf2008-11-291-5/+154
|
* Style improvements - invoking callbacks without visual junk.dkf2008-10-261-2/+2
|
* * generic/tclCmdAH.c (ForNextCallback): handle TCL_CONTINUE inMiguel Sofer2008-10-231-2/+2
| | | | the for body [Bug 2186888].
* * generic/tclCompile.h: Declare the internal tclInstructionTabledgp2008-10-171-2/+2
| | | | | | | | * generic/tclExecute.c: to simply be "const", not CONST86. * generic/tclCmdAH.c: whitespace. * generic/tclCmdIL.c: Uninitialized variable warning. * generic/tclTest.c: const correctness warning.
* * generic/tclCmdAH.c: Fix minor compiler warnings when compilingnijtmans2008-10-141-7/+7
| | | | | | | | * generic/tclCmdMZ.c: with -Wwrite-strings * generic/tclIndexObj.c: * generic/tclProc.c: * generic/tclStubLib.c: * generic/tclUtil.c:
* TIP #323 IMPLEMENTATION (partial)dgp2008-09-241-5/+1
| | | | | | | | * doc/file.n: Revise [file delete] and [file mkdir] to * generic/tclCmdAH.c: accept zero "pathname" arguments (the * generic/tclFCmd.c: no-op case). * tests/cmdAH.test: * tests/fCmd.test:
* * generic/tclCmdAH.c: nre-enabling [eval]; eval scripts are nowMiguel Sofer2008-09-011-20/+29
| | | | | | | * generic/tclOOBasic.c: bytecompiled. Adapted recursion limit tests * tests/interp.test: that were relying on eval not being * tests/nre.test: compiled. Part of the [Bug 2017632] project. * tests/unsupported.test:
* NRE-enable non-compiled [foreach]. [Bug 2017632]dkf2008-08-241-102/+207
|
* * generic/tclBasic.c: Implementation of [coroutine] and [yield]Miguel Sofer2008-08-171-3/+3
| | | | | | | | * generic/tclCmdAH.c: commands (in tcl::unsupported). * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclInt.h: * tests/unsupported.test:
* nr-enabling [for]; [while] made to reuse [for]'s infrastructure.Miguel Sofer2008-07-311-36/+87
|
* * generic/tclBasic.c: NR-enabling [catch]Miguel Sofer2008-07-311-3/+30
| | | | | | * generic/tclCmdAH.c: * generic/tclInt.h: * tests/NRE.test:
* * generic/tclBasic.c: Extended the existing TIP #280 system (infoandreas_kupries2008-07-211-3/+8
| | | | | | | | | | | | * generic/tclCmdAH.c: frame), added the ability to track the * generic/tclCompCmds.c: absolute location of literal procedure * generic/tclCompile.c: arguments, and making this information * generic/tclCompile.h: available to uplevel, eval, and * generic/tclInterp.c: siblings. This allows proper tracking of * generic/tclInt.h: absolute location through custom (Tcl-coded) * generic/tclNamesp.c: control structures based on uplevel, etc. * generic/tclProc.c: * tests/info.test:
* fix [2021443] inconsistant "wrong # args" messages (follow-up)nijtmans2008-07-211-2/+2
|
* fix [2021443] inconsistant "wrong # args" messagesnijtmans2008-07-191-2/+2
|
* NRE implementation [Patch 2017110]Miguel Sofer2008-07-131-3/+2
|
* Small clarifications that code a bit nicer to read.dkf2008-05-301-1/+3
|
* Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-24/+24
|
* missing char in error messagedgp2008-03-141-2/+2
|
* * generic/tclCmdAH.c: Revised direct evaluation implementation ofdgp2008-03-071-6/+9
| | | | | [expr] so that [expr $e] caches compiled bytecodes for the expression as the intrep of $e.
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-6/+6
| | | | objTypes.
* * generic/tclInt.decls: Revised the interfaces of the routinesdgp2007-06-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclExecute.c: TclStackAlloc and TclStackFree to make them easier for callers to use (or more precisely, harder to misuse). TclStackFree now takes a (void *) argument which is the pointer intended to be freed. TclStackFree will panic if that's not actually the memory the call will free. TSA/TSF also now tolerate receiving (interp == NULL), in which case they simply fall back to be calls to Tcl_Alloc/Tcl_Free. * generic/tclIntDecls.h: make genstubs * generic/tclBasic.c: Updated callers * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclFCmd.c: * generic/tclFileName.c: * generic/tclIOCmd.c: * generic/tclIndexObj.c: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclProc.c: * generic/tclTrace.c: * unix/tclUnixPipe.c:
* Handle creation of Tcl_Objs from constant strings better (easier to use, moredkf2007-04-101-41/+44
| | | | efficient). After [Patch 1529526] (afredd)
* Reduce number of StackAlloc and StackFree calls.dgp2007-03-231-26/+16
|
* * generic/tclCmdAH.c (Tcl_ForeachObjCmd): Replaced arraysdgp2007-03-221-39/+28
| | | | | on the C stack and ckalloc calls with TclStackAlloc calls to use memory on Tcl's evaluation stack.
* * generic/tclCmdAH.c (Tcl_ForeachObjCmd): Stop throwing awaydgp2007-03-011-5/+5
| | | | | * tests/foreach.test (foreach-1.14): useful error information when loop variable sets fail.
* * generic/tclCmdAH.c (Tcl_ForeachObjCmd): Rewrite to makedgp2007-03-011-26/+28
| | | | | efficient private copies of the variable and value lists, so we can operate on them without any special shimmer defense coding schemes.
* * generic/tclCmdAH.c (Tcl_ForeachObjCmd): Removed surplus copyingdgp2007-02-261-33/+6
| | | | | of the objv array that used to be a workaround for Bug 404865. That bug is long fixed.
* Function header/whitespace police/general format fixesdkf2007-02-061-121/+147
|
* * generic/tclBasic.c: TIP #280 implementation.andreas_kupries2006-11-281-8/+20
| | | | | | | | | | | | | | | | | | | | | * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclProc.c: * tests/compile.test: * tests/info.test: * tests/platform.test: * tests/safe.test:
* TIP#270 IMPLEMENTATIONdgp2006-11-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tcl.decls: New public routines Tcl_ObjPrintf, * generic/tclStringObj.c: Tcl_AppendObjToErrorInfo, Tcl_Format, * generic/tclInt.h: Tcl_AppendLimitedToObj, Tcl_AppendFormatToObj and Tcl_AppendPrintfToObj. Former internal versions removed. * generic/tclDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclBasic.c: Updated callers. * generic/tclCkalloc.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStrToD.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c:
* * generic/tclCmdAH.c: Further revisions to produce the routinesdgp2006-11-021-7/+3
| | | | | | * generic/tclInt.h: TclFormat() and TclAppendFormatToObj() that * generic/tclNamesp.c: accept (objc, objv) arguments rather than * generic/tclStringObj.c: any varargs stuff.
* * generic/tclBasic.c: Further revised TclAppendPrintToObj() anddgp2006-11-021-8/+7
| | | | | | | | | | | | | | | | | | | | | * generic/tclCkalloc.c: TclObjPrintf() routines to panic when unable * generic/tclCmdAH.c: to complete their formatting operations, rather * generic/tclCmdIL.c: than report an error message. This means an * generic/tclCmdMZ.c: interp argument for error message recording is * generic/tclDictObj.c: no longer needed, further simplifying the * generic/tclExecute.c: interface for callers. * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclParseExpr.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStringObj.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c: