more meaningful error reports for unexpeted end of input