aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-17 22:08:05 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-17 22:08:05 -0400
commit0f70411cbf6548febfc0f664db72a246a92d4225 (patch)
treeb7b396c083db6ab0ee3913c0bae54dfae1d20dd7
parent6905f759e5cdbbfa7e16cf183d01ca1f8a858f71 (diff)
Fix doctests with functions
-rw-r--r--compile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 94b7ec30..e1537c7d 100644
--- a/compile.c
+++ b/compile.c
@@ -229,10 +229,11 @@ CORD compile_statement(env_t *env, ast_t *ast)
(int64_t)(test->expr->end - test->expr->file->text));
} else {
return CORD_asprintf(
- "{ // Test:\n%r $expr = %r;\n"
+ "{ // Test:\n"
+ "%r = %r;\n"
"$test(&$expr, %r, %r, %r, %ld, %ld);\n"
"}",
- compile_type(env, expr_t),
+ compile_declaration(env, expr_t, "$expr"),
compile(env, test->expr),
compile_type_info(env, expr_t),
compile(env, WrapAST(test->expr, TextLiteral, .cord=output)),