summaryrefslogtreecommitdiffstats
path: root/generic/tclCompExpr.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | * generic/tclCompExpr.c: Added a "parseOnly" flag argument todgp2007-07-111-49/+29
| | | | | | | | | | | | | | | | | | | | | | ParseExpr() to indicate whether the caller is Tcl_ParseExpr(), with an end goal of filling a Tcl_Parse with Tcl_Tokens representing the parsed expression, or TclCompileExpr() with the goal of compiling and executing the expression. In the latter case, more aggressive conversion of QUOTED and BRACED lexeme to literals is done. In the former case, all such conversion is avoided, since Tcl_Token production would revert it anyway. This enables simplifications to the GenerateTokensForLiteral() routine as well.
* | Renamed some variables fordgp2007-07-101-46/+115
| | | | | | | | clarity and replaced some cryptic logic with more readable macros.
* | Removed some unused counter variables.dgp2007-07-101-6/+17
| |
* | * generic/tclCompExpr.c: Added a field for operator precedencedgp2007-07-101-40/+165
| | | | | | | | | | | | | | | | to be stored directly in the parse tree. There's no memory cost to this addition, since that memory would have been lost to alignment issues anyway. Also, converted precedence definitions and lookup tables to use symbolic constants instead of raw number for improved readability, and continued extending/improving/correcting comments.
* | More extended commentary about the data structures of the expr parser.dgp2007-07-091-43/+85
| |
* | * generic/tclCompExpr.c: Revision so that the END lexeme neverdgp2007-07-091-4/+32
| | | | | | | | | | | | | | gets inserted into the parse tree. Later tree traversal never reaches it since its location in the tree is not variable. Starting and stopping with the START lexeme (node 0) is sufficient. Also finished lexeme code commentary.
* | * generic/tclCompExpr.c: Added missing creation and returndgp2007-07-091-2/+11
| | | | | | | | of the Tcl_Parse fields that indicate error conditions. [Bug 1749987]
* | More work in progress commenting the expr parserdgp2007-07-051-10/+55
| |
* | Start of work adding more useful comments to the expr parser.dgp2007-07-051-20/+63
| |
* | * generic/tclCompExpr.c: Revised #define values so that theredgp2007-07-031-4/+12
| | | | | | | | is now more expansion room to define more BINARY operators.
* | * generic/tclCompExpr.c: Removed dead code, old implementationsdgp2007-07-021-1486/+48
| | | | | | | | | | * generic/tclEvent.c: of expr parsing and compiling, including the * generic/tclInt.h: routine TclFinalizeCompilation().
* | * generic/tclBasic.c: Move most instances of the Tcl_Parse structdgp2007-06-211-78/+95
| | | | | | | | | | | | * generic/tclCompExpr.c: off the C stack and onto the Tcl stack. * generic/tclCompile.c: This is a rather large struct (> 3kB). * generic/tclParse.c:
* | * generic/tclInt.decls: Revised the interfaces of the routinesdgp2007-06-201-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/tclCompExpr.c (ParseExpr): Revised to be sure thatdgp2007-04-251-3/+17
| | | | | | | | | | | | an error return doesn't prevent all literals getting placed on the litList to be returned to the caller for freeing. Corrects some memleaks. [Bug 1705778, leak K23]
* | * generic/tclCompExpr.c (ParseExpr): Memory leak in error case; thedgp2007-04-241-1/+2
| | | | | | | | literal Tcl_Obj was not getting freed. [Bug 1705778, leak #1 (new)]
* | * generic/tclCompCmds.c (TclCompileUpvarCmd): Plugged a memoryKevin B Kenny2007-04-231-2/+5
| | | | | | | | | | | | | | | | 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.
* | Eliminate use of (VOID*) casts when calling memset or memcpy.dkf2007-04-171-3/+3
| |
* | Handle creation of Tcl_Objs from constant strings better (easier to use, moredkf2007-04-101-42/+37
| | | | | | | | efficient). After [Patch 1529526] (afredd)
* | * generic/tclCompExpr.c:dgp2007-03-301-13/+18
| | | | | | | | | | | | * generic/tclCompCmds.c: Replace arrays on the C stack and ckalloc calls with TclStackAlloc calls to use memory on Tcl's evaluation stack
* | various "const" additions, in line with TIP #27nijtmans2007-02-201-31/+31
| |
* | Cleanup to follow engineering manual guidelinesdkf2006-12-131-232/+327
| |
* | * generic/tclCompExpr.c: Now that the new internal structsdgp2006-12-121-3/+3
| | | | | | | | | | | | | | | | | | are in use to support operator commands, might as well make them the default for [expr] as well and avoid passing every parsed expression through the inefficient Tcl_Token array format. This addresses most issues in [RFE 1517602] Assuming no performance disasters result from this, much dead code supporting the other implementation might now be removed.
* | * generic/tclBasic.c: Final step routing all direct evaluation formsdgp2006-12-121-8/+114
| | | | | | | | | | | | * generic/tclCompExpr.c: of the operator commands through TEBC, * generic/tclCompile.h: dropping all the routines in tclMathOp.c. * generic/tclMathOp.c: Still needs Engineering Manual attention.
* | * generic/tclBasic.c: Another step with all sorting operator commandsdgp2006-12-111-1/+56
| | | | | | | | | | * generic/tclCompExpr.c: now routing through TEBC via * generic/tclCompile.h: TclSortingOpCmd().
* | * generic/tclBasic.c: Another step down the path of re-usingdgp2006-12-081-23/+37
| | | | | | | | | | | | | | | | * generic/tclCompExpr.c: TclExecuteByteCode to implement the TIP 174 * generic/tclCompile.h: commands instead of using a mass of code * generic/tclMathOp.c: duplication. Now all operator commands that * tests/mathop.test: demand exactly one operation are implemented via TclSingleOpCmd and a call to TEBC.
* | * generic/tclCompExpr.c: Revised implementation of TclInvertOpCmddgp2006-12-081-24/+55
| | | | | | | | | | | | | | | | | | | | * generic/tclMathOp.c: to perform a bytecode compile / execute sequence. This demonstrates a path toward avoiding mountains of code duplication in tclMathOp.c and tclExecute.c. * generic/tclCompile.h: Change TclExecuteByteCode() from static to * generic/tclExecute.c: MODULE_SCOPE so all files including tclCompile.h may call it.
* | * generic/tclCompExpr.c: Added implementation for thedgp2006-12-041-24/+260
| | | | | | | | | | | | | | CompileExprTree() routine that can produce expression bytecode directly from internal structures with no need to pass through the Tcl_Token array representation. Still disabled by default. #undef USE_EXPR_TOKENS to try it out.
* | * generic/tclCompExpr.c: Added expr parsing routines thatdgp2006-12-031-6/+1089
| | | | | | | | | | | | | | | | | | | | produce a different set of internal structures representing the parsed expression, as well as routines that go on to convert those structures into the traditional Tcl_Token array format. Use of these routines is currently disabled. #undef PARSE_DIRECT_EXPR_TOKENS to enable them. These routines will only become really useful when more routines that compile directly from the new internal structures are completed.
* | * generic/tclBasic.c: TIP #280 implementation.andreas_kupries2006-11-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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:
* | TIP#270 IMPLEMENTATIONdgp2006-11-151-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tcl.decls: New public routines Tcl_ObjPrintf, * generic/tclStringObj.c: Tcl_AppendObjToErrorInfo, Tcl_Format, * generic/tclInt.h: Tcl_AppendLimitedToObj, Tcl_AppendFormatToObj and Tcl_AppendPrintfToObj. Former internal versions removed. * generic/tclDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclBasic.c: Updated callers. * generic/tclCkalloc.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStrToD.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c:
* | * generic/tclCompExpr.c: fix gcc warnings about 'cast to/fromdas2006-11-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEncoding.c: pointer from/to integer of different * generic/tclEvent.c: size' on 64-bit platforms by casting to * generic/tclExecute.c: intermediate types intptr_t/uintptr_t * generic/tclHash.c: via new PTR2INT(), INT2PTR(), * generic/tclIO.c: PTR2UINT() and UINT2PTR() macros. * generic/tclInt.h: [Patch 1592791] * generic/tclProc.c: * generic/tclTest.c: * generic/tclThreadStorage.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/configure.in: * unix/tclUnixChan.c: * unix/tclUnixPipe.c: * unix/tclUnixPort.h: * unix/tclUnixTest.c: * unix/tclUnixThrd.c: * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
* | * generic/tclParseExpr.c (removed): Moved all the code ofdgp2006-11-091-1/+1051
| | | | | | | | | | | | | | | | | | * generic/tclCompExpr.c: tclParseExpr.c into tclCompExpr.c. * unix/Makefile.in: This sets the stage for expr compiling to * win/Makefile.in: work directly with the full parse tree * win/makefile.bc: structures, and not have to pass through * win/makefile.vc: the information lossy format of an array * win/tcl.dsp: of Tcl_Tokens.
* | * generic/tclCompExpr.c: Removed much complexity that isdgp2006-09-051-292/+88
| | | | | | | | no longer needed.
* | * generic/tclCompExpr.c: Corrected flawed logic fordgp2006-08-311-1/+3
| | | | | | | | | | | | disabling the INST_TRY_CVT_TO_NUMERIC instruction at the end of an expression when function arguments contain operators. [Bug 1541274]
* | Various minor object file size efficiency fixes. [Bug 1530474]dkf2006-08-101-4/+4
| |
* | * unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),das2005-11-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to configure (flag can't be present twice, so can't be in both CFLAGS and LDFLAGS during configure), don't use -prebind when deploying on 10.4, define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542). (SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete autoconf macros. Sync with tk/unix/tcl.m4. * unix/configure.in: fix obsolete autoconf macros, sync gratuitous formatting/ordering differences with tk/unix/configure.in. * unix/Makefile.in: add CFLAGS to tclsh/tcltest link to make executable linking the same as during configure (needed to avoid loosing any linker relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS). Avoid concurrent linking of tclsh and compiling of tclTestInit.o or xtTestInit.o during parallel make. (checkstubs, checkdoc, checkexports): dependency and Darwin fixes (dist): add new macosx files. * unix/tclLoadDyld.c (TclpDlopen): use NSADDIMAGE_OPTION_WITH_SEARCHING on second NSAddImage only. [Bug 1204237] (TclGuessPackageName): should not be MODULE_SCOPE. (TclpLoadMemory): ppc64 and endian (i386) fixes, add support for loading universal (fat) bundles from memory. * unix/tclUnixFCmd.c: * macosx/tclMacOSXFCmd.c: ppc64 and endian (i386) fixes. (TclMacOSXCopyFileAttributes): add support for new Tiger copyfile() API to enable copying of xattrs & ACLs by [file copy]. * generic/tcl.h: add Darwin specifc configure overrides for TCL_WIDE defines to support fat compiles of ppc and ppc64 at the same time, (replaces Darwin CVS fix by emoy, rdar://3693001). add/correct location of version numbers in macosx files. * generic/tclInt.h: clarify fat compile comment. * unix/tclUnixPort.h: add Darwin specifc configure overrides to support fat compiles, where configure runs only once for multiple architectures (replaces Darwin CVS fix by emoy, rdar://3693001). * macosx/tclMacOSXBundle.c: * macosx/tclMacOSXNotify.c: * unix/tclUnixNotfy.c: * unix/tclUnixPort.h: fix #include order to support compile time override of HAVE_COREFOUNDATION in tclUnixPort.h when building for ppc64 * macosx/Tcl.pbproj/default.pbxuser (new file): * macosx/Tcl.pbproj/jingham.pbxuser: * macosx/Tcl.pbproj/project.pbxproj: * macosx/Tcl.xcode/default.pbxuser (new file): * macosx/Tcl.xcode/project.pbxproj (new file): * macosx/Tcl.xcodeproj/default.pbxuser (new file): * macosx/Tcl.xcodeproj/project.pbxproj (new file): new/updated projects for Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with native tcltest targets and support for universal (fat) compiles. * macosx/README: clarification/cleanup, document new Xcode projects and universal (fat) builds via CFLAGS (i.e. all of ppc ppc64 i386 at once). * unix/Makefile.in: * unix/aclocal.m4: * unix/configure.in: * unix/dltest/Makefile.in: * macosx/configure.ac (new file): add support for inclusion of unix/configure.in by macosx/configure.ac, allows generation of a config headers enabled configure script in macosx (required by Xcode projects). * macosx/GNUmakefile: rename from Makefile to avoid overwriting by configure run in tcl/macosx, add support for reusing configure cache, build target fixes, remove GENERIC_FLAGS override now handled by tcl.m4. * generic/tcl.decls: add Tcl_Main declaration as comment to avoid 'checkstubs' target complaining about it missing from stubs. * generic/regex.h: * generic/tclDate.c: * generic/tclEnv.c: * generic/tclGetDate.y: * generic/tclIOUtil.c: * generic/tclObj.c: * generic/tclStubInit.c: * generic/tclStubLib.c: * generic/tclPathObj.c: * generic/tclThreadAlloc.c: * generic/tclThreadStorage.c: * generic/tclTrace.c: * generic/tclVar.c: * generic/tommath.h: * tools/fix_tommath_h.tcl: * unix/tclUnixFCmd.c: ensure externally visible symbols not contained in stubs table are declared as MODULE_SCOPE (or as static if not used outside of own source file). These changes allow 'make checkstubs' to complete without error on Darwin with gcc 4. * generic/rege_dfa.c (getvacant): * generic/regexec.c (cfind): * generic/tclCompExpr.c (CompileSubExpr): * generic/tclNamesp.c (NamespaceEnsembleCmd): * unix/tclUnixChan.c (TclUnixWaitForFile): initialise variables to silence gcc 4 warnings. * generic/tclExecute.c (TclExecuteByteCode): fix unused variable warning when NO_WIDE_TYPE is defined. * generic/regguts.h: only #define NDEBUG if not already #defined. * unix/tclUnixNotfy.c: * macosx/tclMacOSXNotify.c: sync whitespace & comments. * unix/tclUnixPort.h: * win/tclWinPort.h: remove declaration of obsolete&unused TclpMutex API. * unix/configure: * unix/tclConfig.h.in: regen.
* | ANSIfy; generic/*.c now all done except for test codedkf2005-11-021-43/+42
| |
* | TIP#237 IMPLEMENTATIONdgp2005-10-081-16/+1
| | | | | | | | | | | | [kennykb-numerics-branch] Resynchronized with the HEAD; at this checkpoint [-rkennykb-numerics-branch-20051008], the HEAD and kennykb-numerics-branch contain identical code.
* | * generic/tclCompExpr.c: Untangled some dependencies in thedgp2005-08-031-3/+2
| | | | | | | | | | | | * generic/tclEvent.c: order of finalization routines. * generic/tclInt.h: [Bug 1251399] * generic/tclObj.c:
* | Getting more systematic about styledkf2005-07-171-271/+267
| |
* | Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-72/+31
| |
* | Core of implementation of TIP#201 ('in' and 'ni' operators)dkf2004-10-081-1/+5
| |
* | * generic/tclBasic.c:dgp2004-10-061-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclBinary.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclDictObj.c: It is a poor practice to directly set or append to the value of the objResult of an interp, because that value might be shared, and in that circumstance a Tcl_Panic() will be the result. Searched for example of this practice and replaced with safer alternatives, often using the Tcl_AppendResult() routine that dkf just rehabilitated.
* | Report compilation errors at runtime, [Patch 103368] by dgp.Miguel Sofer2004-09-261-13/+4
| |
* | Patch 922727 committed. Implements three changes:dgp2004-04-061-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed):
* | improved commentsMiguel Sofer2004-01-121-10/+6
| |
* | * generic/tclCompExpr.c (CompileLandOrLorExpr): cosmetic changes.Miguel Sofer2004-01-121-17/+12
| |
* | Fix a comment.Miguel Sofer2004-01-121-3/+2
| |
* | * generic/tclCompExpr.c (CompileLandOrLorExpr): new logic, fewerMiguel Sofer2004-01-121-35/+44
| | | | | | | | | | | | | | instructions. As a side effect, the instructions INST_LOR and INST_LAND are now never used. * generic/tclExecute.c (INST_JUMP*): small optimisation; fix a bug in debug code.
* | All uses of 'panic' (the macro) changeddavygrvy2003-12-241-5/+5
| | | | | | | | | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]