def AaProfile.descend

bend-osdev-apparmor@0.1.0.0 · profile.bend:268

import bend-osdev-apparmor@0.1.0.0/profile.bend as Profile
import Base
import bend-osdev-apparmor@0.1.0.0/text.bend as X

268# the child or hat named by the rest of a full name
269def AaProfile.descend(fuel: Nat, m: Maybe<&2, AaProfile>, rest: Maybe<&2, X.AaSplit>) -> Maybe<&2, AaProfile>:
270  match fuel:
271    case 0n:
272      None{}
273    case 1n+f:
274      match m:
275        case None{}:
276          None{}
277        case Some{+p}:
278          match rest:
279            case None{}:
280              Some{p}
281            case Some{sp}:
282              match sp:
283                case X.AaSplit{first, more}:
284                  AaProfile.descend(f, AaProfile.find(AaProfile.list_append(AaProfile.children(p), AaProfile.hats(p)), first), X.AaText.split2.opt(more))

Uses (9)

Used by (1)