Want to help DMD bugfixing? Write a simple utility.
Tyro
Tyro
Sun Mar 20 11:43:55 PDT 2011
Messed that up again: see embeded change. Wish I could just copy
and pase but that's not possible with my current setup.
== Quote from Tyro[a.c.edwards] (nospam at home.com)'s article
> 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;
> # }
# else
# {
# writeln(line);
# }
> #
> # endTest:;
> # if(end)
> # {
> # start = false;
> # end = false;
> # blankLine = true;
> # }
> # }
More information about the Digitalmars-d-learn
mailing list