浏览代码

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
                var part = parts.next();
705
                var part = parts.next();
706
                while (part != null and part.?.len != repl_size) : (part = parts.next()) {
706
                while (part != null and part.?.len != repl_size) : (part = parts.next()) {
707
                    if (part.?.len > 0) {
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