提交 c79d82ea 编写于 作者: C Cyrus Najmabadi

Add tracking bug comment.

上级 6bae5406
......@@ -1250,8 +1250,8 @@ private void ParseCharacterClassComponents(ArrayBuilder<RegexExpressionNode> com
{
var right = ParseRightSideOfCharacterClassRange();
if (TryGetRangeComponentValue(left, isRight: false, out var leftCh) &&
TryGetRangeComponentValue(right, isRight: true, out var rightCh) &&
if (TryGetRangeComponentValue(left, out var leftCh) &&
TryGetRangeComponentValue(right, out var rightCh) &&
leftCh > rightCh)
{
minusToken = minusToken.AddDiagnosticIfNone(new EmbeddedDiagnostic(
......@@ -1271,7 +1271,7 @@ private void ParseCharacterClassComponents(ArrayBuilder<RegexExpressionNode> com
private bool IsEscapedMinus(RegexNode node)
=> node is RegexSimpleEscapeNode simple && IsTextChar(simple.TypeToken, '-');
private bool TryGetRangeComponentValue(RegexExpressionNode component, bool isRight, out char ch)
private bool TryGetRangeComponentValue(RegexExpressionNode component, out char ch)
{
// Don't bother examining the component if it has any errors already. This also means
// we don't have to worry about running into invalid escape sequences and the like.
......@@ -1437,6 +1437,8 @@ private RegexExpressionNode ParseRightSideOfCharacterClassRange()
// is legal [a-\-] (even though \- is less than 'a'). Similarly, the following are
// *illegal* [b-\-a] and [b-\-\-a]. That's because the range that is checked is
// actually "b-a", even though it has all the \- escapes in the middle.
//
// This is tracked with: https://github.com/dotnet/corefx/issues/31786
var first = ParseSingleCharacterClassComponent(isFirst: false, afterRangeMinus: true);
if (!IsEscapedMinus(first))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册