[4.1] 304342f vmodtool should actually raise an error for unknown keywords

Nils Goroll nils.goroll at uplex.de
Fri Sep 4 15:54:55 CEST 2015


commit 304342fdb096d96c0d391f45e43ebca1314b339e
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Aug 18 17:58:29 2015 +0200

    vmodtool should actually raise an error for unknown keywords
    
    ... like 'Unknown keyword: $Init' for 4.0 vcc files.

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 5a6c0fc..85a9ac2 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -870,14 +870,6 @@ def runmain(inputvcc, outputname="vcc_if"):
 	#######################################################################
 	# Break into sections
 
-	keywords = {
-		"$Module":	True,
-		"$Function":	True,
-		"$Object":	True,
-		"$Method":	True,
-		"$Event":	True,
-	}
-
 	sl = []
 	sc = FileSection()
 	sl.append(sc)
@@ -885,7 +877,7 @@ def runmain(inputvcc, outputname="vcc_if"):
 		ln += 1
 		l = lines.pop(0)
 		j = l.split()
-		if len(j) > 0 and j[0] in keywords:
+		if len(j) > 0 and re.match("^\$", j[0]):
 			sc = FileSection()
 			sl.append(sc)
 		sc.add_line(ln, l)



More information about the varnish-commit mailing list