summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix [Bug 1382528]; thanks to Anton Kovalenko for finding this.dkf2005-12-181-13/+16
|
* New TEBC opcode, INST_JUMP_TABLE, for compiling the simple (and common) case ofdkf2005-11-301-1/+237
| | | | | [switch] into a jump-table. Much faster for long switches. Also compiler support for generating the new instruction where appropriate.
* ANSIfy; generic/*.c now all done except for test codedkf2005-11-021-168/+178
|
* * generic/tclClock.c: Removed some dead code.dgp2005-10-191-42/+9
| | | | | | | | | | | | * generic/tclCmdIL.c: * generic/tclCompCmds.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclLiteral.c: * generic/tclParseExpr.c: * generic/tclScan.c: * generic/tclUtil.c: * generic/tclVar.c:
* * generic/tclCompCmds.c: New convenience macro CompileTokens().Miguel Sofer2005-10-101-16/+20
|
* TIP#237 IMPLEMENTATIONdgp2005-10-081-4/+12
| | | | | | [kennykb-numerics-branch] Resynchronized with the HEAD; at this checkpoint [-rkennykb-numerics-branch-20051008], the HEAD and kennykb-numerics-branch contain identical code.
* Compiler for [dict] and related changes.dkf2005-07-211-54/+588
|
* copy/paste/fail-to-modify error in comment.dgp2005-07-131-2/+2
|
* typosdkf2005-06-201-2/+2
|
* Add compilation for TIP#90-style [catch] requiring a new opcode [Bug1219112]dkf2005-06-201-27/+71
|
* Update error case handling following Mo's updates (which are a good thing)dkf2005-06-201-17/+22
|
* D'oh!dkf2005-06-121-2/+2
|
* Simplify command compilation by moving numerous common stanzas into macros ↵dkf2005-06-121-863/+887
| | | | | | so that things say what they do instead of relying on the code-writer knowing all the basic ropes. Also cleaned up the whitespace/style of the code
* Implementation of TIP#241 from Joe Mistachkindkf2005-06-011-31/+45
| | | | Also compilation of [switch -glob -nocase] from Donal Fellows
* Increase efficiency of [lindex] compilationdkf2005-06-011-3/+32
|
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-1/+1
|
* * generic/tclInt.decls: Converted TclMatchIsTrivial to a macro.dgp2005-05-051-10/+5
| | | | | | | | | | | | | | * generic/tclInt.h: * generic/tclUtil.c: * generic/tclIntDecls.h: `make genstubs` * generic/tclStubInit.c: * generic/tclBasic.c: Added callers of TclMatchIsTrivial where * generic/tclCmdIL.c: a search can be done more efficiently * generic/tclCompCmds.c:when it is recognized that a pattern match * generic/tclDictObj.c: is really an exact match. [Patch 1076088] * generic/tclIO.c: * generic/tclNamesp.c: * generic/tclVar.c:
* * generic/tclCompCmds.c: Factored common efficiency trick intodgp2005-05-051-91/+32
| | | | a macro named CompileWord.
* * generic/tclCompCmds.c: Replaced all instance ofdgp2005-05-051-90/+90
| | | | | | | | * generic/tclCompile.c: TCL_OUT_LINE_COMPILE with TCL_ERROR. * generic/tclInt.h: Now that we've eradicated the mistaken * tests/appendComp.test: notion of a "compile-time error", we can use the TCL_ERROR return code to signal any failure to produce bytecode.
* The 2005-04-21 changes to Tcl_GetBooleanFromObj were done to bringdgp2005-04-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | it into agreement with its docs. Further investigation reveals it was the docs that were incorrect. * doc/BoolObj.3: Corrections to the documentation of Tcl_GetBooleanFromObj to bring it into agreement with what this public interface has always done, including noting the difference in function between Tcl_GetBooleanFromObj and Tcl_GetBoolean. * generic/tclGet.c: Revised Tcl_GetBoolean to no longer be a wrapper around Tcl_GetBooleanFromObj (different function!). * generic/tclObj.c: Removed TclGetTruthValueFromObj routine that was added yesterday. Revisions so that only Tcl_GetBoolean-approved values get the "boolean" Tcl_ObjType. This retains the fix for [Bug 1187123]. * generic/tclInt.h: Revert most recent change. * generic/tclBasic.c: * generic/tclCompCmds.c: * generic/tclDictObj.c: * generic/tclExecute.c: * tests/obj.test:
* * generic/tclBasic.c: Updated callers to call new routine.dgp2005-04-211-3/+3
| | | | * generic/tclCompCmds.c: Updated callers to call new routine.
* Improved [switch] compilation.dkf2005-04-081-122/+189
|
* * 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.