aboutsummaryrefslogtreecommitdiff
path: root/boot/parser.yy
diff options
context:
space:
mode:
Diffstat (limited to 'boot/parser.yy')
-rw-r--r--boot/parser.yy12
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); }