X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FTokenReader.vala;h=e3e6096c910a9f55dafc430ae47919137f9412a2;hb=cec8dfd0781a5265d518eec19209e2aa59a05afc;hp=a69151520dda1ab11025bea557a3700f4b9a2d8a;hpb=4986e91f955ba36d90f3e97ea4cd7ab2d49a68be;p=gnome.introspection-doc-generator diff --git a/JSDOC/TokenReader.vala b/JSDOC/TokenReader.vala index a691515..e3e6096 100644 --- a/JSDOC/TokenReader.vala +++ b/JSDOC/TokenReader.vala @@ -242,9 +242,9 @@ namespace JSDOC { */ public bool read_punc (TokenStream stream, TokenArray tokens) { - var found = ""; + string found = ""; var name; - while (!stream.look().eof && Lang.punc(found + stream.look()).length > 0) { + while (!stream.lookEOF() && Lang.punc(found + stream.look()).length > 0) { found += stream.next(); } @@ -272,15 +272,16 @@ namespace JSDOC { tokens.push(new Token(found, "PUNC", Lang.punc(found), this.line)); return true; - }, + } /** @returns {Boolean} Was the token found? */ - read_space : function(/**JSDOC.TokenStream*/stream, tokens) { + public bool read_space (TokenStream stream, TokenArray tokens) + { var found = ""; - while (!stream.look().eof && Lang.isSpace(stream.look()) && !Lang.isNewline(stream.look())) { + while (!stream.lookEOF() && Lang.isSpace(stream.look()) && !Lang.isNewline(stream.look())) { found += stream.next(); } @@ -288,8 +289,12 @@ namespace JSDOC { return false; } //print("WHITE = " + JSON.stringify(found)); - if (this.collapseWhite) found = " "; - if (this.keepWhite) tokens.push(new Token(found, "WHIT", "SPACE", this.line)); + if (this.collapseWhite) { + found = " "; // this might work better if it was a '\n' ??? + } + if (this.keepWhite) { + tokens.push(new Token(found, "WHIT", "SPACE", this.line)); + } return true; }, @@ -297,7 +302,7 @@ namespace JSDOC { /** @returns {Boolean} Was the token found? */ - read_newline : function(/**JSDOC.TokenStream*/stream, tokens) { + public bool read_newline (TokenStream stream, TokenArray tokens) var found = ""; var line = this.line; while (!stream.look().eof && Lang.isNewline(stream.look())) {