Ejemplo n.º 1
0
        public CallInfoContext <InvocationExpressionSyntax, InvocationExpressionSyntax> GetCallInfoContext(SemanticModel semanticModel, SyntaxNode syntaxNode)
        {
            var visitor = new CallInfoVisitor(semanticModel);

            visitor.Visit(syntaxNode);

            return(new CallInfoContext <InvocationExpressionSyntax, InvocationExpressionSyntax>(visitor.ArgAtInvocations, visitor.ArgInvocations, visitor.DirectIndexerAccesses));
        }
 public static void BridgeMethodCall(ParseInfo parseInfo, CallInfo callInfo, DocRange range, string name, bool fatal)
 => parseInfo.TranslateInfo.StagedInitiation.On(InitiationStage.PostContent, () => {
     // Collect the restricted calls.
     foreach (var restrictedCallType in CallInfoVisitor.CollectRestrictedCalls(callInfo))
     {
         // Add the restricted call to the current CallInfo.
         parseInfo.RestrictedCallHandler.AddRestrictedCall(new RestrictedCall(
                                                               restrictedCallType,
                                                               parseInfo.GetLocation(range),
                                                               RestrictedCall.Message_FunctionCallsRestricted(name, restrictedCallType),
                                                               fatal
                                                               ));
     }
 });