fix overwrite symbols - not sure why it was enabled?
[roojspacker] / roojspacker / SymbolSet.vala
index bf82b2a..ef279bb 100644 (file)
@@ -25,7 +25,7 @@ namespace JSDOC {
                                return this.__index;
                        }
                }
-                
+               // CTOR - do nothing..?
                public SymbolSet ()
                {
 
@@ -62,7 +62,8 @@ namespace JSDOC {
             
              
             if (this.hasSymbol(symbol.alias)) {
-                GLib.warning("Overwriting symbol documentation for: %s.",symbol.alias);
+                GLib.warning("Skip Overwriting symbol documentation for: %s.",symbol.alias);
+                return;
             }
             this._index.set(symbol.alias,  symbol);
         }
@@ -181,17 +182,20 @@ namespace JSDOC {
             foreach (var p in this.keys()) {
                 var symbol = this.getSymbol(p);
                 
-                if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
+                if (symbol.is("FILE") || symbol.is("GLOBAL")) {
+                       continue;
+               }
                 
                 // the memberOf value was provided in the @memberOf tag
-                else if (symbol.memberOf.length > 0) {
+                
+                GLib.debug("Resolve: %s memberOf=%s", symbol.alias, symbol.memberOf);
+                               if (symbol.memberOf.length > 0) {
                        var regex = new GLib.Regex("^("+symbol.memberOf+"[.#-])(.+)$");
                        GLib.MatchInfo minfo;
                     var parts = regex.match_full(symbol.alias, -1, 0, 0 , out minfo);
                     
                     // like foo.bar is a memberOf foo
                     if (parts) {                        
-                               
                         symbol.memberOf = minfo.fetch(1);
                         symbol.private_name = minfo.fetch(2);
                     }
@@ -202,9 +206,9 @@ namespace JSDOC {
                         
                         this.renameSymbol(p, symbol.memberOf + symbol.name);
                     }
-                }
+                } else {
                 // the memberOf must be calculated
-                else {
+                
                        GLib.MatchInfo minfo;                
                     var parts = /^(.*[.#-])([^.#-]+)$/.match_full(symbol.alias, -1, 0, 0 , out minfo);
 
@@ -215,7 +219,7 @@ namespace JSDOC {
                 }
 
                 // set isStatic, isInner
-                if (symbol.memberOf.length > 0) {
+                if (symbol.memberOf.length > 0 && !symbol.is("CONSTRUCTOR")) {
                     switch (symbol.memberOf[symbol.memberOf.length-1]) {
                         case '#' :
                             symbol.isStatic = false;
@@ -246,9 +250,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);
                         }
@@ -272,7 +279,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);
                         }
                 }
@@ -295,7 +303,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.");