Skip to content

Commit 56d4564

Browse files
committed
[C#] Version 0.2.21. Templates rules enabled also for struct's, not only for classes.
1 parent 880a18a commit 56d4564

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public class CSharpToCppTransformer : TextTransformer
7474
(new Regex(@"((public|protected|private|internal|abstract|static) )*(?<category>interface|class|struct)"), "${category}", 0),
7575
// class GenericCollectionMethodsBase<TElement> {
7676
// template <typename TElement> class GenericCollectionMethodsBase {
77-
(new Regex(@"class ([a-zA-Z0-9]+)<([a-zA-Z0-9]+)>([^{]+){"), "template <typename $2> class $1$3{", 0),
77+
(new Regex(@"(class|struct) ([a-zA-Z0-9]+)<([a-zA-Z0-9]+)>([^{]+){"), "template <typename $2> class $1$3{", 0),
7878
// static void TestMultipleCreationsAndDeletions<TElement>(SizedBinaryTreeMethodsBase<TElement> tree, TElement* root)
7979
// template<typename T> static void TestMultipleCreationsAndDeletions<TElement>(SizedBinaryTreeMethodsBase<TElement> tree, TElement* root)
8080
(new Regex(@"static ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)<([a-zA-Z0-9]+)>\(([^\)\r\n]+)\)"), "template <typename $3> static $1 $2($4)", 0),
8181
// interface IFactory<out TProduct> {
8282
// template <typename TProduct> class IFactory { public:
8383
(new Regex(@"interface (?<interface>[a-zA-Z0-9]+)<(?<typeParameters>[a-zA-Z0-9 ,]+)>(?<whitespace>[^{]+){"), "template <typename...> class ${interface}; template <typename ${typeParameters}> class ${interface}<${typeParameters}>${whitespace}{" + Environment.NewLine + " public:", 0),
8484
// template <typename TObject, TProperty, TValue>
85-
// template <typename TObject, typename TProperty, TValue>
85+
// template <typename TObject, typename TProperty, typename TValue>
8686
(new Regex(@"(?<before>template <((, )?typename [a-zA-Z0-9]+)+, )(?<typeParameter>[a-zA-Z0-9]+)(?<after>(,|>))"), "${before}typename ${typeParameter}${after}", 10),
8787
// Insert markers
8888
// private: static void BuildExceptionString(this StringBuilder sb, Exception exception, int level)

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

+2-2
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.20</VersionPrefix>
7+
<VersionPrefix>0.2.21</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>Rule fix.</PackageReleaseNotes>
27+
<PackageReleaseNotes>Templates rules enabled also for struct's, not only for classes.</PackageReleaseNotes>
2828
</PropertyGroup>
2929

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

0 commit comments

Comments
 (0)