static void HandleBlock(Vm vm)
{
var instruction = vm.CurrentInstruction ();
var blockEnd = (int)instruction.Arguments;
var name = vm.stack.PopTop ();
if (name.Kind != Value.Kinds.String) {
vm.RaiseShovelError ("The name of a block must be a string.");
}
vm.stack.Push (Value.Make (new NamedBlock () {
Name = name.stringValue,
BlockEnd = blockEnd,
Environment = vm.currentEnvironment
}
)
);
vm.IncrementCells (3);
vm.programCounter++;
}