Tcl Source Code

Check-in [b8e3a1cb71]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Some cleanup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bg-tip-282
Files: files | file ages | folders
SHA1: b8e3a1cb71f11110c935ee88291af02a258a05be
User & Date: griffin 2017-02-25 16:22:18
Original User & Date: briang42 2017-02-25 16:22:18
Context
2017-02-25
22:42
Fix a 2002 bug detected by Brian Griffin : in the presence of [], ParseTokens overshoots the passed ... check-in: e5800b67f9 user: ferrieux tags: bg-tip-282
16:22
Some cleanup check-in: b8e3a1cb71 user: griffin tags: bg-tip-282
2017-02-22
00:39
Add support for arrays in assignment Lvalues check-in: ceec540b41 user: griffin tags: bg-tip-282
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclCompExpr.c.

739
740
741
742
743
744
745

746
747
748
749
750
751
752
753
754
755





756
757
758
759
760
761
762
		    /* 
		     * TODO: this can probably be simplified.  
		     * For now, it is working. 
		     */

		    Tcl_Parse vparse;

		    const char *varend, *varstart = &start[TclParseAllWhiteSpace(start, numBytes)];
		    int code, len;
		    TclParseInit(interp, varstart, numBytes, &vparse);
		    code = Tcl_ParseVarName(NULL, varstart, numBytes, &vparse, 0);
		    if (code != TCL_OK) {
			//fprintf(stderr, "Replace me with proper error!\n");
		    }
		    len = vparse.tokenPtr[0].size;
		    varend = varstart+len;
		    Tcl_FreeParse(&vparse);






		    /* Look ahead for Assignment operator ':=' */
		    if (code == TCL_OK &&
			varend[TclParseAllWhiteSpace(varend,numBytes-len)] == ':' && 
			varend[TclParseAllWhiteSpace(varend,numBytes-len)+1] == '=') {

			lexeme = VARNAME;






>
|

<

<
<
<



>
>
>
>
>







739
740
741
742
743
744
745
746
747
748

749



750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
		    /* 
		     * TODO: this can probably be simplified.  
		     * For now, it is working. 
		     */

		    Tcl_Parse vparse;
		    const char *varend;
		    const char *varstart = &start[TclParseAllWhiteSpace(start, numBytes)];
		    int code, len;

		    code = Tcl_ParseVarName(NULL, varstart, numBytes, &vparse, 0);



		    len = vparse.tokenPtr[0].size;
		    varend = varstart+len;
		    Tcl_FreeParse(&vparse);

		    /* 
		     * An error here just means it's not a valid variable name,
		     * so continue on to treat as a function 
		     */

		    /* Look ahead for Assignment operator ':=' */
		    if (code == TCL_OK &&
			varend[TclParseAllWhiteSpace(varend,numBytes-len)] == ':' && 
			varend[TclParseAllWhiteSpace(varend,numBytes-len)+1] == '=') {

			lexeme = VARNAME;