diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-07-14 19:42:32 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-07-14 19:42:32 +0200 |
| commit | 308a2addf655fe45f2098f8542f0ff1290612cd9 (patch) | |
| tree | 19230bdb673d306d59b32427ad2a3ad5e9850631 /boot/parser.yy | |
| parent | a32a61813ebaecf0c1e69fd1481bf09d8c8b1420 (diff) | |
| download | elna-308a2addf655fe45f2098f8542f0ff1290612cd9.tar.gz | |
Replace procedure end with return
Diffstat (limited to 'boot/parser.yy')
| -rw-r--r-- | boot/parser.yy | 12 |
1 files changed, 6 insertions, 6 deletions
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 <elna::boot::type_expression *> type_expression; %type <std::vector<elna::boot::type_expression *>> type_expressions; %type <elna::boot::traits_expression *> traits_expression; -%type <elna::boot::expression *> expression operand simple_expression return_statement; +%type <elna::boot::expression *> expression operand simple_expression procedure_return; %type <elna::boot::unary_expression *> unary_expression; %type <elna::boot::binary_expression *> binary_expression; %type <std::vector<elna::boot::expression *>> expressions actual_parameter_list; @@ -164,13 +164,13 @@ along with GCC; see the file COPYING3. If not see %type <std::vector<elna::boot::import_declaration *>> 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<boot::procedure_body>($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<std::int32_t>(boot::make_position(@$), $1); } | WORD { $$ = new boot::literal<std::uint32_t>(boot::make_position(@$), $1); } |
