Thread overview
Ddoc/parser behavior question
Jan 07, 2016
Brian Schott
Jan 07, 2016
Jacob Carlborg
Jan 07, 2016
Brian Schott
Jan 07, 2016
Jack Stouffer
January 07, 2016
Consider the following code:

/// doc1
int a, /// doc2
    b, /// doc3
    c; /// doc4

Ddoc's behavior is to generate this documentation:

int a;
    doc1
    doc2

int b;
    doc1
    doc3

int c;
    doc1
    doc4

This isn't really spelled out in the ddoc spec. Is this behavior intentional or just a coincidence?
January 07, 2016
On 2016-01-07 03:14, Brian Schott wrote:
> Consider the following code:
>
> /// doc1
> int a, /// doc2
>      b, /// doc3
>      c; /// doc4
>
> Ddoc's behavior is to generate this documentation:
>
> int a;
>      doc1
>      doc2
>
> int b;
>      doc1
>      doc3
>
> int c;
>      doc1
>      doc4
>
> This isn't really spelled out in the ddoc spec. Is this behavior
> intentional or just a coincidence?

Is it spelled out if one just do:

int a; /// doc1

-- 
/Jacob Carlborg
January 07, 2016
On Thursday, 7 January 2016 at 08:40:37 UTC, Jacob Carlborg wrote:
> Is it spelled out if one just do:
>
> int a; /// doc1

Yes, but that's not my question. The behavior that I'm talking about is that the comment on the line before the line containing "int" is applied to all three variables, and that the comments following the commas and semicolons apply to the variables individually.

January 07, 2016
On Thursday, 7 January 2016 at 02:14:50 UTC, Brian Schott wrote:
> Consider the following code:
>
> /// doc1
> int a, /// doc2
>     b, /// doc3
>     c; /// doc4
>
> Ddoc's behavior is to generate this documentation:
>
> int a;
>     doc1
>     doc2
>
> int b;
>     doc1
>     doc3
>
> int c;
>     doc1
>     doc4

That looks intentional, and IMO is what makes sense. You have the global comment for the declaration and individual comments for each.
January 07, 2016
On 01/07/2016 12:25 PM, Jack Stouffer wrote:
> On Thursday, 7 January 2016 at 02:14:50 UTC, Brian Schott wrote:
>> Consider the following code:
>>
>> /// doc1
>> int a, /// doc2
>>     b, /// doc3
>>     c; /// doc4
>>
>> Ddoc's behavior is to generate this documentation:
>>
>> int a;
>>     doc1
>>     doc2
>>
>> int b;
>>     doc1
>>     doc3
>>
>> int c;
>>     doc1
>>     doc4
>
> That looks intentional, and IMO is what makes sense. You have the global
> comment for the declaration and individual comments for each.

Could someone please contribute the appropriate bit/example in the docs? Thx! -- Andrei