Commit 1cb7b206 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Improve usage restriction messages a little bit.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5008 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 70d8aeed
......@@ -69,7 +69,7 @@ parse_error(struct vcc *tl)
vcc_NextToken(tl);
if (tl->t->tok == ID) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read");
ERRCHK(tl);
assert(vp != NULL);
if (vp->fmt == INT) {
......@@ -120,7 +120,7 @@ parse_set(struct vcc *tl)
vcc_NextToken(tl);
ExpectErr(tl, ID);
vt = tl->t;
vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "set");
vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "cannot be set");
ERRCHK(tl);
assert(vp != NULL);
Fb(tl, 1, "%s", vp->lname);
......@@ -241,7 +241,7 @@ parse_unset(struct vcc *tl)
vcc_NextToken(tl);
ExpectErr(tl, ID);
vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "unset");
vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "cannot be unset");
ERRCHK(tl);
assert(vp != NULL);
if (vp->fmt != STRING || vp->hdr == NULL) {
......@@ -529,7 +529,8 @@ vcc_ParseAction(struct vcc *tl)
for(atp = action_table; atp->name != NULL; atp++) {
if (vcc_IdIs(at, atp->name)) {
if (atp->bitmask != 0)
vcc_AddUses(tl, at, atp->bitmask, "is");
vcc_AddUses(tl, at, atp->bitmask,
"not a valid action");
atp->func(tl);
return(1);
}
......
......@@ -340,7 +340,7 @@ vcc_Cond_2(struct vcc *tl)
vcc_Cond_0(tl);
SkipToken(tl, ')');
} else if (tl->t->tok == ID) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read");
ERRCHK(tl);
assert(vp != NULL);
vcc_NextToken(tl);
......
......@@ -159,7 +159,7 @@ vcc_StringVal(struct vcc *tl)
return 1;
}
if (tl->t->tok == ID) {
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read");
vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read");
if (tl->err)
return (0);
assert(vp != NULL);
......
......@@ -60,7 +60,7 @@ struct proccall {
struct procuse {
VTAILQ_ENTRY(procuse) list;
struct token *t;
const struct token *t;
unsigned mask;
const char *use;
};
......@@ -217,12 +217,11 @@ vcc_AddUses(struct vcc *tl, const struct token *t, unsigned mask,
{
struct procuse *pu;
(void)t;
if (tl->curproc == NULL) /* backend */
return;
pu = TlAlloc(tl, sizeof *pu);
assert(pu != NULL);
pu->t = tl->t;
pu->t = t;
pu->mask = mask;
pu->use = use;
VTAILQ_INSERT_TAIL(&tl->curproc->uses, pu, list);
......@@ -358,7 +357,7 @@ vcc_CheckUseRecurse(struct vcc *tl, const struct proc *p,
pu = vcc_FindIllegalUse(p, m);
if (pu != NULL) {
vsb_printf(tl->sb,
"'%.*s': %s not possible in method '%.*s'.\n",
"'%.*s': %s from method '%.*s'.\n",
PF(pu->t), pu->use, PF(p->name));
vcc_ErrWhere(tl, pu->t);
vsb_printf(tl->sb, "\n...in subroutine \"%.*s\"\n",
......@@ -393,7 +392,7 @@ vcc_CheckUses(struct vcc *tl)
pu = vcc_FindIllegalUse(p, m);
if (pu != NULL) {
vsb_printf(tl->sb,
"'%.*s': %s not possible in method '%.*s'.",
"'%.*s': %s in method '%.*s'.",
PF(pu->t), pu->use, PF(p->name));
vsb_cat(tl->sb, "\nAt: ");
vcc_ErrWhere(tl, pu->t);
......
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