shithub: mc

Download patch

ref: 0de1c881850c5fec2183b2e59cd10b8931cd93a4
parent: 097d0aa9c3b22ed55d82bf4c0bab716942357ad6
author: Ori Bernstein <[email protected]>
date: Thu Sep 21 23:48:56 EDT 2017

Remove 'in' token.

	It's now available as a variable name.

--- a/parse/gram.y
+++ b/parse/gram.y
@@ -84,7 +84,6 @@
 
 %token<tok> Ttype	/* type */
 %token<tok> Tfor	/* for */
-%token<tok> Tin		/* in */
 %token<tok> Twhile	/* while */
 %token<tok> Tif		/* if */
 %token<tok> Telse	/* else */
@@ -946,10 +945,6 @@
 
 forstmt : Tfor optexprln loopcond optexprln block
 	{$$ = mkloopstmt($1->loc, $2, $3, $4, $5);}
-	| Tfor expr Tin exprln block {
-		$$ = mkiterstmt($1->loc, $2, $4, $5);
-		fprintf(stderr, "%s:%d: deprecated for syntax. use ':' to replace 'in'\n", fname($1->loc), lnum($1->loc));
-	}
 	| Tfor expr Tcolon exprln block
 	{$$ = mkiterstmt($1->loc, $2, $4, $5);}
 	| Tfor decl Tendln loopcond optexprln block {
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -191,7 +191,6 @@
 		{"goto", Tgoto},
 		{"if", Tif},
 		{"impl", Timpl},
-		{"in", Tin},
 		{"match", Tmatch},
 		{"pkg", Tpkg},
 		{"pkglocal", Tattr},