X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FTokenReader.vala;h=9f2c12d344168a3992691963dca6ecb8ddde7eb3;hb=47d710e1ad8352be849a59e4728f421627e568a6;hp=7bfe53e1b11ebb2f7e78b1e33dbea587cb917578;hpb=42e03b129be09ca0815c0dde1c70fcfd6707a30b;p=gnome.introspection-doc-generator diff --git a/JSDOC/TokenReader.vala b/JSDOC/TokenReader.vala index 7bfe53e..9f2c12d 100644 --- a/JSDOC/TokenReader.vala +++ b/JSDOC/TokenReader.vala @@ -2,33 +2,14 @@ // test code - -void main() { - var lc = new JSDOC.Lang_Class (); - var tr = new JSDOC.TokenReader(); - tr.keepDocs =true; - tr.keepWhite = true; - tr.keepComments = true; - tr.sepIdents = true; - tr.collapseWhite = false; - tr.filename = "test"; - string str; - FileUtils.get_contents("/home/alan/gitlive/gnome.introspection-doc-generator/JSDOC/Walker2.js", out str); - - var toks = tr.tokenize(new JSDOC.TextStream(str)); // dont merge xxx + . + yyyy etc. - toks.dump(); -} - + //const Token = imports.Token.Token; //const Lang = imports.Lang.Lang; /** @class Search a {@link JSDOC.TextStream} for language tokens. */ - - - - + namespace JSDOC { public class TokenArray: Object { @@ -74,7 +55,7 @@ namespace JSDOC { public void dump() { foreach(var token in this.tokens) { - print(token.asString()); + print(token.asString() +"\n"); } } @@ -280,8 +261,10 @@ namespace JSDOC { while (!stream.lookEOF()) { var ns = stream.look().to_string(); - found += ns; - if (Lang.punc(found + stream.look().to_string()) ) { + + if (null == Lang.punc(found + ns )) { + break; + } found += stream.next(); } @@ -420,7 +403,7 @@ namespace JSDOC { ) { var line = this.line; while (!stream.lookEOF()) { - print(stream.look().to_string()); + //print(stream.look().to_string()); if ( Lang.isNewline(stream.look().to_string())) { break; }