D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14015 - ddoc Error: function unmatched as result of underscore in unittest comment
Summary: ddoc Error: function unmatched as result of underscore in unittest comment
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-20 10:22 UTC by Edwin van Leeuwen
Modified: 2024-12-13 18:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Edwin van Leeuwen 2015-01-20 10:22:10 UTC
Generating ddoc from the following code results in an error:

code:
///
void dummy()
{
}
                                                                               
/// Testing _name
unittest
{
    assert( true );
} 

error:
$ dmd -main -D ddoc.d 
ddoc.d(2): Error: function ddoc.dummy unmatched --- in DDoc comment

The error goes away if you remove the underscore, or wrap it in quotes ("_name") and it seems to only occur in documentation comments before unittests.
Comment 1 Ludovit Lucenic 2015-04-08 17:48:43 UTC
Same error in my case,  although, with different DDoc string. It happens after upgrading my project from 2.066 to 2.067:

/// Lexical type of a string literal
enum StringFormat : ubyte {
	/// string quoted with '"'
	Quoted = 0,
	/// wysiwyg quoted string starting with 'r"'
	RWysiwyg,
	/// wysiwyg string quoted with '`' 
(245:)	BackquoteWysiwyg,
	/// hexadecimal quoted string starting with 'x"'
	Hex
}

gives:

src/les/lexer.d(245): Error: enum member les.lexer.StringFormat.BackquoteWysiwyg unmatched --- in DDoc comment
Comment 2 Ludovit Lucenic 2015-04-08 17:51:26 UTC
(In reply to Ludovit Lucenic from comment #1)
> Same error in my case,  although, with different DDoc string. It happens
> after upgrading my project from 2.066 to 2.067:
> 
> /// Lexical type of a string literal
> enum StringFormat : ubyte {
> 	/// string quoted with '"'
> 	Quoted = 0,
> 	/// wysiwyg quoted string starting with 'r"'
> 	RWysiwyg,
> 	/// wysiwyg string quoted with '`' 
> (245:)	BackquoteWysiwyg,
> 	/// hexadecimal quoted string starting with 'x"'
> 	Hex
> }
> 
> gives:
> 
> src/les/lexer.d(245): Error: enum member
> les.lexer.StringFormat.BackquoteWysiwyg unmatched --- in DDoc comment

I forgot to mention that changing the line 244 to:

 	/// wysiwyg string quoted with '`'`

removes the compiler error.
Comment 3 dlangBugzillaToGithub 2024-12-13 18:39:00 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18930

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB