diff options
author | dgp <dgp@users.sourceforge.net> | 2013-07-18 15:05:18 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-07-18 15:05:18 (GMT) |
commit | 81a1a91361cc615d3e9bf5b9016bd12cd258aa8d (patch) | |
tree | 97de78e38c2f1e7cd5411638a63eaca8ef6f2ab0 /generic/tclAssembly.c | |
parent | 774c4023655381f0f5d722f19ae8bed785ebff58 (diff) | |
download | tcl-81a1a91361cc615d3e9bf5b9016bd12cd258aa8d.zip tcl-81a1a91361cc615d3e9bf5b9016bd12cd258aa8d.tar.gz tcl-81a1a91361cc615d3e9bf5b9016bd12cd258aa8d.tar.bz2 |
[Bug 1c17fbba5d] Fix -errorinfo from syntax errors so that the error is
not obscured. Instead highlight it by making it the last character quoted.
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r-- | generic/tclAssembly.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 62641e6..416ee10 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -985,8 +985,6 @@ TclAssembleCode( const char* instPtr = codePtr; /* Where to start looking for a line of code */ - int instLen; /* Length in bytes of the current line of - * code */ const char* nextPtr; /* Pointer to the end of the line of code */ int bytesLeft = codeLen; /* Number of bytes of source code remaining to * be parsed */ @@ -1000,10 +998,6 @@ TclAssembleCode( */ status = Tcl_ParseCommand(interp, instPtr, bytesLeft, 0, parsePtr); - instLen = parsePtr->commandSize; - if (parsePtr->term == parsePtr->commandStart + instLen - 1) { - --instLen; - } /* * Report errors in the parse. @@ -1012,7 +1006,7 @@ TclAssembleCode( if (status != TCL_OK) { if (flags & TCL_EVAL_DIRECT) { Tcl_LogCommandInfo(interp, codePtr, parsePtr->commandStart, - instLen); + parsePtr->term + 1 - parsePtr->commandStart); } FreeAssemblyEnv(assemEnvPtr); return TCL_ERROR; @@ -1032,6 +1026,13 @@ TclAssembleCode( */ if (parsePtr->numWords > 0) { + int instLen = parsePtr->commandSize; + /* Length in bytes of the current command */ + + if (parsePtr->term == parsePtr->commandStart + instLen - 1) { + --instLen; + } + /* * If tracing, show each line assembled as it happens. */ |