[master] 00dbfb7 Allow for naming arguments in .vcc files
Poul-Henning Kamp
phk at varnish-cache.org
Wed Mar 6 09:00:44 CET 2013
commit 00dbfb76f8245be2c6d667e8bd1272e9fe28a9e2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Mar 6 08:00:28 2013 +0000
Allow for naming arguments in .vcc files
diff --git a/lib/libvcl/vmodtool.py b/lib/libvcl/vmodtool.py
index 9447549..4d964cf 100755
--- a/lib/libvcl/vmodtool.py
+++ b/lib/libvcl/vmodtool.py
@@ -265,6 +265,8 @@ class func(object):
fo.write(self.pfx)
for a in self.al:
fo.write(", " + ctypes[a.typ])
+ if a.nam != None:
+ fo.write(" " + a.nam)
fo.write(");\n")
def c_typedef(self, modname):
@@ -459,6 +461,9 @@ def parse_func(tl, rt_type = None, obj=None):
al.append(arg(t.str))
else:
raise Exception("ARG? %s" % t.str)
+ if is_c_name(tl[0].str):
+ al[-1].nam = tl[0].str
+ t = tl.pop(0)
if tl[0].str == ",":
tl.pop(0)
elif tl[0].str != ")":
diff --git a/lib/libvmod_debug/vmod.vcc b/lib/libvmod_debug/vmod.vcc
index 653f168..57d8721 100644
--- a/lib/libvmod_debug/vmod.vcc
+++ b/lib/libvmod_debug/vmod.vcc
@@ -32,6 +32,6 @@ Function STRING author(ENUM { phk, des, kristian, mithrandir })
Function VOID test_priv_call(PRIV_CALL)
Function VOID test_priv_vcl(PRIV_VCL)
Object obj(STRING) {
- Method STRING .foo(STRING)
+ Method STRING .foo(STRING why)
Method TIME .date()
}
More information about the varnish-commit
mailing list