summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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