D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7383 - Blank lines in code sections cause premature section termination
Summary: Blank lines in code sections cause premature section termination
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: yebblies
URL:
Keywords: ddoc, patch
Depends on:
Blocks:
 
Reported: 2012-01-27 22:40 UTC by siegelords_abode
Modified: 2015-06-09 05:11 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description siegelords_abode 2012-01-27 22:40:10 UTC
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.
Comment 2 github-bugzilla 2012-01-29 01:20:01 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/881457753f1607c4925204e0e265a1f83513044e
Merge pull request #654 from yebblies/issue7383

Issue 7383 - Blank lines in code sections cause premature section termination
Comment 3 github-bugzilla 2012-01-29 01:36:57 UTC
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/08c01a1a2bacd701137bdb80ec2a438fd9851c0f
fix Issue 7383 - Blank lines in code sections cause premature section termination