def defines
import bolt@1.27.0.0/src/rules/correctness/put.bend as Putimport Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
39# does the file define Map.put: a `def` keyword right before a `Map.put`?
40def defines(toks: List<&2, Lex.Tok>) -> Bool:
41 match toks:
42 case Con{Lex.Tok{k, +d, l, c}, +rest}:
43 Lazy.or_else(Bool.and(defines.key(k), Bool.and(String.eq(d, "def"), defines.named(rest))), _u => defines(rest))
44 case Nil{}:
45 False{}