ReadableExpressions icon indicating copy to clipboard operation
ReadableExpressions copied to clipboard

implement override dictionary for translations to expose to consumers

Open nquandt opened this issue 3 years ago • 0 comments

I am in need of the ability to override the translation you've implemented for specific Expression types. I'm exploring metaprogramming via ast -> expression trees -> sourcecode that would essentially be put into a .cs file. The following is probably not the implementation you'd want as maintainer. Please take a look and consider adding this functionality to ReadableExpressions. If the ITranslation required a static param for NodeType I wouldn't need to create an instance in order to add to the dictionary. I'm not sure how to get around the expression tree needed for the ctor. Please consider.. Thanks!

expr.ToReadableString(x =>
    {
        return x.ShowLambdaParameterTypes.OverrideTranslations(new[] { typeof(NewLambdaTranslation) });
    })

nquandt avatar Aug 17 '22 23:08 nquandt