summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2013-09-05 17:50:46 +0200
committerDieter Verfaillie <dieterv@optionexplicit.be>2013-10-08 20:57:29 +0200
commit717be6d97095d5f0641d8d1ef74947dc75b3f204 (patch)
treea15bfcd2f2bc2fd984ff840a1a51cd52711ed1da
parentaa4a40288533b3d06d69ebe8fe1a12bfec2a8cda (diff)
downloadgobject-introspection-717be6d97095d5f0641d8d1ef74947dc75b3f204.tar.gz
giscanner: write '<varargs/>' instead of '<varargs></varargs>'
-rw-r--r--giscanner/girwriter.py3
-rw-r--r--tests/scanner/Foo-1.0-expected.gir6
-rw-r--r--tests/scanner/Regress-1.0-expected.gir6
3 files changed, 5 insertions, 10 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index 2bc9f153..2f3d59cc 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -294,8 +294,7 @@ class GIRWriter(XMLWriter):
elif ntype.ctype:
attrs.append(('c:type', ntype.ctype))
if isinstance(ntype, ast.Varargs):
- with self.tagcontext('varargs', []):
- pass
+ self.write_tag('varargs', [])
elif isinstance(ntype, ast.Array):
if ntype.array_type != ast.Array.C:
attrs.insert(0, ('name', ntype.array_type))
diff --git a/tests/scanner/Foo-1.0-expected.gir b/tests/scanner/Foo-1.0-expected.gir
index 8ef7c203..61d53c96 100644
--- a/tests/scanner/Foo-1.0-expected.gir
+++ b/tests/scanner/Foo-1.0-expected.gir
@@ -621,8 +621,7 @@ uses a C sugar return type.</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter transfer-ownership="none">
- <varargs>
- </varargs>
+ <varargs/>
</parameter>
</parameters>
</method>
@@ -1096,8 +1095,7 @@ exposed to language bindings.</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter transfer-ownership="none">
- <varargs>
- </varargs>
+ <varargs/>
</parameter>
</parameters>
</callback>
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 7b823a3f..637a2735 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -1477,8 +1477,7 @@ uses a C sugar return type.</doc>
<type name="gint" c:type="int"/>
</parameter>
<parameter name="..." transfer-ownership="none">
- <varargs>
- </varargs>
+ <varargs/>
</parameter>
</parameters>
</method>
@@ -1908,8 +1907,7 @@ exposed to language bindings.</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="..." transfer-ownership="none">
- <varargs>
- </varargs>
+ <varargs/>
</parameter>
</parameters>
</callback>