| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* 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/tclParseExpr.c: Exponentiation operator is now
* tests/expr.test: right associative. [Patch 1556802]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCkalloc.c: TclObjPrintf() routines to panic when unable
* generic/tclCmdAH.c: to complete their formatting operations, rather
* generic/tclCmdIL.c: than report an error message. This means an
* generic/tclCmdMZ.c: interp argument for error message recording is
* generic/tclDictObj.c: no longer needed, further simplifying the
* generic/tclExecute.c: interface for callers.
* generic/tclIORChan.c:
* generic/tclIOUtil.c:
* generic/tclInt.h:
* generic/tclMain.c:
* generic/tclNamesp.c:
* generic/tclParseExpr.c:
* generic/tclPkg.c:
* generic/tclProc.c:
* generic/tclStringObj.c:
* generic/tclTimer.c:
* generic/tclUtil.c:
* unix/tclUnixFCmd.c:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCkalloc.c: TclObjPrintf, TclFormatObj, and
* generic/tclCmdAH.c: TclFormatToErrorInfo to a new set of
* generic/tclCmdIL.c: routines TclAppendPrintfToObj,
* generic/tclCmdMZ.c: TclAppendFormatToObj, TclObjPrintf, and
* generic/tclDictObj.c: TclObjFormat, with the intent of making
* generic/tclExecute.c: the latter list, plus TclAppendLimitedToObj
* generic/tclIORChan.c: and TclAppendObjToErrorInfo, public via
* generic/tclIOUtil.c: a revised TIP 270.
* generic/tclInt.h:
* generic/tclMain.c:
* generic/tclNamesp.c:
* generic/tclParseExpr.c:
* generic/tclPkg.c:
* generic/tclProc.c:
* generic/tclStringObj.c:
* generic/tclTimer.c:
* generic/tclUtil.c:
* unix/tclUnixFCmd.c:
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
orphan ExprNodes to store the closure of left pointers. This
lets us avoid repeated re-scanning leftward for the left
boundary of subexpressions, which in worst case led to near
O(N^2) runtime.
|
|
|
|
|
|
|
|
| |
* generic/tclParseExpr.c: to copy only whole characters when
doing %s formatting. This relieves callers of TclObjPrintf() and
TclFormatToErrorInfo() from needing to fix arguments to character
boundaries. Tcl_ParseExpr() simplified by taking advantage.
[Bug 1547786]
|
|
|
|
|
|
| |
* tests/parseExpr.test: testing the error messages of the
new expr parser. Several bug fixes and code simplifications that
appeared during that effort.
|
|
|
|
|
| |
TclCheckBadOctal(), so both [expr 08] and [expr 08z] have same
additional info in error message.
|
|
|
|
| |
* generic/tclParseExpr.c: parse error messages.
|
|
|
|
| |
with prec[] static array.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclExecute.c (TclExecuteByteCode):
* generic/tclIOCmd.c (Tcl_ExecObjCmd):
* generic/tclListObj.c (NewListIntRep):
* generic/tclObj.c (Tcl_GetLongFromObj, Tcl_GetWideIntFromObj,
FreeBignum, Tcl_SetBignumObj):
* generic/tclParseExpr.c (Tcl_ParseExpr):
* generic/tclStrToD.c (TclParseNumber):
* generic/tclStringObj.c (TclAppendFormattedObjs):
* unix/tclUnixPipe.c (TclpCreateProcess): fix signed-with-unsigned
comparison and other warnings from gcc4 -Wextra.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdMZ.c: Modified [string is double] to use
* tests/string.test: TclParseNumber() to parse trailing whitespace.
Ensures consistency, and makes it easier to cleanup after invalid
internal reps left behind by parsing [Bugs 1360432 1382287].
* generic/tclParseExpr.c: Added TCL_PARSE_NO_WHITESPACE to
* generic/tclScan.c: TclParseNumber() calls since [scan] and
* tests/scan.test: [expr] parsing don't want spaces in parsed
numbers.
* generic/tclInt.h: Added TCL_PARSE_NO_WHITESPACE flag to the
* generic/tclStrToD.c: TclParseNumber() interface.
|
| |
|
|
|
|
|
|
| |
NULL can be
cast to any pointer type transparently.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdIL.c:
* generic/tclCompCmds.c:
* generic/tclDictObj.c:
* generic/tclExecute.c:
* generic/tclLiteral.c:
* generic/tclParseExpr.c:
* generic/tclScan.c:
* generic/tclUtil.c:
* generic/tclVar.c:
|
|
|
|
|
|
| |
[kennykb-numerics-branch] Resynchronized with the HEAD; at this
checkpoint [-rkennykb-numerics-branch-20051008], the HEAD and
kennykb-numerics-branch contain identical code.
|
| |
|
|
|
|
|
|
| |
boolean literals accepted by Tcl_GetBoolean, including prefixes
like "y" and "f", and to allow "eq" and "ne" as function names
in the proper context. [Bug 1201589].
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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`
|
| |
|
|
|
|
| |
parser. [Bug 884830]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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):
|
|
|
|
|
| |
* generic/tclParse.c (TclParseInit): for initializing a Tcl_Parse
* generic/tclParseExpr.c: struct into one routine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that appends a Tcl_Obj to the errorInfo, saving the caller the trouble
of extracting the string rep.
* generic/tclStringObj.c (TclAppendLimitedToObj): New internal
routine that supports truncated appends with optional ellipsis marking.
This single routine supports UTF-8-safe truncated appends needed in
several places throughout the Tcl source code, mostly for error and
stack messages. Clean fix for [Bug 760872].
* generic/tclInt.h: Declarations for new internal routines.
* generic/tclCmdMZ.c: Updated callers to use the new routines.
* generic/tclCompExpr.c:
* generic/tclCompile.c:
* generic/tclExecute.c:
* generic/tclIOUtil.c:
* generic/tclNamesp.c:
* generic/tclObj.c:
* generic/tclParseExpr.c:
* generic/tclProc.c:
* generic/tclStringObj.c:
* mac/tclMacResource.c:
* library/init.tcl: Updated ::errorInfo cleanup in [unknown] to
reflect slight modifications to Tcl_LogCommandInfo(). Corrects
failing init-4.* tests.
|
| |
|
| |
|
|
|
|
|
| |
string "0x" (recognize leading "0" as an integer). [Bug 648441].
* tests/parseExpr.test (parseExpr-19.1): Test for Bug 648441.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/Concat.3: all remaining public interfaces of Tcl.
* doc/CrtCommand.3: Notably, the parser no longer writes on
* doc/CrtSlave.3: the string it is parsing, so it is no
* doc/CrtTrace.3: longer necessary for Tcl_Eval() to be
* doc/Eval.3: given a writable string. Also, the
* doc/ExprLong.3: refactoring of the Tcl_*Var* routines
* doc/LinkVar.3: by Miguel Sofer is included, so that the
* doc/ParseCmd.3: "part1" argument for them no longer needs
* doc/SetVar.3: to be writable either.
* doc/TraceVar.3:
* doc/UpVar.3: Compatibility support has been enhanced so
* generic/tcl.decls that a #define of USE_NON_CONST will remove
* generic/tcl.h all possible source incompatibilities with
* generic/tclBasic.c the 8.3 version of the header file(s).
* generic/tclCmdMZ.c The new #define of USE_COMPAT_CONST now does
* generic/tclCompCmds.c what USE_NON_CONST used to do -- disable
* generic/tclCompExpr.c only those new CONST's that introduce
* generic/tclCompile.c irreconcilable incompatibilities.
* generic/tclCompile.h
* generic/tclDecls.h Several bugs are also fixed by this patch.
* generic/tclEnv.c [Bugs 584051,580433] [Patches 585105,582429]
* generic/tclEvent.c
* generic/tclInt.decls
* generic/tclInt.h
* generic/tclIntDecls.h
* generic/tclInterp.c
* generic/tclLink.c
* generic/tclObj.c
* generic/tclParse.c
* generic/tclParseExpr.c
* generic/tclProc.c
* generic/tclTest.c
* generic/tclUtf.c
* generic/tclUtil.c
* generic/tclVar.c
* mac/tclMacTest.c
* tests/expr-old.test
* tests/parseExpr.test
* unix/tclUnixTest.c
* unix/tclXtTest.c
* win/tclWinTest.c
|
|
|
|
| |
Also produce better error messages when this happens.
|
|
|
|
| |
[Bug 550142 "Tcl_ExprObj -> abort"]
|
|
|
|
|
| |
This version builds clean on Solaris/SPARC, with GCC and CC, both with and
without threads and both in 32-bit and 64-bit mode.
|
| |
|
| |
|
| |
|
|
|
|
| |
[Bug #217777]
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/expr.test:
* tests/expr-old.test: added tests for 'eq' and 'ne'
* generic/tclExecute.c:
* generic/tclCompile.h: added INST_STREQ and INST_STRNEQ opcodes
that do strict string comparisons.
* generic/tclCompExpr.c: added 'eq' and 'ne' string comparison
operators.
* generic/tclParseExpr.c (GetLexeme): added 'eq' and 'ne' expr
parse terms (string (in)equality check).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/parseExpr.test:
* tests/string.test:
* generic/tclGet.c:
* generic/tclInt.h:
* generic/tclObj.c:
* generic/tclParseExpr.c:
* generic/tclUtil.c:
* generic/tclExecute.c: added TclCheckBadOctal routine to enhance
error message checking for when users use invalid octal numbers
(like 08), as well as replumbed the Expr*Funcs with a new
VerifyExprObjType to simplify type handling.
* tests/expr.test:
* generic/tclCompile.c: fixed 'bad code length' error for
'expr + {[incr]}' case, with new test case [Bug: 3736]
and seg fault on 'expr + {[error]}' (different cause) that
was caused by a correct optimization that didn't correctly
track how it was modifying the source string in the opt.
The optimization was removed, which means that:
expr 1 + {[string length abc]}
will be not be compiled inline as before, but this should be
written:
expr {1 + [string length abc]}
which will be compiled inline for speed. This prevents
expr 1 + {[mindless error]}
from seg faulting, and only affects optimizations for
degenerate cases [Bug: 3737]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclParseExpr.c: changed '"' to '\"' to make FreeBSD
happy [Bug: 2625]
* generic/tclProc.c: moved static buf to better location and
changed static msg that would overflow in ProcessProcResultCode
[Bug: 2483] and added Tcl_DStringFree to Tcl_ProcObjCmd.
Also reworked size of static buffers.
* tests/stringObj.test: added test 9.11
* generic/tclStringObj.c: changed Tcl_AppendObjToObj to
properly handle the 1-byte dest and mixed src case where
both had had Unicode string len checks made on them. [Bug: 2678]
|
| |
|
|
|
|
| |
makefile caused when the win/pkgIndex.tcl file was replaced
|
|
|