I'm looking for a macro to combine two field expressions which may also include arrays, calls, casts and potentially other expressions that I haven't thought of.
For example, a.b[0] and c().d would become a.b[0].c().d.
I think to write such a macro would involve traversing down the right hand expression tree until reaching a EConst CIdent and turning it into an EField of the left hand expression. Does this sound sensible?
It certainly seems like something that probably already exists, though. Does anyone know where I could find it if so?
Thanks, Juraj. Simn suggested a solution with parse, also, converting the Exprs into strings, concatenating with a "." and then parsing it again. I'm not sure how to convert the Exprs into code strings, though. Do you know how I can do this?