int SerializeNamedBlock(NamedBlock namedBlock, object obj) { var composite = new Composite { Kind = ObjectTypes.NamedBlock, Elements = new int[3] }; var result = SerializeOneHashed (composite, obj); composite.Elements [0] = SerializeOneHashed (namedBlock.Name); composite.Elements [1] = SerializeOne (namedBlock.BlockEnd); composite.Elements [2] = Serialize (namedBlock.Environment); return result; }
int CountCellsNamedBlock(NamedBlock namedBlock, HashSet<object> visited) { var sum = 3; visited.Add (namedBlock); sum += CountCellsString (namedBlock.Name); sum += CountCellsImpl (namedBlock.Environment, visited); return sum; }
NamedBlock RebuildNamedBlock( object[] objects, int index, Composite composite, Func<int, object> reader) { var result = new NamedBlock (); objects [index] = result; result.Name = (string)reader (composite.Elements [0]); result.BlockEnd = (int)(long)reader (composite.Elements [1]); result.Environment = (VmEnvironment)reader (composite.Elements [2]); return result; }
internal static Value Make (NamedBlock nb) { Value result = value; result.Kind = Kinds.NamedBlock; result.NamedBlockValue = nb; return result; }