src/jsdoc/Symbol.vala
[roojspacker] / src / jsdoc / Symbol.vala
index 02b84d3..319c5b4 100644 (file)
@@ -25,6 +25,7 @@ namespace JSDOC {
                        Symbol.regex_prototype = new GLib.Regex("\\.prototype\\.?");
                }
 
+               private string private_string_name = "";
                private string private_name {
                set {
                                var n = Symbol.regex_global(value, value.length, 0, "");
@@ -36,54 +37,61 @@ namespace JSDOC {
                                        n = n.substring(0, n.length-1);
                                }
                        
-                       this.private_name = n;
+                       this.private_string_name = n;
                }
                
                }
                 
         public string name {
-               get { return this.private_name; }
+               get { return this.private_string_name; }
                }
                
       
         string defaultValue = "";
         
-        
-        private Gee.ArrayList<DocTag> private_params{
-               set  {
-                for (var i = 0; i < value.size; i++) {
-                    //if (v[i].constructor != DocTag) { // may be a generic object parsed from signature, like {type:..., name:...}
-                    //    var ty = v[i].hasOwnProperty('type') ? v[i].type : '';
-                    //    this._params[i] = new DocTag(
-                    //        "param"+((ty)?" {"+ty+"}":"")+" "+v[i].name);
-                    //}
-                    //else {
-                    //    this._params[i] = v[i];
-                    //}
-                    this.private_params.add(v.get(i));
-                }
-                //this.params = this._params;
-            }
-        }
-        public Gee.ArrayList<DocTag> params {
-            get {
-                       return this.private_params;
-               }
-                       
-        }
-        
-        
-        private Gee.ArrayList<DocTag>  augments ;  
-        
-        private Gee.ArrayList<DocTag>  exceptions ;
-       
-        private Gee.ArrayList<DocTag>  inherits; 
-        private Gee.ArrayList<DocTag>  methods;
+               private Gee.ArrayList<DocTag> private_doctag_params;
+
+               private Gee.ArrayList<DocTag> private_params{
+                       set  {
+                               for (var i = 0; i < value.size; i++) {
+                                  
+                                   this.private_doctag_params.add(v.get(i));
+                               }
+                               //this.params = this._params;
+                       }
+               }
+     
+               Gee.ArrayList<string> private_string_params{
+                       set  {
+                               for (var i = 0; i < value.size; i++) {
+
+                                   //var ty = v[i].hasOwnProperty('type') ? v[i].type : '';
+                                   this.private_doctag_params.add( new DocTag(value.get(i)));
+                                          
+                                  //"param"+((ty)?" {"+ty+"}":"")+" "+v.get(i).name);
+                                   
+                               }
+                               
+                       }
+               }
+               public Gee.ArrayList<DocTag> params {
+                       get {
+                               return this.private_doctag_params;
+                       }
+               
+               }
+
+               private Gee.ArrayList<DocTag>  augments ;  
+
+               private Gee.ArrayList<DocTag>  exceptions ;
+
+               private Gee.ArrayList<DocTag>  inherits; 
+               private Gee.ArrayList<DocTag>  methods;
 
                private Gee.ArrayList<DocTag> properties;
-        private Gee.ArrayList<DocTag> requires;
-        private Gee.ArrayList<DocTag> returns;
-        private Gee.ArrayList<DocTag> see ;
+               private Gee.ArrayList<DocTag> requires;
+               private Gee.ArrayList<DocTag> returns;
+               private Gee.ArrayList<DocTag> see ;
 
          
         //childClasses : [],
@@ -196,9 +204,9 @@ namespace JSDOC {
             //println("Symbol created: " + isa + ":" + name);
             this.private_name = name;
             this.alias = this.getName();
-            this.setParams(params);
+            this.private_string_params = params; 
             this.isa = (isa == "VIRTUAL")? "OBJECT":isa;
-            this.comment = comment || new DocComment("")
+            this.comment =  new DocComment(comment);
             
             this.srcFile = DocParser.currentSourceFile;
             
@@ -208,15 +216,20 @@ namespace JSDOC {
                        this.alias = this.srcFile;
                }
 
-            this.setTags();
+            this.tagsFromComment();
             
-        },
+        }
 
-        setTags : function() {
+        void tagsFromComment() {
             // @author
             var authors = this.comment.getTag("author");
-            if (authors.length) {
-                this.author = authors.map(function($){return $.desc;}).join(", ");
+            if (authors.size) {
+                       // turns author into a string....
+                       this.author = "";
+                foreach(authors as a) {
+                    this.author += (this.author == "") ? "": ", ";
+                    this.author += a.desc;
+                }
             }
             
             /*~t