static L> indentedStringsToForest(LS l) { if (empty(l)) ret emptyList(); int baseIndent = indentWidth(first(l)); new L> forest; for i over l: { int j = i+1; while (j < l(l) && indentWidth(l.get(j)) > baseIndent) ++j; forest.add(new Tree(l.get(i), indentedStringsToForest(subList(l, i+1, j)))); } ret forest; }