[scanner] Mark enum members as private in transformer
authorJohan Dahlin <johan@gnome.org>
Sun, 26 Sep 2010 15:47:01 +0000 (12:47 -0300)
committerJohan Dahlin <johan@gnome.org>
Sun, 26 Sep 2010 15:47:01 +0000 (12:47 -0300)
Remove enum members which follows /* <private> */ comments
inside the transformer instead of the sourcescanner itself.

Fixes a crash when creating the gir for GstBase.

giscanner/scannerparser.y
giscanner/transformer.py

index d5f9a65..4d85e33 100644 (file)
@@ -878,17 +878,11 @@ enumerator_list
          }
          enumerator
          {
-              if (!scanner->private)
-                {
-                  $$ = g_list_append (NULL, $2);
-                }
+            $$ = g_list_append (NULL, $2);
          }
        | enumerator_list ',' enumerator
          {
-              if (!scanner->private)
-                {
-                  $$ = g_list_append ($1, $3);
-                }
+            $$ = g_list_append ($1, $3);
          }
        ;
 
index 9f2bc15..4ad4d87 100644 (file)
@@ -354,7 +354,7 @@ raise ValueError."""
             if prefixlen > 0:
                 name = child.ident[prefixlen:]
             else:
-                if child.ident is None:
+                if child.private:
                     continue
                 # Ok, the enum members don't have a consistent prefix
                 # among them, so let's just remove the global namespace