Switch D2D1 generation methods to use indented writer

このコミットが含まれているのは:
Sergio Pedri committed 2023-09-30 01:34:04 +02:00
1 親 bc1fc17b21
コミット 6accd17c9f
14ファイル変更
+555 -1372

検索条件に一致するファイルはありません

+11 -1
ファイルの表示
@@ -30,6 +30,16 @@ internal static class SyntaxFormattingHelper
"0xF0", "0xF1", "0xF2", "0xF3", "0xF4", "0xF5", "0xF6", "0xF7", "0xF8", "0xF9", "0xFA", "0xFB", "0xFC", "0xFD", "0xFE", "0xFF"
};
/// <summary>
/// Gets an expression representing a single byte.
/// </summary>
/// <param name="value">The byte to format.</param>
/// <returns>The expression for <paramref name="value"/>.</returns>
public static string GetByteExpression(byte value)
{
return FormattedBytes[value];
}
/// <summary>
/// Writes a formatted expression to initialize a <see cref="ReadOnlySpan{T}"/> with a given content.
/// </summary>
@@ -58,7 +68,7 @@ internal static class SyntaxFormattingHelper
ReadOnlySpan<string> expressions = FormattedBytes.AsSpan();
// First write the first item (which has no leading separator)
expressions[0].AsSpan().CopyTo(span);
expressions[bytecode[0]].AsSpan().CopyTo(span);
// Special case: stop early if there's only one element
if (bytecode.Length == 1)