Hello croft,
please download from
http://www.editplus.com the Edit Plus
Text Editor and open your file.
You will see, that this tool recognizes PHP source code and
will highlight different things.
You will find your problem if you look at the green lines. Green
lines should be comments in source code.
In your source 50% is comment due to line errors or { } errors.
Best regards,