summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
Commit message (Collapse)AuthorAgeFilesLines
* Code Audit results:dkf2010-03-051-3/+3
| | | | | | | | * 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
* More tidying up (whitespace, spelling, useless parentheses, useless casts)dkf2010-02-241-77/+82
|
* CONST -> constnijtmans2009-12-251-1/+1
|
* * generic/tclCompile.c: Re-implement Tcl_SubstObj() as a simpledgp2009-09-171-81/+20
| | | | | | | | | | * generic/tclParse.c: wrapper around TclNRSubstObj(). This has * tests/basic.test: the effect of caching compiled bytecode in * tests/parse.test: the value to be substituted. Note that Tcl_SubstObj() now exists only for extensions. Tcl itself no longer makes any use of it. Note also that TclSubstTokens() is now reachable only by Tcl_EvalEx() and Tcl_ParseVar() so tests aiming to test its functioning needed adjustment to still have the intended effect.
* * generic/tclParse.c Corrected line counting error in multi-commanddgp2009-09-071-0/+4
| | | | * tests/into.test: script substitutions. [Bug 2850901].
* * generic/tclCompCmds.c (TclCompileSubstCmd): Added a bytecodedgp2009-09-041-24/+37
| | | | | | | | | | | | | * generic/tclBasic.c: compiler routine for the [subst] command. * generic/tclCmdMZ.c: This is a partial solution to the need to * generic/tclCompile.c: NR-enable [subst] since bytecode execution is * generic/tclCompile.h: already NR-enabled. [Bug 2314561] Two new * generic/tclExecute.c: bytecode instructions, INST_NOP and * generic/tclInt.h: INST_RETURN_CODE_BRANCH were added to support * generic/tclParse.c: the new routine. INST_RETURN_CODE_BRANCH is * tests/basic.test: likely to be useful in any future effort to * tests/info.test: add a bytecode compiler routine for [try]. * tests/parse.test:
* fix warningsdas2009-08-251-1/+1
|
* * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard,andreas_kupries2009-08-251-8/+123
| | | | | | | | | | | | | | | | | | | | | | | Tcl_EvalEx, TclEvalEx, TclAdvanceContinuations, TclNREvalObjEx): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd, TclListLines): * generic/tclCompCmds.c (*): * generic/tclCompile.c (TclSetByteCodeFromAny, TclInitCompileEnv, TclFreeCompileEnv, TclCompileScript, TclCompileTokens): * 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 the parser, compiler, and execution engine with code and attendant data structures tracking the position of continuation lines which are not visible in the resulting script Tcl_Obj*'s, to properly account for them while counting lines for #280.
* * generic/tclParse.c: Coding standards fixups.dgp2008-12-011-17/+19
|
* Alternate fix for[Bug 2251175]: missing backslash substitution on expanded ↵ferrieux2008-11-271-43/+23
| | | | literals.
* Simplification of expanded-literals handling after analysis of dead branchesferrieux2008-11-191-3/+3
|
* Fix [Bug 2251175]: missing backslash substitution on expanded literals.ferrieux2008-11-171-3/+36
|
* Style improvements - invoking callbacks without visual junk.dkf2008-10-261-4/+4
|
* * generic/tclParse.c: move TclResetCancellation to be called onJoe Mistachkin2008-09-171-2/+2
| | | | | returning to level 0, as opposed to it being called on starting a substitution at level 0.
* * generic/tclParse.c: fixing incomplete reversion of "fix" forMiguel Sofer2008-07-151-1/+2
| | | | [Bug 2017583], missing TclResetCancellation call.
* * generic/tclParse.c: reverting the "fix" for [Bug 2017583],Miguel Sofer2008-07-141-3/+10
| | | | | * tests/parse.test: numLevel management and TclInterpReady check seems to be necessary after all.
* * generic/tclParse.c: Remove unneeded TclInterpReady callMiguel Sofer2008-07-141-7/+4
|
* * generic/tclBasic.c.: Embedded Tcl_Canceled() calls intoMiguel Sofer2008-07-141-4/+1
| | | | | * generic/tclExecute.c: TclInterpReady(). * generic/tclParse.c:
* remove unused variableMiguel Sofer2008-07-141-3/+1
|
* * generic/tclParse.c: remove unnecessary numLevel managementMiguel Sofer2008-07-141-5/+1
| | | | [Bug 2017583]
* TIP 285 ImplementationJoe Mistachkin2008-06-131-1/+6
|
* * generic/tclParse.c (ParseComment): The new TclParseAllWhiteSpace()dgp2008-05-211-4/+7
| | | | | | | * tests/parse.test (parse-15.60): routine has no mechanism to return the "incomplete" status of "\\\n" so calling this routine anywhere that can be reached within a Tcl_ParseCommand() call is a mistake. In particular, ParseComment() must not use it. [Bug 1968882].
* Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-2/+2
|
* Reconcile coding style issues between branchesdgp2008-01-231-7/+9
|
* * generic/tclInt.h: New macro TclGrowParseTokenArray() todgp2008-01-231-66/+14
| | | | | | | | | | | | | | * 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.
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* More minor cleanupdkf2007-11-181-127/+124
|
* [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-3/+3
| | | | objTypes.
* * generic/tclParse.c (Tcl_ParseBraces): fix for possible readMiguel Sofer2007-10-151-2/+2
| | | | after the end of buffer, [Bug 1813528] (Joe Mistachkin).
* * generic/tclParse.c: In contexts where interp and parsePtr->interpdgp2007-07-191-20/+20
| | | | | | might be different, be sure to use the latter for error reporting. Also pulled the interp argument back out of ParseTokens() since we already had a parsePtr->interp to work with.
* * generic/tclBasic.c: Move most instances of the Tcl_Parse structdgp2007-06-211-75/+79
| | | | | | * 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/tclParse.c: fix for uninit read [Bug 1732414].Miguel Sofer2007-06-061-2/+3
|
* * generic/tclBasic.c: Removed code that dealt withdgp2007-05-301-53/+138
| | | | | | | | | | | | | | | | * generic/tclCompile.c: TCL_TOKEN_EXPAND_WORD tokens representing * generic/tclCompile.h: expanded literal words. These sections were mostly in place to enable [info frame] to discover line information in expanded literals. Since the parser now generates a token for each post-expansion word referring to the right location in the original script string, [info frame] gets all the data it needs. * generic/tclInt.h: Revised the parser so that it never produces * generic/tclParse.c: TCL_TOKEN_EXPAND_WORD tokens when parsing an * tests/parse.test: expanded literal word; that is, something like {*}{x y z}. Instead, generate the series of TCL_TOKEN_SIMPLE_WORD tokens to represent the words that expansion of the literal string produces. [RFE 1725186]
* * unix/configure: autoconf-2.59 (FC6 fork)dgp2007-05-181-15/+1
| | | | | | | | | | | | | | | | | * win/configure: * README: Bump version number to 8.5a7 * generic/tcl.h: * library/init.tcl: * tools/tcl.wse.in: * unix/configure.in: * unix/tcl.spec: * win/configure.in: * generic/tclParse.c: Disable and remove the ALLOW_EXPAND sections * tests/info.test: that continued to support the deprecated * tests/mathop.test: {expand} syntax. Updated the few remaining users of that syntax in the test suite.
* Reformat to standard function definition formdkf2007-04-101-24/+27
|
* * generic/tclExecute.c: More ckalloc -> ckrealloc conversions.dgp2007-03-211-9/+10
| | | | | | | | | * generic/tclLiteral.c: * generic/tclNamesp.c: * generic/tclParse.c: * generic/tclPreserve.c: * generic/tclStringObj.c: * generic/tclUtil.c:
* * generic/tclBasic.c: TIP #280 implementation.andreas_kupries2006-11-281-8/+55
| | | | | | | | | | | | | | | | | | | | | * 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:
* * doc/ParseCmd.3, doc/Tcl.n, doc/eval.n, doc/exec.n:hobbs2006-11-031-9/+15
| | | | | | | | | | | | | | | | | | * doc/fconfigure.n, doc/interp.n, doc/unknown.n: * library/auto.tcl, library/init.tcl, library/package.tcl: * library/safe.tcl, library/tm.tcl, library/msgcat/msgcat.tcl: * tests/all.tcl, tests/basic.test, tests/cmdInfo.test: * tests/compile.test, tests/encoding.test, tests/execute.test: * tests/fCmd.test, tests/http.test, tests/init.test: * tests/interp.test, tests/io.test, tests/ioUtil.test: * tests/iogt.test, tests/namespace-old.test, tests/namespace.test: * tests/parse.test, tests/pkg.test, tests/pkgMkIndex.test: * tests/proc.test, tests/reg.test, tests/trace.test: * tests/upvar.test, tests/winConsole.test, tests/winFCmd.test: * tools/tclZIC.tcl: * generic/tclParse.c (Tcl_ParseCommand): Replace {expand} with {*} officially (TIP #293). Leave -DALLOW_EXPAND=0|1 option to keep {expand} syntax for transition users. [Bug 1589629]
* * generic/tclParse.c (Tcl_ParseCommand): also return an error ifMiguel Sofer2006-09-241-2/+2
| | | | start==NULL and numBytes<0. This is coverity's bug #20
* * generic/tclParseExpr.c: Completely new expression parserdgp2006-07-051-16/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that builds a parse tree instead of operating with deep recursion. This corrects reports of stack-blowing crashes parsing long expressions [Bug 906201] and replaces a fundamentally O(N^2) algorithm with an O(N) one [RFE 903765]. The new parser is better able to generate error messages that clearly report both the nature and context of the syntax error [Bugs 1029267, 1381715]. For now, the code for the old parser is still present and can be activated with a "#define OLD_EXPR_PARSER 1". This is for the sake of a clean implementation patch, and for ease of benchmarking. The new parser is non-recursive, so much lighter in stack consumption, but it does use more heap, so there may be cases where parsing of long expressions that succeeded with the old parser will lead to out of memory panics with the new one. There are still more improvements possible on that point, though significant progress may require changes to the Tcl_Token specifications documented for the public Tcl_Parse*() routines. ***POTENTIAL INCOMPATIBILITY*** for any callers that rely on the exact (usually terrible) error messages generated by the old parser. This includes a large number of tests in the test suite. * generic/tclInt.h: Replaced TclParseWhiteSpace() with * generic/tclParse.c: TclParseAllWhiteSpace() which is what * generic/tclParseExpr.c: all the callers really needed. Breaking whitespace runs at newlines is useful only to the command parsing function, and it can call the file scoped routine ParseWhiteSpace() to do that. * tests/expr-old.test: Removed knownBug constraints that masked * tests/expr.test: failures due to revised error messages. * tests/parseExpr.test:
* ANSIfy; generic/*.c now all done except for test codedkf2005-11-021-111/+110
|
* * generic/tclParse.c (Tcl_ParseCommand): add code that recognizeshobbs2005-10-041-15/+23
| | | | | {} in addition to {expand} for word expansion (make with -DALLOW_EMPTY_EXPAND).
* Systematizing the formattingdkf2005-07-211-808/+869
|
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-1/+1
|
* * doc/DString.3: Eliminated use of identifier "string" in Tcl'sdgp2005-05-031-35/+35
| | | | | | | | | | | | | * doc/Environment.3: public C API to avoid conflict/confusion with * doc/Eval.3: the std::string of C++. * doc/ExprLong.3, doc/ExprLongObj.3, doc/GetInt.3, doc/GetOpnFl.3: * doc/ParseCmd.3, doc/RegExp.3, doc/SetResult.3, doc/StrMatch.3: * doc/Utf.3, generic/tcl.decls, generic/tclBasic.c, generic/tclEnv.c: * generic/tclGet.c, generic/tclParse.c, generic/tclParseExpr.c: * generic/tclRegexp.c, generic/tclResult.c, generic/tclUtf.c: * generic/tclUtil.c, unix/tclUnixChan.c: * generic/tclDecls.h: `make genstubs`
* * generic/tclBasic.c (Tcl_EvalEx): Restored recursion limitdgp2005-03-181-4/+11
| | | | | | | | * generic/tclParse.c (TclSubstTokens): testing in nested command * tests/basic.test (basic-46.4): substitutions within direct * tests/parse.test (parse-19.*): script evaluation (Tcl_EvalEx) that got lost in the parser reforms of Tcl 8.1. Added tests for correct behavior. [Bug 1115904]
* * generic/tclParse.c (Tcl_SubstObj): Fix for failed subst-12.3 test.dgp2004-10-261-2/+2
| | | | * tests/subst.test (subst-12.3-5): More tests for Bug 1036649.
* Braces round if bodies...dkf2004-10-061-2/+3
|
* * generic/tclParse.c (Tcl_SubstObj): leak fix by dgp, releaseMiguel Sofer2004-07-121-1/+2
| | | | result on error.
* Patch 922727 committed. Implements three changes:dgp2004-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | * 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):