Наследование: ReturnStatement
Пример #1
0
 public override void VisitYield(YieldStatement yield)
 {
     if (exceptionLevel > 0) {
         report.Error(yield.Location,
                      "`yield' statements may not appear " +
                      "in `protect' statements.");
         return;
     }
     if (yield.Value != null) {
         ilGenerator.Emit(OpCodes.Ldarg_0);
         yield.Value.Accept(this);
         BoxIfNecessary(yield.Value.RawType,
                        currentIter.Current.FieldType);
         ilGenerator.Emit(OpCodes.Stfld, currentIter.Current);
     }
     ilGenerator.Emit(OpCodes.Ldarg_0);
     ilGenerator.Emit(OpCodes.Ldc_I4, yield.ResumePoint.Index);
     ilGenerator.Emit(OpCodes.Stfld, currentIter.CurrentPosition);
     ilGenerator.Emit(OpCodes.Ldc_I4_1);
     ilGenerator.Emit(OpCodes.Br, returnLabel);
     ilGenerator.MarkLabel(yield.ResumePoint.Label);
 }
Пример #2
0
 public override void VisitYield(YieldStatement yield)
 {
     if (currentIter == null) {
         report.Error(yield.Location,
                      "`yield' statements may not appear in routines.");
         return;
     }
     CheckReturnValue(yield);
     yield.ResumePoint.Index = currentIter.ResumePoints.Count;
     currentIter.ResumePoints.Add(yield.ResumePoint);
 }
Пример #3
0
 public virtual void VisitYield(YieldStatement yield)
 {
 }