This commit is contained in:
Edgar 2023-12-21 08:31:16 +01:00
parent 2cd380e931
commit cb85932b5d
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387

View file

@ -107,7 +107,7 @@ pub SubRangeType: ast::Type<'input> = {
} }
} }
ArrayIndexCompatibleType: ast::Type<'input> = { OrdinalType: ast::Type<'input> = {
<SimpleType> => ast::Type::Simple(<>), <SimpleType> => ast::Type::Simple(<>),
<SubRangeType> => <>, <SubRangeType> => <>,
} }
@ -126,11 +126,11 @@ RecordFixedPart: ast::RecordFixedPart<'input> = {
} }
VariantSelector: ast::VariantSelector<'input> = { VariantSelector: ast::VariantSelector<'input> = {
<tag_field:"identifier"> ":" <tag_type:Type> => ast::VariantSelector { <tag_field:"identifier"> ":" <tag_type:OrdinalType> => ast::VariantSelector {
tag_field: Some(tag_field), tag_field: Some(tag_field),
tag_type: Box::new(tag_type) tag_type: Box::new(tag_type)
}, },
<tag_type:Type> => ast::VariantSelector { <tag_type:OrdinalType> => ast::VariantSelector {
tag_field: None, tag_field: None,
tag_type: Box::new(tag_type) tag_type: Box::new(tag_type)
}, },
@ -166,20 +166,19 @@ RecordFieldList: ast::RecordFieldList<'input> = {
} }
pub Type: ast::Type<'input> = { pub Type: ast::Type<'input> = {
<p:"packed"?> "array" "[" <index:CommaNoTrailing<ArrayIndexCompatibleType>> "]" "of" <c:Type> => ast::Type::Array { <p:"packed"?> "record" <field_list:RecordFieldList?> "end" => ast::Type::Record {
field_list: None,
packed: p.is_some(),
},
<p:"packed"?> "array" "[" <index:CommaNoTrailing<OrdinalType>> "]" "of" <c:Type> => ast::Type::Array {
index, index,
component: Box::new(c), component: Box::new(c),
packed: p.is_some(), packed: p.is_some(),
}, },
<SimpleType> => ast::Type::Simple(<>), <SimpleType> => ast::Type::Simple(<>),
<"identifier"> => ast::Type::Identifier(<>),
<EnumeratedType> => ast::Type::Enumerated(<>), <EnumeratedType> => ast::Type::Enumerated(<>),
<SubRangeType> => <>, <SubRangeType> => <>,
// fixme <"identifier"> => ast::Type::Identifier(<>),
<p:"packed"?> "record" <field_list:RecordFieldList?> "end" => ast::Type::Record {
field_list,
packed: p.is_some(),
}
} }
pub TypeDef: ast::TypeDef<'input> = { pub TypeDef: ast::TypeDef<'input> = {