def scan_short
import cli@0.2.0.0/cli.bend as Cliimport Base
3399# The lookup takes only the scope's keys: an accessor for them would take
3400# the state and copy each of its fields.
3401def scan_short(+state: ScanState, token: String) -> Mode:
3402 match state:
3403 case ScanState{Scope{path, Spec{keys, args, slots, variadic, subs,
3404 has_sub, external, needs_sub, version, digit_short, inherit}},
3405 events, resting, positional_count, ext, issue}:
3406 +chars = String.drop(token, 1n)
3407 found = find_short_for_head(chars, keys)
3408 scan_short_go(chars, state, found)