Closed chrysn closed 11 months ago
You can always double any slash. Jim Schaad liked using backslashes :-)
Oh, and you just volunteered doing the ABNF for the matching asterisks... (The matching asterisks at the end are easy, as they are context free, but ignoring only up to n-1 asterisks and a slash inside the comment is interesting.)
I think we are more likely to add line-end comments (whether we start them with #
and/or ;
and/or even //
, you can use as many slashes there as you like).
Only if I can do the asterisk part with "regular" expressions instead of ABNF ;-)
More seriously: Introducing trailing comments would solve the issue almost just as well.
OK, so this is "almost solved" now by c4aff27
Given that the box has been opened to collect (E)DN feature requests here, there's one I'd like to propose: Allow slashes in comments.
Our current comments span from one
/
to the next, so while a comment like/ see http://example.com for details /
technically works, that is just because luckily there are not odd slashes in the URI. Some examples already contain weird workarounds that substitute slashes in the comment with weird lookalike characters, breaking copy-paste of the URI (/ See http:⁄⁄example.com⁄ /
).One way of achieving this is to count asterisks immediately following the first slash, and requiring (at least) the same number of asterisks before the trailing slash. Thus,
/ comment /
,/* See http://example.com/ */
and/** You can wrap comments in /* slashes */ if needed **/
would all be single closed comments.Noteworthy properties of this proposal:
/* comment */
from Doxygen comments/** @directive */
that don't necessarily have the double asterisk on their trailing end. Catering for those habits would mean losing the nesting property, unless we want to start counting comment depths (which would again be unlike what C does).