def global_spec
cli@0.2.0.0 · cli.bend:2789
import cli@0.2.0.0/cli.bend as Cli
import Base
2789
2790def global_spec(items: List<&2, SpecItem>, +all: List<&2, Item>) ->
2791 List<&2, SpecItem>:
2792 match items:
2793 case Nil{}: Nil{}
2794 case SpecArg{+info} <> tail:
2795 +rest = global_spec(tail, all)
2796 attrs = info_attrs(info)
2797 Bool.pick(List<&2, SpecItem>, has_global(attrs),
2798 SpecArg{info} <> rest, rest)
2799 case SpecOther{Exclusive{+name}} <> tail:
2800 +rest = global_spec(tail, all)
2801 Bool.pick(List<&2, SpecItem>, group_global(all, name),
2802 SpecOther{Exclusive{name}} <> rest, rest)
2803 case SpecOther{NeedOne{+name}} <> tail:
2804 +rest = global_spec(tail, all)
2805 Bool.pick(List<&2, SpecItem>, group_global(all, name),
2806 SpecOther{NeedOne{name}} <> rest, rest)
2807 case head <> tail: global_spec(tail, all)