Skip to content

Commit 34cacf6

Browse files
committed
refactor: make schema fields public.
1 parent 2559f57 commit 34cacf6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tasks/ast_codegen/src/defs.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,38 @@ pub enum TypeDef {
1111

1212
#[derive(Debug, Serialize)]
1313
pub struct StructDef {
14-
name: TypeName,
15-
fields: Vec<FieldDef>,
16-
has_lifetime: bool,
14+
pub name: TypeName,
15+
pub fields: Vec<FieldDef>,
16+
pub has_lifetime: bool,
1717
}
1818

1919
#[derive(Debug, Serialize)]
2020
pub struct EnumDef {
21-
name: TypeName,
22-
variants: Vec<EnumVariantDef>,
21+
pub name: TypeName,
22+
pub variants: Vec<EnumVariantDef>,
2323
/// For `@inherits` inherited enum variants
24-
inherits: Vec<EnumInheritDef>,
25-
has_lifetime: bool,
24+
pub inherits: Vec<EnumInheritDef>,
25+
pub has_lifetime: bool,
2626
}
2727

2828
#[derive(Debug, Serialize)]
2929
pub struct EnumVariantDef {
30-
name: TypeName,
31-
fields: Vec<FieldDef>,
32-
discriminant: Option<u8>,
30+
pub name: TypeName,
31+
pub fields: Vec<FieldDef>,
32+
pub discriminant: Option<u8>,
3333
}
3434

3535
#[derive(Debug, Serialize)]
3636
pub struct EnumInheritDef {
37-
super_name: String,
38-
variants: Vec<EnumVariantDef>,
37+
pub super_name: String,
38+
pub variants: Vec<EnumVariantDef>,
3939
}
4040

4141
#[derive(Debug, Serialize)]
4242
pub struct FieldDef {
4343
/// `None` if unnamed
44-
name: Option<String>,
45-
r#type: TypeName,
44+
pub name: Option<String>,
45+
pub r#type: TypeName,
4646
}
4747

4848
impl From<&RType> for Option<TypeDef> {

0 commit comments

Comments
 (0)