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
+32
View File
@@ -31,6 +31,38 @@ cities:
- Perth
`,
},
{
skipDoc: true,
description: "path",
expression: ".cities[2] | path",
input: `return {
["country"] = "Australia"; -- this place
["cities"] = {
"Sydney",
"Melbourne",
"Brisbane",
"Perth",
};
};
`,
expected: "- cities\n- 2\n",
},
{
skipDoc: true,
description: "path",
expression: ".cities[2] | key",
input: `return {
["country"] = "Australia"; -- this place
["cities"] = {
"Sydney",
"Melbourne",
"Brisbane",
"Perth",
};
};
`,
expected: "2\n",
},
{
description: "Basic output example",
scenarioType: "encode",