No references in pattern-matching
This commit is contained in:
parent
6794d22f1d
commit
27d4c2ccbd
@ -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"),
|
||||
|
Loading…
Reference in New Issue
Block a user