summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-07-05 05:34:42 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-07-05 05:34:42 (GMT)
commitf8202fbf0e8d9c875afd03460d20b5b83c0aa10c (patch)
treedd2a47b4c7d1a184335dede04e8b90d2073b63cf /generic/tclInt.h
parent78a8ff907a6cc9f17b52a310bef7c37890273c3c (diff)
downloadtcl-f8202fbf0e8d9c875afd03460d20b5b83c0aa10c.zip
tcl-f8202fbf0e8d9c875afd03460d20b5b83c0aa10c.tar.gz
tcl-f8202fbf0e8d9c875afd03460d20b5b83c0aa10c.tar.bz2
* generic/tclParseExpr.c: Completely new expression parser
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:
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 0ef3b96..35addc8 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.271 2006/06/16 18:35:55 dgp Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.272 2006/07/05 05:34:44 dgp Exp $
*/
#ifndef _TCLINT
@@ -2137,8 +2137,7 @@ MODULE_SCOPE void TclParseInit(Tcl_Interp *interp, CONST char *string,
#if 0
MODULE_SCOPE int TclParseInteger(CONST char *string, int numBytes);
#endif
-MODULE_SCOPE int TclParseWhiteSpace(CONST char *src,
- int numBytes, Tcl_Parse *parsePtr, char *typePtr);
+MODULE_SCOPE int TclParseAllWhiteSpace(CONST char *src, int numBytes);
MODULE_SCOPE int TclProcessReturn(Tcl_Interp *interp,
int code, int level, Tcl_Obj *returnOpts);
MODULE_SCOPE int TclpObjLstat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf);