示例#1
0
        static public (IXor2ComputationNodeReference, AlreadyProcessedSyntaxNodes) FromReturnStatement(ReturnStatementSyntax returnSyntax, MethodBlockAnalysis methodAnalysis, TextSpan span, AlreadyProcessedSyntaxNodes processedNodesOrNull = null)
        {
            Throw.IfNot(methodAnalysis.DataFlowAnalysis.Succeeded);


            var processedNodes = (processedNodesOrNull ?? new AlreadyProcessedSyntaxNodes());

            if (!span.Contains(returnSyntax.Span))
            {
                return(_CreatePair(Xor2ComputationNodeReference.OutOfScope(returnSyntax), processedNodes));
            }

            var rhsSyntax = SyntaxOperations.GetRightHandSideExpression(returnSyntax);

            var previous = _DispatchXor7ExpressionSyntax(rhsSyntax, methodAnalysis, processedNodes ?? new AlreadyProcessedSyntaxNodes(), span);

            var node = ComputationGraphNode.FromReturnStatement(returnSyntax, previous.Item1);


            if (!previous.Item1.IsA)
            {
                return(_CreatePair(node, previous.Item2));
            }


            return(_CreatePair(node, previous.Item2));
        }
示例#2
0
 public AlreadyProcessedSyntaxNodes WithAdded(ComputationGraphNode graphNode)
 {
     _nodesBySyntax.Add(graphNode.Syntax, graphNode);
     return(this);
 }
 Xor2ComputationNodeReference(ComputationGraphNode node)
 {
     _innerXor2 = new Xor2 <ComputationGraphNode, OutsideSyntaxReach>(node);
 }