aboutsummaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-08 14:10:19 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-08 14:10:19 -0500
commit5d35f286336878a3529dabdb3f7800b6f84712eb (patch)
treeee21c66d28027e84fd31080c145978fba18fec89 /ast.c
parent9c842201f312edd483ee99dcf3e321bdac2a7073 (diff)
Improve reductions so they work better nested and also have bespoke code
optimized for min/max and argmin/argmax.
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ast.c b/ast.c
index d9ca65af..86265454 100644
--- a/ast.c
+++ b/ast.c
@@ -142,8 +142,8 @@ CORD ast_to_xml(ast_t *ast)
T(Repeat, "<Repeat>%r</Repeat>", optional_tagged("body", data.body))
T(If, "<If>%r%r%r</If>", optional_tagged("condition", data.condition), optional_tagged("body", data.body), optional_tagged("else", data.else_body))
T(When, "<When><subject>%r</subject>%r%r</When>", ast_to_xml(data.subject), when_clauses_to_xml(data.clauses), optional_tagged("else", data.else_body))
- T(Reduction, "<Reduction>%r%r</Reduction>", optional_tagged("iterable", data.iter),
- optional_tagged("combination", data.combination))
+ T(Reduction, "<Reduction op=%r%r>%r</Reduction>", xml_escape(OP_NAMES[data.op]), optional_tagged("key", data.key),
+ optional_tagged("iterable", data.iter))
T(Skip, "<Skip>%r</Skip>", data.target)
T(Stop, "<Stop>%r</Stop>", data.target)
T(PrintStatement, "<PrintStatement>%r</PrintStatement>", ast_list_to_xml(data.to_print))