vcd: handle enums with fields
This commit is contained in:
parent
42afd2da0e
commit
643816d5b5
|
@ -1428,7 +1428,7 @@ impl Compiler {
|
|||
index: discriminant,
|
||||
ty,
|
||||
}),
|
||||
name,
|
||||
name: "$tag".intern(),
|
||||
ty,
|
||||
flow,
|
||||
};
|
||||
|
|
|
@ -491,7 +491,21 @@ impl WriteTrace for TraceArray {
|
|||
|
||||
impl WriteTrace for TraceEnumWithFields {
|
||||
fn write_trace<W: io::Write, A: Arg>(self, writer: &mut W, arg: A) -> io::Result<()> {
|
||||
todo!()
|
||||
let arg = arg.in_type();
|
||||
let Self {
|
||||
name,
|
||||
discriminant,
|
||||
non_empty_fields,
|
||||
ty: _,
|
||||
flow: _,
|
||||
} = self;
|
||||
write_vcd_scope(writer, "struct", &name, |writer| {
|
||||
discriminant.write_trace(writer, arg)?;
|
||||
for field in non_empty_fields {
|
||||
field.write_trace(writer, arg)?;
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue