summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclCompCmds.c (TclCompileIncrCmd): Corrected checksdgp2005-03-181-15/+11
| | | | | for immediate operand usage to permit leading space and sign characters. [Bug 1165671]
* * generic/tclCompCmds.c (TclCompileIfCmd): Prior fix of Bug 711371dgp2003-07-151-3/+6
| | | | on 2003-04-07 introduced a buffer overflow. Corrected. [Bug 771613]
* * generic/tclCompCmds.c (TclCompileIfCmd): Corrected string limits ofdgp2003-04-071-4/+4
| | | | arguments interpolated in error messages. [Bug 711371]
* * generic/tclCompCmds.c (TclCompileIncrCmd):mdejong2003-02-071-5/+1
| | | | | | | | | | | * tests/incr.test: Don't include the text "(increment expression)" in the errorInfo generated by the compiled version of the incr command since it does not match the message generated by the non-compiled version of incr. It is also not possible to match this error output under Jacl, which does not support a compiler.
* * generic/tclCompCmds.c: Removed an unused variable that caused Kevin B Kenny2003-02-011-13/+2
| | | | compiler warnings on SGI. [Bug 664379]
* * generic/tclCompCmds.c (TclCompilerReturnCmd): Corrected off-by-onedgp2003-01-091-5/+8
| | | | problem with recent commit. [Bug 633204]
* * generic/tclCompCmds.c (TclCompileReturnCmd):dgp2003-01-081-1/+15
| | | | | | | * tests/compile.test: Corrects failure of bytecompiled [catch {return}] to have result TCL_RETURN (not TCL_OK) [Bug 633204]. This patch is a workaround for 8.4.X. A new opcode INST_RETURN is a better long term solution for 8.5 and later.
* * generic/regexpComp.test: added tests 22.*hobbs2002-11-141-32/+45
| | | | | | | * generic/tclCompCmds.c (TclCompileRegexpCmd): add left and right anchoring (^ and $) recognition and check starting or ending .* to extend the number of REs that can be compiled to string match or string equal.
* * generic/tclCompCmds.c (TclCompileRegexpCmd): correct thehobbs2002-09-301-25/+29
| | | | | checking for bad re's that didn't terminate the re string. Resultant compiles were correct, but much slower than necessary.
* 2002-08-26 Miguel Sofer <msofer@users.sourceforge.net>Miguel Sofer2002-08-261-52/+76
| | | | | | * generic/tclCompCmds.c: fix for [Bug 599788] (error in element name causing segfault), reported by Tom Wilkason. Fixed by copying the tokens instead of the source string.
* * doc/CmdCmplt.3: Applied Patch 585105 to fully CONST-ifydgp2002-08-051-154/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/Concat.3: all remaining public interfaces of Tcl. * doc/CrtCommand.3: Notably, the parser no longer writes on * doc/CrtSlave.3: the string it is parsing, so it is no * doc/CrtTrace.3: longer necessary for Tcl_Eval() to be * doc/Eval.3: given a writable string. Also, the * doc/ExprLong.3: refactoring of the Tcl_*Var* routines * doc/LinkVar.3: by Miguel Sofer is included, so that the * doc/ParseCmd.3: "part1" argument for them no longer needs * doc/SetVar.3: to be writable either. * doc/TraceVar.3: * doc/UpVar.3: Compatibility support has been enhanced so * generic/tcl.decls that a #define of USE_NON_CONST will remove * generic/tcl.h all possible source incompatibilities with * generic/tclBasic.c the 8.3 version of the header file(s). * generic/tclCmdMZ.c The new #define of USE_COMPAT_CONST now does * generic/tclCompCmds.c what USE_NON_CONST used to do -- disable * generic/tclCompExpr.c only those new CONST's that introduce * generic/tclCompile.c irreconcilable incompatibilities. * generic/tclCompile.h * generic/tclDecls.h Several bugs are also fixed by this patch. * generic/tclEnv.c [Bugs 584051,580433] [Patches 585105,582429] * generic/tclEvent.c * generic/tclInt.decls * generic/tclInt.h * generic/tclIntDecls.h * generic/tclInterp.c * generic/tclLink.c * generic/tclObj.c * generic/tclParse.c * generic/tclParseExpr.c * generic/tclProc.c * generic/tclTest.c * generic/tclUtf.c * generic/tclUtil.c * generic/tclVar.c * mac/tclMacTest.c * tests/expr-old.test * tests/parseExpr.test * unix/tclUnixTest.c * unix/tclXtTest.c * win/tclWinTest.c
* * generic/tclCompCmds.c (TclCompileCatchCmd): returnMiguel Sofer2002-07-031-7/+2
| | | | | TCL_OUT_LINE_COMPILE instead of TCL_ERROR: let the failure happen at runtime so that it can be caught [Bug 577015].
* optimised read access to local variables created at run-timeMiguel Sofer2002-06-111-126/+7
|
* Fix for [info locals] bug #567386; added compile functions forMiguel Sofer2002-06-111-1/+174
| | | | [global], [upvar] and [variable].
* * generic/tclCompCmds.c (TclCompileStringCmd): removed errorhobbs2002-05-291-7/+1
| | | | creation in code that no longer throws an error.
* bugfix to the bugfix to the new [for] compiled codeMiguel Sofer2002-02-261-3/+5
|
* fixing a bug in last tclCompCmds.c patch, in the code for [for] and [while].Miguel Sofer2002-02-251-21/+25
|
* Optimising [if], [for] and [while] for constant conditionsMiguel Sofer2002-02-221-193/+273
|
* * generic/tclCompCmds.c (TclCompileRegexpCmd): made early checkhobbs2002-02-071-6/+31
| | | | for bad RE to stop checking further.
* * tests/regexpComp.test:hobbs2002-01-301-29/+64
| | | | | * generic/tclCompCmds.c (TclCompileRegexpCmd): enhanced to support -nocase and -- options.
* * tests/regexpComp.test (new):hobbs2002-01-291-18/+132
| | | | | | | | | | | | | * generic/tclInt.h: * generic/tclBasic.c: added TclCompileRegexpCmd entry * generic/tclCompCmds.c (TclCompileStringCmd): corrected to return TCL_OUT_LINE_COMPILE instead of TCL_ERROR for parsing errors, so it only throws the error for runtime compile, in case the user modifies 'string'. (TclCompileRegexpCmd): first try at a byte-compiled regexp command. It handles static strings and ^$ bounded static strings. (TclCompileAppendCmd): made TclPushVarName call always use TCL_CREATE_VAR as numWords is always > 2 at that point.
* * Updated interfaces of generic/tclEncoding, generic/tclFilename.c,dgp2002-01-251-8/+8
| | | | | | | | | | | generic/tclIOUtil.c, generic/tclPipe.c, generic/tclResult.c, generic/tclUtil.c, generic/tclVar.c and mac/tclMacResource.c according to TIP 27. Tcl_TranslateFileName rewritten as wrapper around VFS-aware version. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes source incompatibilities: argv arguments of Tcl_Concat, Tcl_JoinPath, Tcl_OpenCommandChannel, Tcl_Merge; argvPtr arguments of Tcl_SplitList and Tcl_SplitPath.
* * More TIP 27 updates in tclIOUtil.c and tclIndexObj.c that weredgp2002-01-171-2/+2
| | | | | | | overlooked before. Updated callers. ***POTENTIAL INCOMPATIBILITY*** Includes a source incompatibility in the tablePtr arguments of the Tcl_GetIndexFromObj* routines.
* small change in bytecode instructionsINST_LIST_INDEX_MULTI and INST_LSET_FLATMiguel Sofer2001-12-111-11/+3
|
* removed overestimates of necessary stack depth for bytecodes in theMiguel Sofer2001-12-111-2/+9
| | | | fix for [Bug 483611].
* fixed the calculation of the maximal stack depth required by bytecodes [Bug ↵Miguel Sofer2001-12-101-234/+53
| | | | 483611].
* patch for [Bug 483309]Miguel Sofer2001-11-191-1/+2
|
* Reference implementation of TIP's #22, #33 and #45. Adds thehobbs2001-11-141-15/+293
| | | | | | ability of the [lindex] command to have multiple index arguments, and adds the [lset] command. Both commands are byte-code compiled. [Patch #471874] (work by Kenny, commited by Hobbs)
* * generic/tclCompCmds.c (TclCompileStringCmd): INST_STR_MATCH -hobbs2001-09-191-15/+75
| | | | | | | | | | | Updated to Int1 instruction type and added special case to use INST_STR_EQ instead when no glob chars are specified in a static string. * tests/{for.test,foreach.test,if.test,while.test}: * generic/tclCompCmds.c (TclCompileForCmd, TclCompileForeachCmd, TclCompileIfCmd, TclCompileWhileCmd): Corrected the overaggressive compiling of loop bodies enclosed in ""s. [Bug #219166] (msofer)
* * generic/tcl.h: added TclCompileListCmd headerhobbs2001-09-011-2/+84
| | | | | | | | * generic/tclBasic.c: added TclCompileListCmd compile proc * generic/tclCompCmds.c (TclCompileListCmd): function to compile the 'list' command at parse time. * generic/tclExecute.c (TclExecuteByteCode): definition of INST_LIST bytecode.
* * generic/tclCompCmds.c (TclPushVarName): noted 'static' defn.hobbs2001-08-281-2/+2
| | | | [Bug #453872]
* * tests/stringComp.test: added string-1.3hobbs2001-08-251-2/+3
| | | | | | | * generic/tclCompCmds.c (TclCompileStringCmd): changed to return TCL_OUT_LINE_COMPILE instead of TCL_ERROR when compiling and an unknown string method is called. This is necessary as the string command may be never called, or not until 'string' is redefined.
* Fixed overagressive compilation of [catch], [Bug #219184]Miguel Sofer2001-08-221-4/+21
|
* * generic/tclCompCmds.c (TclCompileStringCmd): fixed mem leak whenhobbs2001-06-281-1/+2
| | | | string command failed to parse the subcommand.
* * generic/tclBasic.c: added new CompileProc invocations to basichobbs2001-05-171-306/+694
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command initialization. * generic/tclCompCmds.c: added new compile commands for append, lappend, lindex and llength. Refactored set and incr compile commands to use new TclPushVarName function for handling the varname component during compilation (also used by append and lappend). Changed string compile command to compile toplevel code as well (when possible). * generic/tclCompile.c: added new instruction enums * generic/tclCompile.h: added debug info for new instructions * generic/tclExecute.c (TclExecuteByteCode): moved elemPtr to toplevel var (oft-used). Added definitions for new bytecode instructions INST_LIST_INDEX, INST_LIST_LENGTH, INST_APPEND_SCALAR1, INST_APPEND_SCALAR4, INST_APPEND_ARRAY1, INST_APPEND_ARRAY4, INST_APPEND_ARRAY_STK, INST_APPEND_STK, INST_LAPPEND_SCALAR1, INST_LAPPEND_SCALAR4, INST_LAPPEND_ARRAY1, INST_LAPPEND_ARRAY4, INST_LAPPEND_ARRAY_STK, INST_LAPPEND_STK. Refactored repititious code for reuse with INST_LOAD_STK (same as INST_LOAD_SCALAR_STK), INST_STORE_STK (same as INST_STORE_SCALAR_STK). Updated INST_STR_CMP with style of fix of 2001-04-06 Fellows [Bug #219201] as that fix only affected the runtime eval'ed "string" (string compare is normally byte-compiled now). We may want to back these out for speed in the future, noting the problems with \x00 comparisons in the docs. * generic/tclInt.h: declarations for new compile commands. * generic/tclVar.c: change TclGetIndexedScalar, TclGetElementOfIndexedArray, TclSetElementOfIndexedArray and TclSetIndexedScalar to use flags. The Set functions now support TCL_APPEND_ELEMENT and TCL_LIST_ELEMENT as well. * generic/tclInt.decls: * generic/tclIntDecls.h: minor signature changes for above.
* * generic/tclCompExpr.c: changed INST_STREQ -> INST_STR_EQ,hobbs2000-05-261-37/+120
| | | | | | | | | | | | | | | INST_STRNEQ -> INST_STR_NEQ * generic/tclCompile.c: added streq, strneq, strcmp, strlen & strmatch to the compiled stats instructionTable * generic/tclCompile.h: added instructions INST_STR_CMP, INST_STR_INDEX, INST_STR_MATCH * generic/tclCompCmds.c: added byte compiler support for [string compare|match|index]. * generic/tclExecute.c: Changed INST_STR_(N)EQ to return an Int object and not bother trying to reuse the top stack object. Added INST_STR_CMP, INST_STR_INDEX, INST_STR_MATCH bytecode ops. Extended evalstats output info with Tcl_IsShared stat info.
* * generic/tclInt.h: Added function prototypes forericm2000-05-231-1/+280
| | | | | | | | | | | | | | | | | | | | | | TclCompileStringCmd and TclCompileReturnCmd. * generic/tclCompile.h: Added definition of INST_STRLEN opcode and updated LAST_INST_OPCODE value. * generic/tclBasic.c: Added information about TclCompileStringCmd and TclCompileReturnCmd to BuiltInCmds table. * generic/tclExecute.c (TclExecuteByteCode): Added support for the INST_STRLEN opcode. * generic/tclCompCmds.c (TclCompileStringCmd): Basic implementation of byte-compiled [string] command. Not all subcommands are implemented; those that are not an out-line compiled. (TclCompileReturnCmd): Byte-compiled implementation of [return] command. Only "simple" returns are byte-compiled; in particular, if the -code, -errorinfo or -errorcode flags are used, the command is not byte-compiled.
* * generic/tclCmdIL.c (InfoBodyCmd): made [info body] return ahobbs2000-01-211-12/+36
| | | | | | | | | | | string if the body has been bytecompiled. * generic/tclBasic.c (Tcl_EvalObjEx): added pedantic check for originating proc body of bytecompiled code, #def'd out as the change for [info body] should make it unnecessary * tests/set.test: added test for complex array elem name compiling * generic/tclCompCmds.c (TclCompileSetCmd): Fixed parsing of array elements during compiling, and slightly optimised same [Bug: 3889]
* * generic/tclStringObj.c: fixed Tcl_AppendResultVA so it onlyhobbs1999-10-291-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | iterates once over the va_list (avoiding a memcpy of it, which is not portable). * generic/tclEnv.c: fixed possible ABR error in environ array * tests/scan.test: * generic/tclScan.c: added support for use of inline scan, XPG3 currently not included * tests/incr.test: * tests/set.test: * generic/tclCompCmds.c: fixed improper bytecode handling of 'eval {set array($unknownvar) 5}' (also for incr) * win/tclWinTest.c: added testvolumetype command, as atime is completely ignored for Windows FAT file systems * win/tclWinPort.h: added sys/utime.h to includes * unix/tclUnixPort.h: added utime.h to includes * doc/file.n: * tests/cmdAH.test: * generic/tclCmdAH.c: added time arguments to atime and mtime file command methods (support 'touch' functionality)
* 1999-08-18 Jeff Hobbs <hobbs@scriptics.com>hobbs1999-08-191-2/+2
| | | | | | | | | | | | | | * doc/OpenFileChnl.3: * doc/file.n: * tests/cmdAH.test: * tclIO.c: * tclCmdAH.c: added "file channels ?pattern?" tcl command, with associated Tcl_GetChannelNames and Tcl_GetChannelNamesEx public C APIs (added to tcl.decls as well), with docs and tests. * generic/tclCompile.c: add TCL_TOKEN_VARIABLE to the part types that cause differed compilation for exprs, to correct the expr double-evaluation problem for vars. Added test cases.
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-0/+1980