Updated grammar and AST

This commit is contained in:
2026-05-05 14:30:24 +02:00
parent 1d00667b18
commit ce7dc2b9ba
3 changed files with 19 additions and 57 deletions
+10 -14
View File
@@ -18,22 +18,18 @@ pub enum TypePostfix {
}
#[derive(Debug, Clone, Serialize)]
pub struct Attribute {
pub path: StaticPath,
pub kind: MetaItemKind,
}
pub enum Attribute {
/// #[test]
Path(StaticPath),
#[derive(Debug, Clone, Serialize)]
pub enum MetaItemKind {
Word,
NameValue(Literal),
List(Vec<NestedMetaItem>),
}
/// #[name = "value"]
NameValue { path: StaticPath, value: Literal },
#[derive(Debug, Clone, Serialize)]
pub enum NestedMetaItem {
Literal(Literal),
MetaItem(Attribute),
/// #[derive(Clone, Copy)]
List {
path: StaticPath,
items: Vec<Attribute>,
},
}
#[derive(Debug, Clone, Serialize)]