From 134d3ac4caff6d87c79b0892e57073594cb0064c Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 9 Oct 2026 14:43:11 +0200 Subject: Remove Pointer and nil support --- boot/parser.yy | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'boot/parser.yy') diff --git a/boot/parser.yy b/boot/parser.yy index 855cc76..9628443 100644 --- a/boot/parser.yy +++ b/boot/parser.yy @@ -95,7 +95,6 @@ along with GCC; see the file COPYING3. If not see COLON ":" SEMICOLON ";" DOT "." COMMA "," %token PROGRAM "program" MODULE "module" CAST "cast" - NIL "nil" CONST "const" VAR "var" THREADVAR "threadvar" PROCEDURE "proc" @@ -156,8 +155,8 @@ along with GCC; see the file COPYING3. If not see %type > elsif_then_statements elsif_do_statements;; %type > else_statements block; %type > identifier with_counter; -%type > identifier_definition attributed_identifier; -%type > identifier_definitions; +%type > identifier_definition attributed_identifier field_identifier; +%type > identifier_definitions field_identifiers; %type > attribute; %type > attributes; %type , bool>> import_declaration; @@ -406,11 +405,6 @@ literal: $$ = new boot::literal(boot::make_position(@$), $1, boot::integer_sign::_unsigned); } - | "nil" - { - $$ = new boot::literal(boot::make_position(@$), - nullptr, boot::integer_sign::_unsigned); - } | STRING { $$ = new boot::literal(boot::make_position(@$), @@ -631,8 +625,21 @@ statements: $$.insert($$.cend(), $3); } | statement { $$.push_back($1); } +field_identifier: + IDENTIFIER attributes + { + $$ = std::make_unique($1, boot::make_position(@1), + false, std::vector{}, std::move($2)); + } +field_identifiers: + field_identifier "," field_identifiers + { + $$ = $3; + $$.emplace($$.cbegin(), std::move(*$1)); + } + | field_identifier { $$.emplace_back(std::move(*$1)); } field_declaration: - identifier_definitions ":" type_expression + field_identifiers ":" type_expression { $$ = std::make_pair($1, std::shared_ptr($3)); } field_declarations: field_declaration ";" field_declarations -- cgit v1.2.3