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 f56d7120c4
commit 61eccba173
1 changed files with 24 additions and 0 deletions

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)]