MAINT: TODO cleanups

This commit is contained in:
Jeremy Wall 2019-08-17 17:45:37 -05:00
parent ceb98244c7
commit 7a2a99b859
4 changed files with 1 additions and 11 deletions

View File

@ -210,7 +210,6 @@ pub enum Op {
Typ,
// Runtime hooks
Runtime(Hook),
// TODO(jwall): TRACE instruction
Render,
}
@ -238,7 +237,6 @@ impl TryFrom<&Value> for Val {
let mut flds = Vec::new();
for &(ref k, ref v) in fs.iter() {
let v = v.clone();
// TODO(jwall): The Rc for a Val should no longer be required.
flds.push((k.clone(), Rc::new(v.try_into()?)));
}
Val::Tuple(flds)
@ -247,7 +245,6 @@ impl TryFrom<&Value> for Val {
let mut els = Vec::new();
for e in elems.iter() {
let e = e.clone();
// TODO
els.push(Rc::new(e.try_into()?));
}
Val::List(els)

View File

@ -111,7 +111,7 @@ where
Op::Index => self.op_index(false)?,
Op::SafeIndex => self.op_index(true)?,
Op::Cp => self.op_copy()?,
//TODO(jwall): Should this take a user provided message?
//FIXME(jwall): Should this take a user provided message?
Op::Bang => self.op_bang()?,
Op::InitThunk(jp) => self.op_thunk(idx, jp)?,
Op::Noop => {
@ -514,8 +514,6 @@ where
let tpl = self.pop()?;
if let &C(Tuple(ref flds)) = tpl.as_ref() {
// add name and value to tuple
// TODO(jwall): This is probably memory inefficient and we should
// optimize it a bit.
let mut flds = flds.clone();
self.merge_field_into_tuple(&mut flds, name.clone(), val)?;
// place composite tuple back on stack
@ -533,8 +531,6 @@ where
let list = dbg!(self.pop()?);
if let &C(List(ref elems)) = list.as_ref() {
// add value to list
// TODO(jwall): This is probably memory inefficient and we should
// optimize it a bit.
let mut elems = elems.clone();
elems.push(val);
// Add that value to the list and put list back on stack.
@ -621,7 +617,6 @@ where
}
fn op_copy(&mut self) -> Result<(), Error> {
// TODO Use Cow pointers for this?
// get next value. It should be a Module or Tuple.
let tgt = dbg!(self.pop()?);
// This value should always be a tuple

View File

@ -91,7 +91,6 @@ impl YamlConverter {
}
};
if key == "<<" {
// TODO(jwall): Handle merge keys
if let serde_yaml::Value::Mapping(merge_map) = value {
self.merge_mapping_keys(&mut fs, merge_map)?;
}

View File

@ -591,7 +591,6 @@ fn do_repl<C: Cache>(
loop {
// print prompt
let line = editor.readline(&format!("{}> ", lines.next_line()))?;
// TODO check for a repl command.
// repl commands are only valid while not accumulating a statement;
let trimmed = line.trim();
if trimmed.starts_with("#") {