| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
message generation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
of numeric and boolean literals when compiling expressions with
(optimize == 1).
|
|
|
|
|
|
| |
* generic/tclCompile.c: TclCompileExpr() to profit from better
* generic/tclCompile.h: literal management according to usage.
* generic/tclExecute.c:
|
|
|
|
| |
* generic/tclExecute.c: (dgp)
|
|
|
|
|
| |
* generic/tclCompExpr.c: of struct TclOpCmdClientData to
* generic/tclCompile.h: accomodate C++ compilers [Bug 1855644]
|
| |
|
|
|
|
| |
objTypes.
|
|
|
|
|
|
| |
compilation on VC++.
* generic/tclExecute.c: Silenced several VC++ compiler warnings about
converting 'long' to 'unsigned short'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
zero strings passed as the "permissions" argument as octal numbers,
even if Tcl itself no longer parses integers in that way.
* unix/tclUnixFCmd.c: Revise the "-permissions" [file attribute] so
that it interprets leading zero strings as octal numbers, even if Tcl
itself no longer parses integers in that way.
* generic/tclCompExpr.c: Corrections to code that produces
* generic/tclUtil.c: extended "bad octal" error messages.
* tests/cmdAH.test: Test revisions so that tests pass whether or
* tests/cmdIL.test: not Tcl parses leading zero strings as octal.
* tests/compExpr-old.test:
* tests/compExpr.test:
* tests/compile.test:
* tests/expr-old.test:
* tests/expr.test:
* tests/incr.test:
* tests/io.test:
* tests/lindex.test:
* tests/link.test:
* tests/mathop.test:
* tests/parseExpr.test:
* tests/set.test:
* tests/string.test:
* tests/stringComp.test:
|
|
|
|
| |
to determine lexemes with single-byte representations.
|
|
|
|
|
| |
* generic/tclCompExpr.c: the fields of the OpCmdInfo and
* generic/tclCompile.h: TclOpCmdClientData structs.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/tclCompExpr.c: entries into TclFreeCompileEnv().
* generic/tclExecute.c: Update callers.
|
|
|
|
|
| |
in expressions to register with their intreps intact, even if that
means overwriting existing intreps in already registered literals.
|
|
|
|
|
|
| |
* tests/compExpr.test: to restore literal sharing. Preserve numeric
intreps when literals are created for the first time. Correct memleak
in ExecConstantExprTree() and add test for the leak.
|
|
|
|
| |
numeric when pre-compiling a constant expresion indicates an error.
|
|
|
|
| |
Label needs debug build exposure in TEBC.
|
|
|
|
|
|
|
|
| |
struct (again "free" due to alignment requirements) to mark those
subexpressions that are completely known at compile time. Enhanced
CompileExprTree() and its callers to precompute these constant
subexpressions at compile time. This resolves the issue raised
in [Bug 1564517].
|
| |
|
|
|
|
| |
eliminate duplication.
|
|
|
|
|
|
|
|
| |
OpNode mark field scheme of tree traversal. This eliminates the need
to use magic values in the left and right fields for that purpose.
Also stop abusing the left field within ParseExpr() to store the
number of arguments in a parsed function call. CompileExprTree() now
determines that for itself at compile time.
|
|
|
|
|
|
|
|
|
| |
* generic/tclCompExpr.c: Added a "mark" field to the OpNode
struct, which is used to guide tree traversal. This field costs
nothing since alignement requirements used the memory already.
Rewrote ConvertTreeToTokens() to use the new field, which permitted
consolidation of utility routines CopyTokens() and
GenerateTokensForLiteral().
|
| |
|
| |
|
|
|
|
|
|
| |
explain the operations of ParseExpr(), made significant revisions
to the code so it would be easier to explain, and in the process
made the code simpler and clearer as well.
|
|
|
|
|
|
| |
* tests/parseExpr.test: Several tests of syntax error messages
to check that when expression substrings are truncated they leave
visible the context relevant to the reported error.
|
| |
|
|
|
|
| |
common code for reporting syntax errors in LEAF elements.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
clarity and replaced some cryptic logic with more readable macros.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
of the Tcl_Parse fields that indicate error conditions. [Bug 1749987]
|
| |
|
| |
|
|
|
|
| |
is now more expansion room to define more BINARY operators.
|
|
|
|
|
| |
* generic/tclEvent.c: of expr parsing and compiling, including the
* generic/tclInt.h: routine TclFinalizeCompilation().
|
|
|
|
|
|
| |
* 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/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:
|
|
|
|
|
|
| |
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]
|
|
|
|
| |
literal Tcl_Obj was not getting freed. [Bug 1705778, leak #1 (new)]
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
efficient). After [Patch 1529526] (afredd)
|
|
|
|
|
|
| |
* generic/tclCompCmds.c: Replace arrays on the C stack and
ckalloc calls with TclStackAlloc calls to use memory on Tcl's
evaluation stack
|