JSDOC/TextStream.vala
[gnome.introspection-doc-generator] / JSDOC / TextStream.vala
index a68d2a7..e5f85b5 100644 (file)
@@ -27,7 +27,7 @@ namespace JSDOC {
             
             
             this.text = text;
-            this.length = text.char_count()
+            this.length = text.char_count();
             this.cursor = 0;
         }
         
@@ -38,15 +38,15 @@ namespace JSDOC {
                 return '\0';
             }
             return  this.get_char(this.cursor+n);
-        },
+        }
         
         public bool lookEOF(int n = 0)
         {
-            if (this.cursor+n < 0 || this.cursor+n >= this.length)) {
+            if (this.cursor+n < 0 || this.cursor+n >= this.length) {
                 return true;
             }
-            return  false
-        },
+            return  false;
+        }
         
         /**
          * @param n - number of characters to return..
@@ -62,17 +62,16 @@ namespace JSDOC {
             var i = 0;
             while (i < n) {
                 if (this.cursor+i < this.length) {
-                    pulled += this.text.get_char(this.cursor+i);
-                    i += pulled.to_string.length();
+                    var add = this.text.get_char(this.cursor+i).to_string();
+                    pulled += add;
+                    i += add.length;
                 } else {
-                     
                     return "";
                     
-                    
                 }
             }
             
-            this.cursor += n;
+            this.cursor += pulled.length;
             return pulled;
            
         }