protected static Map Unroll(Selector selector, INode node)
{
if (selector.IsCompound) {
return new PlaceholderMap(selector.Prefix.Name, new ToRoute[] {
(() => new View(Unroll(selector.Suffix, node), node))
}) {
Active = true
};
}
if (selector.HasParameter) {
// add an initializer to the new node that adds the element to the child container.
return new PlaceholderMap(selector.Name, new ToRoute[] {
(() => new View(new ElementMap(null, selector.Parameter, node), node))
}) {
Active = true
};
}
return new NodeMap(selector.Name, node);
}