From e8df7ee946c9e55cace9165f4bb484c1864203ac Mon Sep 17 00:00:00 2001 From: "David G. Moore, Jr" Date: Thu, 23 Nov 2023 06:26:55 -0500 Subject: [PATCH] UPDATED: RegexDtoGenerator Changes - Updated Dgmjr.RegexDtoGenerator.csproj: Updated PackageReference for Dgmjr.RegexDtoGenerator SourceCodePackageReference for System Dgmjr.RegexDto to Dgmjr.RegexOptions parameter. - Updated USPostalAddresssexDtoGenerator. -jr.RegexGenerator. Updated RegexDtoTypeDeclarationModel.cs: - Updated regexOptions property type to RegexOptions. - Updated RegexDtoGenerator to RegexOptions. - Updated return type for Regex() method to Regex. - Updated _regex field type to Regex. --- .../Dgmjr.RegexDtoGenerator.Samples.csproj | 4 +-- Samples/Dgmjr.RegexDtoGenerator.Samples.sln | 26 +++++++++---------- Samples/RegexDtoAttribute.cs | 2 +- Samples/USPostalAddresss.cs | 10 +++---- src/Dgmjr.RegexDtoGenerator.csproj | 6 ++--- src/Dgmjr.RegexDtoGenerator.sln | 26 +++++++++---------- src/Models/RegexDtoTypeDeclarationModel.cs | 8 +++--- src/RegexDtoGenerator.cs | 8 +++--- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Samples/Dgmjr.RegexDtoGenerator.Samples.csproj b/Samples/Dgmjr.RegexDtoGenerator.Samples.csproj index de0d58f..608924a 100644 --- a/Samples/Dgmjr.RegexDtoGenerator.Samples.csproj +++ b/Samples/Dgmjr.RegexDtoGenerator.Samples.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/Samples/Dgmjr.RegexDtoGenerator.Samples.sln b/Samples/Dgmjr.RegexDtoGenerator.Samples.sln index 4cf3441..129f4ae 100644 --- a/Samples/Dgmjr.RegexDtoGenerator.Samples.sln +++ b/Samples/Dgmjr.RegexDtoGenerator.Samples.sln @@ -8,7 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\Packages\Versions.Local.props EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.RegexDtoGenerator.Samples", "Dgmjr.RegexDtoGenerator.Samples.csproj", "{A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.RegexDtoGenerator.Samples", "Dgmjr.RegexDtoGenerator.Samples.csproj", "{C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,18 +20,18 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Local|Any CPU.ActiveCfg = Local|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Local|Any CPU.Build.0 = Local|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Testing|Any CPU.ActiveCfg = Testing|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Testing|Any CPU.Build.0 = Testing|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Staging|Any CPU.ActiveCfg = Staging|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Staging|Any CPU.Build.0 = Staging|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Production|Any CPU.ActiveCfg = Local|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Production|Any CPU.Build.0 = Local|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6B96F0E-8325-4A5E-BFED-1AE0A23530AA}.Release|Any CPU.Build.0 = Release|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Local|Any CPU.ActiveCfg = Local|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Local|Any CPU.Build.0 = Local|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Testing|Any CPU.ActiveCfg = Testing|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Testing|Any CPU.Build.0 = Testing|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Staging|Any CPU.ActiveCfg = Staging|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Staging|Any CPU.Build.0 = Staging|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Production|Any CPU.ActiveCfg = Local|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Production|Any CPU.Build.0 = Local|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C135F894-58C1-41DC-8FC4-FEB2A6B0D9A5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Samples/RegexDtoAttribute.cs b/Samples/RegexDtoAttribute.cs index d6d1e9f..c1fda37 100644 --- a/Samples/RegexDtoAttribute.cs +++ b/Samples/RegexDtoAttribute.cs @@ -13,5 +13,5 @@ // public class RegexDtoAttribute( // string regex, // type? baseType = default, -// Rxo regexOptions = Rxo.Compiled | Rxo.IgnoreCase | Rxo.Multiline +// RegexOptions regexOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline // ) : Attribute { } diff --git a/Samples/USPostalAddresss.cs b/Samples/USPostalAddresss.cs index def9fce..83d2669 100644 --- a/Samples/USPostalAddresss.cs +++ b/Samples/USPostalAddresss.cs @@ -32,11 +32,11 @@ public partial record class USPostalAddressBase | RegexOptions.RightToLeft | RegexOptions.Singleline )] - public static partial Regx Regex(); + public static partial Regex Regex(); #else - private static readonly Regx _regex = new(RegexString); + private static readonly Regex _regex = new(RegexString); - public static Regx Regex() => _regex; + public static Regex Regex() => _regex; #endif public static USPostalAddress Parse(string s) @@ -109,9 +109,9 @@ public partial record class USPostalAddress : USPostalAddressBase )] public static partial System.Text.RegularExpressions.Regex Regex(); #else - private static readonly Regx _regex = new(RegexString); + private static readonly Regex _regex = new(RegexString); - public static new Regx Regex() => _regex; + public static new Regex Regex() => _regex; #endif public USPostalAddress() { } diff --git a/src/Dgmjr.RegexDtoGenerator.csproj b/src/Dgmjr.RegexDtoGenerator.csproj index 0ac8da1..e4bfab1 100644 --- a/src/Dgmjr.RegexDtoGenerator.csproj +++ b/src/Dgmjr.RegexDtoGenerator.csproj @@ -30,9 +30,9 @@ - - - + + + diff --git a/src/Dgmjr.RegexDtoGenerator.sln b/src/Dgmjr.RegexDtoGenerator.sln index 5d3902e..7010ad5 100644 --- a/src/Dgmjr.RegexDtoGenerator.sln +++ b/src/Dgmjr.RegexDtoGenerator.sln @@ -8,7 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\Packages\Versions.Local.props EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.RegexDtoGenerator", "Dgmjr.RegexDtoGenerator.csproj", "{77F2F4E2-D289-4467-A600-51BC4FA945FB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.RegexDtoGenerator", "Dgmjr.RegexDtoGenerator.csproj", "{976286D4-51C6-471D-BF44-9E1D1DAD040D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,18 +20,18 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Local|Any CPU.ActiveCfg = Local|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Local|Any CPU.Build.0 = Local|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Testing|Any CPU.ActiveCfg = Testing|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Testing|Any CPU.Build.0 = Testing|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Staging|Any CPU.ActiveCfg = Staging|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Staging|Any CPU.Build.0 = Staging|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Production|Any CPU.ActiveCfg = Local|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Production|Any CPU.Build.0 = Local|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77F2F4E2-D289-4467-A600-51BC4FA945FB}.Release|Any CPU.Build.0 = Release|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Local|Any CPU.ActiveCfg = Local|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Local|Any CPU.Build.0 = Local|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Testing|Any CPU.ActiveCfg = Testing|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Testing|Any CPU.Build.0 = Testing|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Staging|Any CPU.ActiveCfg = Staging|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Staging|Any CPU.Build.0 = Staging|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Production|Any CPU.ActiveCfg = Local|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Production|Any CPU.Build.0 = Local|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {976286D4-51C6-471D-BF44-9E1D1DAD040D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Models/RegexDtoTypeDeclarationModel.cs b/src/Models/RegexDtoTypeDeclarationModel.cs index 96993b2..6d82004 100644 --- a/src/Models/RegexDtoTypeDeclarationModel.cs +++ b/src/Models/RegexDtoTypeDeclarationModel.cs @@ -26,7 +26,7 @@ public RegexDtoDeclarationModel( RegexDtoConstructorDeclarationModel constructor, IEnumerable properties, string baseType = "", - Rxo regexOptions = Compiled | IgnoreCase | ExplicitCapture + RegexOptions regexOptions = Compiled | IgnoreCase | ExplicitCapture ) { TypeName = typeName; @@ -56,7 +56,7 @@ public RegexDtoDeclarationModel Initialize() } public const string Visibility = "public"; - public readonly Rxo RegexOptions { get; init; } + public readonly RegexOptions RegexOptions { get; init; } public readonly string NamespaceName { get; init; } public readonly string Regex { get; init; } public readonly string TypeName { get; init; } @@ -81,7 +81,7 @@ public RegexDtoBaseTypeDeclarationModel( RegexDtoConstructorDeclarationModel constructor, IEnumerable properties, string baseType = "", - Rxo regexOptions = Compiled | IgnoreCase | ExplicitCapture + RegexOptions regexOptions = Compiled | IgnoreCase | ExplicitCapture ) { TypeName = typeName; @@ -111,7 +111,7 @@ public RegexDtoBaseTypeDeclarationModel Initialize() } public const string Visibility = "public"; - public readonly Rxo RegexOptions { get; init; } + public readonly RegexOptions RegexOptions { get; init; } public readonly string NamespaceName { get; init; } public readonly string Regex { get; init; } public readonly string TypeName { get; init; } diff --git a/src/RegexDtoGenerator.cs b/src/RegexDtoGenerator.cs index d960062..85620d1 100644 --- a/src/RegexDtoGenerator.cs +++ b/src/RegexDtoGenerator.cs @@ -38,15 +38,15 @@ public partial class RegexDtoGenerator : IIncrementalGenerator private const string RegexString = @"\(\?\<(?[a-zA-Z0-9]+)(?:\:(?[a-zA-Z0-9]+\??))?\>.*?\)"; - private const Rxo RegexOptions = Compiled | IgnoreCase | Multiline; + private const RegexOptions RegexOptions = Compiled | IgnoreCase | Multiline; #if NET7_0_OR_GREATER [GeneratedRegex(RegexString, RegexOptions)] - private static partial Regx Regex(); + private static partial Regex Regex(); #else - private static Regx Regex() => _regex; + private static Regex Regex() => _regex; - private static readonly Regx _regex = new(RegexString, RegexOptions); + private static readonly Regex _regex = new(RegexString, RegexOptions); #endif ///