JSDOC/TokenReader.vala
[gnome.introspection-doc-generator] / JSDOC / TokenReader.vala
index 8bf3716..191b7a8 100644 (file)
@@ -90,12 +90,9 @@ namespace JSDOC {
             var tokens = new TokenArray();
            
             bool eof;
-            while (true) {
+            while (!stream.lookEOF()) {
+                
                 
-                stream.look(0, out eof) 
-                if (eof) {
-                    break;
-                }
                 if (this.read_mlcomment(stream, tokens)) continue;
                 if (this.read_slcomment(stream, tokens)) continue;
                 if (this.read_dbquote(stream, tokens))   continue;
@@ -162,7 +159,9 @@ namespace JSDOC {
          */
         public Token lastSym(TokenArray tokens, int n) {
             for (var i = n-1; i >= 0; i--) {
-                if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
+                if (!(tokens.get(i).is("WHIT") || tokens.get(i).is("COMM"))) {
+                    return tokens.get(i);
+                }
             }
             return null;
         },
@@ -172,7 +171,7 @@ namespace JSDOC {
         /**
             @returns {Boolean} Was the token found?
          */
-        read_word : function(/**JSDOC.TokenStream*/stream, tokens) {
+        public bool read_word (TokenStream stream, TokenArray tokens) {
             var found = "";
             while (!stream.look().eof && Lang.isWordChar(stream.look())) {
                 found += stream.next();