Detect type aliasing cycles

This commit is contained in:
2025-03-30 17:09:22 +02:00
parent 0658d07e97
commit f2e2da4a34
10 changed files with 102 additions and 44 deletions

View File

@ -144,7 +144,7 @@ along with GCC; see the file COPYING3. If not see
%type <std::vector<elna::boot::statement *>> statements;
%type <elna::boot::procedure_definition *> procedure_definition;
%type <std::pair<std::vector<std::string>, std::shared_ptr<elna::boot::procedure_type_expression>>> procedure_heading;
%type <elna::boot::return_declaration> return_declaration;
%type <elna::boot::procedure_type_expression::return_t> return_declaration;
%type <std::vector<elna::boot::procedure_definition *>> procedure_definitions procedure_part;
%type <elna::boot::type_definition *> type_definition;
%type <std::vector<elna::boot::type_definition *>> type_definitions type_part;
@ -197,8 +197,8 @@ identifier_definitions:
| identifier_definition { $$.emplace_back(std::move($1)); }
return_declaration:
/* proper procedure */ {}
| "->" "!" { $$ = boot::return_declaration(std::monostate{}); }
| "->" type_expression { $$ = boot::return_declaration($2); }
| "->" "!" { $$ = boot::procedure_type_expression::return_t(std::monostate{}); }
| "->" type_expression { $$ = boot::procedure_type_expression::return_t($2); }
procedure_heading:
"(" formal_parameters ")" return_declaration
{