From 308a2addf655fe45f2098f8542f0ff1290612cd9 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 14 Jul 2026 19:42:32 +0200 Subject: Replace procedure end with return --- boot/parser.yy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'boot/parser.yy') diff --git a/boot/parser.yy b/boot/parser.yy index ef887ab..9f610ee 100644 --- a/boot/parser.yy +++ b/boot/parser.yy @@ -136,7 +136,7 @@ along with GCC; see the file COPYING3. If not see %type type_expression; %type > type_expressions; %type traits_expression; -%type expression operand simple_expression return_statement; +%type expression operand simple_expression procedure_return; %type unary_expression; %type binary_expression; %type > expressions actual_parameter_list; @@ -164,13 +164,13 @@ along with GCC; see the file COPYING3. If not see %type > import_declarations import_part; %% program: - import_part constant_part type_part variable_part procedure_part statement_part return_statement "end" "." + import_part constant_part type_part variable_part procedure_part statement_part "end" "." { - boot::unit *tree = new boot::unit(boot::make_position(@$), $1, $2, $3, $4, $5, $6, $7); + boot::unit *tree = new boot::unit(boot::make_position(@$), $1, $2, $3, $4, $5, $6); driver.tree.reset(tree); } procedure_body: - constant_part variable_part statement_part return_statement "end" + constant_part variable_part statement_part procedure_return { $$ = std::make_unique($1, $2, $3, $4); } statement_part: @@ -233,9 +233,9 @@ elsif_then_statements: $$.emplace($$.begin(), branch); } | /* no branches */ {} -return_statement: +procedure_return: "return" expression { $$ = $2; } - | /* no return statement */ { $$ = nullptr; } + | "return" { $$ = nullptr; } literal: INTEGER { $$ = new boot::literal(boot::make_position(@$), $1); } | WORD { $$ = new boot::literal(boot::make_position(@$), $1); } -- cgit v1.2.3