}
| new_name_list_r type '=' expr_list
{
+ if(addtop != N)
+ fatal("new_name_list_r type '=' expr_list");
+
$$ = rev($1);
dodclvar($$, $2);
}
| exprsym3_list_r LCOLAS expr_list
{
+ if(addtop != N)
+ fatal("exprsym3_list_r LCOLAS expr_list");
+
$$ = rev($1);
$$ = colas($$, $3);
$$ = nod(OAS, $$, $3);
walktype(n->left, Erv);
t = n->left->type;
if(t == T)
- return n;
+ goto ret;
if(n->right->op != ONAME)
- return n;
+ goto ret;
s = n->right->sym;
if(s == S)
- return n;
+ goto ret;
for(d=0; d<nelem(dotlist); d++) {
c = adddot1(s, t, d);
if(c > 0)
goto out;
}
- return n;
+ goto ret;
out:
if(c > 1)
n = nod(ODOT, n, n->right);
n->left->right = newname(dotlist[c].field->sym);
}
+ret:
+ n->ninit = list(addtop, n->ninit);
+ addtop = N;
return n;
}
static Type* sw2(Node*, Type*);
static Type* sw3(Node*, Type*);
static Node* curfn;
-static Node* addtop;
enum
{
if(curfn->type->outtuple)
if(walkret(curfn->nbody))
yyerror("function ends without a return statement");
+ if(addtop != N)
+ fatal("addtop in walk");
walkstate(curfn->nbody);
if(debug['W']) {
snprint(s, sizeof(s), "after %S", curfn->nname->sym);
{
Type *t;
+ addtop = list(addtop, n->ninit);
+ n->ninit = N;
+
if(n->left == N || n->right == N)
return;
switch(n->op) {