encoding/yaml: add Decoder for streaming YAML documents master
Add a Decoder type to the encoding/yaml package that can decode subsequent YAML documents separated by `---`, similar to the sibling encoding/json package. The Decoder provides: - NewDecoder(path, io.Reader) to create a decoder - Extract() method to extract documents one at a time - Proper EOF handling when all documents are consumed - Position information preservation for error reporting Includes comprehensive tests covering single and multiple document scenarios, various data types, and EOF behavior. Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com> Change-Id: I83270af0b9f97adb932f8d518dae8a94fc1b8d71 Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1224789 Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>