Added trailing non-whitespace characters syntax check and modified main loop to ignore rest of line beyond 1024 characters.