static S rules_unfoldIndented(S s, S prefix) { if (containsTabs(s)) warn("Tabs in input"); s = s.replace("\t", " "); L lines = toLines(s); for i over lines: { S line = lines.get(i); S trimmed = trim(line); if (empty(trimmed)) continue; int n = getIndent(line); int j = i+1; bool any = false; while (j < l(lines)) { if (emptyAfterTrim(lines.get(j))) ++j; else if (getIndent(lines.get(j)) > n) { ++j; any = true; } else break; } if (!any) continue; lines.set(i, ""); while (i+1 < j) { ++i; S l = lines.get(i); if (!emptyAfterTrim(l)) lines.set(i, rep(' ', getIndent(l)) + prefix + "(" + trimmed + ") & " + trim(l)); } } ret fromLines(lines); }