def walk
bolt@1.27.0.0 · src/rules/suspicious/fromrev.bend:35
import bolt@1.27.0.0/src/rules/suspicious/fromrev.bend as Fromrev
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/syntax/lex.bend as Lex
35
36def walk(toks: List<&2, Lex.Tok>, +path: String) -> List<&2, F.Finding>:
37 match toks:
38 case Nil{}:
39 Nil{}
40 case Con{Lex.Tok{k, +t, +l, +c}, +rest}:
41 +more = walk(rest, path)
42 Bool.pick(List<&2, F.Finding>, at(t, rest),
43 F.Finding{path, l, c, 16, "fromrev", "String.from_list(List.reverse(..)) walks the list twice and builds one it throws away; fold it onto a String with SCon in one pass."}
44 <> more,
45 more)