From ed87ca353bd6431b72dbf8f9b9d0b68309701b79 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 15 Aug 2018 18:49:11 -0500 Subject: [PATCH] MAINT: TODO cleanups. --- src/build/test.rs | 1 - src/convert/exec.rs | 3 --- src/main.rs | 7 +------ src/parse/mod.rs | 3 ++- src/parse/precedence.rs | 1 - 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/build/test.rs b/src/build/test.rs index bec7237..e984621 100644 --- a/src/build/test.rs +++ b/src/build/test.rs @@ -499,7 +499,6 @@ fn test_eval_selector_list_expr() { ); } -// TODO(jwall): Eval for tuple and list. // Include nested for each. #[test] #[should_panic(expected = "Unable to find tpl1")] diff --git a/src/convert/exec.rs b/src/convert/exec.rs index 98e1a76..8714c18 100644 --- a/src/convert/exec.rs +++ b/src/convert/exec.rs @@ -37,8 +37,6 @@ impl ExecConverter { ExecConverter {} } - // TODO(jwall): We may want to include an built in exec macro for - // creating an exec tuple. #[allow(unused_assignments)] fn write(&self, v: &Val, w: &mut Write) -> Result { // We always expect the Val to be a Tuple. @@ -128,7 +126,6 @@ impl ExecConverter { try!(write!(script, "# Turn on unofficial Bash-Strict-Mode\n")); try!(write!(script, "set -euo pipefail\n")); // 3. Then assign our environment variables - // TODO(jwall): We should escape bash ENV variable values. if let Some(env_list) = env { for &(ref name, ref v) in env_list.iter() { // We only allow string fields in our env tuple. diff --git a/src/main.rs b/src/main.rs index 3148fa4..1f70cfb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,9 +77,7 @@ fn main() { let mut builder = build::Builder::new(root.parent().unwrap(), cache); match ConverterRunner::new(target) { Ok(converter) => { - // TODO(jwall): What should happen if they requested we build a _test.ucg file. - // 1. We could automatically go into validate mode. - // 2. We could warn that this is a test file. + // TODO(jwall): We should warn if this is a test file. let result = builder.build_file(file); if !result.is_ok() { eprintln!("{:?}", result.err().unwrap()); @@ -108,10 +106,7 @@ fn main() { } } } else if let Some(matches) = app.subcommand_matches("build") { - // TODO(jwall): This should take multiple files I think. let files = matches.values_of("INPUT").unwrap(); - // TODO(jwall): We should default to the file name with appropriate - // extension if this is not set. for file in files { let root = PathBuf::from(file); let mut builder = build::Builder::new(root.parent().unwrap(), cache); diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 8cd4ade..449e66e 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -121,13 +121,14 @@ fn triple_to_number(v: (Option, Option, Option)) -> ParseRe }; let to_parse = pref.to_string() + "." + &suf; - // TODO(jwall): if there is an error we should report where that error occured. let f = match FromStr::from_str(&to_parse) { Ok(f) => f, Err(_) => { return Err(error::Error::new( format!("Not a float! {}", to_parse), error::ErrorType::UnexpectedToken, + // NOTE(jwall): This is ugly. I should probably see if I can refactor + // it to something less confusing. maybepos.unwrap(), )) } diff --git a/src/parse/precedence.rs b/src/parse/precedence.rs index 31a79fa..f2bd04e 100644 --- a/src/parse/precedence.rs +++ b/src/parse/precedence.rs @@ -400,7 +400,6 @@ pub fn op_expression(i: TokenIter) -> NomResult { IResult::Error(e) => IResult::Error(e), IResult::Incomplete(i) => IResult::Incomplete(i), IResult::Done(rest, oplist) => { - // TODO run our binary parsing. let mut i_ = OpListIter { source: oplist.as_slice(), };