add a simulator #3

Merged
programmerjake merged 58 commits from adding-simulator into master 2024-12-16 04:06:48 +00:00
2 changed files with 16 additions and 2 deletions
Showing only changes of commit 643816d5b5 - Show all commits

View file

@ -1428,7 +1428,7 @@ impl Compiler {
index: discriminant,
ty,
}),
name,
name: "$tag".intern(),
ty,
flow,
};

View file

@ -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(())
})
}
}