@@ -208,13 +208,13 @@ The grammar for a replacement field is as follows:
208
208
209
209
.. productionlist :: format-string
210
210
replacement_field: "{" [`field_name `] ["!" `conversion `] [":" `format_spec `] "}"
211
- field_name: arg_name ("." `attribute_name ` | "[" `element_index ` "]")*
212
- arg_name: [`identifier ` | `digit`+]
213
- attribute_name: `identifier `
214
- element_index: `digit`+ | `index_string `
211
+ field_name: ` arg_name ` ("." `attribute_name ` | "[" `element_index ` "]")*
212
+ arg_name: [`~python-grammar: identifier ` | `~python-grammar: digit`+]
213
+ attribute_name: `~python-grammar: identifier `
214
+ element_index: `~python-grammar: digit`+ | `index_string `
215
215
index_string: <any source character except "]"> +
216
216
conversion: "r" | "s" | "a"
217
- format_spec: <described in the next section>
217
+ format_spec: ` format-spec:format_spec `
218
218
219
219
In less formal terms, the replacement field can start with a *field_name * that specifies
220
220
the object whose value is to be formatted and inserted
@@ -316,9 +316,9 @@ The general form of a *standard format specifier* is:
316
316
fill: <any character>
317
317
align: "<" | ">" | "=" | "^"
318
318
sign: "+" | "-" | " "
319
- width: `digit`+
319
+ width: `~python-grammar: digit`+
320
320
grouping_option: "_" | ","
321
- precision: `digit`+
321
+ precision: `~python-grammar: digit`+
322
322
type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
323
323
324
324
If a valid *align * value is specified, it can be preceded by a *fill *
0 commit comments