JSDOC/TokenStream.vala
authorAlan Knowles <alan@roojs.com>
Wed, 25 Nov 2015 08:24:34 +0000 (16:24 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 25 Nov 2015 08:24:34 +0000 (16:24 +0800)
JSDOC/TokenStream.vala

index 5c9bee8..3855aed 100644 (file)
@@ -18,8 +18,8 @@ namespace JSDOC {
        public class TokenStream : Object
        {
        
-               Gee.ArrayList<Token> tokens;
-               int cursor; // where are we in the stream.              
+               protected Gee.ArrayList<Token> tokens;
+               public int cursor; // where are we in the stream.               
        
        
                public TokenStream(Gee.ArrayList<Token> tokens) {
@@ -309,6 +309,14 @@ namespace JSDOC {
                    }
                }
                 
+                
+               public void printRange(int start,  int end) {
+                       
+                       for(var i = start; i < end +1; i++) {
+                   print(this.tokens.get(i).asString());
+                       } 
+               }
+                
                /*
                arrayToString : function(ar) {
                    console.log(typeof(ar));
@@ -318,18 +326,19 @@ namespace JSDOC {
                    })
                    return ret.join('');
                },
-               dump: function(start, end)
+               */
+               public void dump(int start, int end)
                {
-                   start = Math.max(start || 0, 0);
-                   end = Math.min(end || this.tokens.length, this.tokens.length);
-                   var out='';
+                   start = int.max(start , 0);
+                   end = int.min(end, this.tokens.size);
+                   string  outs = "";;
                    for (var i =start;i < end; i++) {
                        
-                       out += (this.tokens[i].outData == false) ? this.tokens[i].data : this.tokens[i].outData;
-                   };
-                   print(out);
+                       outs += (this.tokens[i].outData == "") ? this.tokens[i].data : this.tokens[i].outData;
+                   }
+                   print(outs);
                }
-               */
+               
        }
 }