Add name resolution for for loops