public LambdaSharpnode(SimpleLambdaExpressionSyntax syntax) : base(syntax) { this.parameter = new ParameterSharpnode(syntax.Parameter); if (syntax.Body is ExpressionSyntax) { this.body = RoslynToSharpnode.MapExpression((ExpressionSyntax)syntax.Body); } else { this.errorneousResult = new Error( Diagnostics.SSIL126_LambdasMustBeExpressions, syntax.Body); } }
public LambdaSharpnode(ParenthesizedLambdaExpressionSyntax syntax) : base(syntax) { // We only allow for a single kind of lambda expressions: those that fit ForAll and Exists. if (syntax.ParameterList.Parameters.Count != 1) { this.errorneousResult = new Error( Diagnostics.SSIL125_LambdasMustHaveSingleParameter, syntax.ParameterList); return; } this.parameter = new ParameterSharpnode(syntax.ParameterList.Parameters[0]); if (syntax.Body is ExpressionSyntax) { this.body = RoslynToSharpnode.MapExpression((ExpressionSyntax)syntax.Body); } else { this.errorneousResult = new Error( Diagnostics.SSIL126_LambdasMustBeExpressions, syntax.Body); } }