|
|
@ -200,8 +200,9 @@ impl Executor for Interpreter { |
|
|
|
let mut matched = false; |
|
|
|
let mut matched = false; |
|
|
|
for tup in vals.iter() { |
|
|
|
for tup in vals.iter() { |
|
|
|
let tup: &(Expr, Vec<Expr>) = tup; |
|
|
|
let tup: &(Expr, Vec<Expr>) = tup; |
|
|
|
match *tup { |
|
|
|
let cond = &tup.0; |
|
|
|
(ref cond, ref block) if (val == try!(self.run(cond))) => { |
|
|
|
let block = &tup.1; |
|
|
|
|
|
|
|
if val == try!(self.run(cond)) { |
|
|
|
matched = true; |
|
|
|
matched = true; |
|
|
|
let last_expr = block.last().unwrap(); |
|
|
|
let last_expr = block.last().unwrap(); |
|
|
|
for expr in block.iter() { |
|
|
|
for expr in block.iter() { |
|
|
@ -211,8 +212,6 @@ impl Executor for Interpreter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
_ => (), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if !matched && default.is_some() { |
|
|
|
if !matched && default.is_some() { |
|
|
|
result = try!(self.run(default.as_ref().unwrap())); |
|
|
|
result = try!(self.run(default.as_ref().unwrap())); |
|
|
|