Dick
Fabrice, from you reply I wondered: do you have to provide "translation" for all language elements? That seems a bit of an impossible task. I thought that the IL would help find X# syntax using the compiler "reversed" , just like the compiler creates valid IL from X#.
Mmm...that would be so simple...
When ILSpy is decompile IL, it will call a kind of eventHandler for each structure (if, while, method call, parameters, ... ) which is a leaf in the compiled-tree.
So I have to catch each one, and rewrite it the X# way.
For Example, I'm doing two passes to enumerate all LOCALS, then inject their declaration in the second pass and provide all LOCALS at the beginning of code, etc...
So sometimes, the generated code is not perfect because I just write what is arriving from ILSpy, and looks like C# mostly.
But any sample to have a better translation is welcome !
Fab