public LambdaTranslation(LambdaExpression lambda, ITranslationContext context) { Type = lambda.Type; _parameters = new ParameterSetTranslation(lambda.Parameters, context); _bodyTranslation = context.GetCodeBlockTranslationFor(lambda.Body); EstimatedSize = GetEstimatedSize(); if (_bodyTranslation.IsMultiStatement == false) { _bodyTranslation.WithoutTermination(); } }
public LambdaTranslation(LambdaExpression lambda, ITranslationContext context) { Type = lambda.Type; _parameters = ParameterSetTranslation.For(lambda.Parameters, context); _bodyTranslation = context.GetCodeBlockTranslationFor(lambda.Body); TranslationSize = _parameters.TranslationSize + _fatArrow.Length + _bodyTranslation.TranslationSize; FormattingSize = _parameters.FormattingSize + _bodyTranslation.FormattingSize; if (_bodyTranslation.IsMultiStatement == false) { _bodyTranslation.WithoutTermination(); } }