Identify macros that end with while(0)

Hi all,

I want to use rewrite.InsertTextAfter (…) to inject certain function calls at the end of statements. However, the presence of macros of the form:
#define macro do {

}
while(0) \

causes problems because I can’t use the function call insertion as: “, addedFunction()”.

Is there a way I can identify that a source location is end of such a macro that ends with while(0)?

Thanks!