Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Dec 4, 2024

Fixes #61215

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 4, 2024
{
// bug with .NET regex parser. can happen with patterns like: (?(?S))
return treeAndText;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workarounds for when we found regex strings that would crash .net :) these have been fixed in .net core, so we don't need this.

protected RegexConditionalGroupingNode(
RegexKind kind, RegexToken openParenToken, RegexToken questionToken,
RegexExpressionNode result, RegexToken closeParenToken)
RegexAlternationNode result, RegexToken closeParenToken)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made more strongly typed.

<StartupObject />
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<TargetFrameworks>$(NetRoslyn)</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love to see this.

// From the .NET regex code:
// This is code for Posix style properties - [:Ll:] or [:IsTibetan:].
// It currently doesn't do anything other than skip the whole thing!
if (!afterRangeMinus && _currentToken.Kind == RegexKind.OpenBracketToken && _lexer.IsAt(":"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var optionsToken = _lexer.TryScanOptions();
if (optionsToken != null)
// Corresponds to check at: https://github.com/dotnet/runtime/blob/7790117932dc14aaeb2fc82aff6c0dc6c74ce434/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs#L1003
if (!inConditionalExpression)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in dotnet/corefx#16609

@CyrusNajmabadi CyrusNajmabadi changed the title Update regex messages Update regex parsing to latest .Net core parsing (and diagnostic messages). Jan 16, 2025
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review January 16, 2025 22:59
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner January 16, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Regex subsystem error messages to match changes in .net's error messages

3 participants