Skip to content

Commit

Permalink
Version 0.1.14. Lambda rules fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Konard committed Feb 3, 2020
1 parent a73953a commit dd34a68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public class CSharpToCppTransformer : Transformer
(new Regex(@"(^\s+)(private|protected|public)?(: )?(template \<[^>\r\n]+\> )?(static )?(override )?([a-zA-Z0-9]+ )([a-zA-Z0-9]+)\(([^\(\r\n]*)\)\s+=>\s+([^;\r\n]+);"), "$1$2$3$4$5$6$7$8($9) { return $10; }", null, 0),
// () => Integer<TElement>.Zero,
// () { return Integer<TElement>.Zero; },
(new Regex(@"\(\)\s+=>\s+(?<expression>[^(),;\r\n]+((?<parenthesis>\()|(?<-parenthesis>\))|[^();\r\n]*)*[^(),;\r\n]*)(?<after>,|\);)"), "() { return ${expression}; }${after}", null, 0),
(new Regex(@"\(\)\s+=>\s+(?<expression>[^(),;\r\n]+((?<parenthesis>\()|(?<-parenthesis>\))|[^();\r\n]*?)*?[^(),;\r\n]*)(?<after>,|\);)"), "() { return ${expression}; }${after}", null, 0),
// => Integer<TElement>.Zero;
// { return Integer<TElement>.Zero; }
(new Regex(@"\)\s+=>\s+([^;\r\n]+?);"), ") { return $1; }", null, 0),
// () { return avlTree.Count; }
// [&]()-> auto { return avlTree.Count; }
(new Regex(@", \(\) { return ([^;\r\n]+); }"), ", [&]()-> auto { return $1; }", null, 0),
(new Regex(@"(?<before>, |\()\(\) { return (?<expression>[^;\r\n]+); }"), "${before}[&]()-> auto { return ${expression}; }", null, 0),
// 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),
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.1.13</VersionPrefix>
<VersionPrefix>0.1.14</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>Rule fix.</PackageReleaseNotes>
<PackageReleaseNotes>Lambda rules fix.</PackageReleaseNotes>
</PropertyGroup>

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

0 comments on commit dd34a68

Please sign in to comment.