/** * If the next token exactly matches {@code token}, consume it. Otherwise, * throw a {@link ParseException}. */ public void consume(String token) throws ParseException { if (!tryConsume(token)) { throw parseException("Expected \"" + token + "\"."); } }
/** * If the next token exactly matches {@code token}, consume it. Otherwise, * throw a {@link ParseException}. */ public void consume(String token) throws ParseException { if (!tryConsume(token)) { throw parseException("Expected \"" + token + "\"."); } }
/** * If the next token exactly matches {@code token}, consume it. Otherwise, * throw a {@link ParseException}. */ public void consume(String token) throws ParseException { if (!tryConsume(token)) { throw parseException("Expected \"" + token + "\"."); } }