docs(api): document the TOML 1.1 acceptance

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-18 00:20:31 +02:00
parent dfd5d240d2
commit 81033bb27c
+9 -2
View File
@@ -7,6 +7,11 @@ package. The snippets assume:
import "sourcedock.dev/petrbalvin/interpres" 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 ## Functions
### `func Parse(data []byte) (map[string]any, error)` ### `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 Offset date-times decode into `time.Time` and keep their offset. The local
variants decode into `LocalDateTime`, `LocalDate` and `LocalTime`, whose variants decode into `LocalDateTime`, `LocalDate` and `LocalTime`, whose
embedded `time.Time` is normalised to UTC (midnight UTC for a local date, the 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 zero date for a local time). Every kind may omit the seconds as of TOML 1.1
and local kinds; assigning one to the other is an error. (`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 ### Arrays of tables