Show artifacts on failure
This commit is contained in:
parent
056ca1c162
commit
2dae8d6629
@ -92,8 +92,6 @@ impl UnfinishedComputation {
|
|||||||
|
|
||||||
impl FinishedComputation {
|
impl FinishedComputation {
|
||||||
pub fn to_repl(&self) -> String {
|
pub fn to_repl(&self) -> String {
|
||||||
match self.text_output {
|
|
||||||
Ok(ref output) => {
|
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
for stage in ["tokens", "parse_trace", "ast", "symbol_table", "type_check"].iter() {
|
for stage in ["tokens", "parse_trace", "ast", "symbol_table", "type_check"].iter() {
|
||||||
if let Some(artifact) = self.artifacts.get(&stage.to_string()) {
|
if let Some(artifact) = self.artifacts.get(&stage.to_string()) {
|
||||||
@ -103,12 +101,12 @@ impl FinishedComputation {
|
|||||||
write!(&mut buf, "{}: {}\n", stage, output).unwrap();
|
write!(&mut buf, "{}: {}\n", stage, output).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write!(&mut buf, "{}", output).unwrap();
|
match self.text_output {
|
||||||
|
Ok(ref output) => write!(&mut buf, "{}", output).unwrap(),
|
||||||
|
Err(ref err) => write!(&mut buf, "{} {}", "Error: ".red().bold(), err).unwrap(),
|
||||||
|
}
|
||||||
buf
|
buf
|
||||||
}
|
}
|
||||||
Err(ref s) => format!("{} {}", "Error: ".red().bold(), s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn to_noninteractive(&self) -> Option<String> {
|
pub fn to_noninteractive(&self) -> Option<String> {
|
||||||
match self.text_output {
|
match self.text_output {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user