aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm
diff options
context:
space:
mode:
authoreric-saintetienne <eric.saintetienne@gmail.com>2024-07-17 20:02:10 +0100
committerGitHub <noreply@github.com>2024-07-17 19:02:10 +0000
commitc3faae6bf1589380e983aaf9e3238f053ba4a674 (patch)
tree4f6fe3d65daa3aa81cf08f150e26aadd12ac01b0 /src/codegen/llvm
parent9d9b5a11e873cc15e3f1b6e506ecf22c8380c87d (diff)
downloadzig-c3faae6bf1589380e983aaf9e3238f053ba4a674.tar.gz
zig-c3faae6bf1589380e983aaf9e3238f053ba4a674.zip
format: do not force user to provide an alignment field when it's not necessary (#19049)
* format: fix default character when no alignment When no alignment is specified, the character that should be used is the fill character that is otherwise provided, not space. This is closer to the default that C programmers (and other languages) use: "04x" fills with zeroes (in zig as of today x:04 fills with spaces) Test: const std = @import("std"); const expectFmt = std.testing.expectFmt; test "fmt.defaultchar.no-alignment" { // as of today the following test passes: try expectFmt("0x00ff", "0x{x:0>4}", .{255}); // as of today the following test fails (returns "0x ff" instead) try expectFmt("0x00ff", "0x{x:04}", .{255}); } * non breaking improvement of string formatting * improved comment * simplify the code a little * small improvement around how characters identified as valid are consumed
Diffstat (limited to 'src/codegen/llvm')
0 files changed, 0 insertions, 0 deletions