Today, I attempted to convert a Delphi unit that I have written and have kept up with for a number of years, as it is a list of basic functions I use regularly with almost every project.
There are a number of function calls that have function calls as parameters. These are completely borked by the compiler.
For example:
if FileExists(ExpandFileName(Copy(S, 1, i))) then begin
becomes:
if FileExistsUTF8(ExpandFileName(Copy(S) { *Converted from FileExists* } then begin
As you can see, it only keeps one closing parenthesis, and only the first parameter within each nested function. Also, parameters that are function calls do not have their function converted, as ExpandFileName should have been converted to ExpandFileNameUTF8, as it was in other places.
The correct conversion should have been:
if FileExistsUTF8(ExpandFileNameUTF8(Copy(S, 1, i)) { *Converted from ExpandFileName* } ) { *Converted from FileExists* } then begin
There just needs to be a recursive call to convert further functions when looking at parameters of a function.
I'm not even going to attempt to convert my larger projects to Lazarus until there is a fix for this one, as it seems pretty basic. I can't believe others haven't been complaining about it, but then, maybe I don't know where to look. I just did a search for "Delphi Convert" on wiki and forums, but I suppose not a lot of people are attempting this, or they give up and stick with Delphi without voicing their concerns.
I've got a couple of projects I'd like to make available to Linux and Mac users, just can't do it until this particular issue is resolved, as the projects are over a million lines of code each, and that's too much manual editing to fix. I realize no conversion of that size will be perfect, but nested function calls are too common of a programming practice not to include that in the converter.