The following patch addresses the following issues: 1) fixed improper handling of nested and multiline comments that do not take up a complete line.
2) eliminate extra blank lines where unit tests and comments are removed. Replace lines 31 & 32 with: # auto n = countUntil(line, "+/"); # if(n != -1 && n < line.lenght - 2) # { # nested = false; # goto output; # } Replace lines 52 & 53 with: # auto n = countUntil(line, "*/"); # if(n != -1 && n < line.lenght - 2) # { # comment = false; # goto output; # } Replace lines 92 - 100 with; # output:; # if(!start) # { # if(line.length == 0 && !blankLine) # { # blankLine = true; # writeln(line); # } # else if(line.length == 0 && blankLine) # { # goto endTest; # } # # endTest:; # if(end) # { # start = false; # end = false; # blankLine = true; # } # }