proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests

Timothee Cour thelastmammoth at gmail.com
Sun Feb 11 02:28:10 UTC 2018


all these workarounds are rather ugly; the proposed syntax works all
the time (user can just pick a EOC token not in comment) and is analog
to existing D heredoc strings, so nothing surprising there.
Would PR's be accepted?


On Sat, Feb 10, 2018 at 5:01 PM, Jonathan M Davis via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Saturday, February 10, 2018 15:03:08 Walter Bright via Digitalmars-d
> wrote:
>> On 2/8/2018 7:06 PM, Timothee Cour wrote:
>> > /"EOC
>> > This is a multi-line
>> > heredoc comment allowing
>> > /+ documented unittests containing nesting comments +/
>> > and weird urls like https://gcc.gnu.org/onlinedocs/libstdc++/faq.html
>> > EOS"/
>>
>> There isn't any commenting scheme that won't trip you up with certain
>> characters in the comments. I don't see a compelling case for adding
>> another kind of comment.
>>
>> Vladimir's suggestion to use %2B instead of + seems to resolve this
>> adequately.
>
> You could also always just declare a DDOC macro.
>
> Just put
>
> Macros:
>     PLUS=+
>
> in the ddoc comment and then use $(PLUS) instead of +. It's more verbose
> that way given that PLUS isn't one of the standard ddoc macros, but it's
> more idiomatic to look at.
>
> - Jonathan M Davis
>


More information about the Digitalmars-d mailing list