def Slot.order
bend-lint-rules@0.2.0.0 · layout/directive_order.bend:54
import bend-lint-rules@0.2.0.0/layout/directive_order.bend as DirectiveOrder
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
54
55def Slot.order(
56 slots: List<&2, Slot>,
57 sorted: List<&2, Slot>,
58 +path: String,
59 out: List<&2, Lint.Operation>
60) -> List<&2, Lint.Operation>:
61 match slots sorted:
62 case Con{Slot{k, beg, end, t}, rest} Con{Slot{j, b, e, text}, more}:
63 Slot.order(rest, more, path, Lint.Replace{Lint.Span{path, beg, end}, text} <> out)
64 case _ _:
65 List.reverse(&2, Lint.Operation, out)