Commit 00dbfb76 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Allow for naming arguments in .vcc files

parent 640b2e4e
......@@ -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 != ")":
......
......@@ -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()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment