def count
import bolt@1.27.0.0/src/rules/pedantic/rewalk.bend as Rewalkimport Base
540# how many lets of this name take effect before this position
541def count(bs: List<&2, Bind>, +name: String, +line: U32, +col: U32) -> U32:
542 match bs:
543 case Nil{}:
544 0
545 case Con{Bind{+nm, +l, +c}, rest}:
546 +more = count(rest, name, line, col)
547 Bool.pick(U32, Bool.and(String.eq(nm, name), before(l, c, line, col)), (more + 1 : U32), more)