dowhile/while in generator