コード例 #1
0
        internal static IEnumerable <Match <SyntaxNode> > GetMethodMatches(string src1, string src2, ParseOptions options = null, StateMachineKind stateMachine = StateMachineKind.None)
        {
            var methodMatch = GetMethodMatch(src1, src2, options, stateMachine);

            var queue = new Queue <Match <SyntaxNode> >();

            queue.Enqueue(methodMatch);

            while (queue.Count > 0)
            {
                var match = queue.Dequeue();
                yield return(match);

                foreach (var m in match.Matches)
                {
                    if (m.Key == match.OldRoot)
                    {
                        Assert.Equal(match.NewRoot, m.Value);
                        continue;
                    }

                    foreach (var body in GetLambdaBodies(m.Key, m.Value))
                    {
                        var lambdaMatch = new StatementSyntaxComparer(body.Item1, body.Item2).ComputeMatch(m.Key, m.Value);
                        queue.Enqueue(lambdaMatch);
                    }
                }
            }
        }
コード例 #2
0
ファイル: RudeEditTestBase.cs プロジェクト: elemk0vv/roslyn-1
        internal static IEnumerable<Match<SyntaxNode>> GetMethodMatches(string src1, string src2, ParseOptions options = null, StateMachineKind stateMachine = StateMachineKind.None)
        {
            var methodMatch = GetMethodMatch(src1, src2, options, stateMachine);

            var queue = new Queue<Match<SyntaxNode>>();
            queue.Enqueue(methodMatch);

            while (queue.Count > 0)
            {
                var match = queue.Dequeue();
                yield return match;

                foreach (var m in match.Matches)
                {
                    if (m.Key == match.OldRoot)
                    {
                        Assert.Equal(match.NewRoot, m.Value);
                        continue;
                    }

                    foreach (var body in GetLambdaBodies(m.Key, m.Value))
                    {
                        var lambdaMatch = new StatementSyntaxComparer(body.Item1, body.Item2).ComputeMatch(m.Key, m.Value);
                        queue.Enqueue(lambdaMatch);
                    }
                }
            }
        }