diff --git a/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs b/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs index 47b8114..91dd32f 100644 --- a/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs +++ b/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs @@ -114,6 +114,9 @@ public class CSharpToCppTransformer : Transformer // Count => GetSizeOrZero(Root); // GetCount() { return GetSizeOrZero(Root); } (new Regex(@"(\W)([A-Z][a-zA-Z]+)\s+=>\s+([^;\r\n]+);"), "$1Get$2() { return $3; }", null, 0), + // ArgumentInRange(const char* message) { const char* messageBuilder() { return message; } + // ArgumentInRange(const char* message) { auto messageBuilder = [&]() -> const char* { return message; }; + (new Regex(@"(?\W[_a-zA-Z0-9]+\([^\)\n]*\)[\s\n]*{[\s\n]*([^{}]|\n)*?(\r?\n)?[ \t]*)(?[_a-zA-Z0-9*:]+[_a-zA-Z0-9*: ]*) (?[_a-zA-Z0-9]+)\((?[^\)\n]*)\)\s*{(?([^}]|\n)+?)}"), "${before}auto ${methodName} = [&]() -> ${returnType} {${body}};", null, 10), // Func treeCount // std::function treeCount (new Regex(@"Func<([a-zA-Z0-9]+)> ([a-zA-Z0-9]+)"), "std::function<$1()> $2", null, 0), diff --git a/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/Platform.RegularExpressions.Transformer.CSharpToCpp.csproj b/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/Platform.RegularExpressions.Transformer.CSharpToCpp.csproj index 131eeca..91567ae 100644 --- a/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/Platform.RegularExpressions.Transformer.CSharpToCpp.csproj +++ b/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/Platform.RegularExpressions.Transformer.CSharpToCpp.csproj @@ -4,7 +4,7 @@ LinksPlatform's Platform.RegularExpressions.Transformer.CSharpToCpp Class Library Konstantin Diachenko Platform.RegularExpressions.Transformer.CSharpToCpp - 0.1.25 + 0.1.26 Konstantin Diachenko net471;netstandard2.0;netstandard2.1 Platform.RegularExpressions.Transformer.CSharpToCpp @@ -24,7 +24,7 @@ true snupkg latest - Better support for exceptions translation. + Added support for translation functions inside functions.