<commit_before>﻿using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace SharpSwift.Converters
{
    partial class ConvertToSwift
    {
        [ParsesType(typeof(ParenthesizedLambdaExpressionSyntax))]
        public static string ParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node)
        {
            var output = "{ ";
            output += SyntaxNode(node.ParameterList);
            output += " in\r\n";
            output += Block((BlockSyntax)node.Body, false) + "\r\n";
            output += "}";
            return output;
        }

        [ParsesType(typeof(SimpleLambdaExpressionSyntax))]
        public static string SimpleLambdaExpression(SimpleLambdaExpressionSyntax node)
        {
            return node.ToString();
        }
    }
}<commit_msg>simple lambda expressions<commit_after>﻿using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace SharpSwift.Converters
{
    partial class ConvertToSwift
    {
        //TODO: lambda != closure, detect when to use what resulting swift code
        [ParsesType(typeof(ParenthesizedLambdaExpressionSyntax))]
        public static string ParenthesizedLambdaExpression(ParenthesizedLambdaExpressionSyntax node)
        {
            var output = "{ ";
            output += SyntaxNode(node.ParameterList);
            output += " in\r\n";
            output += Block((BlockSyntax)node.Body, false) + "\r\n";
            output += "}";
            return output;
        }

        [ParsesType(typeof(SimpleLambdaExpressionSyntax))]
        public static string SimpleLambdaExpression(SimpleLambdaExpressionSyntax node)
        {
            var output = "{ (";
            output += node.Parameter.Identifier.Text;
            if (node.Parameter.Type != null)
            {
                output += ": " + Type(node.Parameter.Type);
            }
            output += ") in\r\n";
            output += Block((BlockSyntax)node.Body, false) + "\r\n";
            output += "}";
            return output;
        }
    }
}
{'fraction_non_alphanumeric': 0.107, 'fraction_numerical': 0.0, 'mean_word_length': 2.181240063593005, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7483065', 'n_tokens_mistral': 512, 'n_tokens_neox': 499, 'n_words': 97}