def Owner.of

bend-lint-rules@0.2.0.0 · performance/loop_invariant_call.bend:117

import bend-lint-rules@0.2.0.0/performance/loop_invariant_call.bend as LoopInvariantCall
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

117# What judging the calls of the definition `node` reads, with `loops`, the definitions of the file that call themselves.
118def Owner.of(loops: List<&2, String>, +node: Lint.Node) -> Owner:
119  match node:
120    case Lint.Node{Lint.Definition{+t, u}, +n, s, +k, f}:
121      Owner{
122        loops,
123        t,
124        n,
125        fixed(
126          k,
127          Lint.visit(
128            ~Unit,
129            ~List<&2, Lint.Node>,
130            ~self.visit,
131            Unit{},
132            [Lint.Node{Lint.Definition{t, u}, n, s, k, f}]
133          ),
134          0n,
135          []
136        )
137      }
138    case _:
139      Owner{loops, "", "", []}

Uses (9)

Used by (2)