digitalmars.D.learn - How/where to hack DMD to generate docs for string mixed members.
- 9il (11/11) Apr 14 2018 Hey,
- Stefan Koch (3/14) Apr 15 2018 hmm you should be able to see docs for string mixins, if not.
- Jonathan M Davis (14/35) Apr 15 2018 AFAIK, it's never worked to see any ddoc from string mixins. Certainly, ...
- 9il (20/57) Apr 16 2018 Mixin templates works. The problem is the use case for the
- Jonathan M Davis (15/80) Apr 16 2018 Well, the fact that the compiler doesn't display any ddoc from string mi...
- 9il (14/32) Apr 16 2018 -vcg-ast does not help:
Hey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenko
Apr 14 2018
On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote:Hey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenkohmm you should be able to see docs for string mixins, if not. try using -vcg-ast and try to run ddoc on the cg file
Apr 15 2018
On Sunday, April 15, 2018 07:59:17 Stefan Koch via Digitalmars-d-learn wrote:On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote:AFAIK, it's never worked to see any ddoc from string mixins. Certainly, I'm quite sure that it didn't used to work, so if it does now, something changed within the last couple of years. The closest that I'm aware of is that putting /// on a template mixin works so that you can do something like class MyException : Exception { /// mixin basicExceptionCtors; } and have the ddoc within the template mixin show up. - Jonathan M DavisHey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenkohmm you should be able to see docs for string mixins, if not. try using -vcg-ast and try to run ddoc on the cg file
Apr 15 2018
On Sunday, 15 April 2018 at 08:17:21 UTC, Jonathan M Davis wrote:On Sunday, April 15, 2018 07:59:17 Stefan Koch via Digitalmars-d-learn wrote:Mixin templates works. The problem is the use case for the library (you know it) I am working on is looks like: ------ struct S { mixin(WithGetters!("private", // or WithGettersAndConstructor Date, "startDate", Date, "endDate", DayCount, "dayCount", double, "yearFraction", double, "spread", Calculation, "calculation", )); } ------ It should define members and getters and maybe one or more constructors. So mixin strings will be here anyway either in the struct or in a mixin template.On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote:AFAIK, it's never worked to see any ddoc from string mixins. Certainly, I'm quite sure that it didn't used to work, so if it does now, something changed within the last couple of years. The closest that I'm aware of is that putting /// on a template mixin works so that you can do something like class MyException : Exception { /// mixin basicExceptionCtors; } and have the ddoc within the template mixin show up. - Jonathan M DavisHey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenkohmm you should be able to see docs for string mixins, if not. try using -vcg-ast and try to run ddoc on the cg file
Apr 16 2018
On Monday, April 16, 2018 16:05:40 9il via Digitalmars-d-learn wrote:On Sunday, 15 April 2018 at 08:17:21 UTC, Jonathan M Davis wrote:Well, the fact that the compiler doesn't display any ddoc from string mixins is one of those annoying things that has come up from time to time for years now. I don't know what the consequences of changing that behavior would be, but on the surface at least, it seems like it would be a positive change. Regardless, someone would have to make the change to the compiler, and AFAIK, that particular improvement has never been a priority for anyone, but I don't pay much attention to dmd PRs. A quick search turns up this bug report: https://issues.dlang.org/show_bug.cgi?id=2420 And it looks like that one links to this fixed bug https://issues.dlang.org/show_bug.cgi?id=648 which looks like it was when it became possible to at least mark a template mixin with /// to make its ddoc show up. - Jonathan M DavisOn Sunday, April 15, 2018 07:59:17 Stefan Koch via Digitalmars-d-learn wrote:Mixin templates works. The problem is the use case for the library (you know it) I am working on is looks like: ------ struct S { mixin(WithGetters!("private", // or WithGettersAndConstructor Date, "startDate", Date, "endDate", DayCount, "dayCount", double, "yearFraction", double, "spread", Calculation, "calculation", )); } ------ It should define members and getters and maybe one or more constructors. So mixin strings will be here anyway either in the struct or in a mixin template.On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote:AFAIK, it's never worked to see any ddoc from string mixins. Certainly, I'm quite sure that it didn't used to work, so if it does now, something changed within the last couple of years. The closest that I'm aware of is that putting /// on a template mixin works so that you can do something like class MyException : Exception { /// mixin basicExceptionCtors; } and have the ddoc within the template mixin show up. - Jonathan M DavisHey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenkohmm you should be able to see docs for string mixins, if not. try using -vcg-ast and try to run ddoc on the cg file
Apr 16 2018
On Sunday, 15 April 2018 at 07:59:17 UTC, Stefan Koch wrote:On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote:-vcg-ast does not help: --- import object; struct S { mixin("\x0a ///\x0a auto bar() {}\x0a "); } RTInfo!(S) { enum typeof(null) RTInfo = null; } --- Is it bug or is it possible to improve it?Hey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenkohmm you should be able to see docs for string mixins, if not. try using -vcg-ast and try to run ddoc on the cg file
Apr 16 2018