--- dfilter.d.orig Thu Apr 21 10:42:58 2005 +++ dfilter.d Thu Apr 21 10:59:46 2005 @@ -3,8 +3,9 @@ * * * D code filter for Doxygen 1.4.2 * * * -* Portions written by Hauke Duden, Stewart Gordon, James Dunne, * -* probably various anonymous authors.... * +* Portions written by Hauke Duden, Stewart Gordon and James Dunne * +* Tweaks to avert GDC bugs/shortfalls contributed by Anders Bjorklund * +* There are probably various anonymous contributors besides.... * \***********************************************************************/ import std.file, std.ctype, std.string, std.c.stdio, std.stdio; @@ -49,7 +50,9 @@ if (*current == '\'') { for (current++; current < end; current++) - if (*current == '\'') { + if (*current == '\\') { + current++; + } else if (*current == '\'') { current++; break; } @@ -93,6 +96,7 @@ */ commentStart[0..end-current] = current[0..end-current].dup; + end -= current - commentStart; current = commentStart; current[0] = ' '; goto restart; @@ -108,13 +112,13 @@ // Print all text to this point, and set previous to the current point void flush(char* p) { - fwrite(previous, cast(int) (p - previous), 1, stdout); + std.c.stdio.fwrite(previous, cast(int) (p - previous), 1, stdout); previous = current; } // Print all text to a set point, which becomes the new previous point void flushTo(char* p) { - fwrite(previous, cast(int) (p - previous), 1, stdout); + std.c.stdio.fwrite(previous, cast(int) (p - previous), 1, stdout); previous = p; } @@ -186,6 +190,9 @@ t, attrStack.length); fwritefln(stderr, "Pending write: '%s'", previous[0..current - previous]); + debug (step) { + getch(); + } } // remove private blocks if they are on the module level @@ -342,7 +349,8 @@ } else { flush(ptoken); } - currentAttr = currentBlockAttr = attrStack[$-1]; + currentAttr = currentBlockAttr + = attrStack[attrStack.length-1]; attrStack.length = attrStack.length - 1; readingContent = false; break;