def defs
bend-lint-rules@0.2.0.0 · performance/template_value_field.bend:141
import bend-lint-rules@0.2.0.0/performance/template_value_field.bend as TemplateValueField
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
import bend-lint-api@0.2.0.0/shared/lists.bend as Lists
141
142def defs(
143 nodes: List<&2, Lint.Node>,
144 +records: List<&2, String>,
145 out: List<&2, Lint.Finding>
146) -> List<&2, Lint.Finding>:
147 match nodes:
148 case Nil{}:
149 out
150 case Con{Lint.Node{Lint.Definition{t, u}, +n, s, +kids, f}, rest}:
151 defs(
152 rest,
153 records,
154 Lists.onto(
155 &2,
156 Lint.Finding,
157 Lint.visit(
158 ~Owner,
159 ~Lint.Finding,
160 ~visit,
161 Owner{templates(kids, records, []), n},
162 [Lint.Node{Lint.Definition{t, u}, n, s, kids, f}]
163 ),
164 out
165 )
166 )
167 case Con{node, rest}:
168 defs(rest, records, out)