Instead of retroactively filtering each statement to make sure that it obeys anchoring, we should only generate paths that respect anchoring. This would involve us tracking the length of the most recent block in the path context.
For instance:
inserts should only consider index 0 for top anchor, n for bottom anchor, and only insert into empty lists for full anchor;
transforms should only consider index 0 for top, n-1 for bottom, and singleton lists for full anchor;
transform-lists should only generate from 0 downwards for top anchor, n upwards for bottom anchor, and only the full list for full anchor.
This would need a lot of special-casing, and so I'm not particularly minded to do it right now, but it should be done eventually!
Instead of retroactively filtering each statement to make sure that it obeys anchoring, we should only generate paths that respect anchoring. This would involve us tracking the length of the most recent block in the path context.
For instance:
This would need a lot of special-casing, and so I'm not particularly minded to do it right now, but it should be done eventually!