From 6215d449633ec3143cfd9248ea8c87cf13b7dc88 Mon Sep 17 00:00:00 2001 From: Konstantin Diachenko Date: Sat, 29 Feb 2020 20:21:38 +0300 Subject: [PATCH] Version 0.2.11. Added a rule for string format simplification. --- .../CSharpToCppTransformer.cs | 3 +++ ...Platform.RegularExpressions.Transformer.CSharpToCpp.csproj | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs b/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs index 9ae37a5..af583ed 100644 --- a/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs +++ b/csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs @@ -286,6 +286,9 @@ public class CSharpToCppTransformer : TextTransformer // $"Argument {argumentName} is null." // ((std::string)"Argument ").append(argumentName).append(" is null.").data() (new Regex(@"\$""(?(\\""|[^""\r\n])*){(?[_a-zA-Z0-9]+)}(?(\\""|[^""\r\n])*)"""), "((std::string)$\"${left}\").append(${expression}).append(\"${right}\").data()", 10), + // ((std::string)((std::string)"[").append(Minimum).append(", ").data()).append(Maximum).append("]").data() + // ((std::string)"[").append(Minimum).append(", ").append(Maximum).append("]").data() + (new Regex(@"\(\(std::string\)(?\(\(std::string\)""(\\""|[^""])*""\)(\.append\([^)\n]+\))+)\.data\(\)\)\.append"), "${begin}.append", 10), // $" // " (new Regex(@"\$"""), "\"", 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 bbfd79b..c3d55b2 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.2.10 + 0.2.11 Konstantin Diachenko net472;netstandard2.0;netstandard2.1 Platform.RegularExpressions.Transformer.CSharpToCpp @@ -24,7 +24,7 @@ true snupkg latest - ToString translation rules fix. + Added a rule for string format simplification.