Fix #6912 - issue with parsing Roo.lib.Dom
[roojspacker] / roojspacker / SymbolSet.vala
index 3e944f5..4082ee8 100644 (file)
@@ -5,6 +5,17 @@ namespace JSDOC {
 
                private Gee.HashMap<string,Symbol> __index = null;
                
+               
+               public Json.Object toJson()
+               {
+                       var ret = new Json.Object();
+                        foreach(var k in this._index.keys) {
+               ret.set_object_member(k, this._index.get(k).toJson());
+               }
+               return ret;
+               }
+               
+               
                public Gee.HashMap<string,Symbol> _index {
                        get {
                                if (this.__index == null) {
@@ -14,7 +25,7 @@ namespace JSDOC {
                                return this.__index;
                        }
                }
-                
+               // CTOR - do nothing..?
                public SymbolSet ()
                {
 
@@ -235,9 +246,12 @@ namespace JSDOC {
                 }
                 //print("looking for memberOf: " + symbol.memberOf + " FOR " + symbol.alias);
                 // add to parent's methods or properties list
+                GLib.debug("Trying to add '%s' to '%s'", symbol.alias, symbol.memberOf);
+                
                 if (symbol.memberOf.length > 0) {
                     var container = this.getSymbol(symbol.memberOf);
                     if (container == null) {
+                           GLib.debug("Could not find container for '%s'", symbol.memberOf);
                         if (SymbolSet.isBuiltin(symbol.memberOf)) {
                             container = DocParser.addBuiltin(symbol.memberOf);
                         }
@@ -261,7 +275,8 @@ namespace JSDOC {
                         }
                     }
                     
-                    if (container != null && !container.isNamespace) {
+                    if (container != null && (!container.isNamespace || container.isStatic)) {
+                           GLib.debug("Calling addMember  for '%s' onto '%s'", symbol.alias, container.alias);                    
                         container.addMember(symbol);
                         }
                 }
@@ -284,7 +299,7 @@ namespace JSDOC {
                     
                      
                     if (contributer != null) {
-                        contributer.childClasses.add(symbol.alias);
+                        //contributer.childClasses.add(symbol.alias); << removed we do this in one go later.
                         symbol.inheritsFrom.add(contributer.alias);
                         //if (!isUnique(symbol.inheritsFrom)) {
                         //    imports.BuildDocs.Options.LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");