Dlang code mixin output
JS
js.mdnq at gmail.com
Wed Jul 31 07:43:02 PDT 2013
On Wednesday, 31 July 2013 at 13:37:58 UTC, Dicebot wrote:
> On Wednesday, 31 July 2013 at 13:25:45 UTC, JS wrote:
>> On Wednesday, 31 July 2013 at 13:19:46 UTC, dennis luehring
>>> >When you do that with nested templates it
>>> > creates a huge mess... also errors are useless... as the
>>> point to
>>> > the mixin string.
>
> There is one idiom for debugging string mixin mess:
> 098: // pragma(msg, "mixin_id:");
> 099: // pragma(msg, generated_code);
> 100: #line 1 "mixin_id"
> 101: mixin(generated_code)
> 102: #line 103 __FILE__
>
> Not very convenient, but enough to get the job done.
>
> Sonke had nice idea to improve compiler by storing mixin id as
> part of filename an preserving line numbers as-is. Somewhat
> breaking change though.
I already have a method where I use level to store the nesting
level, somewhat inconvenient but it allows me to not show any
nested calls, just the top most template call...
But it doesn't help with intellisense, which thinks the
structs/classes are empty because I generate everything with
mixins(or almost everything at this point)... and is still hard
to read. I'd rather be able to look at a complete D source to see
if anything is out of place then look at a build console
output(which may contain other information and doesn't show much
context for the mixin).
More information about the Digitalmars-d
mailing list