From cb85932b5d47663117808e7fdbfc7f772e94cdc4 Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Thu, 21 Dec 2023 08:31:16 +0100 Subject: [PATCH] ok --- src/grammar.lalrpop | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/grammar.lalrpop b/src/grammar.lalrpop index 87b46a0..c51f34c 100644 --- a/src/grammar.lalrpop +++ b/src/grammar.lalrpop @@ -107,7 +107,7 @@ pub SubRangeType: ast::Type<'input> = { } } -ArrayIndexCompatibleType: ast::Type<'input> = { +OrdinalType: ast::Type<'input> = { => ast::Type::Simple(<>), => <>, } @@ -126,11 +126,11 @@ RecordFixedPart: ast::RecordFixedPart<'input> = { } VariantSelector: ast::VariantSelector<'input> = { - ":" => ast::VariantSelector { + ":" => ast::VariantSelector { tag_field: Some(tag_field), tag_type: Box::new(tag_type) }, - => ast::VariantSelector { + => ast::VariantSelector { tag_field: None, tag_type: Box::new(tag_type) }, @@ -166,20 +166,19 @@ RecordFieldList: ast::RecordFieldList<'input> = { } pub Type: ast::Type<'input> = { - "array" "[" > "]" "of" => ast::Type::Array { + "record" "end" => ast::Type::Record { + field_list: None, + packed: p.is_some(), + }, + "array" "[" > "]" "of" => ast::Type::Array { index, component: Box::new(c), packed: p.is_some(), }, => ast::Type::Simple(<>), - <"identifier"> => ast::Type::Identifier(<>), => ast::Type::Enumerated(<>), => <>, - // fixme - "record" "end" => ast::Type::Record { - field_list, - packed: p.is_some(), - } + <"identifier"> => ast::Type::Identifier(<>), } pub TypeDef: ast::TypeDef<'input> = {