Skip to content

Commit a59d94f

Browse files
committed
Version 0.2.10. ToString translation rules fix.
1 parent e6f37cb commit a59d94f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/CSharpToCppTransformer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ public class CSharpToCppTransformer : TextTransformer
307307
// Insert scope borders.
308308
// class Range { ... public: override const char* ToString() { return ...; }
309309
// class Range {/*~Range~*/ ... public: override const char* ToString() { return ...; }
310-
(new Regex(@"(?<classDeclarationBegin>\r?\n(?<indent>[\t ]*)(struct|class) (?<type>[a-zA-Z0-9]+(<[^{\n]+>)?)[\t ]*(\r?\n)?[\t ]*{)(?<middle>((?!class|struct).|\n)+?)(?<toStringDeclaration>(?<access>(private|protected|public): )override const char\* ToString\(\))"), "${classDeclarationBegin}/*~${type}~*/${middle}${toStringDeclaration}", 0),
310+
(new Regex(@"(?<classDeclarationBegin>\r?\n(?<indent>[\t ]*)(struct|class) (?<type>[a-zA-Z0-9]+(<((?!\s*:\s*)[^{\n])+>)?)(\s*:\s*[^{\n]+)?[\t ]*(\r?\n)?[\t ]*{)(?<middle>((?!class|struct).|\n)+?)(?<toStringDeclaration>(?<access>(private|protected|public): )override const char\* ToString\(\))"), "${classDeclarationBegin}/*~${type}~*/${middle}${toStringDeclaration}", 0),
311311
// Inside the scope of ~!_exceptionsBag!~ replace:
312312
// public: override const char* ToString() { return ...; }
313313
// public: operator std::string() const { return ...; }\n\npublic: friend std::ostream & operator << (std::ostream &out, const A &obj) { return out << (std::string)obj; }
314-
(new Regex(@"(?<scope>/\*~(?<type>[_a-zA-Z0-9<>:]+)~\*/)(?<separator>.|\n)(?<before>((?<!/\*~\k<type>~\*/)(.|\n))*?)(?<toStringDeclaration>\r?\n(?<indent>[ \t]*)(?<access>(private|protected|public): )override const char\* ToString\(\) (?<toStringMethodBody>{[^}\n]+}))"), "${scope}${separator}${before}${indent}${access}operator std::string() const ${toStringMethodBody}" + Environment.NewLine + Environment.NewLine + "${indent}${access}friend std::ostream & operator << (std::ostream &out, const ${type} &obj) { return out << (std::string)obj; }", 0),
314+
(new Regex(@"(?<scope>/\*~(?<type>[_a-zA-Z0-9<>:]+)~\*/)(?<separator>.|\n)(?<before>((?<!/\*~\k<type>~\*/)(.|\n))*?)(?<toStringDeclaration>\r?\n(?<indent>[ \t]*)(?<access>(private|protected|public): )override const char\* ToString\(\) (?<toStringMethodBody>{[^}\n]+}))"), "${scope}${separator}${before}" + Environment.NewLine + "${indent}${access}operator std::string() const ${toStringMethodBody}" + Environment.NewLine + Environment.NewLine + "${indent}${access}friend std::ostream & operator << (std::ostream &out, const ${type} &obj) { return out << (std::string)obj; }", 0),
315315
// Remove scope borders.
316316
// /*~Range~*/
317317
//

csharp/Platform.RegularExpressions.Transformer.CSharpToCpp/Platform.RegularExpressions.Transformer.CSharpToCpp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>LinksPlatform's Platform.RegularExpressions.Transformer.CSharpToCpp Class Library</Description>
55
<Copyright>Konstantin Diachenko</Copyright>
66
<AssemblyTitle>Platform.RegularExpressions.Transformer.CSharpToCpp</AssemblyTitle>
7-
<VersionPrefix>0.2.9</VersionPrefix>
7+
<VersionPrefix>0.2.10</VersionPrefix>
88
<Authors>Konstantin Diachenko</Authors>
99
<TargetFrameworks>net472;netstandard2.0;netstandard2.1</TargetFrameworks>
1010
<AssemblyName>Platform.RegularExpressions.Transformer.CSharpToCpp</AssemblyName>
@@ -24,7 +24,7 @@
2424
<IncludeSymbols>true</IncludeSymbols>
2525
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2626
<LangVersion>latest</LangVersion>
27-
<PackageReleaseNotes>Added support for translation of ToString method.</PackageReleaseNotes>
27+
<PackageReleaseNotes>ToString translation rules fix.</PackageReleaseNotes>
2828
</PropertyGroup>
2929

3030
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">

0 commit comments

Comments
 (0)