Commit 7dba510c authored by Shenghou Ma's avatar Shenghou Ma

cmd/gc: re-word some error messages

Fixes #6557.

R=golang-dev, rsc, tracey.brendan
CC=golang-dev
https://golang.org/cl/14432053
parent 5f3a7aa2
...@@ -289,7 +289,7 @@ variter(NodeList *vl, Node *t, NodeList *el) ...@@ -289,7 +289,7 @@ variter(NodeList *vl, Node *t, NodeList *el)
for(; vl; vl=vl->next) { for(; vl; vl=vl->next) {
if(doexpr) { if(doexpr) {
if(el == nil) { if(el == nil) {
yyerror("missing expr in var dcl"); yyerror("missing expression in var declaration");
break; break;
} }
e = el->n; e = el->n;
...@@ -312,7 +312,7 @@ variter(NodeList *vl, Node *t, NodeList *el) ...@@ -312,7 +312,7 @@ variter(NodeList *vl, Node *t, NodeList *el)
} }
} }
if(el != nil) if(el != nil)
yyerror("extra expr in var dcl"); yyerror("extra expression in var declaration");
return init; return init;
} }
...@@ -329,7 +329,7 @@ constiter(NodeList *vl, Node *t, NodeList *cl) ...@@ -329,7 +329,7 @@ constiter(NodeList *vl, Node *t, NodeList *cl)
vv = nil; vv = nil;
if(cl == nil) { if(cl == nil) {
if(t != N) if(t != N)
yyerror("constdcl cannot have type without expr"); yyerror("const declaration cannot have type without expression");
cl = lastconst; cl = lastconst;
t = lasttype; t = lasttype;
} else { } else {
...@@ -340,7 +340,7 @@ constiter(NodeList *vl, Node *t, NodeList *cl) ...@@ -340,7 +340,7 @@ constiter(NodeList *vl, Node *t, NodeList *cl)
for(; vl; vl=vl->next) { for(; vl; vl=vl->next) {
if(cl == nil) { if(cl == nil) {
yyerror("missing expr in const dcl"); yyerror("missing value in const declaration");
break; break;
} }
c = cl->n; c = cl->n;
...@@ -356,7 +356,7 @@ constiter(NodeList *vl, Node *t, NodeList *cl) ...@@ -356,7 +356,7 @@ constiter(NodeList *vl, Node *t, NodeList *cl)
vv = list(vv, nod(ODCLCONST, v, N)); vv = list(vv, nod(ODCLCONST, v, N));
} }
if(cl != nil) if(cl != nil)
yyerror("extra expr in const dcl"); yyerror("extra expression in const declaration");
iota += 1; iota += 1;
return vv; return vv;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment