From 37c77d93d7418986ad38066289dc5922af376728 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 28 Jul 2019 11:25:21 -0700 Subject: [PATCH] Fix off-by-one error in show-immediate parsing --- schala-repl/src/repl/directive_actions.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schala-repl/src/repl/directive_actions.rs b/schala-repl/src/repl/directive_actions.rs index 346bc16..f0da969 100644 --- a/schala-repl/src/repl/directive_actions.rs +++ b/schala-repl/src/repl/directive_actions.rs @@ -48,14 +48,14 @@ impl DirectiveAction { }, ShowImmediate => { let cur_state = repl.get_cur_language_state(); - let stage_name = match arguments.get(1) { + let stage_name = match arguments.get(0) { Some(s) => s.to_string(), None => return Some(format!("Must specify a thing to debug")), }; let meta = LangMetaRequest::ImmediateDebug(DebugAsk::ByStage { stage_name: stage_name.clone(), token: None }); let meta_response = cur_state.request_meta(meta); - let response = match meta_response { + let response = match meta_response { LangMetaResponse::ImmediateDebug(DebugResponse { ask, value }) => match ask { DebugAsk::ByStage { stage_name: ref this_stage_name, ..} if *this_stage_name == stage_name => value, _ => return Some(format!("Wrong debug stage"))