summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse/gram.y1
-rw-r--r--parse/tok.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/parse/gram.y b/parse/gram.y
index e687fef..bc3e114 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -34,7 +34,6 @@ static void setupinit(Node *n);
%}
-%token<tok> Terror
%token<tok> Tplus /* + */
%token<tok> Tminus /* - */
%token<tok> Tmul /* * */
diff --git a/parse/tok.c b/parse/tok.c
index 34bab2f..4723368 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -484,6 +484,7 @@ static Tok *oper(void)
int tt;
char c;
+ tt = 0;
c = next();
switch (c) {
case '{': tt = Tobrace; break;
@@ -616,7 +617,6 @@ static Tok *oper(void)
tt = Tlnot;
break;
default:
- tt = Terror;
lfatal(curloc, "Junk character %c", c);
break;
}
@@ -806,7 +806,7 @@ static Tok *toknext(void)
t = oper();
}
- if (!t || t->type == Terror)
+ if (!t)
lfatal(curloc, "Unable to parse token starting with %c", c);
return t;
}