def kept
bolt@1.27.0.0 · src/rules/suspicious/empty.bend:201
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
201
202
203
204def kept(toks: List<&2, Lex.Tok>, +xx: String, +dd: Nat, found: Bool, live: Bool) -> Bool:
205 match toks:
206 case Nil{}:
207 found
208 case Con{Lex.Tok{+k, +t, l, c}, rest}:
209 match found:
210 case True{}:
211 True{}
212 case False{}:
213 match live:
214 case False{}:
215 False{}
216 case True{}:
217 kept(rest, xx, close.depth(k, dd), same(k, t, xx), Bool.not(close.here(k, dd)))