当前位置: 首页>>代码示例>>C#>>正文


C# BlockParam.SetFlowControl方法代码示例

本文整理汇总了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");
     }
 }
开发者ID:andreakn,项目名称:ironruby,代码行数:8,代码来源:RubyOps.FlowControl.cs

示例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();
     }
 }
开发者ID:TerabyteX,项目名称:main,代码行数:10,代码来源:RubyOps.FlowControl.cs

示例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");
            }
        }
开发者ID:Hank923,项目名称:ironruby,代码行数:20,代码来源:RuntimeFlowControl.cs


注:本文中的IronRuby.Runtime.BlockParam.SetFlowControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。