ソースを参照

Show full line with escape sequences

Escape sequences are weird, because they specify numbers that "look
like" bytes but they actually seem to care about the character values.
E.g. not byte 30 but character '3' and character '0'.  Odd.
Luna Stadler 4 年 前
コミット
f2225b2692
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1 1
      zig/sdl/hello_sdl.zig

+ 1 - 1
zig/sdl/hello_sdl.zig

@ -705,7 +705,7 @@ pub fn main() !void {
705 705
                var part = parts.next();
706 706
                while (part != null and part.?.len != repl_size) : (part = parts.next()) {
707 707
                    if (part.?.len > 0) {
708
                        std.debug.print("escape char: {d} {s}\n", .{ part.?[0], part.?[1..] });
708
                        std.debug.print("escape char: {d} {s}\n", .{ part.?[0], part.?[0..] });
709 709
                    }
710 710
                }
711 711