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

Method from_parse_tree

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

Source from the content-addressed store, hash-verified

10
11impl Derive for MatchPatternEnumCase {
12 fn from_parse_tree(p: pest::iterators::Pair<'_, Rule>, source: &SourceBuffer) -> Self {
13 assert!(p.as_rule() == Rule::match_pattern_enum_case);
14 let loc = From::from(&p.as_span());
15 let mut inner = p.into_inner();
16 let case = Identifier::from_parse_tree(inner.next().expect("need expression"), source);
17 let payload = inner
18 .next()
19 .map(|next| DeclarationId::from_parse_tree(next, source));
20 Self {
21 loc: source.pointer(loc),
22 case,
23 payload,
24 }
25 }
26}
27
28impl PrettyPrintable for MatchPatternEnumCase {

Callers

nothing calls this directly

Calls 3

expectMethod · 0.80
pointerMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected