本文整理汇总了C#中IronRuby.Runtime.BlockParam.SetFlowControl方法的典型用法代码示例。如果您正苦于以下问题:C# BlockParam.SetFlowControl方法的具体用法?C# BlockParam.SetFlowControl怎么用?C# BlockParam.SetFlowControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IronRuby.Runtime.BlockParam
的用法示例。
在下文中一共展示了BlockParam.SetFlowControl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BlockRetry
public static object BlockRetry(BlockParam/*!*/ blockFlowControl) {
if (blockFlowControl.CallerKind == BlockCallerKind.Yield) {
blockFlowControl.SetFlowControl(BlockReturnReason.Retry, null, blockFlowControl.Proc.Kind);
return RetrySingleton;
} else {
throw new LocalJumpError("retry from proc-closure");
}
}
示例2: YieldBlockReturn
// post-yield return ops:
private static void YieldBlockReturn(BlockParam/*!*/ blockFlowControl, object returnValue)
{
if (blockFlowControl.CallerKind == BlockCallerKind.Yield) {
blockFlowControl.SetFlowControl(BlockReturnReason.Return, null, blockFlowControl.Proc.Kind);
} else {
// if the block is called we can't continue fast stack unwinding:
throw ((BlockReturnResult)returnValue).ToUnwinder();
}
}
示例3: YieldBlockBreak
private static void YieldBlockBreak(RuntimeFlowControl rfc, BlockParam/*!*/ ownerBlockFlowControl, BlockParam/*!*/ yieldedBlockFlowControl, object returnValue) {
Assert.NotNull(ownerBlockFlowControl, yieldedBlockFlowControl);
// target proc-converter:
RuntimeFlowControl targetFrame = yieldedBlockFlowControl.TargetFrame;
Debug.Assert(targetFrame != null);
if (targetFrame.IsActiveMethod) {
if (targetFrame == rfc) {
// The current primary super-frame is the proc-converter, however we are still in the block frame that needs to be unwound.
// Sets the owner's BFC to exit the current block (recursively up to the primary frame).
ownerBlockFlowControl.SetFlowControl(BlockReturnReason.Break, targetFrame, yieldedBlockFlowControl.SourceProcKind);
return;
} else {
throw new MethodUnwinder(targetFrame, returnValue);
}
} else {
throw new LocalJumpError("break from proc-closure");
}
}