authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-11-18 23:11:06+01:00
committergravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-12-09 21:57:17+01:00
log37b1707370b64c03d00024bffc1aa8f5a14a278b
treec63a2d81f8eecec26cc2ec4960e45549eef89b87
parent45650f7003ba84d7188bace63df7a52265b6561e

DepTokenizer.printUnderstandableChar: consider space printable

This makes the function consider space to be printable as well (because it is) and simplifies that function.

1 files changed, 4 insertions(+), 4 deletions(-)

src/DepTokenizer.zig+4-4
...@@ -866,7 +866,7 @@ test "error target - continuation expecting end-of-line" {...@@ -866,7 +866,7 @@ test "error target - continuation expecting end-of-line" {
866 );866 );
867 try depTokenizer("foo.o: \\ ",867 try depTokenizer("foo.o: \\ ",
868 \\target = {foo.o}868 \\target = {foo.o}
869 \\ERROR: illegal char \x20 at position 8: continuation expecting end-of-line869 \\ERROR: illegal char ' ' at position 8: continuation expecting end-of-line
870 );870 );
871 try depTokenizer("foo.o: \\x",871 try depTokenizer("foo.o: \\x",
872 \\target = {foo.o}872 \\target = {foo.o}
...@@ -1053,10 +1053,10 @@ fn printCharValues(out: anytype, bytes: []const u8) !void {...@@ -1053,10 +1053,10 @@ fn printCharValues(out: anytype, bytes: []const u8) !void {
1053}1053}
10541054
1055fn printUnderstandableChar(out: anytype, char: u8) !void {1055fn printUnderstandableChar(out: anytype, char: u8) !void {
1056 if (!std.ascii.isPrint(char) or char == ' ') {1056 if (std.ascii.isPrint(char)) {
1057 try out.print("\\x{X:0>2}", .{char});1057 try out.print("'{c}'", .{char});
1058 } else {1058 } else {
1059 try out.print("'{c}'", .{printable_char_tab[char]});1059 try out.print("\\x{X:0>2}", .{char});
1060 }1060 }
1061}1061}
10621062