This also does some cleanups, I am happy to undo them (or send as
separate patches):
- Change the early exit to stop only once we hit an expansion inside the main file, to make sure we keep following the nested expansions.
- Add more tests to cover all the cases mentioned in the implementation
- Drop the adjustments for prev/next tokens. We do the final checks based on the expansion locations anyway, so any intermediate mapping was a no-op.
(no action needed)
we had extensive discussion of why this change is a no-op, and how to prove it, and what comments to leave.
However in the end I don't think such a comment is necessary, because the code makes sense in isolation, and equivalence-to-previous-version isn't very interesting!