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: removed debugging lineMiguel Sofer2005-03-101-2/+1
|
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp):dgp2004-10-181-47/+56
| | | | | | | | | | | | * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclCmdMZ.c (TclMergeReturnOptions,TclProcessReturn): * generic/tclCompCmds.c (TclCompileReturnCmd): * generic/tclExecute.c (TclCompEvalObj): * generic/tclInt.h (Interp): * generic/tclProc.c (TclUpdateReturnInfo): Place primary storage of the -level and -code information in private fields of the Interp struct, rather than in a DictObj. This should significantly improve performance of TclUpdateReturnInfo.
* Report compilation errors at runtime, [Patch 103368] by dgp.Miguel Sofer2004-09-261-450/+119
|
* * generic/tclCompCmds.c: Tolerate [append] syntax errorsdgp2004-09-221-6/+2
| | | | | * tests/appendComp.test (8.1): at compile time, and allow runtime to raise the error (or succeed if a redefined [append] allows).
* Fix for my bozo-ness. [Bug 898910]dkf2004-02-171-2/+2
|
* Minor comment improvementsdkf2004-01-201-5/+6
|
* Full bytecode compilation for [lassign]dkf2004-01-181-1/+121
|
* Patch 876451: restores performance of [return]. Also allows formsdgp2004-01-131-57/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | such as [return -code error $msg] to be bytecompiled. * generic/tclInt.h: Factored Tcl_ReturnObjCmd() into two pieces: * generic/tclCmdMZ.c: TclMergeReturnOptions(), which can parse the options to [return], check their validity, and create the corresponding return options dictionary, and TclProcessReturn(), which takes that return options dictionary and performs the [return] operation. * generic/tclCompCmds.c: Rewrote TclCompileReturnCmd() to call TclMergeReturnOptions() at compile time so the return options dictionary is computed at compile time (when it is fully known). The dictionary is pushed on the stack along with the result, and the code and level values are included in the bytecode as operands. Also supports optimized compilation of un-[catch]ed [return]s from procs with default options into the INST_DONE instruction. * generic/tclExecute.c: Rewrote INST_RETURN instruction to retrieve the code and level operands, pop the return options from the stack, and call TclProcessReturn() to perform the [return] operation. * generic/tclCompile.h: New utilities include TclEmitInt4 macro * generic/tclCompile.c: and TclWordKnownAtCompileTime().
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-4/+4
| | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]
* Whitespace policedkf2003-10-301-103/+96
|
* * 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/tclBasic.c: Implementation of TIP 90, whichdgp2003-05-051-5/+6
| | | | | | | | | | | | | | | | * generic/tclCmdAH.c: extends the [catch] and [return] * generic/tclCompCmds.c: commands to enable creation of a * generic/tclExecute.c: proc that is a replacement for * generic/tclInt.h: [return]. [Patch 531640] * generic/tclProc.c: * generic/tclResult.c: * tests/cmdAH.test: * tests/cmdMZ.test: * tests/error.test: * tests/proc-old.test: * library/tcltest/tcltest.tcl: The -returnCodes option to [test] failed to recognize the symbolic name "ok" for return code 0.
* corrected comment about the default matching mode for [switch].dgp2003-05-011-3/+4
|
* Default mode of operation of [switch] is exact matching. [Bug 727563]dkf2003-04-281-2/+2
|
* * generic/tclCompCmds.c (TclCompileIfCmd): Corrected string limits ofdgp2003-04-071-4/+4
| | | | arguments interpolated in error messages. [Bug 711371]
* * generic/tclCompCmds.c (TclCompileReturnCmd): Now that [return]dgp2003-04-031-9/+1
| | | | compiles to INST_RETURN, it is safe to compile even outside a proc.
* Stopped some GCC possibly-uninit-variable warnings.dkf2003-03-201-3/+3
|
* * generic/tclCompCmds.c (TclCompileReturnCmd): Alternative fix fordgp2003-03-191-20/+3
| | | | | | | * generic/tclCompile.c (INST_RETURN): [Bug 633204] that uses a new * generic/tclCompile.h (INST_RETURN): bytecode INST_RETURN to * generic/tclExecute.c (INST_RETURN): properly bytecode the [return] command to something that returns TCL_RETURN.
* * generic/tclBasic.c (Tcl_EvalTokensStandard):dgp2003-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCmdMZ.c (Tcl_SubstObj): * generic/tclCompCmds.c (TclCompileSwitchCmd): * generic/tclCompExpr.c (CompileSubExpr): * generic/tclCompile.c (TclSetByteCodeFromAny,TclCompileScript, TclCompileTokens,TclCompileCmdWord): * generic/tclCompile.h (TclCompileScript): * generic/tclExecute.c (TclCompEvalObj): * generic/tclInt.h (Interp,TCL_BRACKET_TERM,TclSubstTokens): * generic/tclParse.c (ParseTokens,Tcl_SubstObj,TclSubstTokens): * tests/subst.test (2.4, 8.7, 8.8, 11.4, 11.5): Substantial refactoring of Tcl_SubstObj to make use of the same parsing and substitution procedures as normal script evaluation. Tcl_SubstObj() moved to tclParse.c. New routine TclSubstTokens() created in tclParse.c which implements all substantial functioning of Tcl_EvalTokensStandard(). TclCompileScript() loses its "nested" argument, the Tcl_Interp struct loses its termOffset field and the TCL_BRACKET_TERM flag in the evalFlags field, all of which were only used (indirectly) by Tcl_SubstObj(). Tests subst-8.7,8.8,11.4,11.5 modified to accomodate the only behavior change: reporting of parse errors now takes precedence over [return] and [continue] exceptions. All other behavior should
* Replaced a non-portable 'bzero' with a portable 'memset'. [Bug 698442].Kevin B Kenny2003-03-061-2/+2
|
* The [switch] command is now bytecode compiled, at least in the most commondkf2003-03-051-19/+401
| | | | | case. There's room for improvement in the future, of course. [Patch #644819] Also adds another macro to help with jump offset fixups.
* * 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]