Example #1
0
 private Func <Declaration, IBoundExpression> CreateNamedArgumentExpressionCreator(string parameterName, ParserRuleContext context)
 {
     return(calledProcedure =>
     {
         ExpressionClassification classification;
         if (calledProcedure.DeclarationType == DeclarationType.Procedure)
         {
             classification = ExpressionClassification.Subroutine;
         }
         else if (calledProcedure.DeclarationType == DeclarationType.Function || calledProcedure.DeclarationType == DeclarationType.LibraryFunction || calledProcedure.DeclarationType == DeclarationType.LibraryProcedure)
         {
             classification = ExpressionClassification.Function;
         }
         else
         {
             classification = ExpressionClassification.Property;
         }
         var parameter = _declarationFinder.FindParameter(calledProcedure, parameterName);
         if (parameter != null)
         {
             return new SimpleNameExpression(parameter, classification, context);
         }
         else
         {
             return null;
         }
     });
 }
Example #2
0
 private Func <Declaration, IBoundExpression> CreateNamedArgumentExpressionCreator(string parameterName, ParserRuleContext context)
 {
     return(calledProcedure =>
     {
         var classification = ExpressionClassificationOfProcedure(calledProcedure);
         var parameter = _declarationFinder.FindParameter(calledProcedure, parameterName);
         return parameter != null
             ? new SimpleNameExpression(parameter, classification, context)
             : null;
     });
 }