this.rewind();
}
-
+ public Gee.ArrayList<Token> toArray()
+ {
+ return this.tokens;
+ }
public void rewind() {
{
// accepts names or "{" etc..
-
+ var stop = in_stop;
start = Lang.punc(start) == null ? start : Lang.punc(start);
if (stop=="") {
Token token;
while (null != (token = this.look(1,false))) {
+ debug("BALANCE: %d %s " , this.cursor, token.asString());
if (token.is(start)) {
// Seed.print("balance: START : " + depth + " " + token.data);
depth++;
if (token.is(stop)) {
depth--;
- // Seed.print("balance: STOP: " + depth + " " + token.data);
+
+ print("balance (%d): STOP: %s\n" , depth , token.data);
if (depth < 1) {
+ this.next(); // shift cursor to eat closer...
+ print("returning got %d\n", got.size);
return got;
}
+
}
if (null == this.next()) {
break;
}
}
-
+ public void dumpAllFlat()
+ {
+ for (var i = 0;i < this.tokens.size; i++) {
+
+ print("%d: %s\n", i, this.tokens[i].asString());
+ }
+
+ }
}
}