[PATCH v2 0/3] Use ? for width specifiers
[Thread Prev] | [Thread Next]
- Subject: [PATCH v2 0/3] Use ? for width specifiers
- From: "S. Gilles" <sgilles@xxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Sun, 24 Nov 2019 18:20:49 -0500
- To: "myrddin-dev" <myrddin-dev@xxxxxxxxxxxxxx>
- Cc: "S. Gilles" <sgilles@xxxxxxx>
Round 2. Instead of stringifying arguments, allow the individual formatters to access the valist. This means only {w=} respects ?, and allows user-installed formatters to have their own logic for their own sentinal values. In order to keep around the checks for the correct number of arguments to fmt, I messed around a bit with the logic of typecursor: tcnext now always decreases nelt by one, so that for ap : valist#, inspecting ap.tc.nelt is always a robust measure of how many elements are available to be pulled out. It looks like that change only affects formatting code; hopefully I haven't missed another use that relies on previous behavior. I think the worst thing about this patchset is the new pullint function, but I'm not really sure how to accomplish it better. S. Gilles (3): Convert lib/test/fmt.myr to use testr Make vanext decrement tc.nelt unconditionally Allow specifying padding width from variable lib/std/fmt.myr | 143 ++++++++++++++++++++++------- lib/std/introspect.myr | 1 + lib/std/test/fmt.myr | 202 +++++++++++++++++++++++++---------------- test/matchctup.myr | 32 +++++++ 4 files changed, 266 insertions(+), 112 deletions(-) create mode 100644 test/matchctup.myr -- 2.24.0
[PATCH v2 1/3] Convert lib/test/fmt.myr to use testr | "S. Gilles" <sgilles@xxxxxxx> |
[PATCH v2 2/3] Make vanext decrement tc.nelt unconditionally | "S. Gilles" <sgilles@xxxxxxx> |
[PATCH v2 3/3] Allow specifying padding width from variable | "S. Gilles" <sgilles@xxxxxxx> |
- Prev by Date: Re: [PATCH 0/2] Use ? in format specifiers
- Next by Date: [PATCH v2 1/3] Convert lib/test/fmt.myr to use testr
- Previous by thread: [PATCH] Document ? in format specifiers, e.g. {w=?}
- Next by thread: [PATCH v2 1/3] Convert lib/test/fmt.myr to use testr
- Index(es):