// assumes that it's a list of statements; return them one by one static L> statements(L tok) { new L> l; int i = 0; while (i < l(tok)) { int j = indexOf(tok, ";", i); if (j < 0) { if (l(tok)-i >= 3) l.add(tok.subList(i, l(tok))); break; } else { l.add(tok.subList(i, j+2)); // actual CNC - we may return some comments twice, but we don't look at them anyways. i = j+1; // go to non-code token } } ret l; } static L> statements(S s) { ret statements(javaTok(s)); }