D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4520 - add support for //! style documentation comments
Summary: add support for //! style documentation comments
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: ddoc, patch
Depends on:
Blocks:
 
Reported: 2010-07-27 10:28 UTC by Trass3r
Modified: 2015-06-09 05:10 UTC (History)
4 users (show)

See Also:


Attachments
patch for the lexer (1.51 KB, patch)
2010-07-27 10:28 UTC, Trass3r
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Trass3r 2010-07-27 10:28:43 UTC
Created attachment 699 [details]
patch for the lexer

I added //! style documentation comments to my dmd and thought I'd share that.

Since it only requires minimal changes to the lexer and doesn't add any
complexity to the compiler it could be integrated into dmd.

Note: Doxygen supports these comments.
Comment 1 bearophile_hugs 2010-07-27 11:08:37 UTC
What's the advantage of using //! instead of the /// style that is already supported?
Comment 2 Trass3r 2010-07-27 11:13:46 UTC
Well it's personal taste.
As I said, only requires minimal changes to the lexer, Doxygen also uses /// and //!, so why not? It's just a proposal.
Comment 3 Leandro Lucarella 2010-07-27 13:59:21 UTC
The fact that is used often in Doxygen might be a factor to include this patch, since it will make life easier for people used to use Doxygen.

Is not a very strong argument for including it, though :)
Comment 4 Jonathan M Davis 2010-07-27 14:54:00 UTC
Except that /// and /** */ are already supported in D and used by doxygen. So, if you're looking for doxygen support, we already have it. It's true that //! is another way to do comments that doxygen supports, but it's not necessary.

Also, what exactly is this patch supposed to do? Does it make it so that //! are treated like ddoc comments? Because //! is already a perfectly legitimate comment because it starts with //, and doxygen will read it exactly the same way it reads ///. If it is the case that it's ddoc comments that you're looking for, I'd argue that you should actually use /++ +/ rather than a doxygen style since doxygen comments are done differently than ddoc comments anyway (doxygen favoring tags and ddoc comments being freeform).

Regardless, I don't care one way or another whether this patch gets included. I just don't see the point.
Comment 5 Trass3r 2010-07-27 15:14:14 UTC
The patch makes //! treated as a ddoc comment.
As I already said, it's just a matter of taste. I prefer //! so I patched my dmd to be free to choose.

I didn't claim this was necessary in any way (which is why this is marked as ENHANCEMENT). It's a tiny 3-line patch that doesn't hurt so I added it here.
Comment 6 anonymous4 2010-07-28 11:24:39 UTC
I'm afraid, it's useless. Doxygen uses its own markup and macros, they will be treated as plain text in ddoc comments. It's useless.
Comment 7 Yao Gomez 2012-02-05 14:31:20 UTC
There was recently a pull request to add this type of doc comments to DMD (I think that it was Trass3r too the one doing it) and it was rejected and closed by Walter & Co.

So I think that it's pretty safe to assume that this definitely will not be accepted. So with this in mind I'm closing this bug report.

However, if you want to give the good fight and make another attempt, please reopen and add your comments.