It might be the worms. Severe worm infection can also cause bloody stool. Give your dog a light diet. Kindly take the dog to the doctor as soon as possible. Also see the link below to look for parvoviral infection and symptoms of worms. Here you go and hope your dog gets well soon.
If your dog is vomiting worms then intestinal parasites are a problem in your dog. Intestinal parasites may not be the only problem. Parvovirus is a life threatening, serious disease that needs immediate veterinary medical attention. Regardless of the cause your dog needs veterinary care now do not wait 2 days. Weakness, dehydration, hypoglycemia, and hypothermia are all secondary complications that if untreated can be fatal. I would have your dog examined by a veterinarian, screened for intestinal parasites, tested for parvovirus, and started on supportive care. Good luck.