Skip to content

Commit a1b5c81

Browse files
authored
Merge pull request #2288 from wilzbach/revert-2268
Fix unrelated DAutoTest diff changes merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
2 parents 36f7800 + db4baa1 commit a1b5c81

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ddoc/source/preprocessor.d

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ All unknown options are passed to the compiler.
6262
text = genHeader(text);
6363
text = genChangelogVersion(inputFile, text);
6464
text = genSwitches(text);
65+
text = fixDdocBugs(inputFile, text);
6566

6667
// Phobos index.d should have been named index.dd
6768
if (inputFile.endsWith(".d") && !inputFile.endsWith("index.d"))
@@ -456,3 +457,17 @@ private void highlightSpecialWords(ref string flag, ref string helpText)
456457
.to!string;
457458
}
458459
}
460+
461+
// Fix ddoc bugs
462+
string fixDdocBugs(string inputFile, string text)
463+
{
464+
465+
// __FILE__ changes on every build
466+
// can be removed once https://github.com/dlang/phobos/pull/6321 is merged and part of a release
467+
if (inputFile.endsWith("exception.d"))
468+
{
469+
text = text.replace(`typeof(new E("", __FILE__, __LINE__)`, `typeof(new E("", string.init, size_t.init)`);
470+
text = text.replace(`typeof(new E(__FILE__, __LINE__)`, `typeof(new E(string.init, size_t.init)`);
471+
}
472+
return text;
473+
}

0 commit comments

Comments
 (0)