Bug 7383 – Blank lines in code sections cause premature section termination
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-27T22:40:00Z
Last change time
2015-06-09T05:11:49Z
Keywords
ddoc, patch
Assigned to
yebblies
Creator
siegelords_abode
Comments
Comment #0 by siegelords_abode — 2012-01-27T22:40:10Z
Test case (compile it with dmd -D):
/**
---
foo;
foo;
---
*/
void test(); // 2x test.d(8): Error: function test.test unmatched --- in DDoc comment
/**
---
foo;
---
*/
void test2(); // 2x test.d(16): Error: function test.test2 unmatched --- in DDoc comment
/**
foo
---
foo;
---
*/
void test3(); // OK
void main() {}
I think I tracked this bug down to line 1119 in doc.c:
if (*p == '\n' && !summary && !namelen)
If I change it to this:
if (*p == '\n' && !summary && !namelen && !inCode)
It compiles the codes above and generates fine HTML. I honestly find the doc.c code impenetrable, so I don't know if this is the right fix. The line is for the D2 dmd, but this bug happens in D1 as well.