mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-24 18:39:50 -04:00
MAINT: TODO cleanups
This commit is contained in:
parent
ceb98244c7
commit
7a2a99b859
@ -210,7 +210,6 @@ pub enum Op {
|
|||||||
Typ,
|
Typ,
|
||||||
// Runtime hooks
|
// Runtime hooks
|
||||||
Runtime(Hook),
|
Runtime(Hook),
|
||||||
// TODO(jwall): TRACE instruction
|
|
||||||
Render,
|
Render,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +237,6 @@ impl TryFrom<&Value> for Val {
|
|||||||
let mut flds = Vec::new();
|
let mut flds = Vec::new();
|
||||||
for &(ref k, ref v) in fs.iter() {
|
for &(ref k, ref v) in fs.iter() {
|
||||||
let v = v.clone();
|
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()?)));
|
flds.push((k.clone(), Rc::new(v.try_into()?)));
|
||||||
}
|
}
|
||||||
Val::Tuple(flds)
|
Val::Tuple(flds)
|
||||||
@ -247,7 +245,6 @@ impl TryFrom<&Value> for Val {
|
|||||||
let mut els = Vec::new();
|
let mut els = Vec::new();
|
||||||
for e in elems.iter() {
|
for e in elems.iter() {
|
||||||
let e = e.clone();
|
let e = e.clone();
|
||||||
// TODO
|
|
||||||
els.push(Rc::new(e.try_into()?));
|
els.push(Rc::new(e.try_into()?));
|
||||||
}
|
}
|
||||||
Val::List(els)
|
Val::List(els)
|
||||||
|
@ -111,7 +111,7 @@ where
|
|||||||
Op::Index => self.op_index(false)?,
|
Op::Index => self.op_index(false)?,
|
||||||
Op::SafeIndex => self.op_index(true)?,
|
Op::SafeIndex => self.op_index(true)?,
|
||||||
Op::Cp => self.op_copy()?,
|
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::Bang => self.op_bang()?,
|
||||||
Op::InitThunk(jp) => self.op_thunk(idx, jp)?,
|
Op::InitThunk(jp) => self.op_thunk(idx, jp)?,
|
||||||
Op::Noop => {
|
Op::Noop => {
|
||||||
@ -514,8 +514,6 @@ where
|
|||||||
let tpl = self.pop()?;
|
let tpl = self.pop()?;
|
||||||
if let &C(Tuple(ref flds)) = tpl.as_ref() {
|
if let &C(Tuple(ref flds)) = tpl.as_ref() {
|
||||||
// add name and value to tuple
|
// 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();
|
let mut flds = flds.clone();
|
||||||
self.merge_field_into_tuple(&mut flds, name.clone(), val)?;
|
self.merge_field_into_tuple(&mut flds, name.clone(), val)?;
|
||||||
// place composite tuple back on stack
|
// place composite tuple back on stack
|
||||||
@ -533,8 +531,6 @@ where
|
|||||||
let list = dbg!(self.pop()?);
|
let list = dbg!(self.pop()?);
|
||||||
if let &C(List(ref elems)) = list.as_ref() {
|
if let &C(List(ref elems)) = list.as_ref() {
|
||||||
// add value to list
|
// add value to list
|
||||||
// TODO(jwall): This is probably memory inefficient and we should
|
|
||||||
// optimize it a bit.
|
|
||||||
let mut elems = elems.clone();
|
let mut elems = elems.clone();
|
||||||
elems.push(val);
|
elems.push(val);
|
||||||
// Add that value to the list and put list back on stack.
|
// Add that value to the list and put list back on stack.
|
||||||
@ -621,7 +617,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn op_copy(&mut self) -> Result<(), Error> {
|
fn op_copy(&mut self) -> Result<(), Error> {
|
||||||
// TODO Use Cow pointers for this?
|
|
||||||
// get next value. It should be a Module or Tuple.
|
// get next value. It should be a Module or Tuple.
|
||||||
let tgt = dbg!(self.pop()?);
|
let tgt = dbg!(self.pop()?);
|
||||||
// This value should always be a tuple
|
// This value should always be a tuple
|
||||||
|
@ -91,7 +91,6 @@ impl YamlConverter {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
if key == "<<" {
|
if key == "<<" {
|
||||||
// TODO(jwall): Handle merge keys
|
|
||||||
if let serde_yaml::Value::Mapping(merge_map) = value {
|
if let serde_yaml::Value::Mapping(merge_map) = value {
|
||||||
self.merge_mapping_keys(&mut fs, merge_map)?;
|
self.merge_mapping_keys(&mut fs, merge_map)?;
|
||||||
}
|
}
|
||||||
|
@ -591,7 +591,6 @@ fn do_repl<C: Cache>(
|
|||||||
loop {
|
loop {
|
||||||
// print prompt
|
// print prompt
|
||||||
let line = editor.readline(&format!("{}> ", lines.next_line()))?;
|
let line = editor.readline(&format!("{}> ", lines.next_line()))?;
|
||||||
// TODO check for a repl command.
|
|
||||||
// repl commands are only valid while not accumulating a statement;
|
// repl commands are only valid while not accumulating a statement;
|
||||||
let trimmed = line.trim();
|
let trimmed = line.trim();
|
||||||
if trimmed.starts_with("#") {
|
if trimmed.starts_with("#") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user