digitalmars.D.bugs - [Issue 11003] New: Improve .di generation
- d-bugmail puremagic.com (91/91) Sep 09 2013 http://d.puremagic.com/issues/show_bug.cgi?id=11003
- d-bugmail puremagic.com (12/26) Oct 10 2013 http://d.puremagic.com/issues/show_bug.cgi?id=11003
http://d.puremagic.com/issues/show_bug.cgi?id=11003 Summary: Improve .di generation Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: hsteoh quickfur.ath.cx Currently, dmd -H generates a "header file" with .di extension containing public symbols of the module being compiled. This enhancement request improves the quality of the output so that these .di files can also serve as a "module contents at-a-glance" overview, in addition to being an importable interface to the module in question. 1) The output should be pretty-printed. Currently, it does try to do this, but the result can be improved further. Perhaps it can format the output using Phobos coding style. 2) Eponymous templates should use the usual shorthand rather than the full form; that is, instead of: template MyClass(T) { class MyClass { ... } } it should output: class MyClass(T) { ... } 3) It should retain formatting of the input source file where possible. Currently, if the input is: writeln("This is a very very long string "~ "broken across multiple lines"); then dmd -H would put the entire statement on a single line: writeln("This is a very very long string " ~ "broken across multiple lines"); It should not do this, since the user presumably has already formatted the source in a more readable way. 3a) Signature constraints should appear on a separate line; that is, instead of: T myFunc(T,U)(U u) if (is(U : T) && is(typeof(U.front))) { ... } the output should be: T myFunc(T,U)(U u) if (is(U : T) && is(typeof(U.front))) { ... } which is more readable. 3b) Function attributes should not be reordered. Currently, this code: void func(int a) pure safe nothrow { ... } gets output as: pure safe nothrow func(int a) { ... } Instead, the original ordering should be used. Otherwise, it is jarring to read, since one expects the .di file to contain what one wrote, not what the compiler thinks one should have written. 4) Template bodies are currently included inline. This makes the resulting .di file harder to be used as a "module at a glance" overview, since function bodies would be included. This should be enhanced so that the function declarations are grouped together at the top, followed by the implementation bodies, for example, this code: class MyTemplateClass(T) { void member1() { /* implementation here */ } void member2() { /* implementation here */ } } should produce this output: class MyTemplateClass(T) { // Overview void member1(); void member2(); // Implementation void member1() { /* implementation here */ } void member2() { /* implementation here */ } } 5) Private template members are intermixed with public members; this should be reordered so that public members come first, and private members later. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 09 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11003 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull2) Eponymous templates should use the usual shorthand rather than the full form; that is, instead of: template MyClass(T) { class MyClass { ... } } it should output: class MyClass(T) { ... }Partial fix: https://github.com/D-Programming-Language/dmd/pull/2649 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 10 2013