Starting to improve infrastrucutre for lang output

To make repl vs non-repl output better
This commit is contained in:
greg 2018-03-11 14:53:08 -07:00
parent 57f56168c5
commit ad8d2b22cd

View File

@ -1,5 +1,6 @@
extern crate colored;
use std::collections::HashMap;
use self::colored::*;
pub struct LLVMCodeString(pub String);
@ -51,6 +52,29 @@ impl LanguageOutput {
}
}
#[derive(Debug, Default)]
pub struct UnfinishedComputation {
artifacts: HashMap<String, TraceArtifact>,
}
#[derive(Debug)]
pub struct FinishedComputation {
artifacts: HashMap<String, TraceArtifact>,
text_output: Result<String, String>,
}
impl UnfinishedComputation {
pub fn add_artifact(&mut self, artifact: TraceArtifact) {
self.artifacts.insert(artifact.stage_name.clone(), artifact);
}
pub fn output(self, output: Result<String, String>) -> FinishedComputation {
FinishedComputation {
artifacts: self.artifacts,
text_output: output
}
}
}
/*
//TODO I'll probably wanna implement this later
#[derive(Debug)]