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