def close.list
bolt@1.27.0.0 · src/rules/suspicious/empty.bend:162
import bolt@1.27.0.0/src/rules/suspicious/empty.bend as Empty
import Base
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
162
163
164
165def close.list(toks: List<&2, Lex.Tok>, +dd: Nat, +ll: Last, done: Bool, got: Maybe<&2, Taken>) -> Maybe<&2, Taken>:
166 match toks:
167 case Nil{}:
168 got
169 case Con{Lex.Tok{+k, +t, l, c}, +rest}:
170 match done:
171 case True{}:
172 got
173 case False{}:
174 +here = close.here(k, dd)
175 close.list(rest, close.depth(k, dd), last.step(k, t, ll), here, Bool.pick(Maybe<&2, Taken>, here,
176 last.name(ll, rest), None{}))