Add '.' (period, dot, ..) to FormatLiterals so that ss.fff can work. (#23861)

Honestly, to me the entire design of a (highly!) restricted set of
`FormatLiterals` characters seems antithetical to the very idea of a
format string template. Fixing that is a much larger change, though.

So, this PR just adds `'.'` so that the standard (both input & output!)
notation for decimal numbers in Nim can be used for the seconds part of
a time format in `lib/pure/times.format(.., f)`. It should only make
legal what was illegal and should be harmless since `'.'` is not used in
any special way otherwise.
This commit is contained in:
c-blake
2024-07-19 10:38:02 +00:00
committed by GitHub
parent 3a103669d1
commit 24f5dfbed2

View File

@@ -1631,7 +1631,7 @@ const
"Sunday"],
)
FormatLiterals = {' ', '-', '/', ':', '(', ')', '[', ']', ','}
FormatLiterals = {' ', '-', '/', ':', '(', ')', '[', ']', ',', '.'}
proc `$`*(f: TimeFormat): string =
## Returns the format string that was used to construct `f`.