summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
Commit message (Collapse)AuthorAgeFilesLines
* Factor out a number of common patterns of use of Tcl_DStringAppend.dkf2012-07-031-2/+2
|
* * generic/tclCompCmds.c (TclCompileLreplaceCmd): Added a compilationdkf2012-02-151-0/+124
| | | | strategy for [lreplace] that tackles the cases which are equivalent to a static [lrange].
* * generic/tclCompCmds.c (TclCompileLrangeCmd): Add compiler fordkf2012-02-151-3/+110
| | | | | | [lrange] with constant indices so we can take advantage of existing TCL_LIST_RANGE_IMM opcode. (TclCompileLindexCmd): Improve coverage of constant-index-style compliation using technique developed for [lrange] above.
* * generic/tclCompCmds.c (TclCompileDictForCmd): [Bug 3487626]: Fixdkf2012-02-151-1/+2
|\ | | | | | | crash in compilation of [dict for] when its implementation command is used directly rather than through the ensemble.
| * * generic/tclCompCmds.c (TclCompileDictForCmd): [Bug 3487626]: Fixdkf2012-02-151-1/+2
| | | | | | | | crash in compilation of [dict for] when its implementation command is used directly rather than through the ensemble.
| * 3485022 Disable ensemble subcommand compile inside a Tcl_Create*Trace().dgp2012-02-061-1/+2
| |
| * 3485022 TclCompileEnsemble() avoid compile when exec traces set.dgp2012-02-061-1/+2
| |\
| * | Drop old code.dgp_switch_compiledgp2011-05-021-155/+2
| | |
| * | Revised TclFindElement() interface.dgp2011-05-021-14/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The final argument had been bracePtr, the address of a boolean var, where the caller can be told whether or not the parsed list element was enclosed in braces. In practice, no callers really care about that. What the callers really want to know is whether the list element value exists as a literal substring of the string being parsed, or whether a call to TclCopyAndCollpase() is needed to produce the list element value. Now the final argument is changed to do what callers actually need. This is a better fit for the calls in tclParse.c, where now a good deal of post-processing checking for "naked backslashes" is no longer necessary. ***POTENTIAL INCOMPATIBILITY*** For any callers calling in via the internal stubs table who really do use the final argument explicitly to check for the enclosing brace scenario. Simply looking for the braces where they must be is the revision available to those callers, and it will backport cleanly. New TclFindElement() is also a better fit for the [switch] compiler.
| * \ \ Replace TclCountSpaceRuns() with TclMaxListLength() which is the function wedgp2011-05-021-13/+2
| |\ \ \ | | |/ / | | | | actually want.
| * | | Tighten up the patch.dgp2011-05-021-13/+16
| | | |
| * | | Rewrite of parts of the [switch] compiler to better use the powers ofdgp2011-04-281-3/+104
| |/ / | | | | | | TclFindElement() and do less parsing on its own. Needs review and testing.
* | | Minor: make comments accurate in [catch] compiler.dkf2012-01-301-22/+22
| | |
* | | * generic/tclCompCmds.c (TclCompileCatchCmd): Added a more efficientdkf2012-01-301-1/+29
| | | | | | | | | | | | bytecode generator for the case where 'catch' is used without any variable arguments; don't capture the result just to discard it.
* | | * generic/tclCompCmds.c (TclCompileDictWithCmd): Corrected handling ofdkf2011-10-091-303/+312
| | | | | | | | | | | | qualified names, and added spacial cases for empty bodies (used when [dict with] is just used for extracting variables).
* | | Added support for having the dict var itself referenced by LVT index.dkf2011-10-031-14/+55
| | |
* | | Experimental compilation of the [dict with] subcommand. No tests yet, and notdkf2011-10-021-0/+179
| | | | | | | | | | | | yet certain that the added bytecode opcodes are correct; evaluation is still needed (but the test suite does pass...)
* | | [Bug 3386417] avoid a reference loop between the bytecode and its companion ↵ferrieux2011-08-091-1/+1
| | | | | | | | | | | | errostack when compiling a syntax error.
* | | Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts indkf2011-03-121-19/+18
| | | | | | | | | rest of Tcl source code. No ABI change. API change *should* be harmless.
* | | Turn namespace into an ensemble. Not yet on trunk because of some mysterious ↵dkf2011-03-091-16/+7
| | | | | | | | | | | | failures that need resolving...
* | | Now that we're no longer using SCM based on RCS, the RCS Keyword linesdgp2011-03-021-2/+0
|\ \ \ | |/ / | | | cause more harm than good. Purged them (except in zlib files).
| * | Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-021-2/+0
| |\ \ | | |/ | | | more harm than good. Purged them.
| | * Now that we're no longer using SCM based on RCS, the RCS Keyword lines causedgp2011-03-011-2/+0
| | | | | | | | | more harm than good. Purged them.
| | * * generic/tclCompCmds.c: [Bug 2881263] (TclCompileForeachCmd,andreas_kupries2009-10-231-3/+4
| | | | | | | | | | | | | | | | | | TclCompileLindexCmd): Fixed. Moved the use of DefineLineInformation after all regular variable declarations, so that an empty statement (-UTIP_280) doesn't confuse c89 compilers.
| | * * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-265/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EvalTokensStandard, Tcl_EvalEx, EvalEx, TclAdvanceContinuations, TclEvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, ListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript): * generic/tclCompile.h (CompileEnv): * generic/tclInt.h (ContLineLoc, Interp): * generic/tclObj.c (ThreadSpecificData, ContLineLocFree, TclThreadFinalizeObjects, TclInitObjSubsystem, TclContinuationsEnter, TclContinuationsEnterDerived, TclContinuationsCopy, TclContinuationsGet, TclFreeObj): * generic/tclProc.c (TclCreateProc): * generic/tclVar.c (TclPtrSetVar): * tests/info.test (info-30.0-22): Extended parser, compiler, and execution with code and attendant data structures tracking the positions of continuation lines which are not visible in script's, to properly account for them while counting lines for #280, during direct and compiled execution.
| | * * generic/tclBasic.c: Extended the existing TIP #280 system (infoandreas_kupries2008-07-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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:
| | * D'oh! Used an 8.5-ism...dkf2007-03-011-2/+2
| | |
| | * Fix [Bug 1671138]dkf2007-03-011-1/+13
| | |
| | * * generic/tclBasic.c: TIP #280 implementation, conditional on the define ↵andreas_kupries2006-11-281-3/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCL_TIP280. * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclProc.c: * tests/compile.test: * tests/info.test: * tests/platform.test: * tests/safe.test:
| | * * 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]
| * | Various mismatches between Tcl_Panic format string and its arguments,nijtmans2011-01-181-7/+7
| | | | | | | | | | | | discovered thanks to [Bug 3159920]
| * | Backport dgp's fixes to comments and ChangeLog entryKevin B Kenny2010-11-051-2/+2
| | |
| * | * generic/tclCompCmds.c (TclCompileCatchCmd):Kevin B Kenny2010-11-031-70/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/compile.test (compile-3,6): Reworked the compilation of the [catch] command so as to avoid placing any code that might throw an exception (specifically, any initial substitutions or any stores to result or options variables) between the BEGIN_CATCH and END_CATCH but outside the exception range. Added a test case that panics on a stack smash if the change is not made. [Bug #3098302]
| * | * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-46/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EvalTokensStandard, Tcl_EvalEx, EvalEx, TclAdvanceContinuations, TclEvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, TclListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript): * generic/tclCompile.h (CompileEnv): * generic/tclInt.h (ContLineLoc, Interp): * generic/tclObj.c (ThreadSpecificData, ContLineLocFree, TclThreadFinalizeObjects, TclInitObjSubsystem, TclContinuationsEnter, TclContinuationsEnterDerived, TclContinuationsCopy, TclContinuationsGet, TclFreeObj): * generic/tclParse.c (TclSubstTokens, Tcl_SubstObj): * generic/tclProc.c (TclCreateProc): * generic/tclVar.c (TclPtrSetVar): * tests/info.test (info-30.0-24): Extended parser, compiler, and execution with code and attendant data structures tracking the positions of continuation lines which are not visible in script Tcl_Obj*'s, to properly account for them while counting lines for #280.
| * | Fix off-by-one error that caused crashes. Backport from HEAD.dkf2008-05-071-2/+2
| | |
* | | Various mismatches between Tcl_Panic format string and its arguments,nijtmans2011-01-181-3/+3
| | | | | | | | | | | | discovered thanks to [Bug 3159920]
* | | Correct typo and mistaken comment.dgp2010-11-041-2/+2
| | |
* | | * generic/tclCompCmds.c (TclCompileCatchCmd):Kevin B Kenny2010-11-031-67/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/compile.test (compile-3,6): Reworked the compilation of the [catch] command so as to avoid placing any code that might throw an exception (specifically, any initial substitutions or any stores to result or options variables) between the BEGIN_CATCH and END_CATCH but outside the exception range. Added a test case that panics on a stack smash if the change is not made. [Bug #3098302]
* | | [Patch 2995655] Report inner contexts in [info errorstack]ferrieux2010-10-201-1/+2
| | |
* | | * generic/tclCompCmds.c (TclCompileDictForCmd): Update the compilationdkf2010-10-201-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclCompile.c (tclInstructionTable): of [dict for] so that * generic/tclExecute.c (TEBCresume): it no longer makes any use of INST_DICT_DONE now that's not needed, and make it clearer in the implementation of the instruction that it's just a deprecated form of unset operation. Followup to my commit of 2010-10-16.
* | | * generic/tclCompCmds.c (TclCompileVariableCmd): Slightly tighterdkf2010-04-301-2/+8
| | | | | | | | | | | | issuing of instructions.
* | | Code Audit results:dkf2010-03-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | Split tclCompCmds.c into two pieces to improve developer sanity.dkf2010-02-261-3541/+375
| | |
* | | Correct silly error with missing semicolonsdkf2010-02-251-3/+3
| | |
* | | Remove unnecessary EXTERN's, which alreadynijtmans2010-02-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | are in the global stub table. Use @EXEEXT@ in stead of @EXT_SUFFIX@ Use -DBUILD_tcl in Makefile for CYGWIN Use EXTERN to control CYGWIN exported symbols Remove some unnecessary type casts.
* | | Make [string length] compiler handle more trivial cases.dkf2010-02-201-108/+105
| | |
* | | Fix error in stack depth calculation for [dict update], correct misleadingdkf2010-02-171-1/+4
| | | | | | | | | | | | comment in description of opcode.
* | | Hive off the ensemble code into its own file.dkf2010-02-131-683/+364
| | | | | | | | | | | | Split the [switch] compiler for sanity's sake.