Would it be possible to improve the formatting of the error?

I’m working down the fortran track to revive the memeory of this language that used during my PhD, I of course make mistakes along the way but in the current state it’s extremelly difficult to read the compilation errors.

In an exercise I get:

/tmp/nth-prime/nth_prime.f:::\\n\\n    |         if all([i % primes(p) .neq. , p=,count]) then\\n      |            \\nError: Missing ( in IF-expression at ()\\n/tmp/nth-prime/nth_prime.f:::\\n\\n    |         end if\\n      |           \\nError: Expecting END DO statement at ()\\nmake[]: *** [CMakeFiles/nth-prime.dir/build.make:: CMakeFiles/nth-prime.dir/nth_prime.f.o] Error \\nmake[]: *** [CMakeFiles/Makefile:: CMakeFiles/nth-prime.dir/all] Error \\nmake: *** [Makefile:: all] Error \\n

which should be displayed:


    |         if all([i % primes(p) .neq. , p=,count]) then
Error: Missing ( in IF-expression at ()

    |         end if
Error: Expecting END DO statement at ()
make[]: *** [CMakeFiles/nth-prime.dir/build.make:: CMakeFiles/nth-prime.dir/nth_prime.f.o] Error 
make[]: *** [CMakeFiles/Makefile:: CMakeFiles/nth-prime.dir/all] Error 
make: *** [Makefile:: all] Error 

it seems that everything comes down to parsing \\n as a line break. Would it be possible to change it ?

@ErikSchierboom This seems straight-forward if @axtens doesn’t get there first :)

@axtens knows considerably less about Fortran than you assume!

In the end, it had nothing to do with Fortran but with a simple sed command: Fix newlines by ErikSchierboom · Pull Request #52 · exercism/fortran-test-runner · GitHub It should now work as intended @12rambau

1 Like