def Runs.extend

bend-lint-rules@0.2.0.0 · layout/directive_order.bend:94

import bend-lint-rules@0.2.0.0/layout/directive_order.bend as DirectiveOrder
import Base
import bend-lint-rules@0.2.0.0/lib/linter/directives.bend as Directives
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

94def Runs.extend(
95  continues: Bool,
96  run: Run,
97  comment: Directives.Comment,
98  +key: String,
99  path: String,
100  out: List<&2, Lint.Finding>
101) -> Runs:
102  match continues run comment:
103    case True{} Run{beg, end, line, last, sorted, slots} Directives.Comment{b, +e, l, t, body}:
104      Runs{
105        Some{
106          Run{
107            beg,
108            e,
109            l,
110            key,
111            sorted && String.is_le(last, key),
112            Slot{key, b, e, "#" ++ body} <> slots
113          }
114        },
115        out
116      }
117    case False{} _ Directives.Comment{b, e, l, t, body}:
118      Runs{Some{Run.first(key, b, e, l, body)}, Runs.close(Some{run}, path, out)}

Uses (14)

Used by (1)