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 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::Expression::*;
match self {
&Null => write!(f, "null"),
&StringLiteral(ref s) => write!(f, "\"{}\"", s),
&Number(n) => write!(f, "{}", n),
&Lambda(Function { prototype: Prototype { ref name, ref parameters, .. }, .. }) => {
match *self {
Null => write!(f, "null"),
StringLiteral(ref s) => write!(f, "\"{}\"", s),
Number(n) => write!(f, "{}", n),
Lambda(Function { prototype: Prototype { ref name, ref parameters, .. }, .. }) => {
write!(f, "«function: {}, {} arg(s)»", name, parameters.len())
}
_ => write!(f, "UNIMPLEMENTED"),