bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5546)

`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.
(cherry picked from commit 7a561afd2c)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2018-02-06 17:14:20 -08:00 committed by Mariatta
parent a702f6b442
commit a747cf6d9b

View file

@ -202,9 +202,9 @@ The grammar for a replacement field is as follows:
.. productionlist:: sf .. productionlist:: sf
replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}" replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}"
field_name: arg_name ("." `attribute_name` | "[" `element_index` "]")* field_name: arg_name ("." `attribute_name` | "[" `element_index` "]")*
arg_name: [`identifier` | `integer`] arg_name: [`identifier` | `digit`+]
attribute_name: `identifier` attribute_name: `identifier`
element_index: `integer` | `index_string` element_index: `digit`+ | `index_string`
index_string: <any source character except "]"> + index_string: <any source character except "]"> +
conversion: "r" | "s" | "a" conversion: "r" | "s" | "a"
format_spec: <described in the next section> format_spec: <described in the next section>