def parse.take_pos

shake@0.7.0.0 · src/cli.bend:1024

import shake@0.7.0.0/src/cli.bend as Cli
import Base

1024# the next remaining positional, or an unexpected word
1025def parse.take_pos(
1026  +tok: String,
1027  +args: List<&2, Arg>,
1028  +up: List<&2, Level>,
1029  subs: List<&2, Sub>,
1030  +path: List<&2, String>,
1031  +binds: List<&2, Bind>,
1032  pos: List<&2, Arg>,
1033  raw: Bool
1034) -> St:
1035  match pos:
1036    case Nil{}:
1037      parse.dead(Unexpected{path, tok}, args, up, subs, path, binds, pos, raw, True{})
1038    case Con{+h, t}:
1039      Arg{+name, _s, _l, _k, _h, _r, _d, +cs} = h
1040      parse.take_choice(allowed(cs, tok), name, tok, args, up, subs, path, binds,
1041        parse.take_pos.keep(rest.is(h), h, t), raw, True{})

Uses (14)

Used by (2)