Dump roc checkmate

This commit is contained in:
Ayaz Hafiz 2023-07-16 15:01:00 -05:00
parent 1282110ef5
commit fcd733e1df
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
8 changed files with 119 additions and 10 deletions

View file

@ -1,3 +1,5 @@
use std::error::Error;
use roc_checkmate_schema::{AllEvents, Event, VariableEvent};
use roc_types::subs as s;
@ -105,6 +107,11 @@ impl Collector {
self.current_event_path.pop();
}
pub fn write(&self, writer: impl std::io::Write) -> Result<(), Box<dyn Error>> {
self.events.write(writer)?;
Ok(())
}
fn add_event(&mut self, event: impl Into<Event>) {
let mut event = event.into();
let is_appendable = EventW::Sub(&mut event).appendable();