@@ -26,9 +26,6 @@ public class CSharpToCppTransformer : Transformer
2626 // out TProduct
2727 // TProduct
2828 ( new Regex ( @"(?<before>(<|, ))(in|out) (?<typeParameter>[a-zA-Z0-9]+)(?<after>(>|,))" ) , "${before}${typeParameter}${after}" , null , 10 ) ,
29- // static class Ensure ... public static readonly EnsureAlwaysExtensionRoot Always = new EnsureAlwaysExtensionRoot(); ... } }
30- // static class Ensure ... static EnsureAlwaysExtensionRoot Always; ... } EnsureAlwaysExtensionRoot Ensure::Always; }
31- ( 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 ) ,
3229 // public abstract class
3330 // class
3431 ( new Regex ( @"(public abstract|static) class" ) , "class" , null , 0 ) ,
@@ -59,6 +56,12 @@ public class CSharpToCppTransformer : Transformer
5956 // Predicate<TArgument> predicate
6057 // std::function<bool(TArgument)> predicate
6158 ( new Regex ( @"Predicate<([a-zA-Z0-9]+)> ([a-zA-Z0-9]+)" ) , "std::function<bool($1)> $2" , null , 0 ) ,
59+ // public static readonly EnsureAlwaysExtensionRoot Always = new EnsureAlwaysExtensionRoot();
60+ // inline static EnsureAlwaysExtensionRoot Always;
61+ ( new Regex ( @"public static readonly (?<type>[a-zA-Z0-9]+) (?<name>[a-zA-Z0-9_]+) = new \k<type>\(\);" ) , "inline static ${type} ${name};" , null , 0 ) ,
62+ // public static readonly string ExceptionContentsSeparator = "---";
63+ // inline static const char* ExceptionContentsSeparator = "---";
64+ ( new Regex ( @"public static readonly string (?<name>[a-zA-Z0-9_]+) = ""(?<string>(\""|[^""])+)"";" ) , "inline static const char* ${name} = \" ${string}\" ;" , null , 0 ) ,
6265 // private const int MaxPath = 92;
6366 // static const int MaxPath = 92;
6467 ( new Regex ( @"private (const|static readonly) ([a-zA-Z0-9]+) ([_a-zA-Z0-9]+) = ([^;]+);" ) , "static const $2 $3 = $4;" , null , 0 ) ,
0 commit comments