From bce199127da5368700f3105e0bd19bc338810915 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 28 Jul 2014 17:54:14 -0400 Subject: scanner: Honor nested types on array declarations as well We have special code to look at (type GLib.List(utf8)), but (type GLib.PtrArray(utf8)) didn't work. This allows NetworkManager to annotate the ActiveConnections property. https://bugzilla.gnome.org/show_bug.cgi?id=733879 --- giscanner/maintransformer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'giscanner/maintransformer.py') diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 19e3f24c..4326374f 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -287,7 +287,10 @@ class MainTransformer(object): return base if isinstance(base, ast.List) and len(rest) == 1: return ast.List(base.name, *rest) - if isinstance(base, ast.Map) and len(rest) == 2: + elif isinstance(base, ast.Array) and len(rest) == 1: + base.element_type = rest[0] + return base + elif isinstance(base, ast.Map) and len(rest) == 2: return ast.Map(*rest) message.warn( "Too many parameters in type specification %r" % (type_str, )) -- cgit v1.2.1