Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 0/3] Use ? for width specifiers


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


Follow-Ups:
[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>