Skip to content

Commit

Permalink
Add StringSyntax attribute to Regex.pattern field (dotnet#64063)
Browse files Browse the repository at this point in the history
I missed adding this one in my initial audit.  It'll be exceedingly rare for a developer to manually write code that assigns a string to this protected field, but every source-generated regex does so, and thus any colorization VS provides will benefit looking at the source-generated code.
  • Loading branch information
stephentoub committed Jan 20, 2022
1 parent 830c6de commit 0e68377
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public partial class Regex : ISerializable
{
internal const int MaxOptionShift = 11;

[StringSyntax(StringSyntaxAttribute.Regex)]
protected internal string? pattern; // The string pattern provided
protected internal RegexOptions roptions; // the top-level options from the options string
protected internal RegexRunnerFactory? factory; // Factory used to create runner instances for executing the regex
Expand Down

0 comments on commit 0e68377

Please sign in to comment.