Want to help DMD bugfixing? Write a simple utility.

Tyro Tyro
Sun Mar 20 11:38:20 PDT 2011


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;
#     }
# }


More information about the Digitalmars-d-learn mailing list