def judge

bend-lint-rules@0.2.0.0 · layout/case.bend:304

import bend-lint-rules@0.2.0.0/layout/case.bend as Case
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

304def judge(
305  +namespace: String,
306  declarations: List<&2, Lint.Declaration>,
307  out: List<&2, Lint.Finding>
308) -> List<&2, Lint.Finding>:
309  match declarations:
310    case Nil{}:
311      List.reverse(&2, Lint.Finding, out)
312    case Con{Lint.Declaration{Lint.Node{+syntax, +name, Some{+span}, kids, facts}, uses}, rest}:
313      judge(
314        namespace,
315        rest,
316        Lists.onto(
317          &2,
318          Lint.Finding,
319          judged(
320            wanted(Lint.Node{syntax, name, Some{span}, kids, facts}, namespace),
321            syntax,
322            name,
323            span
324          ),
325          out
326        )
327      )
328    case Con{d, rest}:
329      judge(namespace, rest, out)

Uses (10)

Used by (1)