KIll old code
This commit is contained in:
parent
9ade0dd1e2
commit
1e4554258f
@ -32,42 +32,6 @@ pub struct DebugOptions {
|
|||||||
pub llvm_ir: bool,
|
pub llvm_ir: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
|
||||||
pub struct LanguageOutput {
|
|
||||||
output: String,
|
|
||||||
artifacts: Vec<TraceArtifact>,
|
|
||||||
pub failed: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl LanguageOutput {
|
|
||||||
pub fn add_artifact(&mut self, artifact: TraceArtifact) {
|
|
||||||
self.artifacts.push(artifact);
|
|
||||||
}
|
|
||||||
pub fn add_output(&mut self, output: String) {
|
|
||||||
self.output = output;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn to_string(&self) -> String {
|
|
||||||
let mut acc = String::new();
|
|
||||||
for line in self.artifacts.iter() {
|
|
||||||
acc.push_str(&line.debug_output.color(line.text_color).to_string());
|
|
||||||
acc.push_str(&"\n");
|
|
||||||
}
|
|
||||||
acc.push_str(&self.output);
|
|
||||||
acc
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn print_to_screen(&self) {
|
|
||||||
for line in self.artifacts.iter() {
|
|
||||||
let color = line.text_color;
|
|
||||||
let stage = line.stage_name.color(color).to_string();
|
|
||||||
let output = line.debug_output.color(color).to_string();
|
|
||||||
println!("{}: {}", stage, output);
|
|
||||||
}
|
|
||||||
println!("{}", self.output);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct UnfinishedComputation {
|
pub struct UnfinishedComputation {
|
||||||
artifacts: HashMap<String, TraceArtifact>,
|
artifacts: HashMap<String, TraceArtifact>,
|
||||||
|
@ -34,7 +34,7 @@ const VERSION_STRING: &'static str = "0.1.0";
|
|||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/static.rs"));
|
include!(concat!(env!("OUT_DIR"), "/static.rs"));
|
||||||
|
|
||||||
pub use language::{LLVMCodeString, ProgrammingLanguageInterface, EvalOptions, ExecutionMethod, TraceArtifact, LanguageOutput, FinishedComputation, UnfinishedComputation};
|
pub use language::{LLVMCodeString, ProgrammingLanguageInterface, EvalOptions, ExecutionMethod, TraceArtifact, FinishedComputation, UnfinishedComputation};
|
||||||
pub type PLIGenerator = Box<Fn() -> Box<ProgrammingLanguageInterface> + Send + Sync>;
|
pub type PLIGenerator = Box<Fn() -> Box<ProgrammingLanguageInterface> + Send + Sync>;
|
||||||
|
|
||||||
pub fn repl_main(generators: Vec<PLIGenerator>) {
|
pub fn repl_main(generators: Vec<PLIGenerator>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user