Lines Matching defs:expr
42 Paren(ref expr) => write!(format, "({})", expr),
56 Paren(ref expr) => write!(format, "[{:?}]", expr),
64 delimited(tag("("), map(expr, |e| Expr::Paren(Box::new(e))), tag(")")),
81 let (oper, expr) = pair;
83 Oper::Add => Expr::Add(Box::new(acc), Box::new(expr)),
84 Oper::Sub => Expr::Sub(Box::new(acc), Box::new(expr)),
85 Oper::Mul => Expr::Mul(Box::new(acc), Box::new(expr)),
86 Oper::Div => Expr::Div(Box::new(acc), Box::new(expr)),
107 fn expr(i: &str) -> IResult<&str, Expr> {
142 expr(" 1 + 2 * 3 ").map(|(i, x)| (i, format!("{:?}", x))),
146 expr(" 1 + 2 * 3 / 4 - 5 ").map(|(i, x)| (i, format!("{:?}", x))),
150 expr(" 72 / 2 / 3 ").map(|(i, x)| (i, format!("{:?}", x))),
158 expr(" ( 1 + 2 ) * 3 ").map(|(i, x)| (i, format!("{:?}", x))),