zig/lib/std
eric-saintetienne c3faae6bf1
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
2024-07-17 19:02:10 +00:00
..
Build build runner: update watch caption to include subprocesses 2024-07-14 22:27:51 -07:00
c std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
compress std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
crypto Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
dwarf dwarf: use StackIterator.MemoryAccessor to check memory accesses instead of isValidMemory 2024-07-10 10:46:35 -04:00
fmt std.fmt.formatFloat: skip f80 round-trip tests on x86_64 windows 2024-07-14 11:19:34 +12:00
fs std.fs.Dir: Rename OpenDirOptions to OpenOptions (#20542) 2024-07-09 13:36:38 -07:00
hash std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
heap gpa: Add never_unmap and retain_metadata test 2024-05-21 19:09:52 +02:00
http std.posix.iovec: use .base and .len instead of .iov_base and .iov_len 2024-04-28 00:20:30 -07:00
io Add File.getOrEnableAnsiEscapeSupport and use it 2024-06-02 16:46:21 -07:00
json json: respect duplicate_field_behavior in std.json.Value.jsonParse 2024-07-03 15:34:59 -04:00
math Fix right shift on negative BigInts 2024-07-12 00:46:03 -07:00
mem
meta std: promote tests to doctests 2024-03-21 14:11:46 -07:00
net std.net, std.http: simplify 2024-02-23 02:37:11 -07:00
os Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
posix std: Convert deprecated aliases to compile errors and fix usages 2024-06-13 10:18:59 -04:00
process Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
Random extract std.posix from std.os 2024-03-19 11:45:09 -07:00
sort std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
tar std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
Target std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
testing
Thread Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
time std: promote tests to doctests 2024-03-21 14:11:46 -07:00
tz
unicode
valgrind std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
zig std.Zir: some declaration traversal fixes 2024-07-16 19:44:15 +01:00
zip std: Convert deprecated aliases to compile errors and fix usages 2024-06-13 10:18:59 -04:00
array_hash_map.zig std.ArrayHashMap: unmanaged holds the pointer stability lock 2024-07-07 12:13:07 +02:00
array_list.zig std.ArrayList.unusedCapacitySlice: Return unaligned slice (#20490) 2024-07-14 00:56:29 +00:00
ascii.zig Rename isASCII to isAscii 2024-07-02 16:31:15 +02:00
atomic.zig bsd: debitrot AtomicOrder renames 2024-03-15 02:28:50 -04:00
base64.zig improve documentation in std 2024-03-10 18:13:30 -07:00
bit_set.zig std: promote tests to doctests 2024-03-21 14:11:46 -07:00
BitStack.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
bounded_array.zig Implement addManyAsSlice for BoundedArray 2024-05-21 13:46:05 +03:00
buf_map.zig
buf_set.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
Build.zig build runner: update watch caption to include subprocesses 2024-07-14 22:27:51 -07:00
builtin.zig riscv: back to hello world panics 2024-05-11 02:17:11 -07:00
c.zig std.c.LC: mark enum as non-exhaustive 2024-07-16 00:32:29 +05:00
coff.zig std: Add loongarch support for coff. (#20583) 2024-07-12 00:47:32 -07:00
compress.zig improve documentation in std 2024-03-10 18:13:30 -07:00
crypto.zig Merge pull request #19239 from jedisct1/ml-kem 2024-03-11 18:48:08 -07:00
debug.zig Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
dwarf.zig dwarf: use StackIterator.MemoryAccessor to check memory accesses instead of isValidMemory 2024-07-10 10:46:35 -04:00
dynamic_library.zig std: avoid references that trigger compile errors 2024-07-04 21:01:42 +01:00
elf.zig add ppc64 reloc definitions 2024-07-02 08:59:10 +02:00
enums.zig EnumMap: fix init 2024-05-26 16:13:54 -04:00
fifo.zig std: promote tests to doctests 2024-03-21 14:11:46 -07:00
fmt.zig format: do not force user to provide an alignment field when it's not necessary (#19049) 2024-07-17 19:02:10 +00:00
fs.zig std.fs.Dir: Rename OpenDirOptions to OpenOptions (#20542) 2024-07-09 13:36:38 -07:00
gpu.zig std: add gpu namespace 2024-02-05 11:55:14 +03:30
hash.zig
hash_map.zig hash_map.zig: Pass self by value and less pointer-int conversion 2024-05-27 13:22:50 +03:00
heap.zig extract std.posix from std.os 2024-03-19 11:45:09 -07:00
http.zig std: avoid references that trigger compile errors 2024-07-04 21:01:42 +01:00
io.zig Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
json.zig Delete compile errors for deprecated decls 2024-05-03 13:27:30 -07:00
leb128.zig Rename *[UI]LEB128 functions to *[UI]leb128 2024-06-23 04:30:12 +01:00
linked_list.zig
log.zig update the codebase for the new std.Progress API 2024-05-27 20:56:48 -07:00
macho.zig The Mach-O header flags gained two new members at some point, and these are missing in the Zig std library. This PR adds these. 2024-04-18 20:08:03 -07:00
math.zig Support Vectors in std.math.clamp 2024-06-01 13:28:16 +03:00
mem.zig indexOfSentinel: fix ub 2024-07-16 05:14:38 -04:00
meta.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
multi_array_list.zig InternPool: implement and use thread-safe list for strings 2024-07-07 22:59:52 -04:00
net.zig std: avoid references that trigger compile errors 2024-07-04 21:01:42 +01:00
once.zig std: improve std.once tests 2024-04-15 15:24:30 -07:00
os.zig Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
packed_int_array.zig compiler: un-implement #19634 2024-04-17 13:41:25 +01:00
pdb.zig extract std.posix from std.os 2024-03-19 11:45:09 -07:00
posix.zig Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
priority_dequeue.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
priority_queue.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
process.zig ArgIteratorWindows.init: Take []const u16 slice instead of multi-item pointer 2024-07-13 18:37:49 -07:00
Progress.zig Progress: avoid race on global_progress.draw_buffer 2024-07-16 05:14:38 -04:00
Random.zig std: Convert deprecated aliases to compile errors and fix usages 2024-06-13 10:18:59 -04:00
RingBuffer.zig std.RingBuffer: use sliceAt/sliceFirst in read*AssumeLength 2024-03-10 18:17:23 +11:00
segmented_list.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
SemanticVersion.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
simd.zig simd: correct suggestVectorLength 2024-07-14 23:02:33 -07:00
sort.zig std: fuzz test sort stability (#20284) 2024-06-20 12:38:54 -07:00
start.zig Merge pull request #20474 from Rexicon226/riscv 2024-07-17 08:39:44 +02:00
start_windows_tls.zig
static_string_map.zig std.static_string_map: Cast length of input for runtime initialization 2024-06-20 23:22:39 +00:00
std.zig std: Convert deprecated aliases to compile errors and fix usages 2024-06-13 10:18:59 -04:00
tar.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
Target.zig std: Add loongarch support for coff. (#20583) 2024-07-12 00:47:32 -07:00
testing.zig std.fs.Dir: Rename OpenDirOptions to OpenOptions (#20542) 2024-07-09 13:36:38 -07:00
Thread.zig Better implementation of GetLastError. (#20623) 2024-07-15 10:49:51 -07:00
time.zig handle visionos target OS tag in the compiler 2024-05-09 15:04:15 +02:00
treap.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
tz.zig
unicode.zig ArgIteratorWindows: Reduce allocated memory by parsing the WTF-16 string directly 2024-07-13 14:48:17 -07:00
Uri.zig std.http.Client: always omit port when it matches default 2024-04-12 22:37:07 -07:00
valgrind.zig Rename nonSIMDCall* to nonSimdCall* 2024-07-03 19:00:17 +01:00
wasm.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
zig.zig compiler: move LazySrcLoc out of std 2024-06-15 00:57:52 +01:00
zip.zig std.zip: Fix typo in doc comments 2024-06-17 16:12:19 -04:00