Tcl Source Code

Artifact [4f163f04ee]
Login

Artifact 4f163f04ee6e0a6a989e8a9076a53456c5df52eb:

Attachment "tip282.patch" to ticket [1969722fff] added by dgp 2008-05-22 23:22:34.
Index: generic/tclCompExpr.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCompExpr.c,v
retrieving revision 1.97
diff -u -r1.97 tclCompExpr.c
--- generic/tclCompExpr.c	28 Feb 2008 20:40:24 -0000	1.97
+++ generic/tclCompExpr.c	22 May 2008 16:08:40 -0000
@@ -292,6 +292,8 @@
 					 * and END pairs with START, in the
 					 * same way that CLOSE_PAREN pairs with
 					 * OPEN_PAREN. */
+#define SEPARATOR	( BINARY | 29)
+
 /*
  * When ParseExpr() builds the parse tree it must choose which operands to
  * connect to which operators.  This is done according to operator precedence.
@@ -308,6 +310,7 @@
     PREC_CLOSE_PAREN,	/* ")" */
     PREC_OPEN_PAREN,	/* "(" */
     PREC_COMMA,		/* "," */
+    PREC_SEPARATOR,	/* ";" */
     PREC_CONDITIONAL,	/* "?", ":" */
     PREC_OR,		/* "||" */
     PREC_AND,		/* "&&" */
@@ -365,8 +368,9 @@
     PREC_EQUAL,		/* NOT_IN_LIST */
     PREC_CLOSE_PAREN,	/* CLOSE_PAREN */
     PREC_END,		/* END */
+    PREC_SEPARATOR,	/* SEPARATOR */
     /* Expansion room for more binary operators */
-    0,  0,  0,
+    0,  0,
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
     0,  
@@ -420,8 +424,9 @@
     INST_LIST_NOT_IN,	/* NOT_IN_LIST */
     0,			/* CLOSE_PAREN */
     0,			/* END */
+    0,			/* SEPARATOR */
     /* Expansion room for more binary operators */
-    0,  0,  0,
+    0,  0,
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
     0,  
@@ -466,7 +471,7 @@
 	COMMA		/* , */,	MINUS		/* - */,
 	0		/* . */,	DIVIDE		/* / */,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,			/* 0-9 */
-	COLON		/* : */,	INVALID		/* ; */,
+	COLON		/* : */,	SEPARATOR	/* ; */,
 	0		/* < or << or <= */,
 	0		/* == or INVALID */,
 	0		/* > or >> or >= */,
@@ -2213,6 +2218,9 @@
 	    case OR:
 		TclEmitForwardJump(envPtr, TCL_TRUE_JUMP, &(jumpPtr->jump));
 		break;
+	    case SEPARATOR:
+		TclEmitOpcode(INST_POP, envPtr);
+		break;
 	    }
 	} else {
 	    switch (nodePtr->lexeme) {
@@ -2223,6 +2231,7 @@
 		}
 		break;
 	    case OPEN_PAREN:
+	    case SEPARATOR:
 
 		/* do nothing */
 		break;