MCPcopy Create free account
hub / github.com/arialang/aria / from_parse_tree

Method from_parse_tree

parser-lib/src/ast/nodes/lambda_function.rs:12–23  ·  view source on GitHub ↗
(p: pest::iterators::Pair<'_, Rule>, source: &SourceBuffer)

Source from the content-addressed store, hash-verified

10
11impl 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
26impl PrettyPrintable for LambdaFunction {

Callers

nothing calls this directly

Calls 3

expectMethod · 0.80
pointerMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected