refactor read_directive
error handling on error while reading char literal
expect returns as early as possible. read_directive might have missed a newline
in unmatched character that has consumed by expect