DeadAccumulator.kind: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/performance/dead_accumulator.bend as DeadAccumulator Lines 34-62 of bend-lint-rules@0.2.0.0/performance/dead_accumulator.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/performance/dead_accumulator.bend&start_line=34&end_line=62 import Base import bend-lint-api@0.2.0.0/linter/lint.bend as Lint # How a use of the parameter below `path` ends: 0 if it is read (in anything but the loop's call of itself, at the # parameter's place), 1 if it is passed there as it is, 2 if it is passed there with something added (`grown`). def kind(path: List<&2, Lint.Above>, target: String, at: U32, grown: Bool) -> U32: match path: case Con{Lint.Above{Lint.Node{Lint.Construction{t}, n, s, k, f}, a}, rest}: kind(rest, target, at, True{}) case Con{Lint.Above{Lint.Node{Lint.Annotation{}, n, s, k, f}, a}, rest}: kind(rest, target, at, grown) case Con{ Lint.Above{ Lint.Node{ Lint.Application{}, n, s, Con{Lint.Node{Lint.Reference{t}, rn, rs, rk, rf}, args}, f }, a }, rest }: Bool.pick( U32, String.eq(t, target) && U32.is_eq(a, (at + 1: U32)), Bool.pick(U32, grown, 2, 1), 0 ) case _: 0 Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Above https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Syntax