test error conditions of parser, including token counting