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> = {