do not update lineno from ONAME nodes,
because they have declaration lineno not use.
show actual name in top-level statement error.
before
runtime.a:7: x.go:5: walkstate: NAME not a top level statement
after
x.go:14: walkstate: runtime.Goexit not a top level statement
R=ken
OCL=29113
CL=29116
return;
more = N;
- lineno = n->lineno;
+ if(n->op != ONAME)
+ lineno = n->lineno;
switch(n->op) {
case OLIST:
break;
default:
- yyerror("walkstate: %O not a top level statement", n->op);
+ if(n->op == ONAME)
+ yyerror("walkstate: %S not a top level statement", n->sym);
+ else
+ yyerror("walkstate: %O not a top level statement", n->op);
case OASOP:
case OAS:
if(nn->op != ORANGE)
fatal("dorange not ORANGE");
- implicitstar(&nn->right);
k = nn->left;
- m = nn->right;
- local = nn->etype;
-
v = N;
if(k->op == OLIST) {
v = k->right;
n = nod(OFOR, N, N);
- walktype(m, Erv);
+ walktype(nn->right, Erv);
+ implicitstar(&nn->right);
+ m = nn->right;
+ local = nn->etype;
+
t = m->type;
if(t == T)
goto out;