[nem-en] Debugging macros again

Kamil Skalski kamil.skalski at gmail.com
Tue Jan 9 22:33:22 CET 2007


2007/1/9, Andrei Varanovich <dotnetby at gmail.com>:
> Hi,
>
> Let's go through the issues one-by-one.
> So what we have:
> 1. It's possible to let the compiler know if the error originated in macro generated code
> or in original source. As Vlad said almost the same problem was solved in VS integration. Do we need Vlad to describe this solution more detailed?

The only question is how reliable it is. Because if it will produce
some strange messages about macros in simple scenarios like incorrect
type in core macros (if, while, for).
Also how should be present this additional info?  Maybe as a hint:

error 11:12:  incorrect type
hint  11:12:  the offending code was generated by macro

Unfortunately we don't have information which macro it was and I don't
see any easy way to have it.

>
> 2. We need to divide somehow the fake code for macro attributes and for macro expressions. And as wee agreed it's really inconvenient to generate all the code (even fake). That's why I was speaking about some hints allow developer to decide whether or not some parts of code should be generated.
> But I also like the solution "To show the AST". Will it be a challenge in implementation?
>

AST of expansion can be seen only in VS and only if code succeeds with
compilation. I don't think that showing AST of code, which triggered
error is a good default, though it is a nice idea if user could enable
it in "verbose mode". So the hint from previous point could be
assisted by AST of offending code.

-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list