def slot_traits_go

cli@0.2.0.0 · cli.bend:2906

import cli@0.2.0.0/cli.bend as Cli
import Base

2906# The traits of the first of slots that takes the operand after count
2907# others, where here says whether slots' head does. It only reads slots:
2908# a walk that returned the slot would copy each of its fields.
2909def slot_traits_go(slots: List<&2, ArgInfo>, count: Nat, here: Bool) ->
2910    SlotTraits:
2911  match slots here:
2912    case Nil{} _: SlotTraits{False{}, False{}, False{}}
2913    case ArgInfo{id, usage, short, long, kind, +attrs} <> tail True{}:
2914      SlotTraits{has_rest(attrs), has_hyphen(attrs), has_as_f32(attrs)}
2915    case info <> +tail False{}:
2916      +rest = Nat.sub(count, 1n)
2917      next = slot_here(tail, rest)
2918      slot_traits_go(tail, rest, next)

Uses (10)

Used by (1)