thanks for the rebasing
the part for adding %%1 support as FOR variable looks ok to me
but the inner loop expansion doesn't:
* it should be on a separate commit as it's a different subject (inner loop expansion is broken whatever the variables are used for nested loops) * it looks like the command (echo %%1 %%2) is expanded in the context of the first FOR loop, but not in the context of the second ; but expansion already happens for a simple loop, so I'm not sure the proposed change (adding a second call to handleExpansion) is correct, but I'll tend to think that the (first) expansion isn't done at the right time
on the last point, there's another pending merge request (for delayed expansion in IF commands) which shows the same concerns (expansion not done when expected)
so either you're up into looking for a better solution for the inner loop expansion, or if not I'll take over from here
concerning the %%1 support (whatever fits you above), I suggest having it separated from the variable expansion (and in the test you don't need nested loop for that)