r5008 - trunk/varnish-cache/lib/libvcl
phk at varnish-cache.org
phk at varnish-cache.org
Mon Jul 5 12:10:20 CEST 2010
Author: phk
Date: 2010-07-05 12:10:19 +0200 (Mon, 05 Jul 2010)
New Revision: 5008
Modified:
trunk/varnish-cache/lib/libvcl/vcc_action.c
trunk/varnish-cache/lib/libvcl/vcc_parse.c
trunk/varnish-cache/lib/libvcl/vcc_string.c
trunk/varnish-cache/lib/libvcl/vcc_xref.c
Log:
Improve usage restriction messages a little bit.
Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 09:37:53 UTC (rev 5007)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 10:10:19 UTC (rev 5008)
@@ -69,7 +69,7 @@
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 @@
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 @@
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 @@
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);
}
Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 09:37:53 UTC (rev 5007)
+++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 10:10:19 UTC (rev 5008)
@@ -340,7 +340,7 @@
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);
Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-05 09:37:53 UTC (rev 5007)
+++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-05 10:10:19 UTC (rev 5008)
@@ -159,7 +159,7 @@
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);
Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-05 09:37:53 UTC (rev 5007)
+++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-05 10:10:19 UTC (rev 5008)
@@ -60,7 +60,7 @@
struct procuse {
VTAILQ_ENTRY(procuse) list;
- struct token *t;
+ const struct token *t;
unsigned mask;
const char *use;
};
@@ -217,12 +217,11 @@
{
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 @@
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 @@
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);
More information about the varnish-commit
mailing list