| 10 | |
| 11 | impl Derive for LambdaFunction { |
| 12 | fn from_parse_tree(p: pest::iterators::Pair<'_, Rule>, source: &SourceBuffer) -> Self { |
| 13 | assert!(p.as_rule() == Rule::lambda_f); |
| 14 | let loc = From::from(&p.as_span()); |
| 15 | let mut inner = p.into_inner(); |
| 16 | let args = ArgumentList::from_parse_tree(inner.next().expect("need arguments"), source); |
| 17 | let body = LambdaBody::from_parse_tree(inner.next().expect("need body"), source); |
| 18 | Self { |
| 19 | loc: source.pointer(loc), |
| 20 | args, |
| 21 | body: Box::new(body), |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | impl PrettyPrintable for LambdaFunction { |