From 81033bb27c7049a79f384821ab11817a468b20b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Balv=C3=ADn?= Date: Fri, 18 Sep 2026 00:20:31 +0200 Subject: [PATCH] docs(api): document the TOML 1.1 acceptance Assisted-by: GLM 5.3 Flash --- docs/API.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/API.md b/docs/API.md index bfa859c..64004fe 100644 --- a/docs/API.md +++ b/docs/API.md @@ -7,6 +7,11 @@ package. The snippets assume: import "sourcedock.dev/petrbalvin/interpres" ``` +The parser accepts TOML 1.0 documents plus the TOML 1.1 extensions: date-times +and times without seconds, the `\e` and `\xHH` escape sequences, and +multi-line inline tables with comments and trailing commas. The encoder emits +TOML 1.0, which is valid under both versions. + ## Functions ### `func Parse(data []byte) (map[string]any, error)` @@ -139,8 +144,10 @@ offending key or index, for example `p: interpres: integer 300 overflows uint8`. Offset date-times decode into `time.Time` and keep their offset. The local variants decode into `LocalDateTime`, `LocalDate` and `LocalTime`, whose embedded `time.Time` is normalised to UTC (midnight UTC for a local date, the -zero date for a local time). There is no implicit conversion between the offset -and local kinds; assigning one to the other is an error. +zero date for a local time). Every kind may omit the seconds as of TOML 1.1 +(`07:32`, `1979-05-27T07:32`); such a value carries a zero second, and the +canonical rendering writes full seconds. There is no implicit conversion +between the offset and local kinds; assigning one to the other is an error. ### Arrays of tables