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
+3 -3
View File
@@ -11,7 +11,7 @@ var pickOperatorScenarios = []expressionScenario{
document: "myMap: {cat: meow, dog: bark, thing: hamster, hamster: squeak}\n",
expression: `.myMap |= pick(["hamster", "cat", "goat"])`,
expected: []string{
"D0, P[], (doc)::myMap: {hamster: squeak, cat: meow}\n",
"D0, P[], (!!map)::myMap: {hamster: squeak, cat: meow}\n",
},
},
{
@@ -20,7 +20,7 @@ var pickOperatorScenarios = []expressionScenario{
document: "!things myMap: {cat: meow, dog: bark, thing: hamster, hamster: squeak}\n",
expression: `.myMap |= pick(["hamster", "cat", "goat"])`,
expected: []string{
"D0, P[], (doc)::!things myMap: {hamster: squeak, cat: meow}\n",
"D0, P[], (!!map)::!things myMap: {hamster: squeak, cat: meow}\n",
},
},
{
@@ -29,7 +29,7 @@ var pickOperatorScenarios = []expressionScenario{
document: "# abc\nmyMap: {cat: meow, dog: bark, thing: hamster, hamster: squeak}\n# xyz\n",
expression: `.myMap |= pick(["hamster", "cat", "goat"])`,
expected: []string{
"D0, P[], (doc)::# abc\nmyMap: {hamster: squeak, cat: meow}\n# xyz\n",
"D0, P[], (!!map)::# abc\nmyMap: {hamster: squeak, cat: meow}\n# xyz\n",
},
},
{