perf(parse): cut allocations and validate UTF-8 in the scan

This commit is contained in:
2026-09-20 22:15:10 +02:00
parent adf189aa2c
commit b4d564c682
6 changed files with 427 additions and 117 deletions
+2 -1
View File
@@ -19,7 +19,8 @@ Decodes a TOML document into a [Document](#documents): the values, the order the
keys were written in, whether a table was written inline, and the comments.
The values follow the mapping in the [Decoding](#decoding) section below.
Returns `*SyntaxError` on a malformed document. Input that is not valid UTF-8
is rejected before the parser runs. Equivalent to
is rejected with a `SyntaxError` naming the line where the invalid byte
appears, because validity is checked during the scan. Equivalent to
`ParseContext(context.Background(), data)`.
```go