improve parsing of "do". fixes #5082

before, parsing the arguments of "do" grabbed too much.