shithub: mc

Download patch

ref: c819f3a197d66c0f7c7c49aaffdf045bd4a46123
parent: 4a30425e39b5126c8950b933ea8df08164125e9b
author: Ori Bernstein <ori@markovcorp.com>
date: Tue Feb 14 05:50:09 EST 2017

Remove unused token type.

--- a/parse/gram.y
+++ b/parse/gram.y
@@ -34,7 +34,6 @@
 
 %}
 
-%token<tok> Terror
 %token<tok> Tplus	/* + */
 %token<tok> Tminus	/* - */
 %token<tok> Tmul	/* * */
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -484,6 +484,7 @@
 	int tt;
 	char c;
 
+	tt = 0;
 	c = next();
 	switch (c) {
 	case '{': tt = Tobrace; break;
@@ -616,7 +617,6 @@
 			  tt = Tlnot;
 		  break;
 	default:
-		  tt = Terror;
 		  lfatal(curloc, "Junk character %c", c);
 		  break;
 	}
@@ -806,7 +806,7 @@
 		t = oper();
 	}
 
-	if (!t || t->type == Terror)
+	if (!t)
 		lfatal(curloc, "Unable to parse token starting with %c", c);
 	return t;
 }