Generic ast (#1829)

Remove dependency on yaml.Node for internal AST representation. Yaml decoder is now just another decoder.
This commit is contained in:
Mike Farah
2023-10-18 12:11:53 +11:00
committed by GitHub
parent 7430419413
commit 13d1bbb45f
171 changed files with 6402 additions and 2421 deletions
-12
View File
@@ -4,25 +4,13 @@ import (
"bufio"
"bytes"
"fmt"
"os"
"reflect"
"testing"
"github.com/pkg/diff"
"github.com/pkg/diff/write"
yaml "gopkg.in/yaml.v3"
)
func ParseData(rawData string) yaml.Node {
var parsedData yaml.Node
err := yaml.Unmarshal([]byte(rawData), &parsedData)
if err != nil {
fmt.Printf("Error parsing yaml: %v\n", err)
os.Exit(1)
}
return parsedData
}
func printDifference(t *testing.T, expectedValue interface{}, actualValue interface{}) {
opts := []write.Option{write.TerminalColor()}
var differenceBuffer bytes.Buffer