2025-08-10 01:34:16 +02:00

29 lines
337 B
Awk

BEGIN {
indent = "";
}
$1 == "//-" {
sub("^ ", "", indent);
}
$1 ~ "^//[+-/0]$", $1 ~ "^//[+-/0]$" {
line = $0;
sub("^[ \t]*//. ?", "", line);
if (line ~ /↩$/)
sub("↩$", "\\", line);
if ($1 == "//0")
print line;
else
print indent line;
}
$1 == "//+" {
indent = indent " ";
}
$1 !~ "^//[+-/0]$" {
print "";
}