
An idea would be to allow calling of generated_token() from one of the other hooks. For instance, if you in rescanned_macro() know when the first macro has been fully texpanded then you can call generated_token() at that point on every token provided to rescanned_macro(). The reason why I say first macro is that a macro in it's formal definition can call another macro, so first macro calls second macro etc.
The suggestion I made above can probably also be considered an optimization (?) because you could also imagine recomputing the correct positions on every call to rescanned_macro. Do you see any reason for this not working?
If the generated_token() gets call for instance in the rescanned_macro() hook you won't be able to track the resulting position of the token because it's impossible to tell, at which expansion level inside a macro the current token got generated. Do I miss something?
You know that for each call to the hook expand_*_like_macro() there is one call to rescanned_macro(), so by using this information I think that you can know the epansion level. In order to avoid multiple calls to generated_token() it is possible to set a bit in the token which tells that it was already set or maybe the correct positions should be negative to begin with(?). Do you see any problems with such an approach?
Regards Hartmut
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users