diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-10-03 00:46:51 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-10-03 00:46:51 +0200 |
| commit | 128a564be05afb1cb2ec76884a81c2bd536899fd (patch) | |
| tree | 12bcd5e877aaff326edb253c6b53a3e8b762d699 /boot/parser.yy | |
| parent | c8c9cb33f400031a697b4cad7ccc6b8555776e4f (diff) | |
| download | elna-128a564be05afb1cb2ec76884a81c2bd536899fd.tar.gz | |
Replace noreturn type with an attribute
Diffstat (limited to 'boot/parser.yy')
| -rw-r--r-- | boot/parser.yy | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/boot/parser.yy b/boot/parser.yy index cc73aef..04c07a8 100644 --- a/boot/parser.yy +++ b/boot/parser.yy @@ -91,9 +91,7 @@ along with GCC; see the file COPYING3. If not see %token <bool> BOOLEAN %token LEFT_PAREN "(" RIGHT_PAREN ")" LEFT_SQUARE "[" RIGHT_SQUARE "]" LEFT_BRACE "{" RIGHT_BRACE "}" GENERIC_OPEN "#[" ATTRIBUTE_OPEN "#{" -%token ASSIGNMENT ":=" - EXCLAMATION "!" ARROW "->" - AT "@" HAT "^" +%token ASSIGNMENT ":=" ARROW "->" AT "@" HAT "^" COLON ":" SEMICOLON ";" DOT "." COMMA "," %token PROGRAM "program" MODULE "module" CAST "cast" @@ -135,7 +133,7 @@ along with GCC; see the file COPYING3. If not see %type <std::vector<elna::boot::switch_case>> switch_cases; %type <elna::boot::variable_declaration *> variable_declaration; %type <std::vector<elna::boot::variable_declaration *>> variable_declarations; -%type <elna::boot::type_expression *> type_expression; +%type <elna::boot::type_expression *> type_expression return_declaration; %type <std::vector<elna::boot::type_expression *>> type_expressions; %type <elna::boot::expression *> expression operand simple_expression procedure_return unary_expression; %type <elna::boot::binary_expression *> binary_expression; @@ -146,7 +144,6 @@ along with GCC; see the file COPYING3. If not see %type <std::vector<elna::boot::statement *>> statements statement_part optional_begin_statements; %type <elna::boot::procedure_declaration *> procedure_declaration; %type <elna::boot::procedure_type_expression *> procedure_heading; -%type <elna::boot::procedure_type_expression::return_t> return_declaration; %type <elna::boot::type_declaration *> type_declaration; %type <std::vector<elna::boot::declaration *>> type_declarations sections section; %type <std::pair<std::vector<elna::boot::import_declaration *>, std::vector<elna::boot::declaration *>>> @@ -274,8 +271,7 @@ identifier_definitions: | attributed_identifier { $$.emplace_back(std::move(*$1)); } return_declaration: %empty {} - | "->" "!" { $$ = boot::procedure_type_expression::return_t(std::monostate{}); } - | "->" type_expression { $$ = boot::procedure_type_expression::return_t($2); } + | "->" type_expression { $$ = $2; } procedure_heading: "(" field_declarations ")" attributes return_declaration { |
