def AaFrames.add_sub

bend-osdev-apparmor@0.1.0.0 · parse.bend:1636

import bend-osdev-apparmor@0.1.0.0/parse.bend as Parse
import Base
import bend-osdev-apparmor@0.1.0.0/text.bend as X
import bend-osdev-apparmor@0.1.0.0/profile.bend as PR

1636# a finished child or hat added to the innermost profile; None if the name is taken
1637def AaFrames.add_sub(fs: List<&2, AaFrame>, +k: PR.AaProfile, +hat: Bool) -> Maybe<&2, List<&2, AaFrame>>:
1638  match fs:
1639    case Nil{}:
1640      None{}
1641    case Con{f, t}:
1642      match f:
1643        case AaFrame{p, h, full, q, s}:
1644          match p:
1645            case None{}:
1646              AaFrames.add_sub.cons(AaFrame{None{}, h, full, q, s}, AaFrames.add_sub(t, k, hat))
1647            case Some{+x}:
1648              AaFrames.add_sub.put(AaFrames.add_sub.go(X.AaText.member(AaFrames.names(x), PR.AaProfile.name(k)), x, k, hat), h, full, q, s, t)

Uses (11)

Used by (1)