summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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
|
* Correct the handling of stack space calculation (the jump pattern used wasdkf2008-03-161-4/+5
| | | | confusing the simple-minded code doing the calculations). [Bug 1903325]
* * generic/tclCompCmds.c (TclCompileReturnCmd): The 2007-10-18 commitdgp2008-02-281-1/+2
| | | | | to optimize compiled [return -level 0 $x] [RFE 1794073] introduced a memory leak of the return options dictionary. Fixing that.
* Fix [Bug 1891827]dkf2008-02-121-5/+9
|
* * generic/tclInt.h: New macro TclGrowParseTokenArray() todgp2008-01-231-19/+16
| | | | | | | | | | | | | | * generic/tclCompCmds.c: simplify code that might need to grow * generic/tclCompExpr.c: an array of Tcl_Tokens in the parsePtr * generic/tclParse.c: field of a Tcl_Parse. Replaces the TclExpandTokenArray() routine via replacing: int needed = parsePtr->numTokens + growth; while (needed > parsePtr->tokensAvailable) { TclExpandTokenArray(parsePtr); } with: TclGrowParseTokenArray(parsePtr, growth); This revision merged over from dgp-refactor branch.
* * generic/tclCompCmds.c (TclCompileRegexpCmd): TCL_REG_NOSUB cannothobbs2007-12-231-6/+5
| | | | | * tests/regexp.test (regexp-22.2): be used because it * tests/regexpComp.test: [Bug 1857126] disallows backrefs.
* * generic/tclCompCmds.c (TclCompileSwitchCmd): update switch -regexphobbs2007-12-191-2/+14
| | | | | | * tests/switch.test-14.*: compilation to pass the cflags to INST_REGEXP (changed on 12-07). Added tests for switch -regexp compilation (need more). [Bug 1854399]
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* * generic/tclExecute.c (TclExecuteByteCode INST_REGEXP):hobbs2007-12-071-2/+9
| | | | | * generic/tclCompCmds.c (TclCompileRegexpCmd): Pass correct RE compile flags at compile time, and use TCL_REG_NOSUB.
* Oops!dkf2007-12-061-2/+2
|
* Fix [Bug 1845320] and [Bug 1845397]dkf2007-12-061-8/+11
|
* Make two-arg switch work reliably (and actually as documented!) [Bug 1836519]dkf2007-12-031-14/+29
|
* Fix stack corruption in [dict append] compilerdkf2007-11-241-26/+31
|
* Turn the [string] command into a real compiled ensemble.dkf2007-11-231-152/+237
|
* Rebuild [dict] as a full compiled ensemble.dkf2007-11-221-410/+566
|
* Generalize the ensemble compiler further. Still doesn't precopile rewrites, ↵dkf2007-11-211-50/+138
| | | | | | but now handles many other things making the compiler at least useful.
* Greatly improved ensemble compiler. This one now can handle any ensemble.dkf2007-11-161-68/+287
| | | | | It is usually not enabled though; only worth it when a subcommand is actually expected to undergo bytecode compilation.
* Compile [info exists] into bytecode. Includes new instructions to support it.dkf2007-11-141-1/+147
|
* (TclCompileSwitchCmd): simplify TclReToGlob usage.hobbs2007-11-141-9/+6
|
* * generic/tclCompCmds.c (TclCompileRegexpCmd): clean up comments,hobbs2007-11-141-9/+12
| | | | only free dstring on OK from TclReToGlob.
* Extend [switch] compiler to handle regular expressions as long as things are notdkf2007-11-131-71/+115
| | | | | too complex. Fix [regexp] compiler so that non-trivial literal regexps get fed to INST_REGEXP.
* * generic/tclCompCmds.c, generic/tclCompile.c, generic/tclCompile.h:hobbs2007-11-121-91/+37
| | | | | | | | | * generic/tclExecute.c, generic/tclInt.decls, generic/tclIntDecls.h: * generic/tclRegexp.c, generic/tclRegexp.h: Add INST_REGEXP and fully * generic/tclStubInit.c, generic/tclUtil.c: compiled [regexp] for the * tests/regexpComp.test: [Bug 1830166] simple cases. Also added TclReToGlob function to convert RE to glob patterns and use these in the possible cases.
* [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-7/+7
| | | | objTypes.
* * generic/tclResult.c (TclMergeReturnOptions): Make sure any -codedgp2007-10-181-2/+8
| | | | | | | | values get pulled out of the dictionary, even if they are integer valued. * generic/tclCompCmds.c (TclCompileReturnCmd): Added code to more optimally compile [return -level 0 $x] to "push $x". [RFE 1794073]
* Add a new command, ::tcl::unsupported::disassembledkf2007-09-251-18/+28
|
* * generic/tclCompCmds.c (TclCompileDictCmd-update):Miguel Sofer2007-09-111-17/+33
| | | | | | * generic/tclCompile.c (tclInstructionTable): * generic/tclExecute.c (INST_DICT_UPDATE_END): fix stack management in [dict update] [Bug 1786481].
* * generic/tclCompCmds.c: Use the new INST_REVERSE instructiondgp2007-09-091-59/+48
| | | | | | | | | * tests/mathop.test: to correct the compiled versions of math operator commands. [Bug 1724437]. * generic/tclCompile.c: New bytecode instruction INST_REVERSE to * generic/tclCompile.h: reverse the order of N items at the top of * generic/tclExecute.c: stack.
* * generic/tclCompCmds.c (TclCompilePowOpCmd): Make a separatedgp2007-09-091-7/+16
| | | | routine to compile ** to account for its different associativity.
* * generic/tclCompExpr.c: Call TclCompileSyntaxError() whendgp2007-08-271-31/+32
| | | | | | | | | | | | | | | | expression syntax errors are found when compiling expressions. With this in place, convert TclCompileExpr to return void, since there's no longer any need to report TCL_ERROR. * generic/tclCompile.c: Update callers. * generic/tclExecute.c: * generic/tclCompCmds.c: New routine TclCompileSyntaxError() * generic/tclCompile.h: to directly compile bytecodes that report a * generic/tclCompile.c: syntax error, rather than (ab)use a call to TclCompileReturnCmd. Also, undo the most recent commit that papered over some issues with that (ab)use. New routine produces a new opcode INST_SYNTAX, which is a minor variation of INST_RETURN_IMM. Also a bit of constification.
* * generic/tclCompCmds.c (TclCompileReturnCmd): Added crash protectiondgp2007-08-231-2/+29
| | | | | to handle callers other than TclCompileScript() failing to meet the initialization assumptions of the TIP 280 code in CompileWord().
* VarReform [Patch 1750051]Miguel Sofer2007-07-311-30/+18
| | | | *** POTENTIAL INCOMPATIBILITY *** (tclInt.h and tclCompile.h)
* 2007-07-11 Miguel Sofer <msofer@users.sf.net>Miguel Sofer2007-07-111-1/+7
| | | | | | | | * generic/tclCompCmds.c (TclCompileWhileCmd): * generic/tclCompile.c (TclCompileScript): Corrected faulty avoidance of INST_START_CMD when the first opcode in a script is within a loop (as produced by 'while 1'), so that the corresponding command is properly counted [Bug 1752146].
* Silence constness warnings for TclStackFree when building with msvc.patthoyts2007-06-281-2/+2
|
* * generic/tclInt.decls: Revised the interfaces of the routinesdgp2007-06-201-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclExecute.c: TclStackAlloc and TclStackFree to make them easier for callers to use (or more precisely, harder to misuse). TclStackFree now takes a (void *) argument which is the pointer intended to be freed. TclStackFree will panic if that's not actually the memory the call will free. TSA/TSF also now tolerate receiving (interp == NULL), in which case they simply fall back to be calls to Tcl_Alloc/Tcl_Free. * generic/tclIntDecls.h: make genstubs * generic/tclBasic.c: Updated callers * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclFCmd.c: * generic/tclFileName.c: * generic/tclIOCmd.c: * generic/tclIndexObj.c: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclProc.c: * generic/tclTrace.c: * unix/tclUnixPipe.c:
* * generic/tclCompCmds.c: Simplified [variable] compiler andMiguel Sofer2007-06-151-11/+2
| | | | | * generic/tclExecute.c: executor. Missed updates to "there is always a valid frame".
* * generic/tclCompCmds.c (TclCompileUpvarCmd): Plugged a memoryKevin B Kenny2007-04-231-1/+4
| | | | | | | | leak in 'upvar' when compiling (a) upvar outside a proc, (b) upvar with a syntax error, or (c) upvar where the frame index is not known at compile time. * generic/tclParseExpr.c (ParseExpr): Plugged a memory leak when parsing expressions that contain syntax errors.
* * generic/tclCompCmds.c: added a cast to silence a compilerKevin B Kenny2007-04-151-2/+2
| | | | | | | | error on VC2005. * library/clock.tcl: Restored unique-prefix matching of keywords on the [clock] command. [Bug 1690041] * tests/clock.test: Added rudimentary test cases for unique-prefix matching of keywords.
* fixing commentsMiguel Sofer2007-04-111-4/+1
|
* * generic/tclCompCmds.c: moved all exceptDepth management to theMiguel Sofer2007-04-111-11/+15
| | | | macros - the decreasing half was managed by hand.
* * generic/tclBasic.c: Added bytecode compilers for theMiguel Sofer2007-04-031-69/+464
| | | | | | | | * generic/tclCompCmds.c: variable linking commands: 'global', * generic/tclCompile.h: 'variable', 'upvar', 'namespace upvar' * generic/tclExecute.c: [Patch 1688593] * generic/tclInt.h: * generic/tclVar.c:
* * generic/tclCompCmds.c: Replace arrays on the C stack anddgp2007-03-301-43/+31
| | | | | ckalloc calls with TclStackAlloc calls to use memory on Tcl's evaluation stack
* fix warningsdas2007-03-161-2/+2
|
* Added a scheme to allow aux-data to be printed out for debugging. For this ↵dkf2007-03-021-25/+189
| | | | | | to work, immediate operands referring to aux-data must be identified as such in the instruction descriptor table using OPERAND_AUX4 (all are always 4 bytes). Rewrote the compiled [dict update] so that it stores critical non-varying data in an aux-data value instead of a (shimmerable) literal. [Bug 1671001]
* Fix [Bug 1671138]dkf2007-03-011-1/+14
|
* A few more very minor changesdkf2007-02-271-20/+11
|
* Assorted cleanup, mostly of comments.dkf2007-02-271-195/+227
|
* Fix [lindex] argument ordering. [bug 1631364]dkf2007-01-091-9/+13
|
* * generic/tclCompCmds.c: Additional commits correct mostdgp2006-12-071-1/+14
| | | | | * generic/tclExecute.c: failing tests illustrating bugs uncovered * generic/tclMathOp.c: in [Path 1578137].
* More #174 bits and piecesdkf2006-12-071-410/+257
|