def forks

bend-lint-api@0.2.0.0 · linter/lint.bend:892

import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import Base

892# Whether a parallel let (two binders, at least) is among `nodes` or under them, or `found`.
893def forks(nodes: List<&2, Node>, found: Bool) -> Bool:
894  match nodes found:
895    case _ True{}:
896      True{}
897    case Nil{} False{}:
898      False{}
899    case Con{
900      Node{
901        Destructure{q},
902        n,
903        s,
904        Con{
905          Node{PatternVariable{a, aq}, an, as, ak, af},
906          Con{Node{PatternVariable{b, bq}, bn, bs, bk, bf}, more}
907        },
908        f
909      },
910      rest
911    } False{}:
912      True{}
913    case Con{Node{syntax, n, s, kids, f}, rest} False{}:
914      forks(rest, forks(kids, False{}))

Uses (4)

Used by (3)