summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorc-blake <c-blake@users.noreply.github.com>2024-07-19 10:38:02 +0000
committerGitHub <noreply@github.com>2024-07-19 12:38:02 +0200
commit24f5dfbed22322f63d1fc27a07d41f746212a7d3 (patch)
tree6143f4fc573e76a717bf1f178bac88360d862426 /lib
parent3a103669d18408cd75ca5c5c97c34f4222c6e217 (diff)
downloadNim-24f5dfbed22322f63d1fc27a07d41f746212a7d3.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/times.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index 1a3dc7512..da130d35e 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`.