Testing LFortran’s parser and formatter (Round 2)

I tried using this today to convert a tricky fixed form file I’ve come across but I got the following error:

(lf) > lfortran fmt --fixed-form project.f
The following argument was not expected: --fixed-form
Run with --help for more information.

(lf) > lfortran --version
LFortran version: 0.18.0
Platform: Windows
Default target: x86_64-pc-windows-msvc

Is the fixed form support not yet available in the latest release?

The fixed form file in question has variable names split across newlines which my usual tool of choice (findent) is unable to deal with hence why I thought I would try lfortran with its AST representation.


Very exciting how far lfortran has come, keep up the good work!

@lkedward I think you have to run it like this:

lfortran --fixed-form fmt ./scipy/sparse/linalg/_propack/PROPACK/double/Lapack_Util/dlasdq.f

That works. If the fixed-form parse fails for you, please report it and we’ll fix it. The parser works for all of scipy now. We should make a release, the latest git version is:

$ lfortran --version
LFortran version: 0.18.0-759-gdfda4b79e
Platform: macOS ARM
Default target: arm64-apple-darwin21.3.0

That is, 759 commits above 0.18.0.

1 Like

@lkedward Can you send me this “tricky” project.f file? You’ve piqued my curiosity.

Thanks for the quick response @certik, I probably should’ve tried that first :laughing:
I’m getting a parse error now, but I’ll update my lfortran version first before looking to reporting it.

@lkedward we’ll fix any parse errors quickly. I was happy that we could parse all of SciPy, so I stopped there, but I know there is more fixed form code out there. Just report it if it happens with the latest master.

1 Like