Skip to content

Commit

Permalink
Version 0.0.19. Added support for static fields initialization with c…
Browse files Browse the repository at this point in the history
…lass instances with parameterless constructors in static classes.
  • Loading branch information
Konard committed Nov 27, 2019
1 parent 5c46988 commit 9fe7d78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class CSharpToCppTransformer : Transformer
// out TProduct
// TProduct
(new Regex(@"(?<before>(<|, ))(in|out) (?<typeParameter>[a-zA-Z0-9]+)(?<after>(>|,))"), "${before}${typeParameter}${after}", null, 10),
// static class Ensure ... public static readonly EnsureAlwaysExtensionRoot Always = new EnsureAlwaysExtensionRoot(); ... } }
// static class Ensure ... static EnsureAlwaysExtensionRoot Always; ... } EnsureAlwaysExtensionRoot Ensure::Always; }
(new Regex(@"static class (?<class>[a-zA-Z0-9]+)(?<before>[\s\S\r\n]+)public static readonly (?<type>[a-zA-Z0-9]+) (?<name>[a-zA-Z0-9_]+) = new \k<type>\(\);(?<after>[\s\S]+[\r\n]+)(?<indent>[ ]+)}(?<ending>[a-zA-Z:; \r\n]+}[ \r\n]+$)"), "static class ${class}${before}static ${type} ${name};${after}${indent}}\r\n${indent}${type} ${class}::${name};${ending}", null, 10),
// public abstract class
// class
(new Regex(@"(public abstract|static) class"), "class", null, 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>LinksPlatform's Platform.RegularExpressions.Transformer.CSharpToCpp Class Library</Description>
<Copyright>Konstantin Diachenko</Copyright>
<AssemblyTitle>Platform.RegularExpressions.Transformer.CSharpToCpp</AssemblyTitle>
<VersionPrefix>0.0.18</VersionPrefix>
<VersionPrefix>0.0.19</VersionPrefix>
<Authors>Konstantin Diachenko</Authors>
<TargetFrameworks>net471;netstandard2.0;netstandard2.1</TargetFrameworks>
<AssemblyName>Platform.RegularExpressions.Transformer.CSharpToCpp</AssemblyName>
Expand All @@ -24,7 +24,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<LangVersion>latest</LangVersion>
<PackageReleaseNotes>Variables of translated interfaces cannot be concrete, only pointers.</PackageReleaseNotes>
<PackageReleaseNotes>Added support for static fields initialization with class instances with parameterless constructors in static classes.</PackageReleaseNotes>
</PropertyGroup>

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

0 comments on commit 9fe7d78

Please sign in to comment.