module Net::IMAP::ResponseParser::ParserUtils

def accept(*args)

returns nil and leaves @token unshifted on no match
returns and shifts token on successful match

like match, but does not raise error on failure.
def accept(*args)
  token = lookahead
  if args.include?(token.symbol)
    shift_token
    token
  end
end