Exemple #1
0
 public override IOperation VisitForToLoop(IForToLoopOperation operation, object argument)
 {
     return(new ForToLoopStatement(operation.Locals, operation.IsChecked, ((BaseForToLoopStatement)operation).Info, operation.ContinueLabel, operation.ExitLabel,
                                   Visit(operation.LoopControlVariable), Visit(operation.InitialValue), Visit(operation.LimitValue), Visit(operation.StepValue),
                                   Visit(operation.Body), VisitArray(operation.NextVariables), ((Operation)operation).SemanticModel, operation.Syntax, operation.Type,
                                   operation.ConstantValue, operation.IsImplicit));
 }
        public override void VisitForToLoop(IForToLoopOperation operation)
        {
            Assert.Equal(OperationKind.Loop, operation.Kind);
            Assert.Equal(LoopKind.ForTo, operation.LoopKind);
            VisitLocals(operation);

            IEnumerable <IOperation> children;

            if (operation.StepValue != null)
            {
                children = new[] { operation.LoopControlVariable, operation.InitialValue, operation.LimitValue, operation.StepValue, operation.Body };
            }
            else
            {
                children = new[] { operation.LoopControlVariable, operation.InitialValue, operation.LimitValue, operation.Body };
            }

            children = children.Concat(operation.NextVariables);
            AssertEx.Equal(children, operation.Children);
        }
        public override void VisitForToLoop(IForToLoopOperation operation)
        {
            VisitLoop(operation);
            Assert.Equal(LoopKind.ForTo, operation.LoopKind);
            _ = operation.IsChecked;
            (ILocalSymbol loopObject, ForToLoopOperationUserDefinedInfo userDefinedInfo) = ((BaseForToLoopStatement)operation).Info;

            if (userDefinedInfo != null)
            {
                VerifySubTree(userDefinedInfo.Addition.Value);
                VerifySubTree(userDefinedInfo.Subtraction.Value);
                VerifySubTree(userDefinedInfo.LessThanOrEqual.Value);
                VerifySubTree(userDefinedInfo.GreaterThanOrEqual.Value);
            }

            IEnumerable <IOperation> children;

            children = new[] { operation.LoopControlVariable, operation.InitialValue, operation.LimitValue, operation.StepValue, operation.Body };
            children = children.Concat(operation.NextVariables);
            AssertEx.Equal(children, operation.Children);
        }
Exemple #4
0
 public virtual void VisitForToLoop(IForToLoopOperation operation)
 {
     DefaultVisit(operation);
 }
Exemple #5
0
 public override void VisitForToLoop([NotNull] IForToLoopOperation operation)
 {
     base.VisitForToLoop(operation);
 }
Exemple #6
0
        public override void VisitForToLoop(IForToLoopOperation operation)
        {
            WalkLoop(operation);

            base.VisitForToLoop(operation);
        }
Exemple #7
0
 public override bool VisitForToLoop([NotNull] IForToLoopOperation operation1, [CanBeNull] IOperation argument)
 {
     return(argument is IForToLoopOperation operation2 && AreBaseOperationsEqual(operation1, operation2) &&
            operation1.LoopKind == operation2.LoopKind && AreSymbolSequencesEqual(operation1.Locals, operation2.Locals));
 }