No references in pattern-matching

This commit is contained in:
greg 2017-01-02 22:17:21 -08:00
parent 6794d22f1d
commit 27d4c2ccbd

View File

@ -64,11 +64,11 @@ impl fmt::Display for ASTNode {
impl fmt::Display for Expression { impl fmt::Display for Expression {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::Expression::*; use self::Expression::*;
match self { match *self {
&Null => write!(f, "null"), Null => write!(f, "null"),
&StringLiteral(ref s) => write!(f, "\"{}\"", s), StringLiteral(ref s) => write!(f, "\"{}\"", s),
&Number(n) => write!(f, "{}", n), Number(n) => write!(f, "{}", n),
&Lambda(Function { prototype: Prototype { ref name, ref parameters, .. }, .. }) => { Lambda(Function { prototype: Prototype { ref name, ref parameters, .. }, .. }) => {
write!(f, "«function: {}, {} arg(s)»", name, parameters.len()) write!(f, "«function: {}, {} arg(s)»", name, parameters.len())
} }
_ => write!(f, "UNIMPLEMENTED"), _ => write!(f, "UNIMPLEMENTED"),