protected override QilNode VisitLoop(QilLoop n) {
if (n.Variable.Binding.NodeType == QilNodeType.Root || n.Variable.Binding.NodeType == QilNodeType.Deref) {
// This is absolute path already. We shouldn't touch it
return n;
}
if (n.Variable.Binding.NodeType == QilNodeType.Content) {
// This is "begin" of reletive path. Let's rewrite it as absolute:
QilUnary content = (QilUnary)n.Variable.Binding;
Debug.Assert(content.Child == this.fixup, "Unexpected content node");
QilIterator it = f.For(f.DescendantOrSelf(f.Root(this.fixup)));
content.Child = it;
n.Variable.Binding = f.Loop(it, content);
return n;
}
n.Variable.Binding = Visit(n.Variable.Binding);
return n;
}