Closed vsht closed 3 years ago
Thanks for the detailed report! I will look at when I can.
When getting down to the details this has nothing to do with parsing. You might tell this by entering those lines inside one of the command-line programs.
Instead it has everything to do with ToExpression
when it gets a multiline string to be interpreted as InputForm.
I don't have installed any version of Wolfram products, I only go by what docs there are on wolfram.com. So I can't check how this matches the Wolfram Language.
The behavior we have right now in #1247 is that the value returned is the last complete expression when there are several expressions.
It appears that Mma is somewhat more fault tolerant when it comes to missing semicolons, cf. e.g. the following admittedly sloppy code
Despite of the semicolons missing at many places, Mma obviously figures out that a CR accounts for a semicolon here. So it happily accepts
Mathics doesn't
For compatibility with other packages it would be good to emulate Mma's behavior. Cf. also Issue #1174
testFile.zip