X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FTokenStream.vala;h=10a8b98f75bd0a31a047f854b4ac73a04407ca71;hb=e80166c6012671cf8c2956f1fa5f943669bff60e;hp=539875b62491c50328ef59bafbfb9ff202f0ffde;hpb=744f21524bd0fb3fce63be27eec9b2c8abb16773;p=gnome.introspection-doc-generator diff --git a/JSDOC/TokenStream.vala b/JSDOC/TokenStream.vala index 539875b..10a8b98 100644 --- a/JSDOC/TokenStream.vala +++ b/JSDOC/TokenStream.vala @@ -28,7 +28,10 @@ namespace JSDOC { this.rewind(); } - + public Gee.ArrayList toArray() + { + return this.tokens; + } public void rewind() { @@ -210,11 +213,11 @@ namespace JSDOC { * @param start {String} token name or data (eg. '{' * @param stop {String} (Optional) token name or data (eg. '}' */ - public Gee.ArrayList balance (string start, string stop = "") throws TokenStreamError + public Gee.ArrayList balance (string start, string in_stop = "") throws TokenStreamError { // accepts names or "{" etc.. - + var stop = in_stop; start = Lang.punc(start) == null ? start : Lang.punc(start); if (stop=="") { @@ -233,6 +236,7 @@ namespace JSDOC { Token token; while (null != (token = this.look(1,false))) { + debug("BALANCE: " + token.asString()); if (token.is(start)) { // Seed.print("balance: START : " + depth + " " + token.data); depth++; @@ -245,10 +249,12 @@ namespace JSDOC { if (token.is(stop)) { depth--; - // Seed.print("balance: STOP: " + depth + " " + token.data); + + print("balance (%d): STOP: %s\n" , depth , token.data); if (depth < 1) { return got; } + } if (null == this.next()) { break;