r5388 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Sat Oct 2 23:22:03 CEST 2010


Author: phk
Date: 2010-10-02 23:22:03 +0200 (Sat, 02 Oct 2010)
New Revision: 5388

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_expr.c
Log:
Improve an error message now that the risk of hitting a wrong type
of symbol is much larger.



Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_expr.c	2010-10-02 21:20:54 UTC (rev 5387)
+++ trunk/varnish-cache/lib/libvcl/vcc_expr.c	2010-10-02 21:22:03 UTC (rev 5388)
@@ -546,6 +546,10 @@
 			vcc_NextToken(tl);
 			break;
 		}
+		/*
+		 * XXX: what if var and func/proc had same name ?
+		 * XXX: look for SYM_VAR first for consistency ?
+		 */
 		sym = VCC_FindSymbol(tl, tl->t, SYM_NONE);
 		if (sym == NULL) {
 			vsb_printf(tl->sb, "Symbol not found: ");
@@ -579,7 +583,9 @@
 			vcc_ErrWhere(tl, tl->t);
 			return;
 		default:
-			vsb_printf(tl->sb, "Symbol is not a function.\n");
+			vsb_printf(tl->sb,
+			    "Symbol type (%s) wrong in expression.\n",
+			    VCC_SymKind(tl, sym));
 			vcc_ErrWhere(tl, tl->t);
 			return;
 		}




More information about the varnish-commit mailing list