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

Add docs

上级 097fefeb
......@@ -134,7 +134,7 @@ private VirtualCharSequence TryConvertVerbatimStringToVirtualChars(SyntaxToken t
}
else if (escapeBraces && IsOpenOrCloseBrace(ch))
{
if (!IsLegalBraceEscape(tokenText, offset, index, out var braceSpan))
if (!IsLegalBraceEscape(tokenText, index, offset, out var braceSpan))
return default;
charResults.Add((ch, braceSpan));
......
......@@ -17,8 +17,13 @@ internal abstract class AbstractVirtualCharService : IVirtualCharService
protected abstract bool IsStringOrCharLiteralToken(SyntaxToken token);
protected abstract VirtualCharSequence TryConvertToVirtualCharsWorker(SyntaxToken token);
/// <summary>
/// Returns <see langword="true"/> if the next two characters at <c>tokenText[index]</c> are <c>{{</c> or
/// <c>}}</c>. If so, <paramref name="span"/> will contain the span of those two characters (based on <paramref
/// name="tokenText"/> starting at <paramref name="offset"/>).
/// </summary>
protected static bool IsLegalBraceEscape(
string tokenText, int offset, int index, out TextSpan span)
string tokenText, int index, int offset, out TextSpan span)
{
if (index + 1 < tokenText.Length)
{
......@@ -148,7 +153,7 @@ private void CheckInvariants(SyntaxToken token, VirtualCharSequence result)
}
else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index]))
{
if (!IsLegalBraceEscape(tokenText, offset, index, out var span))
if (!IsLegalBraceEscape(tokenText, index, offset, out var span))
return default;
result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册