From 36440faa345bf842c348711325312c2b02e4cc23 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 9 Jul 2026 17:24:42 +0200 Subject: Merge program and unit AST types --- boot/parser.yy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'boot/parser.yy') diff --git a/boot/parser.yy b/boot/parser.yy index 7797dd1..42840ff 100644 --- a/boot/parser.yy +++ b/boot/parser.yy @@ -164,8 +164,8 @@ program: { if ($6) { - boot::program *tree = new boot::program(boot::make_position(@1)); - std::swap(tree->body, *$6.release()); + boot::unit *tree = new boot::unit(boot::make_position(@1)); + tree->body = std::make_optional>(std::move(*$6.release())); driver.tree.reset(tree); } @@ -460,7 +460,7 @@ type_expression: } | "record" optional_fields "end" { - $$ = new boot::record_type_expression(boot::make_position(@1), std::move($2), std::nullopt); + $$ = new boot::record_type_expression(boot::make_position(@1), std::move($2)); } | "record" "(" IDENTIFIER ")" optional_fields "end" { -- cgit v1.2.3