Adding the Pascal programming language to the question

Re: Adding the Pascal programming language to the question

by Richard Lobb -
Number of replies: 0

Your addition is essentially working OK, as evidenced by the 5.000. The only problem is that fpc generates extraneous output, including a spurious ld error (see here).

To compile, you currently have 

return_code = subprocess.call("fpc {0} prog.pas".format(pasflags).split())

but that prints the compiler output and also the spurious ld output.

You'll have to replace that with a different subprocess method, such as subprocess.check_output() as used later in the script, which captures the standard output rather than printing it. You may need to capture standard error as well. You should then print that output (possibly after editing it) only if the compile failed - probably that's indicated by the return code from the command being non-zero?

Richard