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


C# CodeGen.EmitContinue方法代码示例

本文整理汇总了C#中CodeGen.EmitContinue方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGen.EmitContinue方法的具体用法?C# CodeGen.EmitContinue怎么用?C# CodeGen.EmitContinue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CodeGen的用法示例。


在下文中一共展示了CodeGen.EmitContinue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Emit

 internal override void Emit(CodeGen cg)
 {
     if (!cg.InLoop()) {
         cg.Context.AddError("'continue' not properly in loop", this);
         return;
     }
     cg.EmitPosition(this);
     cg.EmitContinue();
 }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:9,代码来源:Statements.cs

示例2: EmitFinallyFlowControl

        /// <summary>
        /// If the finally statement contains break, continue, return or yield, we need to
        /// handle the control flow statement after we exit out of finally via OpCodes.Endfinally.
        /// </summary>
        private static void EmitFinallyFlowControl(CodeGen cg, TryFlowResult flow, Slot flag)
        {
            if (flow.Return || flow.Yield) {
                Debug.Assert(flag != null);

                Label noReturn = cg.DefineLabel();

                flag.EmitGet(cg);
                cg.EmitInt(CodeGen.BranchForReturn);
                cg.Emit(OpCodes.Bne_Un, noReturn);

                if (cg.IsGenerator) {
                    // return true from the generator method
                    cg.Emit(OpCodes.Ldc_I4_1);
                    cg.EmitReturn();
                } else if (flow.Any) {
                    // return the actual value
                    cg.EmitReturnValue();
                    cg.EmitReturn();
                }
                cg.MarkLabel(noReturn);
            }

            // Only emit break handling if it is actually needed
            if (flow.Break) {
                Debug.Assert(flag != null);

                Label noReturn = cg.DefineLabel();
                flag.EmitGet(cg);
                cg.EmitInt(CodeGen.BranchForBreak);
                cg.Emit(OpCodes.Bne_Un, noReturn);
                cg.EmitBreak();
                cg.MarkLabel(noReturn);
            }

            // Only emit continue handling if it if actually needed
            if (flow.Continue) {
                Debug.Assert(flag != null);

                Label noReturn = cg.DefineLabel();
                flag.EmitGet(cg);
                cg.EmitInt(CodeGen.BranchForContinue);
                cg.Emit(OpCodes.Bne_Un, noReturn);
                cg.EmitContinue();
                cg.MarkLabel(noReturn);
            }
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:51,代码来源:TryStatement.cs

示例3: Emit

        public override void Emit(CodeGen cg)
        {
            if (Span.IsValid)
            {
              cg.EmitPosition(Start, End);

              if (ScriptDomainManager.Options.LightweightDebugging)
              {
                if (!cg.IsDynamicMethod)
                {
                  var s = SpanToLong(Span);
                  cg.EmitConstant(s);
                  cg.EmitCall(Debugging.DebugMethods.ExpressionInTail); // not really but will do for LW debugger
                }
              }
            }

            if (_statement != null) {
                cg.CheckAndPushTargets(_statement);
            }

            cg.EmitContinue();

            if (_statement != null) {
                cg.PopTargets();
            }
        }
开发者ID:robertlj,项目名称:IronScheme,代码行数:27,代码来源:ContinueStatement.cs


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