Re: preprocessor pass equivalent?

2012-03-16 Thread H. S. Teoh
On Sat, Mar 17, 2012 at 01:21:56AM +0100, Adam D. Ruppe wrote: > On Saturday, 17 March 2012 at 00:13:33 UTC, H. S. Teoh wrote: > >Playing around with it a little, I notice that it doesn't output > >template bodies, even though calls to template functions are left > >intact. It also doesn't expand [

Re: preprocessor pass equivalent?

2012-03-16 Thread Adam D. Ruppe
On Saturday, 17 March 2012 at 00:13:33 UTC, H. S. Teoh wrote: Playing around with it a little, I notice that it doesn't output template bodies, even though calls to template functions are left intact. It also doesn't expand [] into opIndex/opIndexAssign, I didn't play with this yet.. but it m

Re: preprocessor pass equivalent?

2012-03-16 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 02:51:33PM +0100, Adam D. Ruppe wrote: > On Thursday, 15 March 2012 at 08:35:48 UTC, Jay Norwood wrote: > >Is there some option, similar to -E gcc option, that would > >generate the analogous listing for D? > > You could add one to the compiler in just > a few lines; there'

Re: preprocessor pass equivalent?

2012-03-15 Thread Trass3r
There's a pull request to help with debugging string mixins: https://github.com/D-Programming-Language/dmd/pull/426

Re: preprocessor pass equivalent?

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 14:34, Jay Norwood wrote: On Thursday, 15 March 2012 at 10:09:25 UTC, Jacob Carlborg wrote: The Eclipse plugin, Descent, has a view that does something like this. Although I don't know how well it works for D2. It expands mixins, string mixins, replaces scope statements with try

Re: preprocessor pass equivalent?

2012-03-15 Thread Simen Kjærås
On Thu, 15 Mar 2012 14:34:19 +0100, Jay Norwood wrote: I also found mention of a c++ compiler that someone states can compile c++ and output C. Kind of weird, but maybe compiling D to expanded D would not be such a stretch. That's how early C++ compilers worked. Actually, many compilers w

Re: preprocessor pass equivalent?

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 02:51:33PM +0100, Adam D. Ruppe wrote: > On Thursday, 15 March 2012 at 08:35:48 UTC, Jay Norwood wrote: > >Is there some option, similar to -E gcc option, that would > >generate the analogous listing for D? > > You could add one to the compiler in just > a few lines; there'

Re: preprocessor pass equivalent?

2012-03-15 Thread Adam D. Ruppe
On Thursday, 15 March 2012 at 08:35:48 UTC, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? You could add one to the compiler in just a few lines; there's already a function that does it, but it isn't called from anywhere. Ope

Re: preprocessor pass equivalent?

2012-03-15 Thread Jay Norwood
On Thursday, 15 March 2012 at 10:09:25 UTC, Jacob Carlborg wrote: The Eclipse plugin, Descent, has a view that does something like this. Although I don't know how well it works for D2. It expands mixins, string mixins, replaces scope statements with try/catch/finally and other things. It als

Re: preprocessor pass equivalent?

2012-03-15 Thread Jonathan M Davis
On Thursday, March 15, 2012 09:35:46 Jay Norwood wrote: > Is there some option, similar to -E gcc option, that would > generate the analogous listing for D? What I mean is that I'd > like to see all the code in version blocks gone, all the mixin > strings expanded. > > It is probably too much to

Re: preprocessor pass equivalent?

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 11:04, Jacob Carlborg wrote: On 2012-03-15 09:35, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is prob

Re: preprocessor pass equivalent?

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 09:35, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish for having the infered

Re: preprocessor pass equivalent?

2012-03-15 Thread Dmitry Olshansky
On 15.03.2012 12:35, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish for having the infered

preprocessor pass equivalent?

2012-03-15 Thread Jay Norwood
Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish for having the infered auto's expanded...