[parser, types] Call subparser_completed

This commit is contained in:
Eryn Wells 2018-08-24 21:07:04 -07:00
parent d3520be67e
commit c35fce7727
2 changed files with 16 additions and 15 deletions

View file

@ -7,9 +7,10 @@ use std::fmt;
use super::*;
use object::Object;
#[derive(Debug)]
pub struct Pair {
car: Obj,
cdr: Obj
pub car: Obj,
pub cdr: Obj
}
impl Pair {
@ -17,6 +18,10 @@ impl Pair {
Pair { car: Obj::Null, cdr: Obj::Null }
}
pub fn with_car(car: Obj) -> Pair {
Pair { car: car, cdr: Obj::Null }
}
fn fmt_pair(&self, f: &mut fmt::Formatter) -> fmt::Result {
let r = write!(f, "{}", self.car);
r.and_then(|r| match self.cdr {
@ -44,8 +49,3 @@ impl fmt::Display for Pair {
}
}
impl fmt::Debug for Pair {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self)
}
}