From 981b517ccf2d91bf3bf52c518ac43710b57b5e17 Mon Sep 17 00:00:00 2001 From: Kevin Puetz Date: Wed, 13 May 2020 19:20:05 -0500 Subject: [PATCH] nested replacement fields may omit arg_id (#1681) syntax.html already has examples like `fmt::format("{:.{}f}", 3.14, 1)` using this, and https://en.cppreference.com/w/cpp/utility/format/formatter#width_and_precision shows that this is the case for the C++20 std::format The Format Specification Mini-Language grammar seems to be the only one not showing this; update it to match. --- doc/syntax.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/syntax.rst b/doc/syntax.rst index bf2f1b6b..8265f702 100644 --- a/doc/syntax.rst +++ b/doc/syntax.rst @@ -79,8 +79,8 @@ The general form of a *standard format specifier* is: fill: align: "<" | ">" | "^" sign: "+" | "-" | " " - width: `integer` | "{" `arg_id` "}" - precision: `integer` | "{" `arg_id` "}" + width: `integer` | "{" [`arg_id`] "}" + precision: `integer` | "{" [`arg_id`] "}" type: `int_type` | "a" | "A" | "c" | "e" | "E" | "f" | "F" | "g" | "G" | "L" | "p" | "s" int_type: "b" | "B" | "d" | "o" | "x" | "X"