def has_mark

bend-lint-rules@0.2.0.0 · lib/linter/directives.bend:1098

import bend-lint-rules@0.2.0.0/lib/linter/directives.bend as Directives
import Base

1098# Whether `text` has a directive's mark, "bend-lint:". Only a 'b' starts a comparison, so it is one pass.
1099def has_mark(text: String, found: Bool) -> Bool:
1100  match text found:
1101    case _ True{}:
1102      True{}
1103    case SNil{} False{}:
1104      False{}
1105    case SCon{'b', +rest} False{}:
1106      has_mark(rest, String.starts_with(rest, "end-lint:"))
1107    case SCon{c, rest} False{}:
1108      has_mark(rest, False{})

Uses (7)

Used by (2)