Make output_wrapper more concise
This commit is contained in:
parent
b6e3469573
commit
2ec3b21ebf
14
TODO.md
14
TODO.md
@ -105,17 +105,3 @@ if the only two guard patterns are true and false, then the abbreviated syntax:
|
|||||||
`'if' discriminator 'then' block_or_expr 'else' block_or_expr`
|
`'if' discriminator 'then' block_or_expr 'else' block_or_expr`
|
||||||
can replace `'if' discriminator '{' 'true' 'then' block_or_expr; 'false' 'then' block_or_expr '}'`
|
can replace `'if' discriminator '{' 'true' 'then' block_or_expr; 'false' 'then' block_or_expr '}'`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -275,19 +275,14 @@ impl ProgrammingLanguageInterface for Schala {
|
|||||||
where F: Fn(Input, &mut Schala, Option<&mut PassDebugArtifact>) -> Result<Output, String>
|
where F: Fn(Input, &mut Schala, Option<&mut PassDebugArtifact>) -> Result<Output, String>
|
||||||
{
|
{
|
||||||
let stage_names = stage_names();
|
let stage_names = stage_names();
|
||||||
let mut debug_artifact = if tok.debug_requests.contains(&DebugAsk::ByStage { stage_name: stage_names[n].to_string() }) {
|
let ask = DebugAsk::ByStage { stage_name: stage_names[n].to_string() };
|
||||||
Some(PassDebugArtifact::default())
|
let mut debug_artifact = tok.debug_requests.get(&ask).map(|_| PassDebugArtifact::default());
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
let output = func(input, tok.schala, debug_artifact.as_mut());
|
let output = func(input, tok.schala, debug_artifact.as_mut());
|
||||||
|
|
||||||
tok.stage_durations.push((stage_names[n].to_string(), tok.sw.elapsed()));
|
tok.stage_durations.push((stage_names[n].to_string(), tok.sw.elapsed()));
|
||||||
if let Some(artifact) = debug_artifact {
|
if let Some(artifact) = debug_artifact {
|
||||||
for value in artifact.artifacts.into_iter() {
|
for value in artifact.artifacts.into_iter() {
|
||||||
let resp = DebugResponse {
|
let resp = DebugResponse { ask: ask.clone(), value };
|
||||||
ask: DebugAsk::ByStage { stage_name: stage_names[n].to_string() },
|
|
||||||
value,
|
|
||||||
};
|
|
||||||
tok.debug_responses.push(resp);
|
tok.debug_responses.push(resp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user