Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddoc Error: function unmatched as result of underscore in unittest comment #18930

Open
dlangBugzillaToGithub opened this issue Jan 20, 2015 · 2 comments
Labels

Comments

@dlangBugzillaToGithub
Copy link

Edwin van Leeuwen reported this on 2015-01-20T10:22:10Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=14015

CC List

  • Ludovit Lucenic

Description

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.
@dlangBugzillaToGithub
Copy link
Author

llucenic commented on 2015-04-08T17:48:43Z

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

@dlangBugzillaToGithub
Copy link
Author

llucenic commented on 2015-04-08T17:51:26Z

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant