Example #1
0
 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;
 }
Example #2
0
File: Vm.cs Project: mbrezu/Shovel
        int CountCellsNamedBlock(NamedBlock namedBlock, HashSet<object> visited)
        {
            var sum = 3;
            visited.Add (namedBlock);

            sum += CountCellsString (namedBlock.Name);
            sum += CountCellsImpl (namedBlock.Environment, visited);

            return sum;
        }
Example #3
0
        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;
        }
Example #4
0
 internal static Value Make (NamedBlock nb)
 {
     Value result = value;
     result.Kind = Kinds.NamedBlock;
     result.NamedBlockValue = nb;
     return result;
 }