internal FormatYielder Spawn(UnparsableAst child, ChildLocation childLocation = ChildLocation.Unknown)
{
if (childLocation == ChildLocation.Unknown)
{
return new FormatYielder(this)
{
topAncestorCacheForLeft = UnparsableAst.NonCalculated
};
}
else
{
bool isLeftMostChild =
childLocation == ChildLocation.Only
||
direction == Unparser.Direction.LeftToRight && childLocation == ChildLocation.First
||
direction == Unparser.Direction.RightToLeft && childLocation == ChildLocation.Last;
return new FormatYielder(this)
{
topAncestorCacheForLeft = isLeftMostChild
? this.topAncestorCacheForLeft
: (child ?? UnparsableAst.NonCalculated)
};
}
}