summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdAH.c
Commit message (Collapse)AuthorAgeFilesLines
...
| | * * generic/tcl.h Made changes so that the "wideInt" Tcl_ObjTypedgp2003-04-161-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclObj.c is defined on all platforms, even those where * generic/tclPort.h TCL_WIDE_INT_IS_LONG is defined. Also made the Tcl_Value struct have a wideValue field on all platforms. This is a ***POTENTIAL INCOMPATIBILITY*** for TCL_WIDE_INT_IS_LONG platforms because that struct changes size. This is the same TIP 72 incompatibility that was seen on other platforms at the 8.4.0 release, when this change should have happened as well. [Bug 713562] * generic/tclInt.h: New internal macros TclGetWide() and TclGetLongFromWide() to deal with both forms of the "wideInt" Tcl_ObjType, so that conditional TCL_WIDE_INT_IS_LONG code is confined to the header file. * generic/tclCmdAH.c: Replaced most coding that was conditional * generic/tclCmdIL.c: on TCL_WIDE_INT_IS_LONG with code that * generic/tclExecute.c: works across platforms, sometimes using * generic/tclTest.c: the new macros above to do it. * generic/tclUtil.c: * generic/tclVar.c:
| | * Use correct test for the empty string in Tcl_ErrorObjCmddkf2003-04-081-2/+2
| | |
| | * Made format less keen on converting numeric types. [Bug #699060]dkf2003-03-141-9/+42
| | |
| | * Backport of fix for 698146 to remove assumption that time_t is a long...dkf2003-03-141-7/+9
| | |
| | * * generic/tclCmdAH.c (Tcl_FormatObjCmd): Only add the modifierdkf2003-03-141-149/+159
| | | | | | | | | | | | | | | | | | that indicates we've got a wide int when we're formatting in an integer style. Stops some libc's from going mad. [Bug #702622] Also tidied whitespace.
| * | * 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.
| * | [Bug 942170]: Detect the st_blocks field of 'struct stat' correctly.dkf2009-12-281-8/+11
| | |
| * | * generic/tclBasic.c: Extended the existing TIP #280 system (infoandreas_kupries2008-07-211-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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:
* | | Fix gcc -Wextra warning: missing initializernijtmans2010-12-101-37/+37
| | |
* | | * generic/tclCmdAH.c (TclInitFileCmd, TclMakeFileCommandSafe, ...):dkf2010-12-091-665/+1120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Break up [file] into an ensemble. Note that the ensemble is safe in itself, but the majority of its subcommands are not. * generic/tclFCmd.c (FileCopyRename,TclFileDeleteCmd,TclFileAttrsCmd) (TclFileMakeDirsCmd): Adjust these subcommand implementations to work inside an ensemble. (TclFileLinkCmd, TclFileReadLinkCmd, TclFileTemporaryCmd): Move these subcommand implementations from tclCmdAH.c, where they didn't really belong. * generic/tclIOCmd.c (TclChannelNamesCmd): Move to more appropriate source file. * generic/tclEnsemble.c (TclMakeEnsemble): Start of code to make partially-safe ensembles. Currently does not function as expected due to various shortcomings in how safe interpreters are constructed. * tests/cmdAH.test, tests/fCmd.test, tests/interp.test: Test updates to take into account systematization of error messages.
* | | * 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)