Skip to content

Commit b6635f2

Browse files
authored
Merge pull request #2102 from wilzbach/better-error-ddoc
Use a better error message for the Ddoc preprocessor
2 parents 594a9be + d9b632a commit b6635f2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ddoc_preprocessor.d

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ auto parseToc(string text)
123123
{
124124
auto entry = TocEntry(id, name);
125125
if (isH2)
126+
{
126127
toc ~= TocTopEntry(entry, null);
128+
}
127129
else
130+
{
131+
assert(toc.length > 0, "TOC generation error: $(H2) needs to come before $(H3)");
128132
toc.back.children ~= entry;
133+
}
129134
}
130135
while (!text.empty)
131136
{

posix.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ $G/contributors_list.ddoc: | $(STABLE_RDMD) $(TOOLS_DIR) $(INSTALLER_DIR)
970970
################################################################################
971971

972972
$(DDOC_BIN): ddoc_preprocessor.d | $(STABLE_DMD)
973-
$(STABLE_DMD) -of$@ $<
973+
$(STABLE_DMD) -g -of$@ $<
974974

975975
################################################################################
976976
# Build and render the DMD man page

0 commit comments

Comments
 (0)