[master] 252f371 Save the VCL syntax version, we will need it later on.

Poul-Henning Kamp phk at FreeBSD.org
Thu May 19 12:14:06 CEST 2016


commit 252f37106a5efca30da75d08fc21f05c8220dc10
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu May 19 09:59:45 2016 +0000

    Save the VCL syntax version, we will need it later on.

diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h
index 647c760..c9c1396 100644
--- a/lib/libvcc/vcc_compile.h
+++ b/lib/libvcc/vcc_compile.h
@@ -175,6 +175,7 @@ struct vcp {
 struct vcc {
 	unsigned		magic;
 #define VCC_MAGIC		0x24ad719d
+	float			syntax;
 
 	/* Parameter/Template section */
 	const struct vcp	*param;
diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c
index 8a94749..811c90f 100644
--- a/lib/libvcc/vcc_parse.c
+++ b/lib/libvcc/vcc_parse.c
@@ -291,17 +291,17 @@ vcc_ParseDirector(struct vcc *tl)
 static void
 vcc_ParseVcl(struct vcc *tl)
 {
-	double ver;
 	struct token *tok;
 
 	assert(vcc_IdIs(tl->t, "vcl"));
 	vcc_NextToken(tl);
 	tok = tl->t;
-	ver = vcc_DoubleVal(tl);
+	tl->syntax = vcc_DoubleVal(tl);
 	ERRCHK(tl);
-	if (ver != 4.0) {
+	if (tl->syntax != 4.0) {
 		// see TODO above
-		VSB_printf(tl->sb, "VCL version %.1f not supported.\n", ver);
+		VSB_printf(tl->sb, "VCL version %.1f not supported.\n",
+		    tl->syntax);
 		vcc_ErrWhere(tl, tok);
 		ERRCHK(tl);
 	}



More information about the varnish-commit mailing list