replace all remaining `for` with `foreach` or `do`
make `for` parse as `foreach` does

Closes #6997