[gobject-introspection] [scanner] Make sure private enums are filtered
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] [scanner] Make sure private enums are filtered
- Date: Sun, 26 Sep 2010 17:44:49 +0000 (UTC)
commit ea72e772186c16d232d7340712bb7f52ebe8badb
Author: Johan Dahlin <johan gnome org>
Date: Sun Sep 26 14:44:08 2010 -0300
[scanner] Make sure private enums are filtered
This is a follow-up to 60a8c75 which wasn't properly fixed.
giscanner/scannerparser.y | 2 ++
giscanner/transformer.py | 4 ++--
tests/scanner/Regress-1.0-expected.gir | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index 012e343..80da1b9 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -878,10 +878,12 @@ enumerator_list
}
enumerator
{
+ $2->private = scanner->private;
$$ = g_list_append (NULL, $2);
}
| enumerator_list ',' enumerator
{
+ $3->private = scanner->private;
$$ = g_list_append ($1, $3);
}
;
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 4ad4d87..acf0df8 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -351,11 +351,11 @@ raise ValueError."""
prefixlen = 0
members = []
for child in symbol.base_type.child_list:
+ if child.private:
+ continue
if prefixlen > 0:
name = child.ident[prefixlen:]
else:
- if child.private:
- continue
# Ok, the enum members don't have a consistent prefix
# among them, so let's just remove the global namespace
# prefix.
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 15029d2..e1aea04 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -700,10 +700,10 @@ TpAccount::status-changed</doc>
</field>
</record>
<bitfield name="TestPrivateEnum" c:type="RegressTestPrivateEnum">
- <member name="before"
+ <member name="public_enum_before"
value="1"
c:identifier="REGRESS_TEST_PUBLIC_ENUM_BEFORE"/>
- <member name="after"
+ <member name="public_enum_after"
value="4"
c:identifier="REGRESS_TEST_PUBLIC_ENUM_AFTER"/>
</bitfield>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]