mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-25 18:49:50 -04:00
MAINT: TODO cleanups.
This commit is contained in:
parent
ca982dfc02
commit
ed87ca353b
@ -499,7 +499,6 @@ fn test_eval_selector_list_expr() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(jwall): Eval for tuple and list.
|
|
||||||
// Include nested for each.
|
// Include nested for each.
|
||||||
#[test]
|
#[test]
|
||||||
#[should_panic(expected = "Unable to find tpl1")]
|
#[should_panic(expected = "Unable to find tpl1")]
|
||||||
|
@ -37,8 +37,6 @@ impl ExecConverter {
|
|||||||
ExecConverter {}
|
ExecConverter {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(jwall): We may want to include an built in exec macro for
|
|
||||||
// creating an exec tuple.
|
|
||||||
#[allow(unused_assignments)]
|
#[allow(unused_assignments)]
|
||||||
fn write(&self, v: &Val, w: &mut Write) -> Result {
|
fn write(&self, v: &Val, w: &mut Write) -> Result {
|
||||||
// We always expect the Val to be a Tuple.
|
// 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, "# Turn on unofficial Bash-Strict-Mode\n"));
|
||||||
try!(write!(script, "set -euo pipefail\n"));
|
try!(write!(script, "set -euo pipefail\n"));
|
||||||
// 3. Then assign our environment variables
|
// 3. Then assign our environment variables
|
||||||
// TODO(jwall): We should escape bash ENV variable values.
|
|
||||||
if let Some(env_list) = env {
|
if let Some(env_list) = env {
|
||||||
for &(ref name, ref v) in env_list.iter() {
|
for &(ref name, ref v) in env_list.iter() {
|
||||||
// We only allow string fields in our env tuple.
|
// We only allow string fields in our env tuple.
|
||||||
|
@ -77,9 +77,7 @@ fn main() {
|
|||||||
let mut builder = build::Builder::new(root.parent().unwrap(), cache);
|
let mut builder = build::Builder::new(root.parent().unwrap(), cache);
|
||||||
match ConverterRunner::new(target) {
|
match ConverterRunner::new(target) {
|
||||||
Ok(converter) => {
|
Ok(converter) => {
|
||||||
// TODO(jwall): What should happen if they requested we build a _test.ucg file.
|
// TODO(jwall): We should warn if this is a test file.
|
||||||
// 1. We could automatically go into validate mode.
|
|
||||||
// 2. We could warn that this is a test file.
|
|
||||||
let result = builder.build_file(file);
|
let result = builder.build_file(file);
|
||||||
if !result.is_ok() {
|
if !result.is_ok() {
|
||||||
eprintln!("{:?}", result.err().unwrap());
|
eprintln!("{:?}", result.err().unwrap());
|
||||||
@ -108,10 +106,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if let Some(matches) = app.subcommand_matches("build") {
|
} 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();
|
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 {
|
for file in files {
|
||||||
let root = PathBuf::from(file);
|
let root = PathBuf::from(file);
|
||||||
let mut builder = build::Builder::new(root.parent().unwrap(), cache);
|
let mut builder = build::Builder::new(root.parent().unwrap(), cache);
|
||||||
|
@ -121,13 +121,14 @@ fn triple_to_number(v: (Option<Token>, Option<Token>, Option<Token>)) -> ParseRe
|
|||||||
};
|
};
|
||||||
|
|
||||||
let to_parse = pref.to_string() + "." + &suf;
|
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) {
|
let f = match FromStr::from_str(&to_parse) {
|
||||||
Ok(f) => f,
|
Ok(f) => f,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
return Err(error::Error::new(
|
return Err(error::Error::new(
|
||||||
format!("Not a float! {}", to_parse),
|
format!("Not a float! {}", to_parse),
|
||||||
error::ErrorType::UnexpectedToken,
|
error::ErrorType::UnexpectedToken,
|
||||||
|
// NOTE(jwall): This is ugly. I should probably see if I can refactor
|
||||||
|
// it to something less confusing.
|
||||||
maybepos.unwrap(),
|
maybepos.unwrap(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,6 @@ pub fn op_expression(i: TokenIter) -> NomResult<Expression> {
|
|||||||
IResult::Error(e) => IResult::Error(e),
|
IResult::Error(e) => IResult::Error(e),
|
||||||
IResult::Incomplete(i) => IResult::Incomplete(i),
|
IResult::Incomplete(i) => IResult::Incomplete(i),
|
||||||
IResult::Done(rest, oplist) => {
|
IResult::Done(rest, oplist) => {
|
||||||
// TODO run our binary parsing.
|
|
||||||
let mut i_ = OpListIter {
|
let mut i_ = OpListIter {
|
||||||
source: oplist.as_slice(),
|
source: oplist.as_slice(),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user