From 24f5dfbed22322f63d1fc27a07d41f746212a7d3 Mon Sep 17 00:00:00 2001 From: c-blake Date: Fri, 19 Jul 2024 10:38:02 +0000 Subject: [PATCH] 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. --- lib/pure/times.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 1a3dc7512f..da130d35e1 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -1631,7 +1631,7 @@ const "Sunday"], ) - FormatLiterals = {' ', '-', '/', ':', '(', ')', '[', ']', ','} + FormatLiterals = {' ', '-', '/', ':', '(', ')', '[', ']', ',', '.'} proc `$`*(f: TimeFormat): string = ## Returns the format string that was used to construct `f`.