This is a new bug only in version 7.
My actual script, which was ok with version 6, looks like this:
It has windows line endings and ends with 3 newlines
Now this gives error message:
Line 8 is the end of file. Remove the last line and it runs fine. Other variations of the number of trailing line endings and indents give errors similar to the first post. This is quite mysterious.