[gobject-introspection] docwriter/gjs: ignore nodes without a namespace



commit d66b9ec78a8338a90a5b36df69a93cf21040e972
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Feb 25 02:35:28 2014 +0100

    docwriter/gjs: ignore nodes without a namespace
    
    g-ir-compiler ignores them too, and they cause a crash, so whatever.

 giscanner/docwriter.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index 92fa127..37f575b 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -592,6 +592,14 @@ class DocFormatterGjs(DocFormatterIntrospectableBase):
         if isinstance(node, (ast.Compound, ast.Boxed)):
             self.resolve_gboxed_constructor(node)
 
+        # Nodes without namespace are AST bugs really
+        # They are used for structs and unions declared
+        # inline inside other structs, but they are not
+        # even picked up by g-ir-compiler, because they
+        # don't create a <type/> element.
+        # So just ignore them.
+        if isinstance(node, ast.Node) and node.namespace is None:
+            return False
         if isinstance(node, ast.ErrorQuarkFunction):
             return False
         if isinstance(node, ast.Field):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]