int nbh, nelem;
struct fld_spec *fs;
unsigned u;
+ const char *first;
fs = vcc_FldSpec(tl, "!backend", "!weight", NULL);
PF(t_dir));
for (nelem = 0; tl->t->tok != '}'; nelem++) { /* List of members */
+ first = "";
t_be = tl->t;
vcc_ResetFldSpec(fs);
nbh = -1;
if (vcc_IdIs(t_field, "backend")) {
vcc_ParseBackendHost(tl, &nbh,
t_dir, t_policy, nelem);
- Fc(tl, 0, " .host = &bh_%d,", nbh);
+ Fc(tl, 0, "%s .host = &bh_%d", first, nbh);
ERRCHK(tl);
} else if (vcc_IdIs(t_field, "weight")) {
ExpectErr(tl, CNUM);
vcc_ErrWhere(tl, tl->t);
return;
}
- Fc(tl, 0, " .weight = %u", u);
+ Fc(tl, 0, "%s .weight = %u", first, u);
vcc_NextToken(tl);
ExpectErr(tl, ';');
vcc_NextToken(tl);
} else {
ErrInternal(tl);
}
+ first = ", ";
}
vcc_FieldsOk(tl, fs);
if (tl->err) {
struct token *t_field, *t_be;
int nbh, nelem;
struct fld_spec *fs;
+ const char *first;
fs = vcc_FldSpec(tl, "!backend", NULL);
PF(t_dir));
for (nelem = 0; tl->t->tok != '}'; nelem++) { /* List of members */
+ first = "";
t_be = tl->t;
vcc_ResetFldSpec(fs);
nbh = -1;
if (vcc_IdIs(t_field, "backend")) {
vcc_ParseBackendHost(tl, &nbh,
t_dir, t_policy, nelem);
- Fc(tl, 0, " .host = &bh_%d,", nbh);
+ Fc(tl, 0, "%s .host = &bh_%d", first, nbh);
ERRCHK(tl);
} else {
ErrInternal(tl);
}
+ first = ", ";
}
vcc_FieldsOk(tl, fs);
if (tl->err) {