JSDOC/TokenStream.vala
authorAlan Knowles <alan@roojs.com>
Wed, 30 Sep 2015 09:53:00 +0000 (17:53 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 30 Sep 2015 09:53:00 +0000 (17:53 +0800)
JSDOC/TokenStream.vala

index 5dad997..dd2c0a2 100644 (file)
@@ -41,7 +41,7 @@ namespace JSDOC {
 
                if (considerWhitespace == true) {
                
-                   if (this.cursor+n < 0 || this.cursor+n > (this.tokens.length -1)) {
+                   if (this.cursor+n < 0 || this.cursor+n > (this.tokens.size -1)) {
                        return new Token("", "VOID", "START_OF_STREAM");
                    }
                    return this.tokens.get(this.cursor+n);
@@ -55,7 +55,7 @@ namespace JSDOC {
                 if (i < 0) {
                        return new Token("", "VOID", "START_OF_STREAM");
                        }
-                if (i > this.tokens.length) {
+                if (i > this.tokens.size) {
                        return new Token("", "VOID", "END_OF_STREAM");
                        }
 
@@ -75,13 +75,15 @@ namespace JSDOC {
                
            }
 
-           public int lookFor : function (data)
+           public int lookFor  (string data)
            {
                // non tree version..
                var i = this.cursor < 0 ? 0 : this.cursor ;
                
                while (true) {
-                   if (i >= this.tokens.length) return -1;
+                   if (i >= this.tokens.size) {
+                               return -1;
+                       }
                    if (this.tokens[i].data == data) {
                        return i;
                    }