diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-01-23 17:20:29 -0600 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-01-23 17:20:29 -0600 |
commit | 8b5dab508800c08a11a255280798bd4b245e0818 (patch) | |
tree | 094e409df525cba53368827bfefab5e394dbfc59 /src | |
parent | 5be908867a5def57fd5e398a1047f859a68fd1a4 (diff) |
Disable CBN for now.
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/discocaml.rs | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/commands/discocaml.rs b/src/commands/discocaml.rs index 712a846..8451d82 100644 --- a/src/commands/discocaml.rs +++ b/src/commands/discocaml.rs @@ -274,7 +274,7 @@ where Ok(()) } DiscocamlResponse::Error(err) => { - let err = anyhow!("got an error from discocaml: `{}`", err); + let err = anyhow!("got an error from discocaml: `{}`", escape_code(&err)); respond_with_error(&err, send).await; Err(err) } @@ -353,8 +353,7 @@ async fn run_dot(dot: &str) -> Result<BString> { } fn escape_code(s: &str) -> String { - // TODO - s.to_string() + s.replace("`", "\\`") } fn expr_response_message( @@ -375,24 +374,36 @@ fn expr_response_message( .button(CreateButton::new(format!("discocaml-draw-tree/{}", rowid)).label("Draw Tree")) .button( CreateButton::new(format!("discocaml-step-cbv/{}", rowid)) - .label("Step (CBV)") - .disabled(!expr.has_redex), - ) - .button( - CreateButton::new(format!("discocaml-step-cbn/{}", rowid)) - .label("Step (CBN)") + .label("Step") .disabled(!expr.has_redex), ) .button( CreateButton::new(format!("discocaml-run-cbv/{}", rowid)) - .label("Run (CBV)") - .disabled(!expr.has_redex), - ) - .button( - CreateButton::new(format!("discocaml-run-cbn/{}", rowid)) - .label("Run (CBN)") + .label("Run") .disabled(!expr.has_redex), ) + /* + .button( + CreateButton::new(format!("discocaml-step-cbv/{}", rowid)) + .label("Step (CBV)") + .disabled(!expr.has_redex), + ) + .button( + CreateButton::new(format!("discocaml-step-cbn/{}", rowid)) + .label("Step (CBN)") + .disabled(!expr.has_redex), + ) + .button( + CreateButton::new(format!("discocaml-run-cbv/{}", rowid)) + .label("Run (CBV)") + .disabled(!expr.has_redex), + ) + .button( + CreateButton::new(format!("discocaml-run-cbn/{}", rowid)) + .label("Run (CBN)") + .disabled(!expr.has_redex), + ) + */ } pub async fn handle_command( |